Use constants for Gramps icon and splash file

svn: r19935
This commit is contained in:
Nick Hall
2012-06-28 16:21:51 +00:00
parent 508aefea03
commit d1ac573c51
4 changed files with 15 additions and 34 deletions

View File

@@ -43,17 +43,9 @@ else:
# Gramps modules # Gramps modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gen.const import IMAGE_DIR, VERSION from gen.const import VERSION, ICON, SPLASH
from gui.display import display_help, display_url from gui.display import display_help, display_url
#-------------------------------------------------------------------------
#
# Constants
#
#-------------------------------------------------------------------------
GRAMPS_PNG = os.path.join(IMAGE_DIR, "gramps.png")
SPLASH_JPG = os.path.join(IMAGE_DIR, "splash.jpg")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# ErrorReportAssistant # ErrorReportAssistant
@@ -75,8 +67,8 @@ class ErrorReportAssistant(gtk.Assistant):
self._error_details_text_buffer = None self._error_details_text_buffer = None
self._final_report_text_buffer = None self._final_report_text_buffer = None
self.logo = gtk.gdk.pixbuf_new_from_file(GRAMPS_PNG) self.logo = gtk.gdk.pixbuf_new_from_file(ICON)
self.splash = gtk.gdk.pixbuf_new_from_file(SPLASH_JPG) self.splash = gtk.gdk.pixbuf_new_from_file(SPLASH)
self.set_title(_("Error Report Assistant")) self.set_title(_("Error Report Assistant"))
self.connect('close', self.close) self.connect('close', self.close)
@@ -226,7 +218,7 @@ class ErrorReportAssistant(gtk.Assistant):
# Using set_page_side_image causes window sizing problems, so put the # Using set_page_side_image causes window sizing problems, so put the
# image in the main page instead. # image in the main page instead.
image = gtk.Image() image = gtk.Image()
image.set_from_file(SPLASH_JPG) image.set_from_file(SPLASH)
hbox = gtk.HBox() hbox = gtk.HBox()
hbox.pack_start(image, False, False, 0) hbox.pack_start(image, False, False, 0)
@@ -650,7 +642,7 @@ class ErrorReportAssistant(gtk.Assistant):
# Using set_page_side_image causes window sizing problems, so put the # Using set_page_side_image causes window sizing problems, so put the
# image in the main page instead. # image in the main page instead.
image = gtk.Image() image = gtk.Image()
image.set_from_file(SPLASH_JPG) image.set_from_file(SPLASH)
hbox = gtk.HBox() hbox = gtk.HBox()
hbox.pack_start(image, False, False, 0) hbox.pack_start(image, False, False, 0)

View File

