Commit 342ed52f authored by Og B. Maciel's avatar Og B. Maciel

BillReminder now uses GConf to store configuration values

svn path=/trunk/; revision=578
parent 6fe5c474
......@@ -21,6 +21,7 @@ Patches:
========
Daniel Schierbeck <daniel.schierbeck@gmail.com>
Laudeci Oliveira <laudeci@gmail.com>
Wilson Pinto Junior <wilsonpjunior@gmail.com>
Packagers:
=========
......
......@@ -12,6 +12,8 @@ BillReminder 0.3.2
ref: http://code.google.com/p/billreminder/issues/detail?id=4
Backend:
* Changed BillReminder to use GConf for is configuration values.
Thanks Wilson Pinto Junior <wilsonpjunior@gmail.com>
* Changed BillReminder's command line parsing to use OptionParser.
ref: http://code.google.com/p/billreminder/issues/detail?id=3
......
......@@ -8,6 +8,8 @@ AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4")
AM_GCONF_SOURCE_2
dnl put the ACLOCAL flags in the makefile
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
......
2008-07-10 Og Maciel <ogmaciel@gnome.org>
* Makefile.am: Require gconf-2
* billreminder.schemas: Gconf schema
2008-03-08 Og Maciel <ogmaciel@gnome.org>
* billreminder.desktop.in: Changed version attribute to 0.3.
......@@ -2,10 +2,6 @@
SUBDIRS = images
configdir = $(datadir)/billreminder
config_DATA = billreminder.cfg
EXTRA_DIST = $(config_DATA)
servicedir = $(DBUS_SERVICES_DIR)
service_in_files = billreminder.service.in
service_DATA = billreminder.service
......@@ -30,4 +26,7 @@ autostart_DATA = $(autostart_in_files:.desktop.in=.desktop)
EXTRA_DIST += $(autostart_in_files)
CLEANFILES += $(autostart_DATA)
schemadir = $(sysconfdir)/gconf/schemas
schema_DATA = openlh-server.schemas
EXTRA_DIST = $(schema_DATA)
<?xml version="1.0"?>
<gconfschemafile><schemalist>
<schema>
<key>/schemas/apps/billreminder/alarm/interval</key>
<applyto>/apps/billreminder/alarm/interval</applyto>
<owner>interval</owner>
<type>int</type>
<default>60</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/alarm/show_startup_notification</key>
<applyto>/apps/billreminder/alarm/show_startup_notification</applyto>
<owner>billreminder</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/alarm/use_alert_dialog</key>
<applyto>/apps/billreminder/alarm/use_alert_dialog</applyto>
<owner>billreminder</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/alarm/show_before_alarm</key>
<applyto>/apps/billreminder/alarm/show_before_alarm</applyto>
<owner>billreminder</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/alarm/show_pay_notification</key>
<applyto>/apps/billreminder/alarm/show_pay_notification</applyto>
<owner>billreminder</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/alarm/show_alarm</key>
<applyto>/apps/billreminder/alarm/show_alarm</applyto>
<owner>billreminder</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/alarm/notification_days_limit</key>
<applyto>/apps/billreminder/alarm/notification_days_limit</applyto>
<owner>billreminder</owner>
<type>int</type>
<default>15</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/alarm/show_alarm_before_days</key>
<applyto>/apps/billreminder/alarm/show_alarm_before_days</applyto>
<owner>billreminder</owner>
<type>int</type>
<default>3</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/alarm/show_alarm_at_time</key>
<applyto>/apps/billreminder/alarm/show_alarm_at_time</applyto>
<owner>billreminder</owner>
<type>string</type>
<default>13:00</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/gui/due_date</key>
<applyto>/apps/billreminder/gui/due_date</applyto>
<owner>billreminder</owner>
<type>int</type>
<default>0</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/gui/show_menubar</key>
<applyto>/apps/billreminder/gui/show_menubar</applyto>
<owner>billreminder</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/gui/show_paid_bills</key>
<applyto>/apps/billreminder/gui/show_paid_bills</applyto>
<owner>billreminder</owner>
<type>int</type>
<default>2</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/gui/show_toolbar</key>
<applyto>/apps/billreminder/gui/show_toolbar</applyto>
<owner>billreminder</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/gui/width</key>
<applyto>/apps/billreminder/gui/width</applyto>
<owner>billreminder</owner>
<type>int</type>
<default>385</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/gui/height</key>
<applyto>/apps/billreminder/gui/height</applyto>
<owner>billreminder</owner>
<type>int</type>
<default>380</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/gui/x</key>
<applyto>/apps/billreminder/gui/x</applyto>
<owner>billreminder</owner>
<type>int</type>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/gui/y</key>
<applyto>/apps/billreminder/gui/y</applyto>
<owner>billreminder</owner>
<type>int</type>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/delay</key>
<applyto>/apps/billreminder/delay</applyto>
<owner>billreminder</owner>
<type>int</type>
<default>1</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/billreminder/start_in_tray</key>
<applyto>/apps/billreminder/start_in_tray</applyto>
<owner>billreminder</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Fill Here</short>
<long>Fill Here</long>
</locale>
</schema>
</schemalist></gconfschemafile>
2008-07-10 Og Maciel <ogmaciel@gnome.org>
* alarm.py: Make use of gconf values
* main.py: Make use of gconf values
* dbus_manager.py: Make use of gconf values
......@@ -5,6 +5,7 @@ __all__ = ['Alarm']
import datetime
import time
import gconf
from sys import stderr
from gobject import timeout_add
from subprocess import Popen
......@@ -19,6 +20,7 @@ from lib.bubble import NotifyMessage
from lib.utils import verify_pid
from lib.utils import Message
from lib.bill import Bill
from lib.common import GCONF_PATH, GCONF_GUI_PATH, GCONF_ALARM_PATH
class Alarm(object):
......@@ -28,14 +30,15 @@ class Alarm(object):
self.parent = parent
self.tray_hints = {}
self.start()
self.gconf_client = gconf.client_get_default()
def start(self):
start_delay = self.parent.config.getint('General', 'delay') * 60000
start_delay = self.gconf_client.get_int(GCONF_PATH + 'delay') * 60000
print start_delay
if self.parent.config.getboolean('Alarm', 'show_startup_notification'):
if self.gconf_client.get_bool(GCONF_ALARM_PATH + 'show_startup_notification'):
timeout_add(start_delay, self.show_pay_notification)
timeout_add(start_delay + 12000, self.verify_due)
interval = self.parent.config.getint('Alarm', 'interval') * 1000
interval = self.gconf_client.get_int(GCONF_ALARM_PATH + 'interval') * 1000
if interval:
timeout_add(interval, self.timer)
......@@ -50,8 +53,7 @@ class Alarm(object):
def show_pay_notification(self):
today = time.mktime(datetime.date.today().timetuple())
limit = self.parent.config.getint('Alarm',
'notification_days_limit') * 86400.0
limit = self.gconf_client.get_int(GCONF_ALARM_PATH + 'notification_days_limit') * 86400.0
if limit:
records = self.parent.actions.get_bills('dueDate <= %s AND ' \
'paid = 0' % (today + limit))
......@@ -71,7 +73,7 @@ class Alarm(object):
return False
def verify_due(self, sum=0):
if not self.parent.config.getboolean('Alarm', 'show_due_alarm'):
if not self.gconf_client.get_bool(GCONF_ALARM_PATH + 'show_due_alarm'):
return
today = time.mktime(datetime.date.today().timetuple())
if sum > 0:
......@@ -87,7 +89,7 @@ class Alarm(object):
today)
i = 1
use_dialog = self.parent.config.getboolean('Alarm', 'use_alert_dialog')
use_dialog = self.gconf_client.get_bool(GCONF_ALARM_PATH + 'use_alert_dialog')
# TODO: use only one dialog for all bills, if use_dialog == True
for bill in records:
if sum > 0:
......@@ -156,10 +158,10 @@ class Alarm(object):
def timer(self):
interval = self.parent.config.getint('Alarm', 'interval')
interval = self.gconf_client.get_int(GCONF_ALARM_PATH + 'interval')
now = datetime.datetime.now()
alert_hour, alert_minute = self.parent.config.get('Alarm',
'show_alarm_at_time').split(':')
alert_hour, alert_minute = self.gconf_client.get_string(GCONF_ALARM_PATH + \
'show_alarm_at_time').split(':')
alert_hour = int(alert_hour)
alert_minute = int(alert_minute)
alert = datetime.datetime(now.year, now.month, now.day,
......@@ -167,9 +169,9 @@ class Alarm(object):
now = int(time.mktime(now.timetuple()))
alert = int(time.mktime(alert.timetuple()))
# Alarm for bills which will be due before n days
if self.parent.config.getboolean('Alarm', 'show_before_alarm') \
if self.gconf_client.get_bool(GCONF_ALARM_PATH + 'show_before_alarm') \
and alert >= (now - interval/2) and alert < (now + interval/2):
days = self.parent.config.getint('Alarm', 'show_alarm_before_days')
days = self.gconf_client.get_int(GCONF_ALARM_PATH + 'show_alarm_before_days')
self.verify_due(days)
records = self.parent.actions.get_bills('alarm >= %d AND ' \
......@@ -177,7 +179,7 @@ class Alarm(object):
% (now - interval/2, now + interval/2))
i = 0
use_dialog = self.parent.config.getboolean('Alarm', 'use_alert_dialog')
use_dialog = self.gconf_client.get_bool(GCONF_ALARM_PATH + 'use_alert_dialog')
for bill in records:
timeout_add(i * 12000, self.show_bill_notification, bill,
_("The bill %(bill)s will be due at %(day)s.") %\
......
......@@ -157,10 +157,6 @@ class Server(dbus.service.Object):
self.parent.alarm.show_notification(title, msg)
return True
@dbus.service.method(common.DBUS_INTERFACE)
def reload_config(self):
self.parent.config.reload()
# DBus Signals
@dbus.service.signal(common.DBUS_INTERFACE, signature='a{ss}')
def bill_added(self, kwargs):
......
......@@ -26,7 +26,6 @@ from lib import common
from lib import i18n
from lib.utils import verify_pid
from lib.actions import Actions
from lib.config import Config
from alarm import Alarm
from dbus_manager import Server
from dbus_manager import verify_service
......@@ -137,7 +136,6 @@ class Program(Daemon):
self.client_pid = None
self.config = Config()
self.actions = Actions()
self.dbus_server = Server(self)
if options.app_opengui:
......
2008-07-10 Og Maciel <ogmaciel@gnome.org>
* adddialog.py: Make use of gconf values
* prefdialog.py: Make use of gconf values
* maindialog.py: Make use of gconf values
2008-05-10 Og Maciel <ogmaciel@gnome.org>
* adddialog.py: Display the localized currency symbol.
......
......@@ -5,6 +5,7 @@ __all__ = ['AddDialog']
import pygtk
pygtk.require('2.0')
import gtk
import gconf
import datetime
import locale
import gobject
......@@ -14,11 +15,11 @@ from lib import common
from lib import scheduler
from lib.bill import Bill
from lib.actions import Actions
from lib.config import Config
from lib.utils import create_pixbuf
from lib import i18n
from gui.widgets.datebutton import DateButton
from gui.categoriesdialog import CategoriesDialog
from lib.common import GCONF_PATH, GCONF_GUI_PATH, GCONF_ALARM_PATH
class AddDialog(gtk.Dialog):
"""
......@@ -40,11 +41,7 @@ class AddDialog(gtk.Dialog):
selectedDate = datetime.datetime.today()
self.selectedDate = selectedDate
# Configuration data
if self.parent and self.parent.config:
self.config = self.parent.config
else:
self.config = Config()
self.gconf_client = gconf.client_get_default()
# Private copy of any record passed
self.currentrecord = record
......@@ -71,9 +68,9 @@ class AddDialog(gtk.Dialog):
else:
# Use alarm values from preferences
if self.config.get('Alarm', 'show_alarm') == 'true':
atime = self.config.get('Alarm', 'show_alarm_at_time')
adays = self.config.getint('Alarm', 'show_alarm_before_days')
if self.gconf_client.get_bool(GCONF_ALARM_PATH + 'show_alarm') == 'true':
atime = self.gconf_client.get_string(GCONF_ALARM_PATH + 'show_alarm_at_time')
adays = self.gconf_client.get_int(GCONF_ALARM_PATH + 'show_alarm_before_days')
alarmDate = scheduler.get_alarm_timestamp(adays, atime, selectedDate)
self.alarmbutton.set_date(alarmDate)
......@@ -478,8 +475,8 @@ class AddDialog(gtk.Dialog):
# Only reprogram alarm if it is not None
if self.alarmbutton.get_date():
# Use alarm values from preferences
atime = self.config.get('Alarm', 'show_alarm_at_time')
adays = self.config.getint('Alarm', 'show_alarm_before_days')
atime = self.gconf_client.get_string(GCONF_ALARM_PATH + 'show_alarm_at_time')
adays = self.gconf_client.get_int(GCONF_ALARM_PATH + 'show_alarm_before_days')
# Extracts the date off the calendar widget
selDate = self.calendar.get_date()
selDate = scheduler.time_from_calendar(selDate)
......
......@@ -5,6 +5,7 @@ __all__ = ['MainDialog']
import pygtk
pygtk.require('2.0')
import gtk
import gconf
import time
import datetime
from gobject import timeout_add
......@@ -31,8 +32,11 @@ from lib.utils import get_dbus_interface
from lib.utils import force_string
from lib.utils import create_pixbuf
from lib import i18n
from lib.config import Config
from lib.common import GCONF_PATH, GCONF_GUI_PATH, GCONF_ALARM_PATH
from lib.common import CFG_NAME
from lib.common import USER_CFG_PATH
from os.path import exists, join
class MainDialog:
......@@ -51,6 +55,12 @@ class MainDialog:
<separator/>
<menuitem action="Quit"/>
</menu>
<menu action="EditMenu">
<menuitem action="Paid"/>
<menuitem action="NotPaid"/>
<separator/>
<menuitem action="Preferences"/>
</menu>
<menu action="View">
<menuitem action="ShowToolbar"/>
<separator/>
......@@ -65,7 +75,11 @@ class MainDialog:
</ui>'''
def __init__(self):
self.config = Config()
if exists(join(USER_CFG_PATH, CFG_NAME)):
from lib.migrate_to_gconf import migrate
migrate(join(USER_CFG_PATH, CFG_NAME))
self.gconf_client = gconf.client_get_default()
self.message = Message()
# Create a new window
......@@ -139,10 +153,10 @@ class MainDialog:
self.window.add(self.box)
# Restore position and size of window
width = self.config.getint('GUI', 'width')
height = self.config.getint('GUI', 'height')
x = self.config.getint('GUI', 'x')
y = self.config.getint('GUI', 'y')
width = self.gconf_client.get_int(GCONF_GUI_PATH + 'width')
height = self.gconf_client.get_int(GCONF_GUI_PATH + 'height')
x = self.gconf_client.get_int(GCONF_GUI_PATH + 'x')
y = self.gconf_client.get_int(GCONF_GUI_PATH + 'y')
if width and height:
self.window.resize(width, height)
if x and y:
......@@ -153,7 +167,7 @@ class MainDialog:
self._on_show_toolbar(self.showToolbar)
self.list.grab_focus()
if self.config.getboolean('General', 'start_in_tray'):
if self.gconf_client.get_bool(GCONF_PATH + 'start_in_tray'):
self.window.hide()
self.toggle_buttons()
......@@ -189,8 +203,8 @@ class MainDialog:
def _change_view(self, action, current):
#TODO: Change the records selection based on option chose
self.config.set("GUI", "show_paid_bills", str(current.get_current_value()))
self.config.save()
self.gconf_client.set_int(GCONF_GUI_PATH + 'show_paid_bills',
str(current.get_current_value()))
self.reloadTreeView()
return True
......@@ -235,7 +249,7 @@ class MainDialog:
def reloadTreeView(self, *arg):
# Update list with updated record
status = self.config.getint('GUI', 'show_paid_bills')
status = self.gconf_client.get_int(GCONF_GUI_PATH + 'show_paid_bills')
month = self.calendar.get_date()[1] + 1
year = self.calendar.get_date()[0]
......@@ -312,6 +326,7 @@ class MainDialog:
('New', gtk.STOCK_NEW, _("_Add New"), '<Control>n', _("Add a new record"), self.on_btnNew_clicked),
('Edit', gtk.STOCK_EDIT, None, '<Control>e', _("Edit a record"), self.on_btnEdit_clicked),
('Delete', gtk.STOCK_DELETE, None, '<Control>d', _("Delete selected record"), self.on_btnDelete_clicked),
('EditMenu', None, _("_Edit")),
('Paid', gtk.STOCK_APPLY, _("_Paid"), '<Control>p', _("Mark as paid"), self.on_btnPaid_clicked),
('NotPaid', gtk.STOCK_UNDO, _("_Not Paid"), '<Control>u', _("Mark as not paid"), self.on_btnPaid_clicked),
('Preferences', gtk.STOCK_PREFERENCES, None, None, _("Edit preferences"), self.on_btnPref_clicked),
......@@ -321,13 +336,11 @@ class MainDialog:
('About', gtk.STOCK_ABOUT, None, None, _("About the application"), self.on_btnAbout_clicked),
])
# Prevent crash when using old config file
try:
saved_view = self.config.getint('GUI', 'show_paid_bills')
saved_view = self.gconf_client.get_int(GCONF_GUI_PATH + 'show_paid_bills')
except:
saved_view = 1
self.config.set("GUI", "show_paid_bills", str(saved_view))
self.config.save()
self.gconf_client.set_int(GCONF_GUI_PATH + "show_paid_bills", saved_view)
actiongroup.add_toggle_actions([
('ShowToolbar', None, _("Show Toolbar"), None, _("Show the toolbar"), self._on_show_toolbar)
......@@ -355,8 +368,7 @@ class MainDialog:
self.menuUnpaid = self.uimanager.get_widget('/MenuBar/File/NotPaid')
# Check whether we display the toolbar or not
self.showToolbar = actiongroup.get_action('ShowToolbar')
self.showToolbar.set_active(self.config.getboolean('GUI', 'show_toolbar'))
self.showToolbar.set_active(self.gconf_client.get_bool(GCONF_GUI_PATH + 'show_toolbar'))
# Pack it
self.box.pack_start(menubar, expand=False, fill=True, padding=0)
......@@ -425,9 +437,6 @@ class MainDialog:
def preferences(self):
dialogs.preferences_dialog(parent=self.window)
self.config.reload()
if self.iface:
self.iface.reload_config()
# Methods
def _quit_application(self):
......@@ -438,15 +447,13 @@ class MainDialog:
def save_position(self):
x, y = self.window.get_position()
self.config.set('GUI', 'x', x)
self.config.set('GUI', 'y', y)
self.config.save()
self.gconf_client.set_int(GCONF_GUI_PATH + 'x', x)
self.gconf_client.set_int(GCONF_GUI_PATH + 'y', y)
def save_size(self):
width, height = self.window.get_size()
self.config.set('GUI', 'width', width)
self.config.set('GUI', 'height', height)
self.config.save()
self.gconf_client.set_int(GCONF_GUI_PATH + 'width', width)
self.gconf_client.set_int(GCONF_GUI_PATH + 'height', height)
def toggle_buttons(self, paid=None):
""" Toggles all buttons conform number of records present and
......@@ -580,10 +587,10 @@ class MainDialog:
# Toggle toolbar's visibility
if action.get_active():
self.toolbar.show_all()
self.config.set("GUI", "show_toolbar", True)
self.gconf_client.set_bool(GCONF_GUI_PATH + "show_toolbar", True)
else:
self.toolbar.hide_all()
self.config.set("GUI", "show_toolbar", False)
self.gconf_client.set_bool(GCONF_GUI_PATH + "show_toolbar", False)
def main():
gtk.main()
......
......@@ -5,6 +5,7 @@ __all__ = ['PrefDialog']
import pygtk
pygtk.require('2.0')
import gtk
import gconf
import time
import datetime
import locale
......@@ -14,9 +15,8 @@ from subprocess import Popen
from lib import common
from lib import utils
from lib import i18n
from lib.config import Config
from widgets.timewidget import TimeWidget
from lib.common import GCONF_PATH, GCONF_GUI_PATH, GCONF_ALARM_PATH
class PrefDialog(gtk.Dialog):
"""
......@@ -32,12 +32,8 @@ class PrefDialog(gtk.Dialog):
self.props.skip_taskbar_hint = True
self.set_border_width(5)
if self.parent and self.parent.config:
self.config = self.parent.config
else:
self.config = Config()
self.gconf_client = gconf.client_get_default()
self._initialize_dialog_widgets()
self._populate_fields()
......@@ -172,21 +168,19 @@ class PrefDialog(gtk.Dialog):
def _populate_fields(self):
self.notifyCheckbox.set_active( \
self.config.getboolean('Alarm', 'show_before_alarm'))
self.gconf_client.get_bool(GCONF_ALARM_PATH + 'show_before_alarm'))
self.alertCheckbox.set_active( \
self.config.getboolean('Alarm', 'show_alarm'))
self.gconf_client.get_bool(GCONF_ALARM_PATH + 'show_alarm'))
if not self.config.getboolean('Alarm', 'use_alert_dialog'):
if not self.gconf_client.get_bool(GCONF_ALARM_PATH + 'use_alert_dialog'):
self.alertBubble.set_active(True)
else:
self.alertDialog.set_active(True)
self.notifySpinButton.set_value(self.config.getint('Alarm',
'notification_days_limit'))
self.alertSpinButton.set_value(self.config.getint('Alarm',
'show_alarm_before_days'))
self.notifySpinButton.set_value(self.gconf_client.get_int(GCONF_ALARM_PATH + 'notification_days_limit'))
self.alertSpinButton.set_value(self.gconf_client.get_int(GCONF_ALARM_PATH + 'show_alarm_before_days'))
atime = self.config.get('Alarm', 'show_alarm_at_time')
atime = self.gconf_client.get_string(GCONF_ALARM_PATH + 'show_alarm_at_time')
atime = atime.split(":")
self.notificationTime.setHourMinute(atime[0], atime[1])
......@@ -195,30 +189,27 @@ class PrefDialog(gtk.Dialog):
self.notificationTime.hourSpinner.connect("value_changed", self._on_time_changed)
self.notificationTime.minuteSpinner.connect("value_changed", self._on_time_changed)
self.notifyCheckbox.connect("toggled",
self._on_checkbox_toggled, 'Alarm', 'show_before_alarm')
self._on_checkbox_toggled, 'show_before_alarm')
self.alertCheckbox.connect("toggled",
self._on_checkbox_toggled, 'Alarm', 'show_alarm')
self._on_checkbox_toggled, 'show_alarm')
self.notifySpinButton.connect("changed",
self._on_entry_changed, 'Alarm', 'notification_days_limit')