def __init__(self, model):
Controller.__init__(self, model)
- return
def register_view(self, view):
"""Loads the text taking it from the model."""
# self.view.set_authors(self.model.authors)
self.view.set_comments(self.model.comments)
self.view.set_license(self.model.license)
- return
# -----------------------------------------------------
# user callbacks
# -----------------------------------------------------
# observable properties
# -----------------------------------------------------
-
- pass # end of class
def __init__(self, model):
Controller.__init__(self, model)
-
self.filesearch = FilesearchCtrl(model.filesearch)
- return
def register_view(self, view):
"""Creates subviews and connect signals"""
self.view['main_window'].connect('destroy', gtk.main_quit)
self.view['about_btn'].connect('clicked', self.on_about_btn_clicked)
self.view['quit_btn'].connect('clicked', self.on_quit_btn_clicked)
- return
# -----------------------------------------------------
# user callbacks
def quit(self):
gtk.main_quit()
- return
# -----------------------------------------------------
# gtk signals
c = AboutCtrl(self.model.about)
v = AboutView(c)
v.run() # this runs in modal mode
- return
def on_quit_btn_clicked(self, bt):
self.quit()
# -----------------------------------------------------
# observable properties
# -----------------------------------------------------
-
- pass # end of class
def __init__(self, model):
Controller.__init__(self, model)
- return
def register_view(self, view):
Controller.register_view(self, view)
self.view.set_quantity_value(self.model.quantity)
self.view.set_start_path_value(self.model.start_path)
- return
-
# -----------------------------------------------------
# user callbacks
# -----------------------------------------------------
def on_qty_spin_value_changed(self, sb):
# Получаем значение количества файлов из SpinButton
self.model.quantity = sb.get_value_as_int()
- return
def start_btn_released_cb(self, btn):
"""Start file search. Button "Go" activate callback."""
# -----------------------------------------------------
def property_quantity_value_change(self, model, old, new):
+ pass
#self.view.set_quantity_value(new)
- return
def property_start_path_value_change(self, model, old, new):
print model, old, new
self.view.set_start_path_value(new)
- return
def property_stopit_value_change(self, model, old, new):
self.view.set_stopit_value(new)
- return
-
- pass # end of class
under the terms of the GNU General Public License\nas published by the Free \
Software Foundation; either version 3\nof the License, or (at your option) \
any later version.'
-
- return
-
- pass # end of class
self.filesearch = FilesearchModel()
self.about = AboutModel()
- return
-
- pass # end of class
def __init__(self):
Model.__init__(self)
- return
-
- pass # end of class
self['dialog_about'] = gtk.AboutDialog()
ctrl.register_view(self)
- return
-
def set_progname(self, text):
self['dialog_about'].set_name(text)
- return
def set_version(self, text):
self['dialog_about'].set_version(text)
- return
def set_authors(self, text):
self['dialog_about'].set_authors(text)
- return
def set_comments(self, text):
self['dialog_about'].set_comments(text)
- return
def set_license(self, text):
self['dialog_about'].set_license(text)
- return
def run(self):
res = self['dialog_about'].run()
self['dialog_about'].destroy()
return res
-
- pass # end of class
self.filesearch = None
self.__build_widgets()
ctrl.register_view(self)
- return
def __build_widgets(self):
self['main_window'] = gtk.Window()
self['main_window'].add(self['vbox'])
self['main_window'].show_all()
- return
-
def create_sub_views(self, filesearch_ctrl):
"""Creates and connects sub views"""
self.filesearch = FilesearchView(filesearch_ctrl) # not a top level
self['vbox'].pack_start(self.filesearch['vbox'])
- return
-
- pass # end of class
View.__init__(self, ctrl, register=False)
self.__build_widgets()
ctrl.register_view(self)
- return
def __build_widgets(self):
self['vbox'].pack_start(currfile_frm, False, False, 0)
self['vbox'].show_all()
- return
-
def set_quantity_value(self, val):
self['qty_spin'].set_value(val)
- return
def set_start_path_value(self, val):
self['path_entry'].set_text(val)
- return
def set_stopit_value(self, val):
- return
-
- pass # end of class
+ pass