removed about dialog outside MVC scope
authorEugene Gagarin <mosfet07@ya.ru>
Mon, 6 Apr 2009 07:30:42 +0000 (11:30 +0400)
committerEugene Gagarin <mosfet07@ya.ru>
Mon, 6 Apr 2009 07:30:42 +0000 (11:30 +0400)
src/mvc/controllers/about.py [deleted file]
src/mvc/controllers/application.py
src/mvc/models/about.py [deleted file]
src/mvc/models/application.py
src/mvc/views/about.py

diff --git a/src/mvc/controllers/about.py b/src/mvc/controllers/about.py
deleted file mode 100755 (executable)
index 2800ba3..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-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
-    # -----------------------------------------------------
index e14b1f4..24dc8cd 100755 (executable)
@@ -2,8 +2,6 @@ from gtkmvc import Controller
 import gtk
 
 from filesearch import FilesearchCtrl
-
-from about import AboutCtrl
 from views.about import AboutView
 
 
@@ -40,9 +38,7 @@ class ApplicationCtrl(Controller):
     # -----------------------------------------------------
 
     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()
diff --git a/src/mvc/models/about.py b/src/mvc/models/about.py
deleted file mode 100755 (executable)
index a2edff0..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-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.'
index 92266ad..d19d02c 100755 (executable)
@@ -1,7 +1,6 @@
 from gtkmvc import Model
 
 from filesearch import FilesearchModel
-from about import AboutModel
 
 
 class ApplicationModel(Model):
@@ -10,4 +9,3 @@ class ApplicationModel(Model):
         Model.__init__(self)
 
         self.filesearch = FilesearchModel()
-        self.about = AboutModel()
index da87ccf..a759134 100755 (executable)
@@ -1,32 +1,34 @@
 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()