~jtaylor/ubuntu/oneiric/gajim/multiple-CVE

« back to all changes in this revision

Viewing changes to src/dialogs.py

  • Committer: Bazaar Package Importer
  • Author(s): Nafallo Bjälevik
  • Date: 2009-06-12 13:49:19 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20090612134919-basez34an73qkkb1
Tags: 0.12.2-0ubuntu1
* New upstream bugfix release:
  + Better keepalive / ping behaviour
  + Fix custom port handling
  + Improve error messages handling
  + Totem support for played music
  + Fix SSL with some servers
  + Handle XFCE notification-daemon
  + Restore old behaviour of click on systray: left click to open events
  + Network manager 0.7 support
  + Improve Kerberos support
  + Many bugfixes here and there
  + Add -c option to history_manager
* debian/patches/00list:
  - Disable de-update.patch, since it doesn't apply
  - Drop svn-11058.patch since it is included in the new release
* debian/patches/svn-11058.patch:
  - Drop patch since it is included in the new release
* debian/control:
  - Bump required version for intltool as per upstream's requirements

Show diffs side-by-side

added added

removed removed

Lines of Context:
161
161
                                                continue
162
162
                                        groups[g] = 0
163
163
                        c_groups = contact.groups
164
 
                        # FIXME: Move to backend
165
 
                        if not c_groups:
166
 
                                c_groups = [_('General')]
167
164
                        for g in c_groups:
168
165
                                groups[g] += 1
169
166
                group_list = []
221
218
                cancelbutton.connect('clicked', self.on_cancelbutton_clicked)
222
219
 
223
220
                self.xml.signal_autoconnect(self)
 
221
                self.window.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
224
222
                self.window.show_all()
225
223
 
226
224
                self.check = bool(checkbuttontext)
286
284
                self.keys_treeview.set_search_column(1)
287
285
                self.fill_tree(secret_keys, selected)
288
286
                self.window.connect('response', self.on_dialog_response)
 
287
                self.window.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
289
288
                self.window.show_all()
290
289
 
291
290
        def sort_keys(self, model, iter1, iter2):
421
420
                        self.entry.set_text(con.activity['text'])
422
421
 
423
422
                self.xml.signal_autoconnect(self)
 
423
                self.window.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
424
424
                self.window.show_all()
425
425
 
426
426
        def on_enable_checkbutton_toggled(self, widget):
513
513
                        self.entry.set_text(con.mood['text'])
514
514
 
515
515
                self.xml.signal_autoconnect(self)
 
516
                self.window.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
516
517
                self.window.show_all()
517
518
 
518
519
        def on_mood_button_clicked(self, widget, data):
588
589
                        self.countdown()
589
590
                        gobject.timeout_add(1000, self.countdown)
590
591
                self.window.connect('response', self.on_dialog_response)
 
592
                self.window.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
591
593
                self.window.show_all()
592
594
 
593
595
        def countdown(self):
989
991
                dlg.set_transient_for(gajim.interface.roster.window)
990
992
                dlg.set_name('Gajim')
991
993
                dlg.set_version(gajim.version)
992
 
                s = u'Copyright © 2003-2008 Gajim Team'
 
994
                s = u'Copyright © 2003-2009 Gajim Team'
993
995
                dlg.set_copyright(s)
994
996
                copying_file_path = self.get_path('COPYING')
995
997
                if copying_file_path:
1624
1626
                '''accept the request'''
1625
1627
                gajim.connections[self.account].send_authorization(self.jid)
1626
1628
                self.window.destroy()
1627
 
                if self.jid not in gajim.contacts.get_jid_list(self.account):
 
1629
                contact = gajim.contacts.get_contact(self.account, self.jid)
 
1630
                if not contact or _('Not in Roster') in contact.groups:
1628
1631
                        AddNewContactWindow(self.account, self.jid, self.user_nick)
1629
1632
 
1630
1633
        def on_contact_info_activate(self, widget):
1648
1651
        def on_deny_button_clicked(self, widget):
1649
1652
                '''refuse the request'''
1650
1653
                gajim.connections[self.account].refuse_authorization(self.jid)
 
