From f75d1272342c253939b762073bd87a9432efc11e Mon Sep 17 00:00:00 2001 From: Harishankar Date: Wed, 8 Dec 2010 16:50:46 +0530 Subject: [PATCH] Added an icon and about dialog to player app Added an icon and about dialog information to the player app. --- player_mainwindow.py | 39 +++++++++++- playerwindow.glade | 2 + resources/getaclue.svg | 134 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 resources/getaclue.svg diff --git a/player_mainwindow.py b/player_mainwindow.py index 8234893..24fabf6 100644 --- a/player_mainwindow.py +++ b/player_mainwindow.py @@ -4,6 +4,8 @@ # Main window class for GetAClue player +import sys +import os.path import cPickle import pygtk pygtk.require20 () @@ -16,6 +18,19 @@ class MainWindow: # typing mode constants ACROSS = 1 DOWN = 2 + # license text to be displayed in the about dialog + LICENSE_TEXT = """GetAClue is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +GetAClue is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GetAClue. If not, see .""" # quit verification def verify_quit (self): @@ -161,6 +176,10 @@ class MainWindow: puzgrid.queue_draw () dlg.destroy () + # callback for menu help about activated event + def on_about_activate (self, menu_item): + # display the about dialog + self.about () # function to set the selected row/col based on the number clicked # on the clues list and also set the typing mode @@ -508,10 +527,28 @@ class MainWindow: dlg.run () dlg.destroy () + # about dialog + def about (self): + dlg = gtk.AboutDialog () + dlg.set_name ("GetAClue Player") + dlg.set_copyright ("Copyright 2010 V.Harishankar") + dlg.set_website ("http://harishankar.org/software") + dlg.set_authors (("Harishankar",)) + dlg.set_logo (self.window.get_icon()) + dlg.set_license (self.LICENSE_TEXT) + dlg.set_comments ("Create and play Crossword puzzles") + dlg.run () + dlg.destroy () + def __init__ (self, file_to_play = None): # load the user interface self.ui = gtk.Builder () - self.ui.add_from_file ("playerwindow.glade") + + # Path for the interface file - change this if you are distributing + # the application and put the icon, interface file in a different + # location!! + gladepath = os.path.join (sys.path[0], "playerwindow.glade") + self.ui.add_from_file (gladepath) # window object self.window = self.ui.get_object ("mainwindow") diff --git a/playerwindow.glade b/playerwindow.glade index 32dc750..36dd5a6 100644 --- a/playerwindow.glade +++ b/playerwindow.glade @@ -25,6 +25,7 @@ GetAClue player 640 480 + resources/getaclue.svg @@ -161,6 +162,7 @@ True _About True + diff --git a/resources/getaclue.svg b/resources/getaclue.svg new file mode 100644 index 0000000..5d9ec9b --- /dev/null +++ b/resources/getaclue.svg @@ -0,0 +1,134 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + G + E + T + + -- 2.20.1