iconstyle --> iconset

This commit is contained in:
Nikos Kouremenos 2005-03-30 12:29:48 +00:00
parent 45a63ab694
commit 9e8c2a2970
4 changed files with 26 additions and 25 deletions

View file

@ -71,11 +71,11 @@ class Preferences_window:
self.plugin.roster.regroup = self.plugin.config['mergeaccounts'] self.plugin.roster.regroup = self.plugin.config['mergeaccounts']
self.plugin.roster.draw_roster() self.plugin.roster.draw_roster()
def on_iconstyle_combobox_changed(self, widget): def on_iconset_combobox_changed(self, widget):
model = widget.get_model() model = widget.get_model()
active = widget.get_active() active = widget.get_active()
icon_string = model[active][0] icon_string = model[active][0]
self.plugin.config['iconstyle'] = icon_string self.plugin.config['iconset'] = icon_string
self.plugin.roster.mkpixbufs() self.plugin.roster.mkpixbufs()
self.plugin.roster.draw_roster() self.plugin.roster.draw_roster()
@ -702,7 +702,7 @@ class Preferences_window:
self.plugin = plugin self.plugin = plugin
self.xml.get_widget('emoticons_image').set_from_file(\ self.xml.get_widget('emoticons_image').set_from_file(\
'plugins/gtkgui/pixmaps/smile.png') '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_checkbutton = self.xml.get_widget('auto_pop_up_checkbutton')
self.auto_pp_away_checkbutton = self.xml.get_widget \ self.auto_pp_away_checkbutton = self.xml.get_widget \
('auto_pop_up_away_checkbutton') ('auto_pop_up_away_checkbutton')
@ -730,10 +730,10 @@ class Preferences_window:
st = self.plugin.config['mergeaccounts'] st = self.plugin.config['mergeaccounts']
self.xml.get_widget('merge_checkbutton').set_active(st) self.xml.get_widget('merge_checkbutton').set_active(st)
#iconStyle #iconset
list_style = os.listdir('plugins/gtkgui/icons/') list_style = os.listdir('plugins/gtkgui/icons/')
model = gtk.ListStore(gobject.TYPE_STRING) model = gtk.ListStore(gobject.TYPE_STRING)
self.iconstyle_combobox.set_model(model) self.iconset_combobox.set_model(model)
l = [] l = []
for i in list_style: for i in list_style:
if i != 'CVS' and i[0] != '.': if i != 'CVS' and i[0] != '.':
@ -742,8 +742,8 @@ class Preferences_window:
l.append(' ') l.append(' ')
for i in range(len(l)): for i in range(len(l)):
model.append([l[i]]) model.append([l[i]])
if self.plugin.config['iconstyle'] == l[i]: if self.plugin.config['iconset'] == l[i]:
self.iconstyle_combobox.set_active(i) self.iconset_combobox.set_active(i)
#Color for account text #Color for account text
colSt = self.plugin.config['accounttextcolor'] colSt = self.plugin.config['accounttextcolor']

View file

@ -2991,7 +2991,7 @@
<child> <child>
<widget class="GtkLabel" id="label174"> <widget class="GtkLabel" id="label174">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Icon _style:</property> <property name="label" translatable="yes">_Status iconset:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property> <property name="justify">GTK_JUSTIFY_LEFT</property>
@ -3014,12 +3014,12 @@
</child> </child>
<child> <child>
<widget class="GtkComboBox" id="iconstyle_combobox"> <widget class="GtkComboBox" id="iconset_combobox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="items" translatable="yes"></property> <property name="items" translatable="yes"></property>
<property name="add_tearoffs">False</property> <property name="add_tearoffs">False</property>
<property name="focus_on_click">True</property> <property name="focus_on_click">True</property>
<signal name="changed" handler="on_iconstyle_combobox_changed" last_modification_time="Sun, 06 Mar 2005 16:01:18 GMT"/> <signal name="changed" handler="on_iconset_combobox_changed" last_modification_time="Wed, 30 Mar 2005 12:19:34 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>

View file

@ -818,8 +818,10 @@ class plugin:
'msg4':'I\'m working.',\ 'msg4':'I\'m working.',\
'msg5_name':'Nap',\ 'msg5_name':'Nap',\
'msg5':'I\'m taking a nap.',\ 'msg5':'I\'m taking a nap.',\
'msg6_name':'Offline',\
'msg6':'I\'m offline.',\
'trayicon':1,\ 'trayicon':1,\
'iconstyle':'sun',\ 'iconset':'sun',\
'inmsgcolor':'#ff0000',\ 'inmsgcolor':'#ff0000',\
'outmsgcolor': '#0000ff',\ 'outmsgcolor': '#0000ff',\
'statusmsgcolor':'#1eaa1e',\ 'statusmsgcolor':'#1eaa1e',\
@ -881,11 +883,11 @@ class plugin:
#2:autoaway and use sleeper #2:autoaway and use sleeper
#3:autoxa and use sleeper #3:autoxa and use sleeper
self.send('ASK_ROSTER', a, self.queueIN) self.send('ASK_ROSTER', a, self.queueIN)
#in pygtk2.4 #in pygtk2.4 FIXME: (nk) WHAT DO YOU MEAN?
iconstyle = self.config['iconstyle'] iconset = self.config['iconset']
if not iconstyle: if not iconset:
iconstyle = 'sun' iconset = 'sun'
path = 'plugins/gtkgui/icons/' + iconstyle + '/' path = 'plugins/gtkgui/icons/' + iconset + '/'
files = [path + 'online.gif', path + 'online.png', path + 'online.xpm'] files = [path + 'online.gif', path + 'online.png', path + 'online.xpm']
pix = None pix = None
for fname in files: for fname in files:

View file

@ -1097,16 +1097,16 @@ class Roster_window:
def mkpixbufs(self): def mkpixbufs(self):
"""initialise pixbufs array""" """initialise pixbufs array"""
iconstyle = self.plugin.config['iconstyle'] iconset = self.plugin.config['iconset']
if not iconstyle: if not iconset:
iconstyle = 'sun' iconset = 'sun'
self.path = 'plugins/gtkgui/icons/' + iconstyle + '/' self.path = 'plugins/gtkgui/icons/' + iconset + '/'
self.pixbufs = {} self.pixbufs = {}
for state in ('connecting', 'online', 'chat', 'away', 'xa', 'dnd', \ for state in ('connecting', 'online', 'chat', 'away', 'xa', 'dnd', \
'invisible', 'offline', 'error', 'requested', 'message', 'opened', \ 'invisible', 'offline', 'error', 'requested', 'message', 'opened', \
'closed', 'not in the roster'): 'closed', 'not in the roster'):
# try to open a pixfile with the correct method # try to open a pixfile with the correct method
state_file = state.replace(" ", "_") state_file = state.replace(' ', '_')
files = [] files = []
files.append(self.path + state_file + '.gif') files.append(self.path + state_file + '.gif')
files.append(self.path + state_file + '.png') files.append(self.path + state_file + '.png')
@ -1115,8 +1115,7 @@ class Roster_window:
image.show() image.show()
self.pixbufs[state] = image self.pixbufs[state] = image
for file in files: for file in files:
if not os.path.exists(file): if os.path.exists(file):
continue
image.set_from_file(file) image.set_from_file(file)
break break