~jconti/ubuntu/precise/emesene/fix-956422

« back to all changes in this revision

Viewing changes to PreferenceWindow.py

  • Committer: Bazaar Package Importer
  • Author(s): Devid Antonio Filoni
  • Date: 2010-04-14 01:33:51 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20100414013351-r2icbt5gs4ai71j8
Tags: 1.6.1-0ubuntu1
* New upstream release (LP: #562646).
* Fix missing-debian-source-format lintian warning.
* Refresh 20_dont_build_own_libmimic.patch patch.
* Bump Standards-Version to 3.8.4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
        if self.connected:
98
98
            for i in LIST:
99
99
                #we should use always the same icon size, we can remove that field in LIST
100
 
                listStore.append([self.render_icon(i['stock_id'], gtk.ICON_SIZE_LARGE_TOOLBAR), i['text']])
 
100
                listStore.append([self.render_icon(i['stock_id'], \
 
101
                                  gtk.ICON_SIZE_LARGE_TOOLBAR), i['text']])
101
102
        else:
102
103
            for j in [0, 5, 7, 8]:
103
104
                i = LIST[j]
104
 
                listStore.append([self.render_icon(i['stock_id'], gtk.ICON_SIZE_LARGE_TOOLBAR), i['text']])
 
105
                listStore.append([self.render_icon(i['stock_id'], \
 
106
                                  gtk.ICON_SIZE_LARGE_TOOLBAR), i['text']])
105
107
 
106
108
        # Create the TreeView
107
109
        treeView = gtk.TreeView(listStore)
185
187
            self.controller.msn.connect('connection-problem', self.close)
186
188
            self.controller.msn.connect('connection-closed', self.close)
187
189
            self.controller.msn.connect('disconnected', self.close)
188
 
            if self.controller.trayIcon != None:
 
190
            self.controller.mainWindow.menu.disconnectItem.connect(\
 
191
                                        'button-release-event', self.close)
 
192
                                        #why the 'activate' signal is not emmited??
 
193
            if self.controller.trayIcon != None and \
 
194
               self.controller.trayDisconnect != None:
189
195
                self.controller.trayDisconnect.connect('activate', self.close)
190
196
 
191
197
        # These can appear if connection is False.
280
286
        labelPM = gtk.Label(_("Personal Message:"))
281
287
        self.entryPM = gtk.Entry(max=129)
282
288
 
 
289
        if self.controller.connected:
 
290
            self.controller.msn.connect('self-personal-message-changed', self.update_pm_entry)
 
291
            self.controller.msn.connect('self-nick-changed', self.update_nick_entry)
 
292
 
283
293
        labelStartup = gtk.Label(_('Start-up Mode:'))
284
294
        labelStartup.set_alignment(0.00, 0.50)
285
295
 
286
296
        ''' START UP MODE '''
 
297
        configValue = self.config.glob['startup']
287
298
        self.startup = gtk.combo_box_new_text()
288
299
        self.startup.append_text(_('Normal'))
289
 
        self.startup.append_text(_("Notification Icon Only"))
 
300
        if not self.config.glob['disableTrayIcon']:
 
301
            self.startup.append_text(_("Notification Icon Only"))
 
302
            self.values2 = {'default':0,'iconify':1,'minimize':2}
 
303
        else:
 
304
            if configValue == 'iconify': configValue = 'minimize'
 
305
            self.values2 = {'default':0,'minimize':1}
290
306
        self.startup.append_text(_("Minimized"))
291
307
        self.values1 = {_('Normal'):'default',_("Notification Icon Only"):'iconify',_("Minimized"):'minimize'}
292
 
        self.values2 = {'default':0,'iconify':1,'minimize':2}
293
 
        self.startup.set_active(self.values2[self.config.glob['startup']])
 
308
        self.startup.set_active(self.values2[configValue])
294
309
        self.startup.connect("changed", self.save)
295
310
 
296
311
        vbGLabel = gtk.VBox(homogeneous=False, spacing=5)
420
435
        self.list_small = rbCLSmall
421
436
        
422
437
        # Label for the contact list icon sizes
423
 
        lbCL = gtk.Label(_('Contact list buddy icon size:'))
 
438
        lbCL = gtk.Label(_('Icon size:'))
424
439
        
425
440
        hbCLSize.pack_start(lbCL, False, True)
426
441
        hbCLSize.pack_start(rbCLLarge, False, True, padding=20)
455
470
        self.pack_start(alignFT, False, True)
456
471
 
457
472
        self.show_all()
 
473
 
 
474
    def update_nick_entry(self, msnp, oldNick, newNick):
 
475
        self.entryNick.set_text(newNick)
 
476
 
 
477
    def update_pm_entry(self, msnp, user, pm):
 
478
        self.entryPM.set_text(pm)
458
479
        
459
480
    def onToggled(self, radio, option):
460
481
 
540
561
        scroll.set_shadow_type(gtk.SHADOW_OUT)
541
562
        hbScroll = gtk.HBox()
542
563
        hbScroll.pack_start(scroll, True, True, padding=5)
543
 
 
 
564
        
 
565
        self.disableFormat = gtk.CheckButton(_('Disable text formatting'))
 
566
        self.disableFormat.set_active(self.config.user['disableFormat'])
 
567
        self.disableFormat.connect("clicked", self.onDisableFormatClicked)
544
568
 
545
569
        ''' ICON THEME WIDGETS '''
546
570
        currentTheme = self.config.user['theme']
678
702
        ''' PACK EVERYTHING HERE FOR THE MAIN VBOX '''
679
703
        self.pack_start(hbTabLabel,False, True, padding=5)
680
704
        self.pack_start(hbThemes, False, False)
 
705
        self.pack_start(self.disableFormat, False)
681
706
        self.pack_start(hbScroll, True, True)
682
707
        self.pack_start(hbColoursLabel, False, True)
683
708
        self.pack_start(hbColorAndRestore, False, True)
832
857
        except:
833
858
            pass
834
859
 
 
860
    def onDisableFormatClicked(self, button):
 
861
        self.config.user['disableFormat'] = self.disableFormat.get_active()
 
862
        self.conv_theme.set_buffer(self.preview().get_buffer())
 
863
 
835
864
    def save(self):
836
865
        return
837
866
        
856
885
 
857
886
        self.windowshbox = gtk.HBox()
858
887
        self.mainalign = gtk.Alignment(0.5, 0.5, 0.0, 0.0)
859
 
        posStatus = self.config.user['statusComboOnTop']
 
888
        posStatus = self.config.user['statusComboPos']
860
889
        self.mainWindowPreview(posStatus)
861
890
 
862
891
        pageOneLabel = gtk.Label()
912
941
 
913
942
        comboSide.pack_start(self.avatarsOnRight, True, True)
914
943
 
915
 
        self.statusComboOnTop = gtk.combo_box_new_text()
916
 
        self.statusComboOnTop.append_text(_('Below contact list'))
917
 
        self.statusComboOnTop.append_text(_('Above contact list'))
918
 
        self.comboOnTopvalues = {_('Below contact list'):False,_('Above contact list'):True}
919
 
        self.comboOnTopvalues2 = {False:0,True:1}
920
 
        self.statusComboOnTop.set_active(self.comboOnTopvalues2[posStatus])
921
 
        self.statusComboOnTop.connect('changed', self.on_toggle_status_box)
 
944
        self.statusComboPos = gtk.combo_box_new_text()
 
945
        self.statusComboPos.append_text(_('Icon in user panel'))
 
946
        self.statusComboPos.append_text(_('Above contact list'))
 
947
        self.statusComboPos.append_text(_('Below contact list'))
 
948
#        self.comboOnTopvalues = {_('Icon in user panel'):0,_('Below contact list'):1,_('Above contact list'):2}
 
949
#        self.comboOnTopvalues2 = {False:0,True:1}
 
950
#        self.statusComboPos.set_active(self.comboOnTopvalues2[posStatus])
 
951
        self.statusComboPos.set_active(posStatus)
 
952
        self.statusComboPos.connect('changed', self.on_toggle_status_box)
922
953
 
923
 
        comboSide.pack_start(self.statusComboOnTop, True, True)
 
954
        comboSide.pack_start(self.statusComboPos, True, True)
924
955
 
925
956
        combosBox.pack_start(comboSide, True, True)
926
957
        self.page_one.pack_start(combosBox, False, False)
933
964
 
934
965
        self.checks = []
935
966
        mkcheck(self.page_two, 'windows', _('Use multiple _windows'), self)
 
967
        mkcheck(self.page_two, 'parseSmilies', _('Display smilies'), self)
936
968
        mkcheck(self.page_two, 'showTabCloseButton', \
937
969
            _('Show close button on _each tab'), self)
938
970
        mkcheck(self.page_two, 'avatarsInUserList', \
967
999
        self.mainvbox.set_size_request(60, -1)
968
1000
        self.addPreview(self.mainvbox, 'showMenu', _('Show _menu bar'), 10)
969
1001
        self.addPreview(self.mainvbox, 'showUserPanel', _('Show _user panel'), 20)
970
 
        if pos:
 
1002
        if pos==0:
 
1003
            self.addPreview(self.mainvbox, 'showSearchEntry', _('Show _search entry'), 10)
 
1004
            self.addPreview(self.mainvbox, None, None, 90)
 
1005
        elif pos==1:
971
1006
            self.addPreview(self.mainvbox, 'showStatusCombo', _('Always show _search entry'), 10)
972
1007
            self.addPreview(self.mainvbox, 'showSearchEntry', _('Show _search entry'), 10)
973
1008
            self.addPreview(self.mainvbox, None, None, 80)
1031
1066
#        self.config.user['avatarsOnRight'] = self.avatarsvalues[avatarsOnRight]
1032
1067
#    
1033
1068
    def savestatus(self, combo):
1034
 
        self.config.user['statusComboOnTop'] = combo.get_active()
 
1069
        self.config.user['statusComboPos'] = combo.get_active()
1035
1070
    
1036
1071
    def save(self, *args):
1037
1072
        avatarsOnRight = self.avatarsOnRight.get_active_text()
1038
1073
        self.config.user['avatarsOnRight'] = self.avatarsvalues[avatarsOnRight]
1039
 
        statusOnTop = self.statusComboOnTop.get_active_text()
1040
 
        self.config.user['statusComboOnTop'] = self.comboOnTopvalues[statusOnTop]
 
1074
#        statusOnTop = self.statusComboPos.get_active_text()
 
1075
        self.config.user['statusComboPos'] = self.statusComboPos.get_active()
1041
1076
 
1042
1077
class ToggleToolbar(gtk.HBox):
1043
1078
    ''' This represents the fake window toolbar to enable or disable buttons '''