bigboard r7342 - trunk/bigboard/stocks/mail
- From: marinaz svn gnome org
- To: svn-commits-list gnome org
- Subject: bigboard r7342 - trunk/bigboard/stocks/mail
- Date: Tue, 20 May 2008 03:22:26 +0000 (UTC)
Author: marinaz
Date: Tue May 20 03:22:25 2008
New Revision: 7342
URL: http://svn.gnome.org/viewvc/bigboard?rev=7342&view=rev
Log:
Make labels in the label slideout look like links.
Display full account name in the label slideout and make clicking on it open the account in the browser.
Modified:
trunk/bigboard/stocks/mail/MailStock.py
Modified: trunk/bigboard/stocks/mail/MailStock.py
==============================================================================
--- trunk/bigboard/stocks/mail/MailStock.py (original)
+++ trunk/bigboard/stocks/mail/MailStock.py Tue May 20 03:22:25 2008
@@ -66,6 +66,9 @@
else:
return "https://mail.google.com/a/" + domain
+def on_visit_mail_account(widget, account_name):
+ libbig.show_url(create_account_url(account_name))
+
class GoogleAccountInfo(AutoStruct):
def __init__(self):
super(GoogleAccountInfo, self).__init__({ 'google_account' : None, \
@@ -92,7 +95,12 @@
vbox = CanvasVBox(border_color=0x0000000ff, spacing=4)
self.get_root().append(vbox)
header = Header(topborder=False)
- account_text = hippo.CanvasText(classes='header', text=ga.name)
+ if ga.domain and len(ga.domain) > 0:
+ account_name = ga.name + "@" + ga.domain
+ else:
+ account_name = ga.name + "@gmail.com"
+ account_text = ActionLink(text=account_name)
+ account_text.connect("activated", on_visit_mail_account, account_name)
header.append(account_text, hippo.PACK_EXPAND)
vbox.append(header)
try:
@@ -108,9 +116,9 @@
box.connect('button-release-event', self.on_button_release_event, label)
vbox.append(box)
hbox = CanvasHBox(spacing=4, padding=4)
- text= hippo.CanvasText(text=label, xalign=hippo.ALIGNMENT_START)
+ text= ActionLink(text=label, xalign=hippo.ALIGNMENT_START)
hbox.append(text)
- text= hippo.CanvasText(text=number, xalign=hippo.ALIGNMENT_START)
+ text= ActionLink(text="(%s)" % number, xalign=hippo.ALIGNMENT_START)
hbox.append(text, flags=hippo.PACK_END)
box.append(hbox)
@@ -267,9 +275,9 @@
account = CanvasHBox(xalign=hippo.ALIGNMENT_START)
account_name = ActionLink(text=gobj.get_account().get_username_as_google_email(), size_mode=hippo.CANVAS_SIZE_ELLIPSIZE_END, font="14px")
- account_name.connect("activated", self.__on_visit_mail_account, gobj)
+ account_name.connect("activated", on_visit_mail_account, gobj.get_account().get_username_as_google_email())
unread_message_count = ActionLink(text=" (%s)" % labelsDict['inbox'], font="14px", xalign=hippo.ALIGNMENT_START)
- unread_message_count.connect("activated", self.__on_visit_mail_account, gobj)
+ unread_message_count.connect("activated", on_visit_mail_account, gobj.get_account().get_username_as_google_email())
# connecting to this signal once per GoogleAccountInfo did not work in all cases, and connecting multiple
# times means that the function would be called multiple times, so we need to keep the expand_arrow_signal_id
# to use it for disconnecting, and then connect again each time
@@ -323,7 +331,7 @@
self._box.set_child_visible(self.__failed_to_connect_message, False)
google_account_box.remove_all()
account = ActionLink(text=gobj.get_account().get_username_as_google_email(), xalign=hippo.ALIGNMENT_START, size_mode=hippo.CANVAS_SIZE_ELLIPSIZE_END, font="14px")
- account.connect("activated", self.__on_visit_mail_account, gobj)
+ account.connect("activated", on_visit_mail_account, gobj.get_account().get_username_as_google_email())
google_account_box.append(account)
logged_in_flag = False
@@ -334,7 +342,7 @@
if not logged_in_flag:
google_account_box.remove_all()
account = ActionLink(text=gobj.get_account().get_username_as_google_email(), xalign=hippo.ALIGNMENT_START, size_mode=hippo.CANVAS_SIZE_ELLIPSIZE_END, font="14px")
- account.connect("activated", self.__on_visit_mail_account, gobj)
+ account.connect("activated", on_visit_mail_account, gobj.get_account().get_username_as_google_email())
google_account_box.append(account)
self._box.set_child_visible(self.__failed_to_connect_message, True)
@@ -427,7 +435,4 @@
libbig.show_url(create_account_url(google_account.get_account().get_username_as_google_email()))
if done_with_sleep_state == 0:
done_with_sleep_state = 1
-
- def __on_visit_mail_account(self, widget, gobj):
- libbig.show_url(create_account_url(gobj.get_account().get_username_as_google_email()))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]