Ticket #1186: mergeacct_in_accountsw.diff

File mergeacct_in_accountsw.diff, 4.4 kB (added by SF, 3 years ago)
  • config.py

     
    105105                st = gajim.config.get('saveposition') 
    106106                self.xml.get_widget('save_position_checkbutton').set_active(st) 
    107107                 
    108                 #Merge accounts 
    109                 st = gajim.config.get('mergeaccounts') 
    110                 self.xml.get_widget('merge_checkbutton').set_active(st) 
    111  
    112108                # Sort contacts by show 
    113109                st = gajim.config.get('sort_by_show') 
    114110                self.xml.get_widget('sort_by_show_checkbutton').set_active(st) 
     
    470466        def on_save_position_checkbutton_toggled(self, widget): 
    471467                self.on_checkbutton_toggled(widget, 'saveposition') 
    472468         
    473         def on_merge_checkbutton_toggled(self, widget): 
    474                 self.on_checkbutton_toggled(widget, 'mergeaccounts') 
    475                 gajim.interface.roster.regroup = gajim.config.get('mergeaccounts') 
    476                 gajim.interface.roster.draw_roster() 
    477          
    478469        def on_sort_by_show_checkbutton_toggled(self, widget): 
    479470                self.on_checkbutton_toggled(widget, 'sort_by_show') 
    480471                gajim.interface.roster.draw_roster() 
     
    16461637                self.init_accounts() 
    16471638                self.window.show_all() 
    16481639 
     1640                #Merge accounts 
     1641                st = gajim.config.get('mergeaccounts') 
     1642                self.xml.get_widget('merge_checkbutton').set_active(st) 
     1643 
    16491644        def on_accounts_window_key_press_event(self, widget, event): 
    16501645                if event.keyval == gtk.keysyms.Escape: 
    16511646                        self.window.destroy()    
     
    17101705                        gajim.interface.instances[account]['account_modification'] = \ 
    17111706                                AccountModificationWindow(account) 
    17121707 
     1708        def on_merge_checkbutton_toggled(self, widget): 
     1709                gajim.config.set('mergeaccounts', widget.get_active()) 
     1710                gajim.interface.save_config() 
     1711                gajim.interface.roster.regroup = gajim.config.get('mergeaccounts') 
     1712                gajim.interface.roster.draw_roster() 
     1713 
    17131714class DataFormWindow: 
    17141715        def __init__(self, account, config): 
    17151716                self.account = account 
  • gtkgui.glade

     
    462462      </child> 
    463463 
    464464      <child> 
     465        <widget class="GtkCheckButton" id="merge_checkbutton"> 
     466          <property name="visible">True</property> 
     467          <property name="tooltip" translatable="yes">If you have 2 or more accounts and it is checked, Gajim will list all contacts as if you had one account</property> 
     468          <property name="can_focus">True</property> 
     469          <property name="label" translatable="yes">_Merge accounts</property> 
     470          <property name="use_underline">True</property> 
     471          <property name="relief">GTK_RELIEF_NORMAL</property> 
     472          <property name="focus_on_click">True</property> 
     473          <property name="active">False</property> 
     474          <property name="inconsistent">False</property> 
     475          <property name="draw_indicator">True</property> 
     476          <signal name="toggled" handler="on_merge_checkbutton_toggled" last_modification_time="Sun, 06 Mar 2005 15:07:26 GMT"/> 
     477        </widget> 
     478        <packing> 
     479          <property name="padding">0</property> 
     480          <property name="expand">False</property> 
     481          <property name="fill">False</property> 
     482        </packing> 
     483      </child> 
     484 
     485      <child> 
    465486        <widget class="GtkHButtonBox" id="hbuttonbox15"> 
    466487          <property name="visible">True</property> 
    467488          <property name="layout_style">GTK_BUTTONBOX_END</property> 
     
    33263347              </child> 
    33273348 
    33283349              <child> 
    3329                 <widget class="GtkCheckButton" id="merge_checkbutton"> 
    3330                   <property name="visible">True</property> 
    3331                   <property name="tooltip" translatable="yes">If you have 2 or more accounts and it is checked, Gajim will list all contacts as if you had one account</property> 
    3332                   <property name="can_focus">True</property> 
    3333                   <property name="label" translatable="yes">_Merge accounts</property> 
    3334                   <property name="use_underline">True</property> 
    3335                   <property name="relief">GTK_RELIEF_NORMAL</property> 
    3336                   <property name="focus_on_click">True</property> 
    3337                   <property name="active">False</property> 
    3338                   <property name="inconsistent">False</property> 
    3339                   <property name="draw_indicator">True</property> 
    3340                   <signal name="toggled" handler="on_merge_checkbutton_toggled" last_modification_time="Sun, 06 Mar 2005 15:07:26 GMT"/> 
    3341                 </widget> 
    3342                 <packing> 
    3343                   <property name="padding">0</property> 
    3344                   <property name="expand">False</property> 
    3345                   <property name="fill">False</property> 
    3346                 </packing> 
    3347               </child> 
    3348  
    3349               <child> 
    33503350                <widget class="GtkCheckButton" id="sort_by_show_checkbutton"> 
    33513351                  <property name="visible">True</property> 
    33523352                  <property name="can_focus">True</property>