GTK3: working select person dialog
svn: r20237
This commit is contained in:
parent
0ea744e5e5
commit
1ce27ee12b
@ -27,6 +27,7 @@
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gen.ggettext import gettext as _
|
from gen.ggettext import gettext as _
|
||||||
|
from gi.repository import Gdk
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -96,13 +97,13 @@ class SelectPerson(BaseSelector):
|
|||||||
|
|
||||||
def _on_row_activated(self, treeview, path, view_col):
|
def _on_row_activated(self, treeview, path, view_col):
|
||||||
store, paths = self.selection.get_selected_rows()
|
store, paths = self.selection.get_selected_rows()
|
||||||
if paths and len(paths[0]) == 2 :
|
if paths and len(paths[0].get_indices ()) == 2 :
|
||||||
self.window.response(Gtk.ResponseType.OK)
|
self.window.response(Gtk.ResponseType.OK)
|
||||||
|
|
||||||
def _key_press(self, obj, event):
|
def _key_press(self, obj, event):
|
||||||
if event.keyval in (Gdk.KEY_Return, Gdk.KEY_KP_Enter):
|
if event.keyval in (Gdk.KEY_Return, Gdk.KEY_KP_Enter):
|
||||||
store, paths = self.selection.get_selected_rows()
|
store, paths = self.selection.get_selected_rows()
|
||||||
if paths and len(paths[0]) == 1 :
|
if paths and len(paths[0].get_indices ()) == 1 :
|
||||||
if self.tree.row_expanded(paths[0]):
|
if self.tree.row_expanded(paths[0]):
|
||||||
self.tree.collapse_row(paths[0])
|
self.tree.collapse_row(paths[0])
|
||||||
else:
|
else:
|
||||||
|
@ -39,6 +39,7 @@ log = logging.getLogger("gen.progressdialog")
|
|||||||
# GTK modules
|
# GTK modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
from gi.repository import GObject
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user