we now add default emoticons / status messages only if there is no in the config file

This commit is contained in:
Yann Leboulanger 2005-06-01 20:03:37 +00:00
parent b49addcafe
commit 74fd69cb0c
2 changed files with 10 additions and 6 deletions

View File

@ -342,10 +342,4 @@ class Config:
self.add_per('soundevents', event) self.add_per('soundevents', event)
self.set_per('soundevents', event, 'enable', default[0]) self.set_per('soundevents', event, 'enable', default[0])
self.set_per('soundevents', event, 'path', default[1]) self.set_per('soundevents', event, 'path', default[1])
for emot in self.emoticons_default:
self.add_per('emoticons', emot)
self.set_per('emoticons', emot, 'path', self.emoticons_default[emot])
for msg in self.statusmsg_default:
self.add_per('statusmsg', msg)
self.set_per('statusmsg', msg, 'message', self.statusmsg_default[msg])
return return

View File

@ -723,6 +723,16 @@ class Interface:
} }
parser.read() parser.read()
gajim.verbose = gajim.config.get('verbose') gajim.verbose = gajim.config.get('verbose')
#add default emoticons is there is not in the config file
if len(gajim.config.get_per('emoticons')) == 0:
for emot in gajim.config.emoticons_default:
gajim.config.add_per('emoticons', emot)
gajim.config.set_per('emoticons', emot, 'path', gajim.config.emoticons_default[emot])
#add default status messages is there is not in the config file
if len(gajim.config.get_per('statusmsg')) == 0:
for msg in gajim.config.statusmsg_default:
gajim.config.add_per('statusmsg', msg)
gajim.config.set_per('statusmsg', msg, 'message', gajim.config.statusmsg_default[msg])
if gajim.verbose: if gajim.verbose:
gajim.log.setLevel(gajim.logging.DEBUG) gajim.log.setLevel(gajim.logging.DEBUG)