Commit 922dca19 authored by Gaute Hope's avatar Gaute Hope

Applied patch from Frank Arnold fixing mainwindow template button. Now

* 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'

svn path=/trunk/; revision=1067
parent 4afb3b35
2008-01-31 Gaute Hope <eg@gaute.vetsj.com>
* 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 $prefix/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'
2008-01-30 Gaute Hope <eg@gaute.vetsj.com>
* Release 2.0.0
......
......@@ -3,7 +3,7 @@ _Name=Scheduled tasks
_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
......
gnomeschedule_iconsdir = $(prefix)/share/icons
gnomeschedule_iconsdir = $(prefix)/share/pixmaps/gnome-schedule
gnomeschedule_icons_DATA = \
gnome-schedule.svg \
......
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@"
......
......@@ -175,9 +175,9 @@ class main:
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 @@ class main:
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 @@ class main:
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 @@ class main:
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 ()
......
......@@ -71,8 +71,9 @@ pr = gnome.program_init ("gnome-schedule", config.getVersion(), properties=props
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 @@ class ScheduleApplet(gnomeapplet.Applet):
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 @@ class ScheduleApplet(gnomeapplet.Applet):
]
#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 @@ gobject.type_register(ScheduleApplet)
#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",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment