From 53d68c9c7fb2a0b45e1d4be61353747f6fae836a Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 11 Jul 2007 10:09:31 +0000 Subject: [PATCH] copy old gtk+ theme to new default one --- configure.ac | 2 +- src/common/defs.py | 2 +- src/common/optparser.py | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 8df07adb7..aa4674623 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([Gajim - A Jabber Instant Messager], - [0.11.1.3],[http://trac.gajim.org/],[gajim]) + [0.11.1.4],[http://trac.gajim.org/],[gajim]) AC_PREREQ([2.59]) AM_INIT_AUTOMAKE([1.8]) AC_CONFIG_HEADER(config.h) diff --git a/src/common/defs.py b/src/common/defs.py index d3f9497d3..35bf91f8a 100644 --- a/src/common/defs.py +++ b/src/common/defs.py @@ -2,7 +2,7 @@ docdir = '../' datadir = '../' -version = '0.11.1.3' +version = '0.11.1.4' import sys, os.path for base in ('.', 'common'): diff --git a/src/common/optparser.py b/src/common/optparser.py index 73a74a5ea..807c69740 100644 --- a/src/common/optparser.py +++ b/src/common/optparser.py @@ -159,6 +159,8 @@ class OptionsParser: self.update_config_to_01112() if old < [0, 11, 1, 3] and new >= [0, 11, 1, 3]: self.update_config_to_01113() + if old < [0, 11, 1, 4] and new >= [0, 11, 1, 4]: + self.update_config_to_01114() gajim.logger.init_vars() gajim.config.set('version', new_version) @@ -431,3 +433,25 @@ class OptionsParser: con.close() gajim.config.set('version', '0.11.1.3') + def update_config_to_01114(self): + # add default theme if it doesn't exist + d = ['accounttextcolor', 'accountbgcolor', 'accountfont', + 'accountfontattrs', 'grouptextcolor', 'groupbgcolor', 'groupfont', + 'groupfontattrs', 'contacttextcolor', 'contactbgcolor', 'contactfont', + 'contactfontattrs', 'bannertextcolor', 'bannerbgcolor', 'bannerfont', + 'bannerfontattrs'] + theme_name = _('default') + if theme_name not in gajim.config.get_per('themes'): + gajim.config.add_per('themes', theme_name) + if gajim.config.get_per('themes', 'gtk+'): + # copy from old gtk+ theme + for o in d: + val = gajim.config.get_per('themes', 'gtk+', o) + gajim.config.set_per('themes', theme_name, o, val) + gajim.config.del_per('themes', 'gtk+') + else: + # copy from default theme + theme = gajim.config.themes_default[theme_name] + for o in d: + gajim.config.set_per('themes', theme_name, o, theme[d.index(o)]) + gajim.config.set('version', '0.11.1.4')