@@ -55,7 +55,7 @@ import gtk
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gen.const import IMAGE_DIR, USER_HOME from gen.const import USER_HOME, ICON, SPLASH
from gen.config import config from gen.config import config
from gui.pluginmanager import GuiPluginManager from gui.pluginmanager import GuiPluginManager
from gen.utils.file import (find_folder, get_new_filename, from gen.utils.file import (find_folder, get_new_filename,
@@ -64,14 +64,6 @@ from gui.managedwindow import ManagedWindow
from gui.dialog import ErrorDialog from gui.dialog import ErrorDialog
from gui.user import User from gui.user import User
#-------------------------------------------------------------------------
#
# Constants
#
#-------------------------------------------------------------------------
_gramps_png = os.path.join(IMAGE_DIR,"gramps.png")
_splash_jpg = os.path.join(IMAGE_DIR,"splash.jpg")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# ExportAssistant # ExportAssistant
@@ -140,11 +132,11 @@ class ExportAssistant(gtk.Assistant, ManagedWindow) :
self.person = self.dbstate.db.find_initial_person() self.person = self.dbstate.db.find_initial_person()
try: try:
self.logo = gtk.gdk.pixbuf_new_from_file(_gramps_png) self.logo = gtk.gdk.pixbuf_new_from_file(ICON)
except: except:
self.logo = None self.logo = None
try: try:
self.splash = gtk.gdk.pixbuf_new_from_file(_splash_jpg) self.splash = gtk.gdk.pixbuf_new_from_file(SPLASH)
except: except:
self.splash = None self.splash = None

View File

@@ -46,7 +46,7 @@ from gen.utils.callback import Callback
from gen.plug import BasePluginManager, PluginRegister from gen.plug import BasePluginManager, PluginRegister
from gen.constfunc import win from gen.constfunc import win
from gen.config import config from gen.config import config
from gen.const import IMAGE_DIR from gen.const import ICON
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@@ -86,8 +86,7 @@ def base_reg_stock_icons(iconpaths, extraiconsize, items):
pass pass
if not pixbuf : if not pixbuf :
icon_file = os.path.join(IMAGE_DIR, 'gramps.png') pixbuf = gtk.gdk.pixbuf_new_from_file(ICON)
pixbuf = gtk.gdk.pixbuf_new_from_file (icon_file)
## FIXME from gtk 2.17.3/2.15.2 change this to ## FIXME from gtk 2.17.3/2.15.2 change this to
## FIXME pixbuf = pixbuf.add_alpha(True, 255, 255, 255) ## FIXME pixbuf = pixbuf.add_alpha(True, 255, 255, 255)

View File

@@ -49,7 +49,7 @@ import gobject
# GRAMPS modules # GRAMPS modules
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from gen.const import IMAGE_DIR, URL_MANUAL_PAGE from gen.const import URL_MANUAL_PAGE, ICON, SPLASH
from gui.display import display_help from gui.display import display_help
from gen.lib import MediaObject from gen.lib import MediaObject
from gen.db import DbTxn from gen.db import DbTxn
@@ -66,8 +66,6 @@ import gen.mime
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
WIKI_HELP_PAGE = '%s_-_Tools' % URL_MANUAL_PAGE WIKI_HELP_PAGE = '%s_-_Tools' % URL_MANUAL_PAGE
WIKI_HELP_SEC = _('manual|Media_Manager...') WIKI_HELP_SEC = _('manual|Media_Manager...')
GRAMPS_PNG = os.path.join(IMAGE_DIR, "gramps.png")
SPLASH_JPG = os.path.join(IMAGE_DIR, "splash.jpg")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@@ -86,8 +84,8 @@ class MediaMan(tool.Tool):
self.build_batch_ops() self.build_batch_ops()
self.assistant = gtk.Assistant() self.assistant = gtk.Assistant()
self.logo = gtk.gdk.pixbuf_new_from_file(GRAMPS_PNG) self.logo = gtk.gdk.pixbuf_new_from_file(ICON)
self.splash = gtk.gdk.pixbuf_new_from_file(SPLASH_JPG) self.splash = gtk.gdk.pixbuf_new_from_file(SPLASH)
self.assistant.set_title(_('Gramps Media Manager')) self.assistant.set_title(_('Gramps Media Manager'))
self.assistant.connect('close', self.close) self.assistant.connect('close', self.close)
@@ -208,7 +206,7 @@ class IntroductionPage(gtk.HBox):
# Using set_page_side_image causes window sizing problems, so put the # Using set_page_side_image causes window sizing problems, so put the
# image in the main page instead. # image in the main page instead.
image = gtk.Image() image = gtk.Image()
image.set_from_file(SPLASH_JPG) image.set_from_file(SPLASH)
label = gtk.Label(self.__get_intro_text()) label = gtk.Label(self.__get_intro_text())
label.set_line_wrap(True) label.set_line_wrap(True)
@@ -367,7 +365,7 @@ class ConclusionPage(gtk.HBox):
# Using set_page_side_image causes window sizing problems, so put the # Using set_page_side_image causes window sizing problems, so put the
# image in the main page instead. # image in the main page instead.
image = gtk.Image() image = gtk.Image()
image.set_from_file(SPLASH_JPG) image.set_from_file(SPLASH)
self.label = gtk.Label() self.label = gtk.Label()
self.label.set_line_wrap(True) self.label.set_line_wrap(True)