1654
                contact = gajim.contacts.get_contact(self.account, self.jid)
 
1655
                if contact and _('Not in Roster') in contact.get_shown_groups():
 
1656
                        gajim.interface.roster.remove_contact(self.jid, self.account)
1651
1657
                self.window.destroy()
1652
1658
 
1653
1659
        def on_actions_button_clicked(self, widget):
2199
2205
 
2200
2206
                if gajim.config.get('use_speller') and HAS_GTK_SPELL and action == 'send':
2201
2207
                        try:
2202
 
                                spell1 = gtkspell.Spell(self.conversation_textview.tv)
2203
 
                                spell2 = gtkspell.Spell(self.message_textview)
2204
2208
                                lang = gajim.config.get('speller_language')
2205
 
                                if lang:
2206
 
                                        spell1.set_language(lang)
2207
 
                                        spell2.set_language(lang)
 
2209
                                if not lang:
 
2210
                                        lang = gajim.LANG
 
2211
                                gtkspell.Spell(self.conversation_textview.tv, lang)
 
2212
                                gtkspell.Spell(self.message_textview, lang)
2208
2213
                        except gobject.GError, msg:
2209
2214
                                AspellDictError(lang)
2210
2215
 
2350
2355
                else:
2351
2356
                        sender_list = [self.to_entry.get_text().decode('utf-8')]
2352
2357
 
 
2358
                jid_jist = []
2353
2359
                for to_whom_jid in sender_list:
2354
2360
                        if to_whom_jid in self.completion_dict:
2355
2361
                                to_whom_jid = self.completion_dict[to_whom_jid].jid
 
2362
                        try:
 
2363
                                jid_jist.append(helpers.parse_jid(to_whom_jid))
 
2364
                        except helpers.InvalidFormat, e:
 
2365
                                ErrorDialog(_('Invalid JID'), e[0])
 
2366
                                return
2356
2367
 
 
2368
                for to_whom_jid in jid_jist:
2357
2369
                        subject = self.subject_entry.get_text().decode('utf-8')
2358
2370
                        begin, end = self.message_tv_buffer.get_bounds()
2359
2371
                        message = self.message_tv_buffer.get_text(begin, end).decode('utf-8')
2421
2433
                self.tagIn = buffer.create_tag('incoming')
2422
2434
                color = gajim.config.get('inmsgcolor')
2423
2435
                self.tagIn.set_property('foreground', color)
 
2436
                self.tagInComment = buffer.create_tag('in_comment')
 
2437
                self.tagInComment.set_property('foreground', color)
 
2438
 
2424
2439
                self.tagOut = buffer.create_tag('outgoing')
2425
2440
                color = gajim.config.get('outmsgcolor')
2426
2441
                self.tagOut.set_property('foreground', color)
 
2442
                self.tagOutComment = buffer.create_tag('out_comment')
 
2443
                self.tagOutComment.set_property('foreground', color)
2427
2444
 
2428
2445
                self.enabled = False
2429
2446
 
2477
2494
                if end_rect.y <= (visible_rect.y + visible_rect.height):
2478
2495
                        at_the_end = True
2479
2496
                end_iter = buffer.get_end_iter()
 
2497
                if kind == 'incoming':
 
2498
                        buffer.insert_with_tags_by_name(end_iter, '<!-- In -->\n',
 
2499
                                'in_comment')
 
2500
                elif kind == 'outgoing':
 
2501
                        buffer.insert_with_tags_by_name(end_iter, '<!-- Out -->\n',
 
2502
                                'out_comment')
 
2503
                end_iter = buffer.get_end_iter()
2480
2504
                buffer.insert_with_tags_by_name(end_iter, stanza.replace('><', '>\n<') + \
2481
2505
                        '\n\n', kind)
2482
2506
                if at_the_end:
2993
3017
                self.progressbar = self.xml.get_widget('progressbar')
2994
3018
                self.dialog.set_title(title_text)
2995
3019
                self.dialog.set_default_size(450, 250)
 
3020
                self.window.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
2996
3021
                self.dialog.show_all()
2997
3022
                self.xml.signal_autoconnect(self)
2998
3023