From: Matthijs Kooijman Date: Mon, 17 Aug 2009 19:47:11 +0000 (+0200) Subject: Remove the title argument from the *View classes constructors. X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fmobilegtd.git;a=commitdiff_plain;h=73edf6925c29d595c774b5d6b3361be3d13422ff Remove the title argument from the *View classes constructors. --- diff --git a/src/gui/gui.py b/src/gui/gui.py index b265617..1dc34b2 100644 --- a/src/gui/gui.py +++ b/src/gui/gui.py @@ -103,9 +103,11 @@ def restore_gui(object): class ListView(object): - def __init__(self,title): - self.title = title + def __init__(self): self.view = appuifw.Listbox(self.items(),self.change_entry) + + def set_title(self, title): + self.title = title def change_entry(self): pass @@ -161,9 +163,9 @@ class ListView(object): class WidgetBasedListView(ListView): - def __init__(self,title): + def __init__(self): self.widgets = self.generate_widgets() - super(WidgetBasedListView,self).__init__(title) + super(WidgetBasedListView,self).__init__() self.exit_flag = False def run(self): @@ -234,12 +236,12 @@ class KeyBindingView(object): self.view.bind(key,no_action) class SearchableListView(WidgetBasedListView): - def __init__(self,title,entry_filters): + def __init__(self,entry_filters): self.current_entry_filter_index = 0 self.entry_filters = entry_filters self.filtered_list = self.entry_filters[0] self.lock = None - super(SearchableListView,self).__init__(title) + super(SearchableListView,self).__init__() def search_item(self): @@ -255,9 +257,9 @@ class SearchableListView(WidgetBasedListView): class EditableListView(SearchableListView,KeyBindingView): - def __init__(self,title,entry_filters): + def __init__(self,entry_filters): KeyBindingView.__init__(self) - super(EditableListView, self).__init__(title,entry_filters) + super(EditableListView, self).__init__(entry_filters) def key_and_menu_bindings(self,selected_index): key_and_menu_bindings=[] diff --git a/src/gui/project_details/project_view.py b/src/gui/project_details/project_view.py index 6a8f2f7..bb3fff0 100644 --- a/src/gui/project_details/project_view.py +++ b/src/gui/project_details/project_view.py @@ -63,8 +63,9 @@ class ProjectView(EditableListView): def __init__(self,project): self.project = project self.project.observers.append(self) - super(ProjectView, self).__init__(self.project.name, [lambda:self.project.actions.with_property(lambda a:a.status==action.active)]) + super(ProjectView, self).__init__([lambda:self.project.actions.with_property(lambda a:a.status==action.active)]) self.set_keybindings(ACTION_LIST_KEYS_AND_MENU) + self.set_title(self.project.name) def exit(self): self.project.observers.remove(self) diff --git a/src/gui/projects_list/project_list_view.py b/src/gui/projects_list/project_list_view.py index 0712a72..80bffec 100644 --- a/src/gui/projects_list/project_list_view.py +++ b/src/gui/projects_list/project_list_view.py @@ -24,8 +24,9 @@ class ProjectListView(EditableListView): def __init__(self,projects): self.projects = projects self.projects.observers.append(self) - super(ProjectListView, self).__init__(u'Projects', [lambda:projects]) + super(ProjectListView, self).__init__([lambda:projects]) self.set_keybindings(PROJECT_LIST_KEYS_AND_MENU) + self.set_title(u'Projects') #appuifw.note(u'Before starting thread') # thread.start_new_thread(projects.process,()) #appuifw.note(u'After starting thread %s'%repr(projects.observers))