typos and small fixes (mostly: edit groups dont send changes if nothing changed) allover
This commit is contained in:
parent
7f8e130d19
commit
f1fdb97fc4
111
src/config.py
111
src/config.py
|
@ -895,7 +895,7 @@ class Account_modification_window:
|
||||||
"""Class for account informations"""
|
"""Class for account informations"""
|
||||||
def on_account_modification_window_destroy(self, widget):
|
def on_account_modification_window_destroy(self, widget):
|
||||||
"""close window"""
|
"""close window"""
|
||||||
del self.plugin.windows['account_modification']
|
del self.plugin.windows[self.account]['account_modification']
|
||||||
|
|
||||||
def on_cancel_button_clicked(self, widget):
|
def on_cancel_button_clicked(self, widget):
|
||||||
self.window.destroy()
|
self.window.destroy()
|
||||||
|
@ -1340,7 +1340,7 @@ class Accounts_window:
|
||||||
|
|
||||||
def on_new_button_clicked(self, widget):
|
def on_new_button_clicked(self, widget):
|
||||||
"""When new button is clicked : open an account information window"""
|
"""When new button is clicked : open an account information window"""
|
||||||
if self.plugin.windows.has_key('account_modification_window'):
|
if self.plugin.windows.has_key('account_modification'):
|
||||||
self.plugin.windows['account_modification'].window.present()
|
self.plugin.windows['account_modification'].window.present()
|
||||||
else:
|
else:
|
||||||
self.plugin.windows['account_modification'] = \
|
self.plugin.windows['account_modification'] = \
|
||||||
|
@ -1374,7 +1374,7 @@ class Accounts_window:
|
||||||
sel = self.accounts_treeview.get_selection()
|
sel = self.accounts_treeview.get_selection()
|
||||||
(model, iter) = sel.get_selected()
|
(model, iter) = sel.get_selected()
|
||||||
account = model.get_value(iter, 0)
|
account = model.get_value(iter, 0)
|
||||||
if self.plugin.windows[account].has_key('account_modification_window'):
|
if self.plugin.windows[account].has_key('account_modification'):
|
||||||
self.plugin.windows[account]['account_modification'].window.present()
|
self.plugin.windows[account]['account_modification'].window.present()
|
||||||
else:
|
else:
|
||||||
self.plugin.windows[account]['account_modification'] = \
|
self.plugin.windows[account]['account_modification'] = \
|
||||||
|
@ -1628,15 +1628,65 @@ class Add_remove_emoticons_window:
|
||||||
|
|
||||||
class Service_discovery_window:
|
class Service_discovery_window:
|
||||||
"""Class for Service Discovery Window:
|
"""Class for Service Discovery Window:
|
||||||
to know the services on the selected server"""
|
to know the services on a server"""
|
||||||
def on_service_discovery_window_destroy(self, widget):
|
def on_service_discovery_window_destroy(self, widget):
|
||||||
"""close window"""
|
"""close window"""
|
||||||
del self.plugin.windows[self.account]['disco']
|
del self.plugin.windows[self.account]['disco']
|
||||||
|
|
||||||
def on_close_button_clicked(self, widget):
|
def on_close_button_clicked(self, widget):
|
||||||
"""When Close button is clicked"""
|
|
||||||
self.window.destroy()
|
self.window.destroy()
|
||||||
|
|
||||||
|
def __init__(self, plugin, account):
|
||||||
|
if gajim.connections[account].connected < 2:
|
||||||
|
dialog.Error_dialog(_('You must be connected to browse services'))
|
||||||
|
return
|
||||||
|
xml = gtk.glade.XML(GTKGUI_GLADE, 'service_discovery_window', APP)
|
||||||
|
self.window = xml.get_widget('service_discovery_window')
|
||||||
|
self.services_treeview = xml.get_widget('services_treeview')
|
||||||
|
self.join_button = xml.get_widget('join_button')
|
||||||
|
self.register_button = xml.get_widget('register_button')
|
||||||
|
self.address_comboboxentry = xml.get_widget('address_comboboxentry')
|
||||||
|
self.address_comboboxentry_entry = self.address_comboboxentry.child
|
||||||
|
self.address_comboboxentry_entry.set_activates_default(True)
|
||||||
|
self.plugin = plugin
|
||||||
|
self.account = account
|
||||||
|
self.agent_infos = {}
|
||||||
|
model = gtk.TreeStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
|
||||||
|
self.services_treeview.set_model(model)
|
||||||
|
#columns
|
||||||
|
renderer = gtk.CellRendererText()
|
||||||
|
renderer.set_data('column', 0)
|
||||||
|
self.services_treeview.insert_column_with_attributes(-1, 'Name', \
|
||||||
|
renderer, text=0)
|
||||||
|
renderer = gtk.CellRendererText()
|
||||||
|
renderer.set_data('column', 1)
|
||||||
|
self.services_treeview.insert_column_with_attributes(-1, 'Service', \
|
||||||
|
renderer, text=1)
|
||||||
|
|
||||||
|
self.address_comboboxentry = xml.get_widget('address_comboboxentry')
|
||||||
|
liststore = gtk.ListStore(str)
|
||||||
|
self.address_comboboxentry.set_model(liststore)
|
||||||
|
self.address_comboboxentry.set_text_column(0)
|
||||||
|
self.latest_addresses = gajim.config.get('latest_disco_addresses').split()
|
||||||
|
server_address = gajim.config.get_per('accounts', self.account, \
|
||||||
|
'hostname')
|
||||||
|
if server_address in self.latest_addresses:
|
||||||
|
self.latest_addresses.remove(server_address)
|
||||||
|
self.latest_addresses.insert(0, server_address)
|
||||||
|
if len(self.latest_addresses) > 10:
|
||||||
|
self.latest_addresses = self.latest_addresses[0:10]
|
||||||
|
for j in self.latest_addresses:
|
||||||
|
self.address_comboboxentry.append_text(j)
|
||||||
|
self.address_comboboxentry.child.set_text(server_address)
|
||||||
|
|
||||||
|
self.register_button = xml.get_widget('register_button')
|
||||||
|
self.register_button.set_sensitive(False)
|
||||||
|
self.join_button = xml.get_widget('join_button')
|
||||||
|
self.join_button.set_sensitive(False)
|
||||||
|
xml.signal_autoconnect(self)
|
||||||
|
self.browse(server_address)
|
||||||
|
self.window.show_all()
|
||||||
|
|
||||||
def browse(self, jid):
|
def browse(self, jid):
|
||||||
"""Send a request to the core to know the available services"""
|
"""Send a request to the core to know the available services"""
|
||||||
model = self.services_treeview.get_model()
|
model = self.services_treeview.get_model()
|
||||||
|
@ -1842,54 +1892,3 @@ class Service_discovery_window:
|
||||||
self.services_treeview.get_model().clear()
|
self.services_treeview.get_model().clear()
|
||||||
self.browse(server_address)
|
self.browse(server_address)
|
||||||
self.plugin.save_config()
|
self.plugin.save_config()
|
||||||
|
|
||||||
def __init__(self, plugin, account):
|
|
||||||
if gajim.connections[account].connected < 2:
|
|
||||||
dialog.Error_dialog(_('You must be connected to browse services'))
|
|
||||||
return
|
|
||||||
xml = gtk.glade.XML(GTKGUI_GLADE, 'service_discovery_window', APP)
|
|
||||||
self.window = xml.get_widget('service_discovery_window')
|
|
||||||
self.services_treeview = xml.get_widget('services_treeview')
|
|
||||||
self.join_button = xml.get_widget('join_button')
|
|
||||||
self.register_button = xml.get_widget('register_button')
|
|
||||||
self.address_comboboxentry = xml.get_widget('address_comboboxentry')
|
|
||||||
self.address_comboboxentry_entry = self.address_comboboxentry.child
|
|
||||||
self.address_comboboxentry_entry.set_activates_default(True)
|
|
||||||
self.plugin = plugin
|
|
||||||
self.account = account
|
|
||||||
self.agent_infos = {}
|
|
||||||
model = gtk.TreeStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
|
|
||||||
self.services_treeview.set_model(model)
|
|
||||||
#columns
|
|
||||||
renderer = gtk.CellRendererText()
|
|
||||||
renderer.set_data('column', 0)
|
|
||||||
self.services_treeview.insert_column_with_attributes(-1, 'Name', \
|
|
||||||
renderer, text=0)
|
|
||||||
renderer = gtk.CellRendererText()
|
|
||||||
renderer.set_data('column', 1)
|
|
||||||
self.services_treeview.insert_column_with_attributes(-1, 'Service', \
|
|
||||||
renderer, text=1)
|
|
||||||
|
|
||||||
self.address_comboboxentry = xml.get_widget('address_comboboxentry')
|
|
||||||
liststore = gtk.ListStore(str)
|
|
||||||
self.address_comboboxentry.set_model(liststore)
|
|
||||||
self.address_comboboxentry.set_text_column(0)
|
|
||||||
self.latest_addresses = gajim.config.get('latest_disco_addresses').split()
|
|
||||||
server_address = gajim.config.get_per('accounts', self.account, \
|
|
||||||
'hostname')
|
|
||||||
if server_address in self.latest_addresses:
|
|
||||||
self.latest_addresses.remove(server_address)
|
|
||||||
self.latest_addresses.insert(0, server_address)
|
|
||||||
if len(self.latest_addresses) > 10:
|
|
||||||
self.latest_addresses = self.latest_addresses[0:10]
|
|
||||||
for j in self.latest_addresses:
|
|
||||||
self.address_comboboxentry.append_text(j)
|
|
||||||
self.address_comboboxentry.child.set_text(server_address)
|
|
||||||
|
|
||||||
self.register_button = xml.get_widget('register_button')
|
|
||||||
self.register_button.set_sensitive(False)
|
|
||||||
self.join_button = xml.get_widget('join_button')
|
|
||||||
self.join_button.set_sensitive(False)
|
|
||||||
xml.signal_autoconnect(self)
|
|
||||||
self.browse(server_address)
|
|
||||||
self.window.show_all()
|
|
||||||
|
|
|
@ -239,6 +239,7 @@ class Edit_groups_dialog:
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.account = account
|
self.account = account
|
||||||
self.user = user
|
self.user = user
|
||||||
|
self.changes_made = False
|
||||||
self.list = self.xml.get_widget('groups_treeview')
|
self.list = self.xml.get_widget('groups_treeview')
|
||||||
self.xml.get_widget('nickname_label').set_markup(\
|
self.xml.get_widget('nickname_label').set_markup(\
|
||||||
_('Contact\'s name: <i>%s</i>') % user.name)
|
_('Contact\'s name: <i>%s</i>') % user.name)
|
||||||
|
@ -251,7 +252,7 @@ class Edit_groups_dialog:
|
||||||
def run(self):
|
def run(self):
|
||||||
self.dialog.run()
|
self.dialog.run()
|
||||||
self.dialog.destroy()
|
self.dialog.destroy()
|
||||||
#TODO: do not send if unnecesary
|
if self.changes_made:
|
||||||
gajim.connections[self.account].update_user(self.user.jid, \
|
gajim.connections[self.account].update_user(self.user.jid, \
|
||||||
self.user.name, self.user.groups)
|
self.user.name, self.user.groups)
|
||||||
|
|
||||||
|
@ -275,6 +276,7 @@ class Edit_groups_dialog:
|
||||||
self.update_user()
|
self.update_user()
|
||||||
|
|
||||||
def group_toggled_cb(self, cell, path):
|
def group_toggled_cb(self, cell, path):
|
||||||
|
self.changes_made = True
|
||||||
model = self.list.get_model()
|
model = self.list.get_model()
|
||||||
if model[path][1] and len(self.user.groups) == 1: # we try to remove
|
if model[path][1] and len(self.user.groups) == 1: # we try to remove
|
||||||
# the latest group
|
# the latest group
|
||||||
|
|
|
@ -9204,7 +9204,7 @@ Custom</property>
|
||||||
<property name="height_request">0</property>
|
<property name="height_request">0</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="tooltip" translatable="yes">Click for contact's extented information</property>
|
<property name="tooltip" translatable="yes">Click for contact's extented information</property>
|
||||||
<property name="label" translatable="yes">Anonymous <id@server/res></property>
|
<property name="label" translatable="yes">Anonymous <nick@server/res></property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="relief">GTK_RELIEF_NONE</property>
|
<property name="relief">GTK_RELIEF_NONE</property>
|
||||||
<property name="focus_on_click">True</property>
|
<property name="focus_on_click">True</property>
|
||||||
|
|
|
@ -313,24 +313,28 @@ class interface:
|
||||||
elif self.roster.contacts[account].has_key(ji):
|
elif self.roster.contacts[account].has_key(ji):
|
||||||
#It isn't an agent
|
#It isn't an agent
|
||||||
self.roster.chg_user_status(user1, array[1], array[2], account)
|
self.roster.chg_user_status(user1, array[1], array[2], account)
|
||||||
#play sound
|
#inform the user about new contact online
|
||||||
if old_show < 2 and new_show > 1 and gajim.config.get_per( \
|
if old_show < 2 and new_show > 1:
|
||||||
'soundevents', 'contact_connected', 'enabled'):
|
if gajim.config.get_per('soundevents', 'contact_connected', \
|
||||||
|
'enabled'):
|
||||||
self.play_sound('contact_connected')
|
self.play_sound('contact_connected')
|
||||||
if not self.windows[account]['chats'].has_key(jid) and \
|
if not self.windows[account]['chats'].has_key(jid) and \
|
||||||
not self.queues[account].has_key(jid) and \
|
not self.queues[account].has_key(jid) and \
|
||||||
gajim.config.get('notify_on_online') and \
|
gajim.config.get('notify_on_online'):
|
||||||
gajim.config.get('autopopupaway'):
|
#FIXME: check what is OUR STATUS and do the rest
|
||||||
|
if gajim.config.get('autopopupaway'):
|
||||||
instance = dialogs.Popup_window(self, 'Contact Online', jid, \
|
instance = dialogs.Popup_window(self, 'Contact Online', jid, \
|
||||||
account)
|
account)
|
||||||
self.roster.popup_windows.append(instance)
|
self.roster.popup_windows.append(instance)
|
||||||
elif old_show > 1 and new_show < 2 and gajim.config.get_per( \
|
elif old_show > 1 and new_show < 2:
|
||||||
'soundevents', 'contact_disconnected', 'enabled'):
|
if gajim.config.get_per('soundevents', 'contact_disconnected', \
|
||||||
|
'enabled'):
|
||||||
self.play_sound('contact_disconnected')
|
self.play_sound('contact_disconnected')
|
||||||
if not self.windows[account]['chats'].has_key(jid) and \
|
if not self.windows[account]['chats'].has_key(jid) and \
|
||||||
not self.queues[account].has_key(jid) and \
|
not self.queues[account].has_key(jid) and \
|
||||||
gajim.config.get('notify_on_offline') and \
|
gajim.config.get('notify_on_offline'):
|
||||||
gajim.config.get('autopopupaway'):
|
#FIXME: check what is OUR STATUS and do the rest
|
||||||
|
if gajim.config.get('autopopupaway'):
|
||||||
instance = dialogs.Popup_window(self, 'Contact Offline', jid, \
|
instance = dialogs.Popup_window(self, 'Contact Offline', jid, \
|
||||||
account)
|
account)
|
||||||
self.roster.popup_windows.append(instance)
|
self.roster.popup_windows.append(instance)
|
||||||
|
@ -354,8 +358,9 @@ class interface:
|
||||||
if not self.windows[account]['chats'].has_key(jid) and \
|
if not self.windows[account]['chats'].has_key(jid) and \
|
||||||
not self.queues[account].has_key(jid):
|
not self.queues[account].has_key(jid):
|
||||||
first = True
|
first = True
|
||||||
if gajim.config.get('notify_on_new_message') and \
|
if gajim.config.get('notify_on_new_message'):
|
||||||
gajim.config.get('autopopupaway'):
|
#FIXME: check what is OUR STATUS (if we're online) and do the rest
|
||||||
|
if gajim.config.get('autopopupaway'):
|
||||||
instance = dialogs.Popup_window(self, 'New Message', jid, account)
|
instance = dialogs.Popup_window(self, 'New Message', jid, account)
|
||||||
self.roster.popup_windows.append(instance)
|
self.roster.popup_windows.append(instance)
|
||||||
self.roster.on_message(jid, array[1], array[2], account)
|
self.roster.on_message(jid, array[1], array[2], account)
|
||||||
|
@ -743,7 +748,7 @@ class interface:
|
||||||
|
|
||||||
# get instances for windows/dialogs that will show_all()/hide()
|
# get instances for windows/dialogs that will show_all()/hide()
|
||||||
self.windows['preferences'] = config.Preferences_window(self)
|
self.windows['preferences'] = config.Preferences_window(self)
|
||||||
self.windows['add_remove_emoticons_window'] = \
|
self.windows['add_remove_emoticons'] = \
|
||||||
config.Add_remove_emoticons_window(self)
|
config.Add_remove_emoticons_window(self)
|
||||||
self.windows['roster'] = self.roster
|
self.windows['roster'] = self.roster
|
||||||
|
|
||||||
|
|
|
@ -530,7 +530,7 @@ class Roster_window:
|
||||||
menu.reposition()
|
menu.reposition()
|
||||||
|
|
||||||
def on_edit_account(self, widget, account):
|
def on_edit_account(self, widget, account):
|
||||||
if self.plugin.windows.has_key('account_modification_window'):
|
if self.plugin.windows.has_key('account_modification'):
|
||||||
self.plugin.windows['account_modification'].window.present()
|
self.plugin.windows['account_modification'].window.present()
|
||||||
else:
|
else:
|
||||||
self.plugin.windows['account_modification'] = \
|
self.plugin.windows['account_modification'] = \
|
||||||
|
@ -879,7 +879,7 @@ class Roster_window:
|
||||||
path = None
|
path = None
|
||||||
autopopup = gajim.config.get('autopopup')
|
autopopup = gajim.config.get('autopopup')
|
||||||
autopopupaway = gajim.config.get('autopopupaway')
|
autopopupaway = gajim.config.get('autopopupaway')
|
||||||
if (autopopup == 0 or ( not autopopupaway and \
|
if (not autopopup or ( not autopopupaway and \
|
||||||
gajim.connections[account].connected > 2)) and not \
|
gajim.connections[account].connected > 2)) and not \
|
||||||
self.plugin.windows[account]['chats'].has_key(jid):
|
self.plugin.windows[account]['chats'].has_key(jid):
|
||||||
#We save it in a queue
|
#We save it in a queue
|
||||||
|
|
Loading…
Reference in New Issue