[Commits] .git branch master updated.
Wade Brainerd
wadetb at gmail.com
Sat Nov 29 23:14:13 EST 2008
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "/home/wadeb/public_git/finance/.git".
The branch, master has been updated
via b802ec21e57bb3594c82e04c06f6f4e1224d9189 (commit)
from b12dfca78e0ea9279c1e355dd804268999d2c598 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
finance.py | 29 +++++++++++++++++++----------
po/Finance.pot | 52 ++++++++++++++++++++++++++++------------------------
registerscreen.py | 22 ++++++++++++++--------
3 files changed, 61 insertions(+), 42 deletions(-)
- Log -----------------------------------------------------------------
commit b802ec21e57bb3594c82e04c06f6f4e1224d9189
Author: Wade Brainerd <wadetb at gmail.com>
Date: Sun Nov 30 04:13:26 2008 +0000
Bug fixes. Split New Transaction into New Credit / New Debit with separate hotkeys (to optimize transaction entry).
diff --git a/finance.py b/finance.py
index 2e8ac85..4f9cb6c 100755
--- a/finance.py
+++ b/finance.py
@@ -177,14 +177,19 @@ class Finance(sugar.activity.activity.Activity):
self.helpbtn.show_all()
def build_toolbox(self):
- self.newitembtn = sugar.graphics.toolbutton.ToolButton('list-add')
- self.newitembtn.set_tooltip(_("New Transaction"))
- self.newitembtn.props.accelerator = '<Ctrl>N'
- self.newitembtn.connect('clicked', self.register.newitem_cb)
-
- self.eraseitembtn = sugar.graphics.toolbutton.ToolButton('list-remove')
- self.eraseitembtn.set_tooltip(_("Delete Transaction"))
- self.eraseitembtn.props.accelerator = '<Ctrl>D'
+ self.newcreditbtn = sugar.graphics.toolbutton.ToolButton('list-add')
+ self.newcreditbtn.set_tooltip(_("New Credit"))
+ self.newcreditbtn.props.accelerator = '<Ctrl>A'
+ self.newcreditbtn.connect('clicked', self.register.newcredit_cb)
+
+ self.newdebitbtn = sugar.graphics.toolbutton.ToolButton('list-remove')
+ self.newdebitbtn.set_tooltip(_("New Debit"))
+ self.newdebitbtn.props.accelerator = '<Ctrl>D'
+ self.newdebitbtn.connect('clicked', self.register.newdebit_cb)
+
+ self.eraseitembtn = sugar.graphics.toolbutton.ToolButton('dialog-cancel')
+ self.eraseitembtn.set_tooltip(_("Erase Transaction"))
+ self.eraseitembtn.props.accelerator = '<Ctrl>E'
self.eraseitembtn.connect('clicked', self.register.eraseitem_cb)
#sep = gtk.SeparatorToolItem()
@@ -192,7 +197,8 @@ class Finance(sugar.activity.activity.Activity):
#sep.set_draw(False)
transactionbar = gtk.Toolbar()
- transactionbar.insert(self.newitembtn, -1)
+ transactionbar.insert(self.newcreditbtn, -1)
+ transactionbar.insert(self.newdebitbtn, -1)
transactionbar.insert(self.eraseitembtn, -1)
self.thisperiodbtn = sugar.graphics.toolbutton.ToolButton('go-down')
@@ -383,7 +389,8 @@ class Finance(sugar.activity.activity.Activity):
# Only add and delete transactions on register screen.
add_del = self.screens[-1] == self.register
- self.newitembtn.set_sensitive(add_del)
+ self.newcreditbtn.set_sensitive(add_del)
+ self.newdebitbtn.set_sensitive(add_del)
self.eraseitembtn.set_sensitive(add_del)
def get_this_period(self):
@@ -497,6 +504,8 @@ class Finance(sugar.activity.activity.Activity):
self.data['transactions'].append(t)
self.transaction_map[id] = t
+ self.build_visible_transactions()
+
return id
def destroy_transaction(self, id):
diff --git a/po/Finance.pot b/po/Finance.pot
index 59dfea2..c201320 100644
--- a/po/Finance.pot
+++ b/po/Finance.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-11-15 03:58+0000\n"
+"POT-Creation-Date: 2008-11-30 04:12+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
@@ -31,8 +31,8 @@ msgstr ""
msgid "Debit Categories"
msgstr ""
-#: finance.py:110 finance.py:221 finance.py:320 finance.py:400 finance.py:416
-#: finance.py:432
+#: finance.py:110 finance.py:227 finance.py:326 finance.py:407 finance.py:423
+#: finance.py:439
msgid "Month"
msgstr ""
@@ -40,80 +40,84 @@ msgstr ""
msgid "Show Help"
msgstr ""
-#: finance.py:181 registerscreen.py:201
-msgid "New Transaction"
+#: finance.py:181 registerscreen.py:196
+msgid "New Credit"
msgstr ""
-#: finance.py:186
-msgid "Delete Transaction"
+#: finance.py:186 registerscreen.py:207
+msgid "New Debit"
msgstr ""
-#: finance.py:214
+#: finance.py:191
+msgid "Erase Transaction"
+msgstr ""
+
+#: finance.py:220
msgid "Period: "
msgstr ""
-#: finance.py:219 finance.py:314 finance.py:392 finance.py:410 finance.py:426
+#: finance.py:225 finance.py:320 finance.py:399 finance.py:417 finance.py:433
#: budgetscreen.py:150 budgetscreen.py:171
msgid "Day"
msgstr ""
-#: finance.py:220 finance.py:317 finance.py:395 finance.py:413 finance.py:429
+#: finance.py:226 finance.py:323 finance.py:402 finance.py:420 finance.py:436
#: budgetscreen.py:174
msgid "Week"
msgstr ""
-#: finance.py:222 finance.py:323 finance.py:403 finance.py:422 finance.py:438
+#: finance.py:228 finance.py:329 finance.py:410 finance.py:429 finance.py:445
#: budgetscreen.py:177
msgid "Year"
msgstr ""
-#: finance.py:223 finance.py:326 finance.py:327 finance.py:374 finance.py:406
-#: finance.py:442 finance.py:447 finance.py:452 finance.py:465
+#: finance.py:229 finance.py:332 finance.py:333 finance.py:380 finance.py:413
+#: finance.py:449 finance.py:454 finance.py:459 finance.py:472
#: budgetscreen.py:150
msgid "Forever"
msgstr ""
-#: finance.py:239
+#: finance.py:245
msgid "Register"
msgstr ""
-#: finance.py:244 budgetscreen.py:80
+#: finance.py:250 budgetscreen.py:80
msgid "Budget"
msgstr ""
-#: finance.py:249
+#: finance.py:255
msgid "Chart"
msgstr ""
-#: finance.py:259
+#: finance.py:265
msgid "Transaction"
msgstr ""
-#: finance.py:260
+#: finance.py:266
msgid "Period"
msgstr ""
-#: finance.py:261
+#: finance.py:267
msgid "View"
msgstr ""
-#: finance.py:318
+#: finance.py:324
msgid "Week of"
msgstr ""
-#: finance.py:364
+#: finance.py:370
msgid "Balance: "
msgstr ""
-#: finance.py:380
+#: finance.py:386
msgid "Previous"
msgstr ""
-#: finance.py:381
+#: finance.py:387
msgid "This"
msgstr ""
-#: finance.py:382
+#: finance.py:388
msgid "Next"
msgstr ""
diff --git a/registerscreen.py b/registerscreen.py
index afa2426..543d805 100644
--- a/registerscreen.py
+++ b/registerscreen.py
@@ -144,12 +144,7 @@ class RegisterScreen(gtk.VBox):
def amount_edit_cb(self, cell_renderer, path, new_text):
id = self.liststore[path][0]
t = self.activity.transaction_map[id]
- amount = locale.atof(new_text)
- if amount > 0 and t['type'] == 'debit':
- t['type'] = 'credit'
- if amount < 0 and t['type'] == 'credit':
- t['type'] = 'debit'
- t['amount'] = abs(float(new_text))
+ t['amount'] = abs(locale.atof(new_text))
self.activity.update_summary()
def date_render_cb(self, column, cell_renderer, model, iter):
@@ -192,13 +187,24 @@ class RegisterScreen(gtk.VBox):
if new_text != '':
self.activity.category_names[new_text] = 1
- def newitem_cb(self, widget):
+ def newcredit_cb(self, widget):
# Automatically display the register screen.
if self.activity.screens[-1] != self.activity.register:
self.activity.pop_screen()
self.activity.push_screen(self)
- id = self.activity.create_transaction(_('New Transaction'), 'credit', 0)
+ id = self.activity.create_transaction(_('New Credit'), 'credit', 0)
+ iter = self.liststore.append((id,))
+ # Set cursor and begin editing the description.
+ self.treeview.set_cursor(self.liststore.get_path(iter), self.treeview.get_column(0), True)
+
+ def newdebit_cb(self, widget):
+ # Automatically display the register screen.
+ if self.activity.screens[-1] != self.activity.register:
+ self.activity.pop_screen()
+ self.activity.push_screen(self)
+
+ id = self.activity.create_transaction(_('New Debit'), 'debit', 0)
iter = self.liststore.append((id,))
# Set cursor and begin editing the description.
self.treeview.set_cursor(self.liststore.get_path(iter), self.treeview.get_column(0), True)
-----------------------------------------------------------------------
--
/home/wadeb/public_git/finance/.git
More information about the Commits
mailing list