Commit f2690709 authored by Gaute Hope's avatar Gaute Hope

src/atEditor.py, src/crontabEditor.py: Uncommented the preview stuff

parent de5c865d
2005-12-23 Gaute Hope <eg@gaute.vetsj.com>
* src/scheduleapplet.py, src/gnome-schedule-applet.py: Changed xml format, using setup_menu_from_file() and not setup_menu()
* src/atEditor.py, src/crontabEditor.py: Uncommented the preview stuff
2005-12-21 Philip Van Hoof <pvanhoof@gnome.org>
* Bugfix for Bug #324687 (refresh of jobs)
......
......@@ -387,9 +387,12 @@ class AtEditor:
preview = gtk.Image()
preview.show()
iconopendialog = gtk.FileChooserDialog(_("Choose an Icon for this Scheduled Task"), self.widget, gtk.FILE_CHOOSER_ACTION_OPEN, (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT), "")
# Preview stuff appears to be highly unstable :-(
# iconopendialog.set_preview_widget(preview)
# iconopendialog.connect("update-preview", self.update_preview_cb, preview)
# 2005-12-23, gauteh: seems to work ok now.
iconopendialog.set_preview_widget(preview)
iconopendialog.connect("update-preview", self.update_preview_cb, preview)
res = iconopendialog.run()
if res != gtk.RESPONSE_REJECT:
self.icon = iconopendialog.get_filename()
......@@ -397,16 +400,20 @@ class AtEditor:
self.__update_textboxes__ ()
# def update_preview_cb(self, file_chooser, preview):
# filename = file_chooser.get_preview_filename()
# try:
# pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(filename, 128, 128)
# preview.set_from_pixbuf(pixbuf)
# have_preview = True
# except:
# have_preview = False
# file_chooser.set_preview_widget_active(have_preview)
# return
def update_preview_cb(self, file_chooser, preview):
filename = file_chooser.get_preview_filename()
try:
pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(filename, 128, 128)
preview.set_from_pixbuf(pixbuf)
have_preview = True
except:
have_preview = False
file_chooser.set_preview_widget_active(have_preview)
return
def __loadicon__ (self):
......
......@@ -318,25 +318,30 @@ class CrontabEditor:
preview = gtk.Image()
preview.show()
iconopendialog = gtk.FileChooserDialog(_("Choose an Icon for this Scheduled Task"), self.widget, gtk.FILE_CHOOSER_ACTION_OPEN, (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT), "")
# Preview stuff appears to be highly unstable :-(
# iconopendialog.set_preview_widget(preview)
# iconopendialog.connect("update-preview", self.update_preview_cb, preview)
# 2005-12-23, gauteh: seems to work ok now.
iconopendialog.set_preview_widget(preview)
iconopendialog.connect("update-preview", self.update_preview_cb, preview)
res = iconopendialog.run()
if res != gtk.RESPONSE_REJECT:
self.icon = iconopendialog.get_filename()
iconopendialog.destroy ()
self.__update_textboxes__ ()
# def update_preview_cb(self, file_chooser, preview):
# filename = file_chooser.get_preview_filename()
# try:
# pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(filename, 128, 128)
# preview.set_from_pixbuf(pixbuf)
# have_preview = True
# except:
# have_preview = False
# file_chooser.set_preview_widget_active(have_preview)
# return
def update_preview_cb(self, file_chooser, preview):
filename = file_chooser.get_preview_filename()
try:
pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(filename, 128, 128)
preview.set_from_pixbuf(pixbuf)
have_preview = True
except:
have_preview = False
file_chooser.set_preview_widget_active(have_preview)
return
def on_template_combobox_entry_changed (self, widget):
......
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