Show
Ignore:
Timestamp:
09/03/07 11:20:04 (15 months ago)
Author:
asterix
Message:

rename gtk+ theme to default theme fixes #2794

Location:
branches/gajim_0.11.1/src/common
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11.1/src/common/config.py

    r7845 r8700  
    8282                'urlmsgcolor': [ opt_color, '#0000ff', '', True ], 
    8383                'collapsed_rows': [ opt_str, '', _('List (space separated) of rows (accounts and groups) that are collapsed.'), True ], 
    84                 'roster_theme': [ opt_str, 'gtk+', '', True ], 
     84                'roster_theme': [ opt_str, _('default'), '', True ], 
    8585                'saveposition': [ opt_bool, True ], 
    8686                'mergeaccounts': [ opt_bool, False, '', True ], 
     
    384384        themes_default = { 
    385385                # sorted alphanum 
    386                 'gtk+': [ '', '', '', 'B', '', '','', 'I', '', '', '', '', '','', '', 
    387                         'B' ], 
     386                _('default'): [ '', '', '', 'B', '', '','', 'I', '', '', '', '', '','', 
     387                        '', 'B' ], 
    388388 
    389389                _('green'): [ '', '#94aa8c', '', 'B', '#0000ff', '#eff3e7', 
  • branches/gajim_0.11.1/src/common/defs.py

    r7990 r8700  
    33datadir = '../' 
    44 
    5 version = '0.11.1' 
     5version = '0.11.1.4' 
    66 
    77import sys, os.path 
  • branches/gajim_0.11.1/src/common/optparser.py

    r7940 r8700  
    152152                if old < [0, 11, 0, 1] and new >= [0, 11, 0, 1]: 
    153153                        self.update_config_to_01101() 
     154                if old < [0, 11, 0, 2] and new >= [0, 11, 0, 2]: 
     155                        self.update_config_to_01102() 
     156                if old < [0, 11, 1, 1] and new >= [0, 11, 1, 1]: 
     157                        self.update_config_to_01111() 
     158                if old < [0, 11, 1, 2] and new >= [0, 11, 1, 2]: 
     159                        self.update_config_to_01112() 
     160                if old < [0, 11, 1, 3] and new >= [0, 11, 1, 3]: 
     161                        self.update_config_to_01113() 
     162                if old < [0, 11, 1, 4] and new >= [0, 11, 1, 4]: 
     163                        self.update_config_to_01114() 
    154164 
    155165                gajim.logger.init_vars() 
     
    177187                        'contactfontattrs', 'bannertextcolor', 'bannerbgcolor', 'bannerfont',  
    178188                        'bannerfontattrs'] 
    179                 for theme_name in (_('grocery'), _('gtk+')): 
     189                for theme_name in (_('grocery'), _('default')): 
    180190                        if theme_name not in gajim.config.get_per('themes'): 
    181191                                gajim.config.add_per('themes', theme_name) 
     
    208218        def assert_unread_msgs_table_exists(self): 
    209219                '''create table unread_messages if there is no such table''' 
    210                 #FIXME see #2812 
    211220                back = os.getcwd() 
    212221                os.chdir(logger.LOG_DB_FOLDER) 
     
    376385                                self.old_values['before_time'], self.old_values['after_time'])) 
    377386                gajim.config.set('version', '0.11.0.1') 
     387 
     388        def update_config_to_01102(self): 
     389                '''fill time_stamp from before_time and after_time''' 
     390                if self.old_values.has_key('ft_override_host_to_send'): 
     391                        gajim.config.set('ft_add_hosts_to_send', 
     392                                self.old_values['ft_override_host_to_send']) 
     393                gajim.config.set('version', '0.11.0.2') 
     394         
     395        def update_config_to_01111(self): 
     396                '''always_hide_chatbuttons -> compact_view''' 
     397                if self.old_values.has_key('always_hide_groupchat_buttons') and \ 
     398                self.old_values.has_key('always_hide_chat_buttons'): 
     399                        gajim.config.set('compact_view', self.old_values['always_hide_groupchat_buttons'] and \ 
     400                        self.old_values['always_hide_chat_buttons']) 
     401                gajim.config.set('version', '0.11.1.1') 
     402 
     403        def update_config_to_01112(self): 
     404                '''gtk+ theme is renamed to default''' 
     405                if self.old_values.has_key('roster_theme') and \ 
     406                self.old_values['roster_theme'] == 'gtk+': 
     407                        gajim.config.set('roster_theme', _('default')) 
     408                gajim.config.set('version', '0.11.1.2') 
     409 
     410        def update_config_to_01113(self): 
     411                # copy&pasted from update_config_to_01013 
     412                back = os.getcwd() 
     413                os.chdir(logger.LOG_DB_FOLDER) 
     414                con = sqlite.connect(logger.LOG_DB_FILE) 
     415                os.chdir(back) 
     416                cur = con.cursor() 
     417                try: 
     418                        cur.executescript( 
     419                                ''' 
     420                                CREATE TABLE caps_cache ( 
     421                                        node TEXT, 
     422                                        ver TEXT, 
     423                                        ext TEXT, 
     424                                        data BLOB 
     425                                ); 
     426                                ''' 
     427                        ) 
     428                        con.commit() 
     429                except sqlite.OperationalError, e: 
     430                        pass 
     431                con.close() 
     432                gajim.config.set('version', '0.11.1.3') 
     433 
     434        def update_config_to_01114(self): 
     435                # add default theme if it doesn't exist 
     436                d = ['accounttextcolor', 'accountbgcolor', 'accountfont', 
     437                        'accountfontattrs', 'grouptextcolor', 'groupbgcolor', 'groupfont', 
     438                        'groupfontattrs', 'contacttextcolor', 'contactbgcolor', 'contactfont', 
     439                        'contactfontattrs', 'bannertextcolor', 'bannerbgcolor', 'bannerfont',  
     440                        'bannerfontattrs'] 
     441                theme_name = _('default') 
     442                if theme_name not in gajim.config.get_per('themes'): 
     443                        gajim.config.add_per('themes', theme_name) 
     444                        if gajim.config.get_per('themes', 'gtk+'): 
     445                                # copy from old gtk+ theme 
     446                                for o in d: 
     447                                        val = gajim.config.get_per('themes', 'gtk+', o) 
     448                                        gajim.config.set_per('themes', theme_name, o, val) 
     449                                gajim.config.del_per('themes', 'gtk+') 
     450                        else: 
     451                                # copy from default theme 
     452                                theme = gajim.config.themes_default[theme_name] 
     453                                for o in d: 
     454                                        gajim.config.set_per('themes', theme_name, o, theme[d.index(o)]) 
     455                gajim.config.set('version', '0.11.1.4')