gnome-schedule r1067 - in trunk: . desktop icons src



Author: gauteh
Date: Thu Jan 31 13:58:42 2008
New Revision: 1067
URL: http://svn.gnome.org/viewvc/gnome-schedule?rev=1067&view=rev

Log:
* Applied patch from Frank Arnold fixing mainwindow template button.
* desktop/gnome-schedule.desktop.in.in: Now using .svg, not removed .png icon
* icons/Makefile.am: Installing icons under /share/pixmaps/gnome-schedule
* src/config.py.in: Updated image path
* src/mainWindow.py, src/scheduleapplet.py: Only trying to load data files from current location if launched with '--debug'

Modified:
   trunk/ChangeLog
   trunk/desktop/gnome-schedule.desktop.in.in
   trunk/icons/Makefile.am
   trunk/src/config.py.in
   trunk/src/mainWindow.py
   trunk/src/scheduleapplet.py

Modified: trunk/desktop/gnome-schedule.desktop.in.in
==============================================================================
--- trunk/desktop/gnome-schedule.desktop.in.in	(original)
+++ trunk/desktop/gnome-schedule.desktop.in.in	Thu Jan 31 13:58:42 2008
@@ -3,7 +3,7 @@
 _Comment=Manage your system tasks
 Categories=System;
 OnlyShowIn=GNOME
-Icon=gnome-schedule.png
+Icon= prefix@/share/pixmaps/gnome-schedule/gnome-schedule.svg
 Exec= prefix@/bin/gnome-schedule
 Type=Application
 StartupNotify=true

Modified: trunk/icons/Makefile.am
==============================================================================
--- trunk/icons/Makefile.am	(original)
+++ trunk/icons/Makefile.am	Thu Jan 31 13:58:42 2008
@@ -1,4 +1,4 @@
-gnomeschedule_iconsdir = $(prefix)/share/icons
+gnomeschedule_iconsdir = $(prefix)/share/pixmaps/gnome-schedule
 
 gnomeschedule_icons_DATA = \
 	gnome-schedule.svg \

Modified: trunk/src/config.py.in
==============================================================================
--- trunk/src/config.py.in	(original)
+++ trunk/src/config.py.in	Thu Jan 31 13:58:42 2008
@@ -1,5 +1,5 @@
 version = "@VERSION@"
-image_dir = "@prefix@/share/icons"
+image_dir = "@prefix@/share/pixmaps/gnome-schedule"
 glade_dir = "@prefix@/share/gnome-schedule"
 locale_dir = "@prefix@/share/locale"
 crontabbin = "@CRONTAB_CONFIG@"

Modified: trunk/src/mainWindow.py
==============================================================================
--- trunk/src/mainWindow.py	(original)
+++ trunk/src/mainWindow.py	Thu Jan 31 13:58:42 2008
@@ -175,9 +175,9 @@
 		self.run_button.set_sensitive (False)
 	
 		self.button_tb = self.button_template.get_child ()
-		self.tvbox = self.button_tb.get_child ()
-		for w in self.tvbox.get_children ():
-			self.tvbox.remove (w)
+		self.button_tb.remove(self.button_tb.get_child())
+		self.tvbox = gtk.HBox()
+		self.button_tb.add(self.tvbox)
 		icon = gtk.Image ()
 		icon.set_from_pixbuf (self.normalicontemplate)
 		label = gtk.Label (_("Templates"))
@@ -321,39 +321,43 @@
 			
 		
 	def __loadIcon__(self):
-		if os.access("../icons/gnome-schedule.svg", os.F_OK):
-			self.iconPixbuf = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/gnome-schedule.svg", 52, 52)
+		if self.debug_flag:
+			if os.access("../icons/gnome-schedule.svg", os.F_OK):
+				self.iconPixbuf = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/gnome-schedule.svg", 52, 52)
 		else:
 			try:
 				self.iconPixbuf = gtk.gdk.pixbuf_new_from_file_at_size (config.getImagedir() + "/gnome-schedule.svg", 52, 52)
 			except:
 				print _("ERROR: Could not load icon")
 
-		if os.access ("../icons/crontab.svg", os.F_OK):
-			self.iconcrontab = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/crontab.svg", 19, 19)
-			self.bigiconcrontab = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/crontab.svg", 49, 49)
+		if self.debug_flag:
+			if os.access ("../icons/crontab.svg", os.F_OK):
+				self.iconcrontab = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/crontab.svg", 19, 19)
+				self.bigiconcrontab = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/crontab.svg", 49, 49)
 		else:
 			try:
 				self.iconcrontab = gtk.gdk.pixbuf_new_from_file_at_size (config.getImagedir() + "/crontab.svg", 19, 19)
 				self.bigiconcrontab = gtk.gdk.pixbuf_new_from_file_at_size (config.getImagedir() + "/crontab.svg", 49, 49)
 			except:
 				print _("ERROR: Could not load icon")		
-				
-		if os.access ("../icons/calendar.svg", os.F_OK):
-			self.iconcalendar = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/calendar.svg", 19, 19)
-			self.bigiconcalendar = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/calendar.svg", 49, 49)
+			
+		if self.debug_flag:				
+			if os.access ("../icons/calendar.svg", os.F_OK):
+				self.iconcalendar = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/calendar.svg", 19, 19)
+				self.bigiconcalendar = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/calendar.svg", 49, 49)
 		else:
 			try:
 				self.iconcalendar = gtk.gdk.pixbuf_new_from_file_at_size (config.getImagedir() + "/calendar.svg", 19, 19)
 				self.bigiconcalendar = gtk.gdk.pixbuf_new_from_file_at_size (config.getImagedir() + "/calendar.svg", 49, 49)
 			except:
 				print _("ERROR: Could not load icon")
