elect all rows when escape is pressed or when we click under all rows
This commit is contained in:
parent
2d35fbcafd
commit
4106ff0f55
|
@ -236,6 +236,7 @@
|
|||
<signal name="row_activated" handler="on_row_activated" last_modification_time="Sun, 12 Oct 2003 18:11:52 GMT"/>
|
||||
<signal name="row_expanded" handler="on_row_expanded" last_modification_time="Wed, 10 Dec 2003 10:31:44 GMT"/>
|
||||
<signal name="row_collapsed" handler="on_row_collapsed" last_modification_time="Wed, 10 Dec 2003 10:54:27 GMT"/>
|
||||
<signal name="key_release_event" handler="on_treeview_event" last_modification_time="Tue, 18 May 2004 23:30:46 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
|
|
@ -697,24 +697,35 @@ class roster_Window:
|
|||
|
||||
def on_treeview_event(self, widget, event):
|
||||
"""popup user's group's or agent menu"""
|
||||
if (event.button == 3) & (event.type == gtk.gdk.BUTTON_PRESS):
|
||||
try:
|
||||
path, column, x, y = self.tree.get_path_at_pos(int(event.x), \
|
||||
int(event.y))
|
||||
except TypeError:
|
||||
return
|
||||
model = self.tree.get_model()
|
||||
iter = model.get_iter(path)
|
||||
type = model.get_value(iter, 2)
|
||||
if type == 'group':
|
||||
self.mk_menu_g(event)
|
||||
elif type == 'agent':
|
||||
self.mk_menu_agent(event, iter)
|
||||
elif type == 'user':
|
||||
self.mk_menu_user(event, iter)
|
||||
elif type == 'account':
|
||||
self.mk_menu_account(event, iter)
|
||||
return gtk.TRUE
|
||||
if event.type == gtk.gdk.BUTTON_PRESS:
|
||||
if event.button == 3:
|
||||
try:
|
||||
path, column, x, y = self.tree.get_path_at_pos(int(event.x), \
|
||||
int(event.y))
|
||||
except TypeError:
|
||||
self.tree.get_selection().unselect_all()
|
||||
return
|
||||
model = self.tree.get_model()
|
||||
iter = model.get_iter(path)
|
||||
type = model.get_value(iter, 2)
|
||||
if type == 'group':
|
||||
self.mk_menu_g(event)
|
||||
elif type == 'agent':
|
||||
self.mk_menu_agent(event, iter)
|
||||
elif type == 'user':
|
||||
self.mk_menu_user(event, iter)
|
||||
elif type == 'account':
|
||||
self.mk_menu_account(event, iter)
|
||||
return gtk.TRUE
|
||||
if event.button == 1:
|
||||
try:
|
||||
path, column, x, y = self.tree.get_path_at_pos(int(event.x), \
|
||||
int(event.y))
|
||||
except TypeError:
|
||||
self.tree.get_selection().unselect_all()
|
||||
if event.type == gtk.gdk.KEY_RELEASE:
|
||||
if event.keyval == gtk.keysyms.Escape:
|
||||
self.tree.get_selection().unselect_all()
|
||||
return gtk.FALSE
|
||||
|
||||
def on_req_usub(self, widget, user, account):
|
||||
|
|
Loading…
Reference in New Issue