+++ /dev/null
-from gtkmvc import Controller
-import gtk
-import gobject
-
-class AboutCtrl(Controller):
- """Controller of 'About' dialog. It handles the filling dialog and
- the close button."""
-
- def __init__(self, model):
- Controller.__init__(self, model)
-
- def register_view(self, view):
- """Loads the text taking it from the model."""
-
- Controller.register_view(self, view)
- self.view.set_progname(self.model.progname)
- self.view.set_version(self.model.version)
-# self.view.set_authors(self.model.authors)
- self.view.set_comments(self.model.comments)
- self.view.set_license(self.model.license)
-
- # -----------------------------------------------------
- # user callbacks
- # -----------------------------------------------------
-
- # -----------------------------------------------------
- # gtk signals
- # -----------------------------------------------------
-
- # -----------------------------------------------------
- # observable properties
- # -----------------------------------------------------
import gtk
from filesearch import FilesearchCtrl
-
-from about import AboutCtrl
from views.about import AboutView
# -----------------------------------------------------
def on_about_btn_clicked(self, tb):
- c = AboutCtrl(self.model.about)
- v = AboutView(c)
- v.run() # this runs in modal mode
+ AboutView() # this runs in modal mode
def on_quit_btn_clicked(self, bt):
self.quit()
+++ /dev/null
-from gtkmvc import Model
-
-from __main__ import __version__, __progname__
-
-
-class AboutModel(Model):
-
- def __init__(self):
- Model.__init__(self)
-
- self.progname = __progname__
- self.version = __version__
-
- self.authors = [ 'Alex Taker\n * Email: alteker@gmail.com\n',
- 'Eugene Gagarin\n * Email: mosfet07@ya.ru\n',
- 'Alexandr Popov\n * Email: popov2al@gmail.com' ]
-
- self.comments = 'Tool for find some information on computer.'
-
- self.license = \
-'This program is free software; you can redistribute it and/or\nmodify it \
-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.'
from gtkmvc import Model
from filesearch import FilesearchModel
-from about import AboutModel
class ApplicationModel(Model):
Model.__init__(self)
self.filesearch = FilesearchModel()
- self.about = AboutModel()
from gtkmvc import View
import gtk
-
-class AboutView(View):
- """This is the view for the 'About' dialog"""
-
- def __init__(self, ctrl):
- View.__init__(self, ctrl, register=False)
-
- self['dialog_about'] = gtk.AboutDialog()
- ctrl.register_view(self)
-
- def set_progname(self, text):
- self['dialog_about'].set_name(text)
-
- def set_version(self, text):
- self['dialog_about'].set_version(text)
-
- def set_authors(self, text):
- self['dialog_about'].set_authors(text)
-
- def set_comments(self, text):
- self['dialog_about'].set_comments(text)
-
- def set_license(self, text):
- self['dialog_about'].set_license(text)
-
- def run(self):
- res = self['dialog_about'].run()
- self['dialog_about'].destroy()
- return res
+from __main__ import __version__, __progname__
+
+
+class AboutView(gtk.AboutDialog):
+ """About dialog window."""
+
+ def __init__(self):
+ """Create&show about dialog."""
+ gtk.AboutDialog.__init__(self)
+
+ self.progname = __progname__
+ self.version = __version__
+ self.authors = [ 'Alex Taker\n * Email: alteker@gmail.com\n',
+ 'Eugene Gagarin\n * Email: mosfet07@ya.ru\n',
+ 'Alexandr Popov\n * Email: popov2al@gmail.com' ]
+ self.comments = 'Tool for find some information on computer.'
+ self.license = \
+'This program is free software; you can redistribute it and/or\nmodify it \
+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.'
+
+ self.set_name(self.progname)
+ self.set_version(self.version)
+ self.set_authors(self.authors)
+ self.set_comments(self.comments)
+ self.set_license(self.license)
+
+ self.show_all()
+ self.run()
+ self.destroy()