Commit 9a2adff4 authored by Philip Van Hoof's avatar Philip Van Hoof

*** empty log message ***

parent 24b165d1
......@@ -13,7 +13,8 @@ gnomeschedule_PYTHON = \
editor.py \
schedule.py \
lang.py \
support.py
support.py \
saveWindow.py
uidir = $(datadir)/gnome-schedule
ui_DATA = gnome-schedule.glade
......
......@@ -253,9 +253,12 @@ class Crontab:
thefield = m.groups()[5] + field[len(field)-1]
# thefield = "1,2,3,4"
fields = thefield.split (",")
for field in fields:
num = int (field)
# print num
for fieldx in fields:
try:
num = int (fieldx)
except:
raise Exception('steps', self.translate_frequency (type), _("%s is not a number") % (fieldx))
if type=="minute":
if num > 59 or num < 0:
raise Exception('steps', self.translate_frequency (type), _("must be between 59 and 0"))
......
......@@ -324,6 +324,7 @@ class CrontabEditor:
self.check_field_format (self.month, "month")
self.check_field_format (self.weekday, "weekday")
except Exception, ex:
print ex
x, y, z = ex
self.WrongRecordDialog (x, y, z)
return
......
......@@ -38,8 +38,11 @@ class Editor:
def __init__(self, parent, schedule):
pass
def SaveTemplate (self, template_name):
raise 'Abstract method please override'
def showedit (self, record, linenumber, iter, mode):
raise 'Abstract method please override'
def showadd (self, mode):
raise 'Abstract method please override'
This diff is collapsed.
......@@ -25,12 +25,10 @@ import re
import gtk.glade
import support
import gconf
# import atEditor
# import atEditorHelper
import setuserWindow
import saveWindow
import schedule
import crontab
# import at
import sys
import time
import config
......@@ -144,6 +142,11 @@ class main:
self.setuserwidget.hide()
self.setuserWindow = setuserWindow.SetuserWindow (self)
#save window
self.savewidget = self.xml.get_widget("saveWindow")
self.savewidget.hide()
self.saveWindow = saveWindow.SaveWindow (self)
if self.root == 0:
# hiding the 'set user' option if not root
self.btnSetUser.hide()
......
# setuserWindow.py - UI code for changing user
# Copyright (C) 2004, 2005 Philip Van Hoof <me at freax dot org>
# Copyright (C) 2004, 2005 Gaute Hope <eg at gaute dot eu dot org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import gtk
import pwd
import string
import pwd
##
## I18N
##
from rhpl.translate import _, N_
import rhpl.translate as translate
domain = 'gnome-schedule'
translate.textdomain (domain)
gtk.glade.bindtextdomain(domain)
class SaveWindow:
def __init__(self, parent):
self.ParentClass = parent
self.xml = self.ParentClass.xml
self.editor = self.ParentClass.editor
self.widget = self.ParentClass.savewidget
self.widget.connect("delete-event", self.on_cancel_button_clicked)
self.cancel_button = self.xml.get_widget ("save_cancel_button")
self.ok_button = self.xml.get_widget ("save_ok_button")
self.save_entry = self.xml.get_widget("save_entry")
self.xml.signal_connect("on_save_cancel_button_clicked", self.on_cancel_button_clicked)
self.xml.signal_connect("on_save_ok_button_clicked", self.on_ok_button_clicked)
self.populateCombobox ()
def ShowSaveWindow (self, editor):
self.editor = editor
self.widget.show_all()
def populateCombobox (self):
pass
def on_cancel_button_clicked (self, *args):
self.widget.hide()
return gtk.TRUE
def on_ok_button_clicked (self, *args):
self.editor.SaveTemplate (self.save_entry.get_text())
self.widget.hide ()
return gtk.TRUE
......@@ -38,6 +38,9 @@ class Schedule:
self.read()
return
def savetemplate (self, template_name, record, nooutput, title, icon):
raise 'Abstract method please override'
def gettemplatenames (self):
raise 'Abstract method please override'
......
......@@ -37,7 +37,6 @@ class SetuserWindow:
self.widget = self.ParentClass.setuserwidget
self.widget.connect("delete-event", self.on_cancel_button_clicked)
self.user_combobox = self.xml.get_widget ("user_combobox")
self.cancel_button = self.xml.get_widget ("setuser_cancel_button")
self.ok_button = self.xml.get_widget ("setuser_ok_button")
self.entUser = self.xml.get_widget("entUser")
......
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