Commit b3b5e2c1 authored by Og B. Maciel's avatar Og B. Maciel

Added refresh method to Timeline and minor fixes.

svn path=/trunk/; revision=662
parent cbebbcfe
2008-09-29 Luiz Armesto <luiz.armesto@gmail.com>
* src/gui/widgets/timeline.py: Renamed Bullet attribute amount to amountDue, and minor fixes.
* src/gui/widgets/timeline.py: Renamed Bullet attribute amount to
amountDue, added refresh method to Timeline and minor fixes.
* src/gui/maindialog.py: Use new timeline widget now.
* src/lib/actions.py, src/lib/dbus_actions.py, src/daemon/dbus_manager.py:
Added new methods to dbus - get_interval_totals and get_interval_bills.
......
......@@ -212,6 +212,7 @@ class MainDialog:
iface = get_dbus_interface(common.DBUS_INTERFACE, common.DBUS_PATH)
if iface:
iface.connect_to_signal("bill_edited", self.reloadTreeView)
iface.connect_to_signal("bill_edited", self.reloadTimeline)
iface.connect_to_signal("show_main_window", self.window.show)
self.iface = iface
timeout_add(2000, self._send_tray_hints)
......@@ -429,6 +430,7 @@ class MainDialog:
self._update_statusbar()
# Reload records tree (something changed)
self.reloadTreeView()
self.reloadTimeline()
def edit_bill(self):
records = dialogs.edit_dialog(parent=self.window,
......@@ -449,12 +451,14 @@ class MainDialog:
print str(e)
# Reload records tree (something changed)
self.reloadTreeView()
self.reloadTimeline()
def remove_bill(self):
try:
if self.actions.delete_bill(self.currentrecord.Id):
self.list.remove()
self._update_statusbar()
self.reloadTimeline()
except Exception, e:
print str(e)
......@@ -651,6 +655,11 @@ class MainDialog:
return t
def reloadTimeline(self, *args):
print 'reloadtimeline'
self._bullet_cache = {}
self.timeline.refresh()
def on_timeline_cb(self, date):
# TODO: Improve tooltip
# TODO: Improve cache
......
......@@ -144,6 +144,11 @@ class Timeline(gtk.DrawingArea):
self.draw()
return False
def refresh(self):
self._bullets = {}
self._dist_dates()
self.queue_draw_area(0, 0, self.allocation.width, self.allocation.height)
def draw(self, redraw=False):
if self.orientation == gtk.ORIENTATION_HORIZONTAL:
self._hdraw(redraw)
......
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