fix scroll up/down with keyboard

This commit is contained in:
guinux 2013-04-30 18:06:47 +02:00
parent 6ceb3d234f
commit f560beb1ba
3 changed files with 63 additions and 45 deletions

View File

@ -667,6 +667,7 @@
<property name="fixed_height_mode">True</property>
<property name="show_expanders">False</property>
<signal name="button-press-event" handler="on_list_treeview_button_press_event" swapped="no"/>
<signal name="move-cursor" handler="on_list_treeview_move_cursor" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection" id="list_treeview_selection"/>
</child>
@ -1136,6 +1137,24 @@
</object>
</child>
</object>
<object class="GtkListStore" id="repos_list">
<columns>
<!-- column-name name -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="search_list">
<columns>
<!-- column-name terms -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="state_list">
<columns>
<!-- column-name state -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="packages_list">
<columns>
<!-- column-name name -->
@ -1156,24 +1175,6 @@
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="repos_list">
<columns>
<!-- column-name name -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="search_list">
<columns>
<!-- column-name terms -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="state_list">
<columns>
<!-- column-name state -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="transaction_sum">
<columns>
<!-- column-name action -->

View File

@ -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):

View File

@ -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))