Ticket #1982: gmail_extra_details-v1.patch
| File gmail_extra_details-v1.patch, 5.8 kB (added by bluegray, 3 years ago) |
|---|
-
src/config.py
441 441 # Notify user of new gmail e-mail messages, 442 442 # only show checkbox if user has a gtalk account 443 443 notify_gmail_checkbutton = self.xml.get_widget('notify_gmail_checkbutton') 444 notify_gmail_extra_checkbutton = self.xml.get_widget('notify_gmail_extra_checkbutton') 444 445 notify_gmail_checkbutton.set_no_show_all(True) 446 notify_gmail_extra_checkbutton.set_no_show_all(True) 445 447 for account in gajim.config.get_per('accounts'): 446 448 jid = gajim.get_jid_from_account(account) 447 449 if gajim.get_server_from_jid(jid) == 'gmail.com': 448 450 st = gajim.config.get('notify_on_new_gmail_email') 449 451 notify_gmail_checkbutton.set_active(st) 450 452 notify_gmail_checkbutton.show() 453 st = gajim.config.get('notify_on_new_gmail_email_extra') 454 notify_gmail_extra_checkbutton.set_active(st) 455 notify_gmail_extra_checkbutton.show() 451 456 break 452 457 else: 453 458 notify_gmail_checkbutton.hide() 459 notify_gmail_extra_checkbutton.hide() 454 460 455 461 self.xml.signal_autoconnect(self) 456 462 … … 846 852 def on_send_os_info_checkbutton_toggled(self, widget): 847 853 self.on_checkbutton_toggled(widget, 'send_os_info') 848 854 849 def on_notify_gmail_checkbutton_toggled(self, widget): 855 def on_notify_gmail_checkbutton_toggled(self, widget): 850 856 self.on_checkbutton_toggled(widget, 'notify_on_new_gmail_email') 857 858 def on_notify_gmail_extra_checkbutton_toggled(self, widget): 859 self.on_checkbutton_toggled(widget, 'notify_on_new_gmail_email_extra') 851 860 852 861 def fill_msg_treeview(self): 853 862 self.xml.get_widget('delete_msg_button').set_sensitive(False) -
src/gajim.py
1026 1026 def handle_event_gmail_notify(self, account, array): 1027 1027 jid = array[0] 1028 1028 gmail_new_messages = int(array[1]) 1029 gmail_messages_list = array[2] 1029 1030 if gajim.config.get('notify_on_new_gmail_email'): 1030 1031 img = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', 1031 1032 'single_msg_recv.png') #FIXME: find a better image 1032 1033 title = _('New E-mail on %(gmail_mail_address)s') % \ 1033 1034 {'gmail_mail_address': jid} 1034 1035 text = i18n.ngettext('You have %d new E-mail message', 'You have %d new E-mail messages', gmail_new_messages, gmail_new_messages, gmail_new_messages) 1036 1037 if gajim.config.get('notify_on_new_gmail_email_extra'): 1038 for gmessage in gmail_messages_list: 1039 # each message has a 'From', 'Subject' and 'Snippet' field 1040 text += _('\nFrom: %(from_address)s') % \ 1041 {'from_address': gmessage['From']} 1042 1035 1043 path = gtkgui_helpers.get_path_to_generic_or_avatar(img) 1036 1044 notify.popup(_('New E-mail'), jid, account, 'gmail', 1037 1045 path_to_image = path, title = title, text = text) -
src/common/config.py
126 126 'after_nickname': [ opt_str, ':' ], 127 127 'send_os_info': [ opt_bool, True ], 128 128 'notify_on_new_gmail_email': [ opt_bool, True ], 129 'notify_on_new_gmail_email_extra': [ opt_bool, True ], 129 130 'usegpg': [ opt_bool, False, '', True ], 130 131 'use_gpg_agent': [ opt_bool, False ], 131 132 'change_roster_title': [ opt_bool, True, _('Add * and [n] in roster title?')], -
src/common/connection_handlers.py
1239 1239 newmsgs = gm.getTag('mailbox').getAttr('total-matched') 1240 1240 if newmsgs != '0': 1241 1241 # there are new messages 1242 if gm.getTag('mailbox').getTag('mail-thread-info'): 1243 gmail_messages = gm.getTag('mailbox').getTags('mail-thread-info') 1244 gmail_messages_list = [] 1245 for gmessage in gmail_messages: 1246 gmail_from = gmessage.getTag('senders').getTag('sender').getAttr('address') 1247 gmail_subject = gmessage.getTag('subject').getData() 1248 gmail_snippet = gmessage.getTag('snippet').getData() 1249 gmail_messages_list.append({ \ 1250 'From': gmail_from, \ 1251 'Subject': gmail_subject, \ 1252 'Snippet': gmail_snippet}) 1242 1253 jid = gajim.get_jid_from_account(self.name) 1243 1254 gajim.log.debug(('You have %s new gmail e-mails on %s.') % (newmsgs, jid)) 1244 self.dispatch('GMAIL_NOTIFY', (jid, newmsgs ))1255 self.dispatch('GMAIL_NOTIFY', (jid, newmsgs, gmail_messages_list)) 1245 1256 raise common.xmpp.NodeProcessed 1246 1257 1247 1258 def _messageCB(self, con, msg): -
data/glade/preferences_window.glade
3164 3164 <property name="fill">False</property> 3165 3165 </packing> 3166 3166 </child> 3167 3168 <child> 3169 <widget class="GtkCheckButton" id="notify_gmail_extra_checkbutton"> 3170 <property name="can_focus">True</property> 3171 <property name="label" translatable="yes">Display _extra email details</property> 3172 <property name="use_underline">True</property> 3173 <property name="relief">GTK_RELIEF_NORMAL</property> 3174 <property name="focus_on_click">True</property> 3175 <property name="active">False</property> 3176 <property name="inconsistent">False</property> 3177 <property name="draw_indicator">True</property> 3178 <signal name="toggled" handler="on_notify_gmail_extra_checkbutton_toggled" last_modification_time="Wed, 06 Apr 2005 14:43:56 GMT"/> 3179 </widget> 3180 <packing> 3181 <property name="padding">0</property> 3182 <property name="expand">False</property> 3183 <property name="fill">False</property> 3184 </packing> 3185 </child> 3167 3186 </widget> 3168 3187 </child> 3169 3188 </widget>
