Commit 28320f5d authored by Gaute Hope's avatar Gaute Hope

Applied patch from Frank Arnold: bug 325177

parent f360de66
2005-12-29 Gaute Hope <eg@gaute.vetsj.com>
* Applied patch from Frank Arnold: bug 325177
2005-12-26 Gaute Hope <eg@gaute.vetsj.com>
* Applied patch from Frank Arnold: bug 324988
......
......@@ -40,11 +40,6 @@ else
AC_MSG_ERROR([You need to have python libglade bindings installed])
fi
AC_PATH_PROG(GNOMEHELP_CONFIG, gnome-help, no)
if test x$GNOMEHELP_CONFIG = xno; then
AC_MSG_ERROR(Please install the application gnome-help)
fi
AC_PATH_PROG(CRONTAB_CONFIG, crontab, no)
if test x$CRONTAB_CONFIG = xno; then
AC_MSG_ERROR(Please install the application crontab)
......
......@@ -20,6 +20,7 @@
#pygtk modules
import gtk
import gobject
import gnome
#python modules
import os
......@@ -82,7 +83,7 @@ class AtEditor:
self.combobox_entry = self.combobox.get_child()
self.template_combobox.get_child().connect ("changed", self.on_template_combobox_entry_changed)
self.xml.signal_connect("on_at_help_button_clicked", self.on_help_button_clicked)
self.xml.signal_connect("on_at_help_button_clicked", self.on_at_help_button_clicked)
self.xml.signal_connect("on_at_cancel_button_clicked", self.on_cancel_button_clicked)
self.xml.signal_connect("on_at_ok_button_clicked", self.on_ok_button_clicked)
......@@ -499,12 +500,21 @@ class AtEditor:
return hour, minute, day, month, year
def on_help_button_clicked (self, *args):
help_page = "file://" + config.getDocdir() + "/addingandediting.html"
path = config.getGnomehelpbin ()
pid = os.fork()
if not pid:
os.execv(path, [path, help_page])
def on_at_help_button_clicked (self, *args):
try:
gnome.help_display_with_doc_id (
self.ParentClass.gprogram, '',
'gnome-schedule.xml',
'myapp-adding-once')
except gobject.GError, error:
dialog = gtk.MessageDialog (
self.widget,
gtk.DIALOG_DESTROY_WITH_PARENT,
gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE)
dialog.set_markup ("<b>" + _("Could not display help") + "</b>")
dialog.format_secondary_text ("%s" % error)
dialog.run ()
dialog.destroy ()
def on_cancel_button_clicked (self, *args):
......
......@@ -2,7 +2,6 @@ version = "@VERSION@"
image_dir = "@prefix@/share/pixmaps"
glade_dir = "@prefix@/share/gnome-schedule"
locale_dir = "@prefix@/share/locale"
gnomehelpbin = "@GNOMEHELP_CONFIG@"
crontabbin = "@CRONTAB_CONFIG@"
atbin = "@AT_CONFIG@"
atqbin = "@ATQ_CONFIG@"
......@@ -32,9 +31,6 @@ def getBatchbin ():
def getCrontabbin ():
return crontabbin
def getGnomehelpbin ():
return gnomehelpbin
def getVersion ():
return version
......
......@@ -20,7 +20,7 @@
#pygtk modules
import gtk
import gobject
import gnome
#python modules
import re
......@@ -87,14 +87,14 @@ class CrontabEditor:
self.chkNoOutput = self.xml.get_widget("chkNoOutput")
self.help_button = self.xml.get_widget ("help_button")
self.help_button = self.xml.get_widget ("cron_help_button")
self.cancel_button = self.xml.get_widget ("cancel_button")
self.ok_button = self.xml.get_widget ("ok_button")
self.template_combobox.get_child().connect ("changed", self.on_template_combobox_entry_changed)
self.xml.signal_connect("on_remove_button_clicked", self.on_remove_button_clicked)
self.xml.signal_connect("on_add_help_button_clicked", self.on_add_help_button_clicked)
self.xml.signal_connect("on_cron_help_button_clicked", self.on_cron_help_button_clicked)
self.xml.signal_connect("on_cancel_button_clicked", self.on_cancel_button_clicked)
self.xml.signal_connect("on_ok_button_clicked", self.on_ok_button_clicked)
self.xml.signal_connect("on_anyadvanced_entry_changed", self.on_anyadvanced_entry_changed)
......@@ -409,12 +409,21 @@ class CrontabEditor:
self.__reset__ ()
def on_add_help_button_clicked (self, *args):
help_page = "file://" + config.getDocdir() + "/addingandediting.html"
path = config.getGnomehelpbin ()
pid = os.fork()
if not pid:
os.execv(path, [path, help_page])
def on_cron_help_button_clicked (self, *args):
try:
gnome.help_display_with_doc_id (
self.ParentClass.gprogram, '',
'gnome-schedule.xml',
'myapp-adding-recurrent')
except gobject.GError, error:
dialog = gtk.MessageDialog (
self.widget,
gtk.DIALOG_DESTROY_WITH_PARENT,
gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE)
dialog.set_markup ("<b>" + _("Could not display help") + "</b>")
dialog.format_secondary_text ("%s" % error)
dialog.run ()
dialog.destroy ()
def on_cancel_button_clicked (self, *args):
......
......@@ -416,7 +416,7 @@
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="help_button">
<widget class="GtkButton" id="cron_help_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
......@@ -425,7 +425,7 @@
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-11</property>
<signal name="clicked" handler="on_help_button_clicked" last_modification_time="Wed, 30 Mar 2005 13:30:05 GMT"/>
<signal name="clicked" handler="on_cron_help_button_clicked" last_modification_time="Wed, 30 Mar 2005 13:30:05 GMT"/>
</widget>
</child>
......
......@@ -534,9 +534,21 @@ class main:
#open help
def on_manual_menu_activate (self, *args):
gnome.help_display_with_doc_id(self.gprogram, '', 'gnome-schedule.xml', '')
try:
gnome.help_display_with_doc_id (
self.gprogram, '',
'gnome-schedule.xml', '')
except gobject.GError, error:
dialog = gtk.MessageDialog (
self.widget,
gtk.DIALOG_DESTROY_WITH_PARENT,
gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE)
dialog.set_markup ("<b>" + _("Could not display help") + "</b>")
dialog.format_secondary_text ("%s" % error)
dialog.run ()
dialog.destroy ()
#quit program
def __quit__(self, *args):
if self.inapplet:
......
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