| | 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() |
| | 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') |