From 01a8117ebdb592a90760393b1253c3a8378f2e62 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Mon, 24 Jan 2011 21:50:06 +0000 Subject: [PATCH] GEPS 008: File Organization : about dialog in gui + pylint fixes + real modal svn: r16464 --- src/Makefile.am | 1 - src/gui/Makefile.am | 1 + src/{GrampsAboutDialog.py => gui/aboutdialog.py} | 11 +++++++++-- src/gui/viewmanager.py | 14 +++++++------- 4 files changed, 17 insertions(+), 10 deletions(-) rename src/{GrampsAboutDialog.py => gui/aboutdialog.py} (97%) diff --git a/src/Makefile.am b/src/Makefile.am index 2891ffa69..16a05b3b3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -35,7 +35,6 @@ gdir_PYTHON = \ ExportAssistant.py\ ExportOptions.py\ glade.py\ - GrampsAboutDialog.py\ GrampsDisplay.py\ gramps.py\ ImgManip.py\ diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index b8b4d49e0..382f31258 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -14,6 +14,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/gui pkgdata_PYTHON = \ __init__.py \ + aboutdialog.py \ basesidebar.py \ columnorder.py \ configure.py \ diff --git a/src/GrampsAboutDialog.py b/src/gui/aboutdialog.py similarity index 97% rename from src/GrampsAboutDialog.py rename to src/gui/aboutdialog.py index ded69b8ad..9af03c448 100644 --- a/src/GrampsAboutDialog.py +++ b/src/gui/aboutdialog.py @@ -75,9 +75,11 @@ CONTRIB_HEADER = _('\n==== Contributors ====\n') #------------------------------------------------------------------------- class GrampsAboutDialog(gtk.AboutDialog): """Create an About dialog with all fields set.""" - def __init__(self): + def __init__(self, parent): """Setup all the fields shown in the About dialog.""" gtk.AboutDialog.__init__(self) + self.set_transient_for(parent) + self.set_modal(True) self.set_name(const.PROGRAM_NAME) self.set_version(const.VERSION) @@ -110,9 +112,11 @@ class GrampsAboutDialog(gtk.AboutDialog): self.set_documenters(const.DOCUMENTERS) self.set_logo(gtk.gdk.pixbuf_new_from_file(const.SPLASH)) - self.set_modal(True) def get_versions(self): + """ + Obtain version information of core dependencies + """ if hasattr(os, "uname"): operatingsystem = os.uname()[0] distribution = os.uname()[2] @@ -135,6 +139,9 @@ class GrampsAboutDialog(gtk.AboutDialog): ellipses(distribution))) def ellipses(text): + """ + Ellipsize text on length 40 + """ if len(text) > 40: return text[:40] + "..." return text diff --git a/src/gui/viewmanager.py b/src/gui/viewmanager.py index a41182a92..0a5646359 100644 --- a/src/gui/viewmanager.py +++ b/src/gui/viewmanager.py @@ -91,7 +91,7 @@ from gui.widgets.progressdialog import ProgressMonitor, GtkProgressDialog from gui.configure import GrampsPreferences from gen.db.backup import backup from gen.db.exceptions import DbException -from GrampsAboutDialog import GrampsAboutDialog +from gui.aboutdialog import GrampsAboutDialog from gui.navigator import Navigator from gui.views.tags import Tags from gen.utils.configmanager import safe_eval @@ -742,7 +742,7 @@ class ViewManager(CLIManager): ('ExtraPlugins', None, _('_Extra Reports/Tools'), None, None, extra_plugins_activate), ('About', gtk.STOCK_ABOUT, _('_About'), None, None, - display_about_box), + self.display_about_box), ('PluginStatus', None, _('_Plugin Manager'), None, None, self.__plugin_status), ('FAQ', None, _('_FAQ'), None, None, faq_activate), @@ -1727,11 +1727,11 @@ class ViewManager(CLIManager): ofile.write('') return (ofile.getvalue(), actions) -def display_about_box(obj): - """Display the About box.""" - about = GrampsAboutDialog() - about.run() - about.destroy() + def display_about_box(self, obj): + """Display the About box.""" + about = GrampsAboutDialog(self.uistate.window) + about.run() + about.destroy() def key_bindings(obj): """