[billreminder: 10/17] Added info about view mode on statusbar.
- From: Og B. Maciel <ogmaciel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [billreminder: 10/17] Added info about view mode on statusbar.
- Date: Thu, 24 Feb 2011 01:56:13 +0000 (UTC)
commit b965568da29b55397a28f5c6d6b451c79a9efdbc
Author: Luiz Armesto <luiz armesto gmail com>
Date: Wed Feb 23 20:07:29 2011 -0300
Added info about view mode on statusbar.
src/gui/maindialog.py | 8 ++++++++
src/gui/widgets/statusbar.py | 21 +++++++++++++++++++--
2 files changed, 27 insertions(+), 2 deletions(-)
---
diff --git a/src/gui/maindialog.py b/src/gui/maindialog.py
index 514f4c1..d736b29 100644
--- a/src/gui/maindialog.py
+++ b/src/gui/maindialog.py
@@ -388,6 +388,14 @@ class MainDialog:
# Toggles toolbar buttons on/off
self.toggle_buttons()
+ show_paid_bills = self.gconf_client.get('show_paid_bills')
+ if show_paid_bills is 0:
+ self.statusbar.Info(_("Not Paid Only"))
+ elif show_paid_bills is 1:
+ self.statusbar.Info(_("Paid Only"))
+ else:
+ self.statusbar.Info('')
+
# Event handlers
def _on_list_button_press_event(self, widget, event):
""" This function will handle the signal to show a popup menu
diff --git a/src/gui/widgets/statusbar.py b/src/gui/widgets/statusbar.py
index d95bf47..078f9b4 100644
--- a/src/gui/widgets/statusbar.py
+++ b/src/gui/widgets/statusbar.py
@@ -3,6 +3,7 @@
__all__ = ['Statusbar']
import gtk
+import pango
from lib import i18n
@@ -29,7 +30,12 @@ class Statusbar(gtk.HBox):
self.noteValue = gtk.Label()
self.noteValue.set_justify(gtk.JUSTIFY_LEFT)
self.noteValue.set_markup("")
- self.pack_start(self.noteValue, expand=False, fill=True, padding=2)
+ self.pack_start(self.noteValue, expand=True, fill=True, padding=2)
+
+ self.infoValue = gtk.Label()
+ self.infoValue.set_justify(gtk.JUSTIFY_RIGHT)
+ self.infoValue.set_markup("")
+ self.pack_start(self.infoValue, expand=False, fill=True, padding=2)
self.set_border_width(2)
@@ -37,11 +43,22 @@ class Statusbar(gtk.HBox):
self.recordCount.set_markup("%(count)d " % {'count': count})
def Notes(self, notes=''):
- if notes:
+ if notes:
# Add notes to status bar...
self.noteValue.set_markup("%(notes)s" % \
{'notes': notes.replace('\n', ' ')})
# ... and a tooltip.
self.noteValue.set_tooltip_text(notes.replace('\n', ' '))
+ self.noteValue.set_ellipsize(pango.ELLIPSIZE_END)
else:
self.noteValue.set_markup('')
+
+ def Info(self, info=''):
+ if info:
+ # Add notes to status bar...
+ self.infoValue.set_markup("<b>%(info)s</b>" % \
+ {'info': info.replace('\n', ' ')})
+ # ... and a tooltip.
+ self.infoValue.set_tooltip_text(info.replace('\n', ' '))
+ else:
+ self.infoValue.set_markup('')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]