From f560beb1baa600249d04aa84a6f872905f6c2a03 Mon Sep 17 00:00:00 2001 From: guinux Date: Tue, 30 Apr 2013 18:06:47 +0200 Subject: [PATCH] fix scroll up/down with keyboard --- gui/manager.glade | 37 +++++++++++++++---------------- pamac-daemon.py | 55 ++++++++++++++++++++++++----------------------- pamac/main.py | 16 ++++++++++++++ 3 files changed, 63 insertions(+), 45 deletions(-) diff --git a/gui/manager.glade b/gui/manager.glade index d6bfb43..d71c9ed 100644 --- a/gui/manager.glade +++ b/gui/manager.glade @@ -667,6 +667,7 @@ True False + @@ -1136,6 +1137,24 @@ + + + + + + + + + + + + + + + + + + @@ -1156,24 +1175,6 @@ - - - - - - - - - - - - - - - - - - diff --git a/pamac-daemon.py b/pamac-daemon.py index a4ea9fe..5e31f49 100755 --- a/pamac-daemon.py +++ b/pamac-daemon.py @@ -277,6 +277,7 @@ class PamacDBusService(dbus.service.Object): self.target = '' self.percent = 0 self.error = '' + self.get_handle() for db in self.handle.get_syncdbs(): try: self.t = self.handle.init_transaction() @@ -298,22 +299,22 @@ class PamacDBusService(dbus.service.Object): self.task.start() success('') - @dbus.service.method('org.manjaro.pamac', 'a{sb}', 's', sender_keyword='sender', connection_keyword='connexion') - def Init(self, options, sender=None, connexion=None): + @dbus.service.method('org.manjaro.pamac', 'a{sb}', 's')#, sender_keyword='sender', connection_keyword='connexion') + def Init(self, options):#, sender=None, connexion=None): self.error = '' - if self.policykit_test(sender,connexion,'org.manjaro.pamac.init_release'): - try: - self.get_handle() - self.t = self.handle.init_transaction(**options) - print('Init:',self.t.flags) - except pyalpm.error as e: - self.error += ' --> '+str(e)+'\n' - finally: - if self.error: - self.EmitTransactionError(self.error) - return self.error - else: - return _('Authentication failed') + #if self.policykit_test(sender,connexion,'org.manjaro.pamac.init_release'): + try: + self.get_handle() + self.t = self.handle.init_transaction(**options) + print('Init:',self.t.flags) + except pyalpm.error as e: + self.error += ' --> '+str(e)+'\n' + finally: + if self.error: + self.EmitTransactionError(self.error) + return self.error + #else: + # return _('Authentication failed') @dbus.service.method('org.manjaro.pamac', '', 's') def Sysupgrade(self): @@ -373,7 +374,7 @@ class PamacDBusService(dbus.service.Object): print(e) self.error += ' --> '+str(e)+'\n' finally: - return self.error + return self.error @dbus.service.method('org.manjaro.pamac', '', 'a(ss)') def To_Remove(self): @@ -449,18 +450,18 @@ class PamacDBusService(dbus.service.Object): def EmitTransactionError(self, message): pass - @dbus.service.method('org.manjaro.pamac', '', 's', sender_keyword='sender', connection_keyword='connexion') - def Release(self, sender=None, connexion=None): + @dbus.service.method('org.manjaro.pamac', '', 's')#, sender_keyword='sender', connection_keyword='connexion') + def Release(self):#, sender=None, connexion=None): self.error = '' - if self.policykit_test(sender,connexion,'org.manjaro.pamac.init_release'): - try: - self.t.release() - except pyalpm.error as e: - self.error += ' --> '+str(e)+'\n' - finally: - return self.error - else : - return _('Authentication failed') + #if self.policykit_test(sender,connexion,'org.manjaro.pamac.init_release'): + try: + self.t.release() + except pyalpm.error as e: + self.error += ' --> '+str(e)+'\n' + finally: + return self.error + #else : + # return _('Authentication failed') @dbus.service.method('org.manjaro.pamac') def StopDaemon(self): diff --git a/pamac/main.py b/pamac/main.py index 782a282..f11f109 100644 --- a/pamac/main.py +++ b/pamac/main.py @@ -959,6 +959,22 @@ class Handler: current_filter = ('search', search_entry.get_text().split()) set_packages_list() + def on_list_treeview_move_cursor(self, treeview, step, count): + liststore, treeiter = treeview.get_selection().get_selected() + if treeiter: + if packages_list[treeiter][0] != _('No package found'): + if packages_list[treeiter][0] in transaction.localpkgs.keys(): + set_infos_list(transaction.localpkgs[packages_list[treeiter][0]]) + set_deps_list(transaction.localpkgs[packages_list[treeiter][0]], "local") + set_details_list(transaction.localpkgs[packages_list[treeiter][0]], "local") + set_files_list(transaction.localpkgs[packages_list[treeiter][0]]) + files_scrolledwindow.set_visible(True) + elif packages_list[treeiter][0] in transaction.syncpkgs.keys(): + set_infos_list(transaction.syncpkgs[packages_list[treeiter][0]]) + set_deps_list(transaction.syncpkgs[packages_list[treeiter][0]], "sync") + set_details_list(transaction.syncpkgs[packages_list[treeiter][0]], "sync") + files_scrolledwindow.set_visible(False) + def on_list_treeview_button_press_event(self, treeview, event): if event.button == 1: # left click treepath, viewcolumn, x, y = treeview.get_path_at_pos(int(event.x), int(event.y))