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.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']

View File

@ -2991,7 +2991,7 @@
<child>
<widget class="GtkLabel" id="label174">
<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_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@ -3014,12 +3014,12 @@
</child>
<child>
<widget class="GtkComboBox" id="iconstyle_combobox">
<widget class="GtkComboBox" id="iconset_combobox">
<property name="visible">True</property>
<property name="items" translatable="yes"></property>
<property name="add_tearoffs">False</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>
<packing>
<property name="padding">0</property>

View File

@ -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:

View File

@ -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):