add a "open gmail inbox" menuitem for account context menu. Fixes #1673
This commit is contained in:
parent
3399924761
commit
7fd8d0a29b
|
@ -12,7 +12,7 @@
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
|
|
||||||
<child internal-child="image">
|
<child internal-child="image">
|
||||||
<widget class="GtkImage" id="image1227">
|
<widget class="GtkImage" id="image1235">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="stock">gtk-network</property>
|
<property name="stock">gtk-network</property>
|
||||||
<property name="icon_size">1</property>
|
<property name="icon_size">1</property>
|
||||||
|
@ -25,6 +25,14 @@
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</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>
|
<child>
|
||||||
<widget class="GtkImageMenuItem" id="join_group_chat_menuitem">
|
<widget class="GtkImageMenuItem" id="join_group_chat_menuitem">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
@ -32,7 +40,7 @@
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
|
|
||||||
<child internal-child="image">
|
<child internal-child="image">
|
||||||
<widget class="GtkImage" id="image1234">
|
<widget class="GtkImage" id="image1236">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="stock">gtk-connect</property>
|
<property name="stock">gtk-connect</property>
|
||||||
<property name="icon_size">1</property>
|
<property name="icon_size">1</property>
|
||||||
|
@ -52,7 +60,7 @@
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
|
|
||||||
<child internal-child="image">
|
<child internal-child="image">
|
||||||
<widget class="GtkImage" id="image1235">
|
<widget class="GtkImage" id="image1237">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="stock">gtk-new</property>
|
<property name="stock">gtk-new</property>
|
||||||
<property name="icon_size">1</property>
|
<property name="icon_size">1</property>
|
||||||
|
@ -72,7 +80,7 @@
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
|
|
||||||
<child internal-child="image">
|
<child internal-child="image">
|
||||||
<widget class="GtkImage" id="image1233">
|
<widget class="GtkImage" id="image1238">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="stock">gtk-add</property>
|
<property name="stock">gtk-add</property>
|
||||||
<property name="icon_size">1</property>
|
<property name="icon_size">1</property>
|
||||||
|
@ -92,7 +100,7 @@
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
|
|
||||||
<child internal-child="image">
|
<child internal-child="image">
|
||||||
<widget class="GtkImage" id="image1232">
|
<widget class="GtkImage" id="image1239">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="stock">gtk-find</property>
|
<property name="stock">gtk-find</property>
|
||||||
<property name="icon_size">1</property>
|
<property name="icon_size">1</property>
|
||||||
|
@ -112,7 +120,7 @@
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
|
|
||||||
<child internal-child="image">
|
<child internal-child="image">
|
||||||
<widget class="GtkImage" id="image1231">
|
<widget class="GtkImage" id="image1240">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="stock">gtk-preferences</property>
|
<property name="stock">gtk-preferences</property>
|
||||||
<property name="icon_size">1</property>
|
<property name="icon_size">1</property>
|
||||||
|
@ -125,4 +133,5 @@
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
||||||
</glade-interface>
|
</glade-interface>
|
||||||
|
|
|
@ -18,6 +18,7 @@ import gtk
|
||||||
import gobject
|
import gobject
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
import urllib
|
||||||
|
|
||||||
import common.sleepy
|
import common.sleepy
|
||||||
import history_window
|
import history_window
|
||||||
|
@ -1737,6 +1738,15 @@ class RosterWindow:
|
||||||
gajim.interface.instances[account]['account_modification'] = \
|
gajim.interface.instances[account]['account_modification'] = \
|
||||||
config.AccountModificationWindow(account)
|
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):
|
def on_change_status_message_activate(self, widget, account):
|
||||||
show = gajim.SHOW_LIST[gajim.connections[account].connected]
|
show = gajim.SHOW_LIST[gajim.connections[account].connected]
|
||||||
dlg = dialogs.ChangeStatusMessageDialog(show)
|
dlg = dialogs.ChangeStatusMessageDialog(show)
|
||||||
|
@ -1758,11 +1768,12 @@ class RosterWindow:
|
||||||
childs = account_context_menu.get_children()
|
childs = account_context_menu.get_children()
|
||||||
|
|
||||||
status_menuitem = childs[0]
|
status_menuitem = childs[0]
|
||||||
join_group_chat_menuitem = childs[1]
|
open_gmail_inbox_menuitem = childs[1]
|
||||||
new_message_menuitem = childs[2]
|
join_group_chat_menuitem = childs[2]
|
||||||
add_contact_menuitem = childs[3]
|
new_message_menuitem = childs[3]
|
||||||
service_discovery_menuitem = childs[4]
|
add_contact_menuitem = childs[4]
|
||||||
edit_account_menuitem = childs[5]
|
service_discovery_menuitem = childs[5]
|
||||||
|
edit_account_menuitem = childs[6]
|
||||||
sub_menu = gtk.Menu()
|
sub_menu = gtk.Menu()
|
||||||
status_menuitem.set_submenu(sub_menu)
|
status_menuitem.set_submenu(sub_menu)
|
||||||
|
|
||||||
|
@ -1794,6 +1805,13 @@ class RosterWindow:
|
||||||
sub_menu.append(item)
|
sub_menu.append(item)
|
||||||
item.connect('activate', self.change_status, account, 'offline')
|
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)
|
edit_account_menuitem.connect('activate', self.on_edit_account, account)
|
||||||
add_contact_menuitem.connect('activate', self.on_add_new_contact, account)
|
add_contact_menuitem.connect('activate', self.on_add_new_contact, account)
|
||||||
service_discovery_menuitem.connect('activate',
|
service_discovery_menuitem.connect('activate',
|
||||||
|
|
Loading…
Reference in New Issue