[plugin_installer] Improve Scrolling
This commit is contained in:
@@ -343,15 +343,12 @@ class PluginInstaller(GajimPlugin):
|
|||||||
self.homepage_linkbutton.set_property('sensitive', False)
|
self.homepage_linkbutton.set_property('sensitive', False)
|
||||||
|
|
||||||
def select_root_iter(self):
|
def select_root_iter(self):
|
||||||
if hasattr(self, 'available_page'):
|
selection = self.available_treeview.get_selection()
|
||||||
selection = self.available_treeview.get_selection()
|
if selection.count_selected_rows() == 0:
|
||||||
if selection.count_selected_rows() == 0:
|
root_iter = self.available_plugins_model.get_iter_first()
|
||||||
root_iter = self.available_plugins_model.get_iter_first()
|
path = self.available_plugins_model.get_path(root_iter)
|
||||||
selection.select_iter(root_iter)
|
selection.select_iter(root_iter)
|
||||||
scr_win = self.xml.get_object('scrolled_description_window')
|
self.available_treeview.scroll_to_cell(path)
|
||||||
vadjustment = scr_win.get_vadjustment()
|
|
||||||
if vadjustment:
|
|
||||||
vadjustment.set_value(0)
|
|
||||||
|
|
||||||
|
|
||||||
class DownloadAsync(threading.Thread):
|
class DownloadAsync(threading.Thread):
|
||||||
@@ -500,9 +497,9 @@ class DownloadAsync(threading.Thread):
|
|||||||
config.get('info', 'description'),
|
config.get('info', 'description'),
|
||||||
config.get('info', 'authors'),
|
config.get('info', 'authors'),
|
||||||
config.get('info', 'homepage'), ])
|
config.get('info', 'homepage'), ])
|
||||||
|
GLib.idle_add(self.plugin.select_root_iter)
|
||||||
else:
|
else:
|
||||||
self.download_plugin()
|
self.download_plugin()
|
||||||
GLib.idle_add(self.plugin.select_root_iter)
|
|
||||||
|
|
||||||
def download_plugin(self):
|
def download_plugin(self):
|
||||||
for remote_dir in self.remote_dirs:
|
for remote_dir in self.remote_dirs:
|
||||||
|
|||||||
Reference in New Issue
Block a user