GEPS 008: File Organization : about dialog in gui + pylint fixes + real modal

svn: r16464
This commit is contained in:
Benny Malengier 2011-01-24 21:50:06 +00:00
parent a3e4c12c87
commit 01a8117ebd
4 changed files with 17 additions and 10 deletions

View File

@ -35,7 +35,6 @@ gdir_PYTHON = \
ExportAssistant.py\
ExportOptions.py\
glade.py\
GrampsAboutDialog.py\
GrampsDisplay.py\
gramps.py\
ImgManip.py\

View File

@ -14,6 +14,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/gui
pkgdata_PYTHON = \
__init__.py \
aboutdialog.py \
basesidebar.py \
columnorder.py \
configure.py \

View File

@ -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

View File

@ -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('</menu></menubar></ui>')
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):
"""