make get_ui_status func which converts dnd xa to human understandble strings and use that func in Status change dialog
This commit is contained in:
parent
d4d667690e
commit
052cd2740b
2 changed files with 18 additions and 12 deletions
|
@ -180,8 +180,9 @@ class Change_status_message_dialog:
|
||||||
def __init__(self, plugin, status, autoconnect = 0):
|
def __init__(self, plugin, status, autoconnect = 0):
|
||||||
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'change_status_message_dialog', APP)
|
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'change_status_message_dialog', APP)
|
||||||
self.window = self.xml.get_widget('change_status_message_dialog')
|
self.window = self.xml.get_widget('change_status_message_dialog')
|
||||||
self.window.set_title(status.capitalize() + ' Status Message')
|
ui_status = plugin.roster.get_ui_status(status)
|
||||||
self.plugin = plugin
|
self.window.set_title(ui_status + ' Status Message')
|
||||||
|
|
||||||
message_textview = self.xml.get_widget('message_textview')
|
message_textview = self.xml.get_widget('message_textview')
|
||||||
self.message_buffer = message_textview.get_buffer()
|
self.message_buffer = message_textview.get_buffer()
|
||||||
self.message_buffer.set_text(gajim.config.get('last_msg'))
|
self.message_buffer.set_text(gajim.config.get('last_msg'))
|
||||||
|
|
|
@ -1396,6 +1396,17 @@ class Roster_window:
|
||||||
start = '* '
|
start = '* '
|
||||||
self.window.set_title(start + 'Gajim')
|
self.window.set_title(start + 'Gajim')
|
||||||
|
|
||||||
|
def get_ui_status(self, status):
|
||||||
|
if status == 'dnd':
|
||||||
|
ui_status = 'Busy'
|
||||||
|
elif status == 'xa':
|
||||||
|
ui_status = 'Extended Away'
|
||||||
|
elif status == 'chat':
|
||||||
|
ui_status = 'Free for chat'
|
||||||
|
else:
|
||||||
|
ui_status = status.capitalize()
|
||||||
|
return ui_status
|
||||||
|
|
||||||
def __init__(self, plugin):
|
def __init__(self, plugin):
|
||||||
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'roster_window', APP)
|
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'roster_window', APP)
|
||||||
self.window = self.xml.get_widget('roster_window')
|
self.window = self.xml.get_widget('roster_window')
|
||||||
|
@ -1454,16 +1465,10 @@ class Roster_window:
|
||||||
self.status_combobox.pack_start(cell, True)
|
self.status_combobox.pack_start(cell, True)
|
||||||
self.status_combobox.add_attribute(cell, 'text', 0)
|
self.status_combobox.add_attribute(cell, 'text', 0)
|
||||||
|
|
||||||
for status in ['online', 'chat', 'away', 'xa', 'dnd', 'invisible', 'offline']:
|
for status in ['online', 'chat', 'away', 'xa', 'dnd', 'invisible',
|
||||||
if status == 'dnd':
|
'offline']:
|
||||||
status_better = 'Busy'
|
ui_status = self.get_ui_status(status)
|
||||||
elif status == 'xa':
|
iter = liststore.append([ui_status, self.jabber_state_images[status], status])
|
||||||
status_better = 'Extended Away'
|
|
||||||
elif status == 'chat':
|
|
||||||
status_better = 'Free for chat'
|
|
||||||
else:
|
|
||||||
status_better = status.capitalize()
|
|
||||||
iter = liststore.append([status_better, self.jabber_state_images[status], status])
|
|
||||||
self.status_combobox.show_all()
|
self.status_combobox.show_all()
|
||||||
self.status_combobox.set_model(liststore)
|
self.status_combobox.set_model(liststore)
|
||||||
self.status_combobox.set_active(6) # default to offline
|
self.status_combobox.set_active(6) # default to offline
|
||||||
|
|
Loading…
Add table
Reference in a new issue