pitivi r1119 - in trunk: . pitivi/ui
- From: edwardrv svn gnome org
- To: svn-commits-list gnome org
- Subject: pitivi r1119 - in trunk: . pitivi/ui
- Date: Sat, 17 May 2008 13:44:04 +0100 (BST)
Author: edwardrv
Date: Sat May 17 12:44:03 2008
New Revision: 1119
URL: http://svn.gnome.org/viewvc/pitivi?rev=1119&view=rev
Log:
* pitivi/ui/sourcefactories.py:
Make icon selection code more generic.
Remove self.filepixbuf since it's no longer used.
Fixes #518301
Modified:
trunk/ChangeLog
trunk/pitivi/ui/sourcefactories.py
Modified: trunk/pitivi/ui/sourcefactories.py
==============================================================================
--- trunk/pitivi/ui/sourcefactories.py (original)
+++ trunk/pitivi/ui/sourcefactories.py Sat May 17 12:44:03 2008
@@ -212,17 +212,8 @@
self._newProjectFailedCb)
# default pixbufs
- icontheme = gtk.icon_theme_get_default()
- self.filepixbuf = icontheme.load_icon("misc", 32, 0)
- pixdir = get_pixmap_dir()
- if not self.filepixbuf:
- self.filepixbuf = gtk.gdk.pixbuf_new_from_file(os.path.join(pixdir, "pitivi-file.png"))
- self.audiofilepixbuf = icontheme.load_icon("audio-x-generic", 32, 0)
- if not self.audiofilepixbuf:
- self.audiofilepixbuf = gtk.gdk.pixbuf_new_from_file(os.path.join(pixdir, "pitivi-sound.png"))
- self.videofilepixbuf = icontheme.load_icon("video-x-generic", 32, 0)
- if not self.videofilepixbuf:
- self.videofilepixbuf = gtk.gdk.pixbuf_new_from_file(os.path.join(pixdir, "pitivi-video.png"))
+ self.audiofilepixbuf = self._getIcon("audio-x-generic", "pitivi-sound.png")
+ self.videofilepixbuf = self._getIcon("video-x-generic", "pitivi-video.png")
# Drag and Drop
self.drag_dest_set(gtk.DEST_DEFAULT_DROP | gtk.DEST_DEFAULT_MOTION,
@@ -242,6 +233,17 @@
# Error dialog box
self.errorDialogBox = None
+ def _getIcon(self, iconname, alternate):
+ icontheme = gtk.icon_theme_get_default()
+ pixdir = get_pixmap_dir()
+ icon = None
+ try:
+ icon = icontheme.load_icon(iconname, 32, 0)
+ finally:
+ if not icon:
+ icon = gtk.gdk.pixbuf_new_from_file(os.path.join(pixdir, alternate))
+ return icon
+
def _connectToProject(self, project):
"""Connect signal handlers to a project.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]