From afa1de13f0576ace6dcbb0176490fd20922950cd Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Tue, 2 Sep 2008 13:01:17 +0200 Subject: Switch from tabs to 4 spaces --- portato/gui/windows/search.py | 98 +++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 49 deletions(-) (limited to 'portato/gui/windows/search.py') diff --git a/portato/gui/windows/search.py b/portato/gui/windows/search.py index e776dd1..415cbfe 100644 --- a/portato/gui/windows/search.py +++ b/portato/gui/windows/search.py @@ -17,59 +17,59 @@ from .basic import AbstractDialog from ...helper import debug class SearchWindow (AbstractDialog): - """A window showing the results of a search process.""" - - def __init__ (self, parent, list, jump_to): - """Constructor. + """A window showing the results of a search process.""" + + def __init__ (self, parent, list, jump_to): + """Constructor. - @param parent: parent-window - @type parent: gtk.Window - @param list: list of results to show - @type list: string[] - @param jump_to: function to call if "OK"-Button is hit - @type jump_to: function(string)""" - - AbstractDialog.__init__(self, parent) - - self.jump_to = jump_to # function to call for jumping - self.list = list - self.list.sort() - - # combo box - self.searchList = self.tree.get_widget("searchList") - self.build_sort_list() - self.searchList.get_selection().select_path(0) + @param parent: parent-window + @type parent: gtk.Window + @param list: list of results to show + @type list: string[] + @param jump_to: function to call if "OK"-Button is hit + @type jump_to: function(string)""" + + AbstractDialog.__init__(self, parent) + + self.jump_to = jump_to # function to call for jumping + self.list = list + self.list.sort() + + # combo box + self.searchList = self.tree.get_widget("searchList") + self.build_sort_list() + self.searchList.get_selection().select_path(0) - # finished --> show - self.window.show_all() + # finished --> show + self.window.show_all() - def build_sort_list (self): - """Builds the sort list.""" - - store = gtk.ListStore(str) - self.searchList.set_model(store) + def build_sort_list (self): + """Builds the sort list.""" + + store = gtk.ListStore(str) + self.searchList.set_model(store) - # build categories - for p in self.list: - store.append(["%s/%s" % tuple(p.split("/"))]) + # build categories + for p in self.list: + store.append(["%s/%s" % tuple(p.split("/"))]) - cell = gtk.CellRendererText() - col = gtk.TreeViewColumn(_("Results"), cell, markup = 0) - self.searchList.append_column(col) + cell = gtk.CellRendererText() + col = gtk.TreeViewColumn(_("Results"), cell, markup = 0) + self.searchList.append_column(col) - def ok (self, *args): - self.jump() - self.close() - - def jump (self, *args): - model, iter = self.searchList.get_selection().get_selected() - self.jump_to(self.list[model.get_path(iter)[0]]) + def ok (self, *args): + self.jump() + self.close() + + def jump (self, *args): + model, iter = self.searchList.get_selection().get_selected() + self.jump_to(self.list[model.get_path(iter)[0]]) - def cb_key_pressed_combo (self, widget, event): - """Emulates a ok-button-click.""" - keyname = gtk.gdk.keyval_name(event.keyval) - if keyname == "Return": # take it as an "OK" if Enter is pressed - self.jump() - return True - else: - return False + def cb_key_pressed_combo (self, widget, event): + """Emulates a ok-button-click.""" + keyname = gtk.gdk.keyval_name(event.keyval) + if keyname == "Return": # take it as an "OK" if Enter is pressed + self.jump() + return True + else: + return False -- cgit v1.2.3-54-g00ecf