-				
-		if os.access ("../icons/template.svg", os.F_OK):
-			self.icontemplate = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/template.svg", 19, 19)
-			self.normalicontemplate = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/template.svg", 25, 25)
-			self.bigicontemplate = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/template.svg", 49, 49)
-			self.pathicontemplate = "../icons/template.svg"
+		
+		if self.debug_flag:		
+			if os.access ("../icons/template.svg", os.F_OK):
+				self.icontemplate = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/template.svg", 19, 19)
+				self.normalicontemplate = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/template.svg", 25, 25)
+				self.bigicontemplate = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/template.svg", 49, 49)
+				self.pathicontemplate = "../icons/template.svg"
 		else:
 			try:
 				self.icontemplate = gtk.gdk.pixbuf_new_from_file_at_size (config.getImagedir() + "/template.svg", 19, 19)
@@ -362,10 +366,11 @@
 				self.pathicontemplate = config.getImagedir() + "/template.svg"
 			except:
 				print _("ERROR: Could not load icon")
-				
-		if os.access ("../icons/at.svg", os.F_OK):
-			self.iconat = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/at.svg", 19, 19)
-			self.bigiconat = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/at.svg", 49, 49)
+		
+		if self.debug_flag:		
+			if os.access ("../icons/at.svg", os.F_OK):
+				self.iconat = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/at.svg", 19, 19)
+				self.bigiconat = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/at.svg", 49, 49)
 		else:
 			try:
 				self.iconat = gtk.gdk.pixbuf_new_from_file_at_size (config.getImagedir() + "/at.svg", 19, 19)
@@ -375,13 +380,19 @@
 				
 		
 	def __loadGlade__(self):
-		if os.access("gnome-schedule.glade", os.F_OK):
-			self.xml = gtk.glade.XML ("gnome-schedule.glade", domain="gnome-schedule")
+		if self.debug_flag:
+			if os.access("gnome-schedule.glade", os.F_OK):
+				try:
+					self.xml = gtk.glade.XML ("gnome-schedule.glade", domain="gnome-schedule")
+				except:
+					print _("ERROR: Coul not load glade file")
+					quit ()
 		else:
 			try:
 				self.xml = gtk.glade.XML (config.getGladedir() + "/gnome-schedule.glade", domain="gnome-schedule")
 			except:
 				print _("ERROR: Could not load glade file")
+				quit ()
 
 	
 	

Modified: trunk/src/scheduleapplet.py
==============================================================================
--- trunk/src/scheduleapplet.py	(original)
+++ trunk/src/scheduleapplet.py	Thu Jan 31 13:58:42 2008
@@ -71,8 +71,9 @@
 
 
 class ScheduleApplet(gnomeapplet.Applet):
-	def __init__(self, applet, iid, gprogram):
+	def __init__(self, applet, iid, gprogram, debug_flag):
 		self.__gobject_init__()
+		self.debug_flag = debug_flag
 		
 		gettext.bindtextdomain(config.GETTEXT_PACKAGE(), config.GNOMELOCALEDIR())
 		gettext.textdomain(config.GETTEXT_PACKAGE())
@@ -106,11 +107,12 @@
 
 	
 	def __loadIcon__(self):
-		if os.access("../icons/gnome-schedule.svg", os.F_OK):
-			self.iconPixbuf = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/gnome-schedule.svg", 19, 19)
+		if self.debug_flag:
+			if os.access("../icons/gnome-schedule.svg", os.F_OK):
+				self.iconPixbuf = gtk.gdk.pixbuf_new_from_file_at_size ("../icons/gnome-schedule.svg", 52, 52)
 		else:
 			try:
-				self.iconPixbuf = gtk.gdk.pixbuf_new_from_file_at_size (config.getImagedir() + "/gnome-schedule.svg", 19, 19)
+				self.iconPixbuf = gtk.gdk.pixbuf_new_from_file_at_size (config.getImagedir() + "/gnome-schedule.svg", 52, 52)
 			except:
 				print _("ERROR: Could not load icon")
 
@@ -122,14 +124,16 @@
 				]
 		
 		#check for file in current dir
-		if os.access ("gnome-schedule-applet.xml", os.F_OK):
-			datadir = './'
+		if self.debug_flag:
+			if os.access ("gnome-schedule-applet.xml", os.F_OK):
+				datadir = './'
 		else:
 			if os.access (config.getGladedir() + "/gnome-schedule-applet.xml", os.F_OK):
 				datadir = config.getGladedir()
 			else:
 				print _("ERROR: Could not load menu xml file")
 				datadir = ''
+				quit ()
 				
 		self.applet.setup_menu_from_file(datadir,  "gnome-schedule-applet.xml", "gnome-schedule", self.verbs)
 			
@@ -170,7 +174,7 @@
 
 #factory
 def schedule_applet_factory(applet, iid):
-    ScheduleApplet(applet, iid, pr)
+    ScheduleApplet(applet, iid, pr, debug_flag)
     return True
   
 gnomeapplet.bonobo_factory("OAFIID:GNOME_GnomeSchedule_Factory",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]