From 24a995d00683ffd387f8a0eb5e307036c4fecfba Mon Sep 17 00:00:00 2001 From: Eugene Gagarin Date: Wed, 29 Apr 2009 11:06:46 +0400 Subject: [PATCH] Added About dialog in Help menu --- src/main.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index c1ee10c..bb3ad86 100755 --- a/src/main.py +++ b/src/main.py @@ -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) -- 1.7.9.5