From 9e8c2a2970ccd37a42886a5704d2da0af4fca9fe Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Wed, 30 Mar 2005 12:29:48 +0000 Subject: [PATCH] iconstyle --> iconset --- plugins/gtkgui/config.py | 14 +++++++------- plugins/gtkgui/gtkgui.glade | 6 +++--- plugins/gtkgui/gtkgui.py | 14 ++++++++------ plugins/gtkgui/roster_window.py | 17 ++++++++--------- 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/plugins/gtkgui/config.py b/plugins/gtkgui/config.py index 02964ff39..f1e18a868 100644 --- a/plugins/gtkgui/config.py +++ b/plugins/gtkgui/config.py @@ -71,11 +71,11 @@ class Preferences_window: self.plugin.roster.regroup = self.plugin.config['mergeaccounts'] self.plugin.roster.draw_roster() - def on_iconstyle_combobox_changed(self, widget): + def on_iconset_combobox_changed(self, widget): model = widget.get_model() active = widget.get_active() icon_string = model[active][0] - self.plugin.config['iconstyle'] = icon_string + self.plugin.config['iconset'] = icon_string self.plugin.roster.mkpixbufs() self.plugin.roster.draw_roster() @@ -702,7 +702,7 @@ class Preferences_window: self.plugin = plugin self.xml.get_widget('emoticons_image').set_from_file(\ 'plugins/gtkgui/pixmaps/smile.png') - self.iconstyle_combobox = self.xml.get_widget('iconstyle_combobox') + self.iconset_combobox = self.xml.get_widget('iconset_combobox') self.auto_pp_checkbutton = self.xml.get_widget('auto_pop_up_checkbutton') self.auto_pp_away_checkbutton = self.xml.get_widget \ ('auto_pop_up_away_checkbutton') @@ -730,10 +730,10 @@ class Preferences_window: st = self.plugin.config['mergeaccounts'] self.xml.get_widget('merge_checkbutton').set_active(st) - #iconStyle + #iconset list_style = os.listdir('plugins/gtkgui/icons/') model = gtk.ListStore(gobject.TYPE_STRING) - self.iconstyle_combobox.set_model(model) + self.iconset_combobox.set_model(model) l = [] for i in list_style: if i != 'CVS' and i[0] != '.': @@ -742,8 +742,8 @@ class Preferences_window: l.append(' ') for i in range(len(l)): model.append([l[i]]) - if self.plugin.config['iconstyle'] == l[i]: - self.iconstyle_combobox.set_active(i) + if self.plugin.config['iconset'] == l[i]: + self.iconset_combobox.set_active(i) #Color for account text colSt = self.plugin.config['accounttextcolor'] diff --git a/plugins/gtkgui/gtkgui.glade b/plugins/gtkgui/gtkgui.glade index 056a8230d..435727469 100644 --- a/plugins/gtkgui/gtkgui.glade +++ b/plugins/gtkgui/gtkgui.glade @@ -2991,7 +2991,7 @@ True - Icon _style: + _Status iconset: True False GTK_JUSTIFY_LEFT @@ -3014,12 +3014,12 @@ - + True False True - + 0 diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py index 5a0ea062b..0c7188aba 100644 --- a/plugins/gtkgui/gtkgui.py +++ b/plugins/gtkgui/gtkgui.py @@ -818,8 +818,10 @@ class plugin: 'msg4':'I\'m working.',\ 'msg5_name':'Nap',\ 'msg5':'I\'m taking a nap.',\ + 'msg6_name':'Offline',\ + 'msg6':'I\'m offline.',\ 'trayicon':1,\ - 'iconstyle':'sun',\ + 'iconset':'sun',\ 'inmsgcolor':'#ff0000',\ 'outmsgcolor': '#0000ff',\ 'statusmsgcolor':'#1eaa1e',\ @@ -881,11 +883,11 @@ class plugin: #2:autoaway and use sleeper #3:autoxa and use sleeper self.send('ASK_ROSTER', a, self.queueIN) - #in pygtk2.4 - iconstyle = self.config['iconstyle'] - if not iconstyle: - iconstyle = 'sun' - path = 'plugins/gtkgui/icons/' + iconstyle + '/' + #in pygtk2.4 FIXME: (nk) WHAT DO YOU MEAN? + iconset = self.config['iconset'] + if not iconset: + iconset = 'sun' + path = 'plugins/gtkgui/icons/' + iconset + '/' files = [path + 'online.gif', path + 'online.png', path + 'online.xpm'] pix = None for fname in files: diff --git a/plugins/gtkgui/roster_window.py b/plugins/gtkgui/roster_window.py index 86897280a..ca7db358d 100644 --- a/plugins/gtkgui/roster_window.py +++ b/plugins/gtkgui/roster_window.py @@ -1097,16 +1097,16 @@ class Roster_window: def mkpixbufs(self): """initialise pixbufs array""" - iconstyle = self.plugin.config['iconstyle'] - if not iconstyle: - iconstyle = 'sun' - self.path = 'plugins/gtkgui/icons/' + iconstyle + '/' + iconset = self.plugin.config['iconset'] + if not iconset: + iconset = 'sun' + self.path = 'plugins/gtkgui/icons/' + iconset + '/' self.pixbufs = {} for state in ('connecting', 'online', 'chat', 'away', 'xa', 'dnd', \ 'invisible', 'offline', 'error', 'requested', 'message', 'opened', \ 'closed', 'not in the roster'): # try to open a pixfile with the correct method - state_file = state.replace(" ", "_") + state_file = state.replace(' ', '_') files = [] files.append(self.path + state_file + '.gif') files.append(self.path + state_file + '.png') @@ -1115,10 +1115,9 @@ class Roster_window: image.show() self.pixbufs[state] = image for file in files: - if not os.path.exists(file): - continue - image.set_from_file(file) - break + if os.path.exists(file): + image.set_from_file(file) + break def sound_is_ok(self, sound): if not os.path.exists(sound):