[billreminder/fresh] Renamed add/remove toolbar buttons to new/delete respectively and added about dialog.
- From: Og B. Maciel <ogmaciel src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [billreminder/fresh] Renamed add/remove toolbar buttons to new/delete respectively and added about dialog.
- Date: Sat, 23 Jan 2010 01:07:56 +0000 (UTC)
commit 43c4a6184ec307521ff5c10238a87e4c921b3883
Author: Og B. Maciel <ogmaciel gnome org>
Date: Fri Jan 22 19:51:42 2010 -0500
Renamed add/remove toolbar buttons to new/delete respectively and added about dialog.
data/new.ui | 25 +++++++++++++++++++------
src/gui/new.py | 15 ++++++++++-----
2 files changed, 29 insertions(+), 11 deletions(-)
---
diff --git a/data/new.ui b/data/new.ui
index 78c05c0..019e301 100644
--- a/data/new.ui
+++ b/data/new.ui
@@ -54,12 +54,12 @@
</packing>
</child>
<child>
- <object class="GtkToolButton" id="add">
+ <object class="GtkToolButton" id="new">
<property name="visible">True</property>
<property name="label" translatable="yes">toolbutton4</property>
<property name="use_underline">True</property>
- <property name="stock_id">gtk-add</property>
- <signal name="clicked" handler="on_add_clicked"/>
+ <property name="stock_id">gtk-new</property>
+ <signal name="clicked" handler="on_new_clicked"/>
</object>
<packing>
<property name="expand">False</property>
@@ -80,12 +80,25 @@
</packing>
</child>
<child>
- <object class="GtkToolButton" id="remove">
+ <object class="GtkToolButton" id="delete">
<property name="visible">True</property>
<property name="label" translatable="yes">toolbutton6</property>
<property name="use_underline">True</property>
- <property name="stock_id">gtk-remove</property>
- <signal name="clicked" handler="on_remove_clicked"/>
+ <property name="stock_id">gtk-delete</property>
+ <signal name="clicked" handler="on_delete_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="about">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">toolbutton7</property>
+ <property name="use_underline">True</property>
+ <property name="stock_id">gtk-about</property>
+ <signal name="clicked" handler="on_about_clicked"/>
</object>
<packing>
<property name="expand">False</property>
diff --git a/src/gui/new.py b/src/gui/new.py
index ab22749..f747bb2 100755
--- a/src/gui/new.py
+++ b/src/gui/new.py
@@ -15,6 +15,8 @@ import itertools
import datetime as dt
import calendar
+(PAID, UPCOMING, OVERDUE) = range(3)
+
class MainWindow:
def __init__(self):
# Create a new window
@@ -59,14 +61,14 @@ class MainWindow:
start_date, end_date = self.start_date, self.end_date
paid = None
- if 0 in self.filtered_types: # paid
+ if PAID in self.filtered_types: # paid
paid = True
- if 1 in self.filtered_types: # upcoming
+ if UPCOMING in self.filtered_types: # upcoming
# Make sure to show upcoming bills for the selected month only.
start_date = max(self.start_date, dt.date.today() + dt.timedelta(days = 1))
- if 2 in self.filtered_types: # overdue
+ if OVERDUE in self.filtered_types: # overdue
end_date = dt.date.today() - dt.timedelta(days = 1)
bills = self.actions.get_interval_bills(start_date, end_date, paid)
@@ -153,7 +155,7 @@ class MainWindow:
self.load_bills()
- def on_add_clicked(self, button):
+ def on_new_clicked(self, button):
today = dt.date.today()
records = dialogs.add_dialog(parent=self.window, selectedDate=today)
@@ -180,7 +182,7 @@ class MainWindow:
rec = self.actions.edit(rec)
self.load_bills()
- def on_remove_clicked(self, button):
+ def on_delete_clicked(self, button):
current = self.upcoming.get_selected_bill()
if not current:
return
@@ -196,6 +198,9 @@ class MainWindow:
self.actions.delete(current)
self.load_bills()
+ def on_about_clicked(self, button):
+ dialogs.about_dialog(parent=self.window)
+
def get_widget(self, name):
""" skip one variable (huh) """
return self.ui.get_object(name)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]