diff options
author | Philipp Hörist <forenjunkie@chello.at> | 2017-02-25 02:06:39 +0300 |
---|---|---|
committer | Philipp Hörist <forenjunkie@chello.at> | 2017-02-25 17:13:08 +0300 |
commit | 71491aa9a1adddeadd6a3b94a64393e3991cf254 (patch) | |
tree | 139d8da3a7f044671f435b005d63d6489b0bc0bf /plugin_installer | |
parent | c08aea63ef7f45d1c77d288a2105768110adf98c (diff) |
[plugin_installer] Improve Scrolling
Diffstat (limited to 'plugin_installer')
-rw-r--r-- | plugin_installer/plugin_installer.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/plugin_installer/plugin_installer.py b/plugin_installer/plugin_installer.py index e30e2e3..7a0c374 100644 --- a/plugin_installer/plugin_installer.py +++ b/plugin_installer/plugin_installer.py @@ -343,15 +343,12 @@ class PluginInstaller(GajimPlugin): self.homepage_linkbutton.set_property('sensitive', False) def select_root_iter(self): - if hasattr(self, 'available_page'): - selection = self.available_treeview.get_selection() - if selection.count_selected_rows() == 0: - root_iter = self.available_plugins_model.get_iter_first() - selection.select_iter(root_iter) - scr_win = self.xml.get_object('scrolled_description_window') - vadjustment = scr_win.get_vadjustment() - if vadjustment: - vadjustment.set_value(0) + selection = self.available_treeview.get_selection() + if selection.count_selected_rows() == 0: + root_iter = self.available_plugins_model.get_iter_first() + path = self.available_plugins_model.get_path(root_iter) + selection.select_iter(root_iter) + self.available_treeview.scroll_to_cell(path) class DownloadAsync(threading.Thread): @@ -500,9 +497,9 @@ class DownloadAsync(threading.Thread): config.get('info', 'description'), config.get('info', 'authors'), config.get('info', 'homepage'), ]) + GLib.idle_add(self.plugin.select_root_iter) else: self.download_plugin() - GLib.idle_add(self.plugin.select_root_iter) def download_plugin(self): for remote_dir in self.remote_dirs: |