add a "open gmail inbox" menuitem for account context menu. Fixes #1673

This commit is contained in:
Yann Leboulanger 2006-09-08 22:13:48 +00:00
parent 3399924761
commit 7fd8d0a29b
2 changed files with 38 additions and 11 deletions

View File

@ -12,7 +12,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1227">
<widget class="GtkImage" id="image1235">
<property name="visible">True</property>
<property name="stock">gtk-network</property>
<property name="icon_size">1</property>
@ -25,6 +25,14 @@
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="open_gmail_inbox">
<property name="visible">True</property>
<property name="label" translatable="yes">_Open Gmail Inbox</property>
<property name="use_underline">True</property>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="join_group_chat_menuitem">
<property name="visible">True</property>
@ -32,7 +40,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1234">
<widget class="GtkImage" id="image1236">
<property name="visible">True</property>
<property name="stock">gtk-connect</property>
<property name="icon_size">1</property>
@ -52,7 +60,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1235">
<widget class="GtkImage" id="image1237">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
@ -72,7 +80,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1233">
<widget class="GtkImage" id="image1238">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
@ -92,7 +100,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1232">
<widget class="GtkImage" id="image1239">
<property name="visible">True</property>
<property name="stock">gtk-find</property>
<property name="icon_size">1</property>
@ -112,7 +120,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1231">
<widget class="GtkImage" id="image1240">
<property name="visible">True</property>
<property name="stock">gtk-preferences</property>
<property name="icon_size">1</property>
@ -125,4 +133,5 @@
</widget>
</child>
</widget>
</glade-interface>

View File

@ -18,6 +18,7 @@ import gtk
import gobject
import os
import time
import urllib
import common.sleepy
import history_window
@ -1737,6 +1738,15 @@ class RosterWindow:
gajim.interface.instances[account]['account_modification'] = \
config.AccountModificationWindow(account)
def on_open_gmail_inbox(self, widget, account):
if gajim.config.get_per('accounts', account, 'savepass'):
url = ('http://www.google.com/accounts/ServiceLoginAuth?service=mail&Email=%s&Passwd=%s&continue=https://mail.google.com/mail') %\
(urllib.quote(gajim.config.get_per('accounts', account, 'name')),
urllib.quote(gajim.config.get_per('accounts', account, 'password')))
else:
url = ('http://mail.google.com/')
helpers.launch_browser_mailer('url', url)
def on_change_status_message_activate(self, widget, account):
show = gajim.SHOW_LIST[gajim.connections[account].connected]
dlg = dialogs.ChangeStatusMessageDialog(show)
@ -1758,11 +1768,12 @@ class RosterWindow:
childs = account_context_menu.get_children()
status_menuitem = childs[0]
join_group_chat_menuitem = childs[1]
new_message_menuitem = childs[2]
add_contact_menuitem = childs[3]
service_discovery_menuitem = childs[4]
edit_account_menuitem = childs[5]
open_gmail_inbox_menuitem = childs[1]
join_group_chat_menuitem = childs[2]
new_message_menuitem = childs[3]
add_contact_menuitem = childs[4]
service_discovery_menuitem = childs[5]
edit_account_menuitem = childs[6]
sub_menu = gtk.Menu()
status_menuitem.set_submenu(sub_menu)
@ -1794,6 +1805,13 @@ class RosterWindow:
sub_menu.append(item)
item.connect('activate', self.change_status, account, 'offline')
if gajim.config.get_per('accounts', account, 'hostname') not in gajim.gmail_domains:
open_gmail_inbox_menuitem.set_no_show_all(True)
open_gmail_inbox_menuitem.hide()
else:
open_gmail_inbox_menuitem.connect('activate', self.on_open_gmail_inbox,
account)
edit_account_menuitem.connect('activate', self.on_edit_account, account)
add_contact_menuitem.connect('activate', self.on_add_new_contact, account)
service_discovery_menuitem.connect('activate',