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\ ExportAssistant.py\
ExportOptions.py\ ExportOptions.py\
glade.py\ glade.py\
GrampsAboutDialog.py\
GrampsDisplay.py\ GrampsDisplay.py\
gramps.py\ gramps.py\
ImgManip.py\ ImgManip.py\

View File

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

View File

@ -75,9 +75,11 @@ CONTRIB_HEADER = _('\n==== Contributors ====\n')
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
class GrampsAboutDialog(gtk.AboutDialog): class GrampsAboutDialog(gtk.AboutDialog):
"""Create an About dialog with all fields set.""" """Create an About dialog with all fields set."""
def __init__(self): def __init__(self, parent):
"""Setup all the fields shown in the About dialog.""" """Setup all the fields shown in the About dialog."""
gtk.AboutDialog.__init__(self) gtk.AboutDialog.__init__(self)
self.set_transient_for(parent)
self.set_modal(True)
self.set_name(const.PROGRAM_NAME) self.set_name(const.PROGRAM_NAME)
self.set_version(const.VERSION) self.set_version(const.VERSION)
@ -110,9 +112,11 @@ class GrampsAboutDialog(gtk.AboutDialog):
self.set_documenters(const.DOCUMENTERS) self.set_documenters(const.DOCUMENTERS)
self.set_logo(gtk.gdk.pixbuf_new_from_file(const.SPLASH)) self.set_logo(gtk.gdk.pixbuf_new_from_file(const.SPLASH))
self.set_modal(True)
def get_versions(self): def get_versions(self):
"""
Obtain version information of core dependencies
"""
if hasattr(os, "uname"): if hasattr(os, "uname"):
operatingsystem = os.uname()[0] operatingsystem = os.uname()[0]
distribution = os.uname()[2] distribution = os.uname()[2]
@ -135,6 +139,9 @@ class GrampsAboutDialog(gtk.AboutDialog):
ellipses(distribution))) ellipses(distribution)))
def ellipses(text): def ellipses(text):
"""
Ellipsize text on length 40
"""
if len(text) > 40: if len(text) > 40:
return text[:40] + "..." return text[:40] + "..."
return text return text

View File

@ -91,7 +91,7 @@ from gui.widgets.progressdialog import ProgressMonitor, GtkProgressDialog
from gui.configure import GrampsPreferences from gui.configure import GrampsPreferences
from gen.db.backup import backup from gen.db.backup import backup
from gen.db.exceptions import DbException from gen.db.exceptions import DbException
from GrampsAboutDialog import GrampsAboutDialog from gui.aboutdialog import GrampsAboutDialog
from gui.navigator import Navigator from gui.navigator import Navigator
from gui.views.tags import Tags from gui.views.tags import Tags
from gen.utils.configmanager import safe_eval from gen.utils.configmanager import safe_eval
@ -742,7 +742,7 @@ class ViewManager(CLIManager):
('ExtraPlugins', None, _('_Extra Reports/Tools'), None, None, ('ExtraPlugins', None, _('_Extra Reports/Tools'), None, None,
extra_plugins_activate), extra_plugins_activate),
('About', gtk.STOCK_ABOUT, _('_About'), None, None, ('About', gtk.STOCK_ABOUT, _('_About'), None, None,
display_about_box), self.display_about_box),
('PluginStatus', None, _('_Plugin Manager'), None, None, ('PluginStatus', None, _('_Plugin Manager'), None, None,
self.__plugin_status), self.__plugin_status),
('FAQ', None, _('_FAQ'), None, None, faq_activate), ('FAQ', None, _('_FAQ'), None, None, faq_activate),
@ -1727,9 +1727,9 @@ class ViewManager(CLIManager):
ofile.write('</menu></menubar></ui>') ofile.write('</menu></menubar></ui>')
return (ofile.getvalue(), actions) return (ofile.getvalue(), actions)
def display_about_box(obj): def display_about_box(self, obj):
"""Display the About box.""" """Display the About box."""
about = GrampsAboutDialog() about = GrampsAboutDialog(self.uistate.window)
about.run() about.run()
about.destroy() about.destroy()