Added About dialog in Help menu
authorEugene Gagarin <mosfet07@ya.ru>
Wed, 29 Apr 2009 07:06:46 +0000 (11:06 +0400)
committerEugene Gagarin <mosfet07@ya.ru>
Wed, 29 Apr 2009 07:06:46 +0000 (11:06 +0400)
src/main.py

index c1ee10c..bb3ad86 100755 (executable)
@@ -26,7 +26,18 @@ class Control(object):
 #==============================================================================
 
 class Abstraction(object):
-    pass
+    def __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.'
 
 #==============================================================================
 
@@ -72,6 +83,7 @@ class Gtk_Presentation(object):
             fileitem = gtk.MenuItem( '_File' )
             viewitem = gtk.MenuItem( '_View' )
             helpitem = gtk.MenuItem( '_Help' )
+            helpitem.connect('activate', about_dialog)
             menubar.add(fileitem)
             menubar.add(viewitem)
             menubar.add(helpitem)
@@ -94,6 +106,18 @@ class Gtk_Presentation(object):
 
             return toolbar
 
+        def about_dialog(widget):
+            """About dialog window."""
+            dialog = gtk.AboutDialog()
+            dialog.set_name(abstrac.progname)
+            dialog.set_version(abstrac.version)
+            dialog.set_authors(abstrac.authors)
+            dialog.set_comments(abstrac.comments)
+            dialog.set_license(abstrac.license)
+            dialog.show_all()
+            dialog.run()
+            dialog.destroy()
+
         window = gtk.Window()
         window.set_default_size(560, 400)
         window.set_geometry_hints(None, 560, 400)