asking the user about removing an account that he's connected

This commit is contained in:
Nikos Kouremenos 2005-05-20 15:05:22 +00:00
parent 0e7e396289
commit 4b6e527fdf
1 changed files with 20 additions and 20 deletions

View File

@ -245,7 +245,7 @@ class Preferences_window:
self.xml.get_widget('browse_sounds_hbox').set_sensitive(False) self.xml.get_widget('browse_sounds_hbox').set_sensitive(False)
#sound player #sound player
self.xml.get_widget('soundplayer_entry').set_text(\ self.xml.get_widget('soundplayer_entry').set_text(
gajim.config.get('soundplayer')) gajim.config.get('soundplayer'))
#sounds treeview #sounds treeview
@ -331,9 +331,9 @@ class Preferences_window:
elif gajim.config.get('openwith') == 'custom': elif gajim.config.get('openwith') == 'custom':
self.links_open_with_combobox.set_active(2) self.links_open_with_combobox.set_active(2)
self.xml.get_widget('custom_apps_frame').set_sensitive(True) self.xml.get_widget('custom_apps_frame').set_sensitive(True)
self.xml.get_widget('custom_browser_entry').set_text(\ self.xml.get_widget('custom_browser_entry').set_text(
gajim.config.get('custombrowser')) gajim.config.get('custombrowser'))
self.xml.get_widget('custom_mail_client_entry').set_text(\ self.xml.get_widget('custom_mail_client_entry').set_text(
gajim.config.get('custommailapp')) gajim.config.get('custommailapp'))
#log presences in user file #log presences in user file
@ -407,7 +407,7 @@ class Preferences_window:
self.plugin.roster.draw_roster() self.plugin.roster.draw_roster()
def on_use_emoticons_checkbutton_toggled(self, widget): def on_use_emoticons_checkbutton_toggled(self, widget):
self.on_checkbutton_toggled(widget, 'useemoticons', \ self.on_checkbutton_toggled(widget, 'useemoticons',
[self.xml.get_widget('add_remove_emoticons_button')]) [self.xml.get_widget('add_remove_emoticons_button')])
def on_add_remove_emoticons_button_clicked(self, widget): def on_add_remove_emoticons_button_clicked(self, widget):
@ -1237,8 +1237,7 @@ class Account_modification_window:
return return
if not self.plugin.windows[self.account]['infos'].has_key('vcard'): if not self.plugin.windows[self.account]['infos'].has_key('vcard'):
self.plugin.windows[self.account]['infos'][jid] = \ self.plugin.windows[self.account]['infos'][jid] = \
dialogs.Vcard_window(jid, self.plugin, dialogs.Vcard_window(jid, self.plugin, self.account, True)
self.account, True)
gajim.connections[self.account].request_vcard(jid) gajim.connections[self.account].request_vcard(jid)
def on_gpg_choose_button_clicked(self, widget, data = None): def on_gpg_choose_button_clicked(self, widget, data = None):
@ -1378,7 +1377,6 @@ class Service_registration_window:
'''Class for Service registration window: '''Class for Service registration window:
Window that appears when we want to subscribe to a service''' Window that appears when we want to subscribe to a service'''
def on_cancel_button_clicked(self, widget): def on_cancel_button_clicked(self, widget):
'''When Cancel button is clicked'''
self.window.destroy() self.window.destroy()
def draw_table(self): def draw_table(self):
@ -1402,7 +1400,7 @@ class Service_registration_window:
table.show_all() table.show_all()
def on_ok_button_clicked(self, widget): def on_ok_button_clicked(self, widget):
'''When Ok button is clicked : '''When Ok button is clicked:
send registration info to the core''' send registration info to the core'''
for name in self.entries.keys(): for name in self.entries.keys():
self.infos[name] = self.entries[name].get_text() self.infos[name] = self.entries[name].get_text()
@ -1455,9 +1453,9 @@ class Add_remove_emoticons_window:
col.add_attribute(renderer, 'image', 2) col.add_attribute(renderer, 'image', 2)
self.fill_emot_treeview() self.fill_emot_treeview()
self.emot_tree.get_model().connect('row-changed', \ self.emot_tree.get_model().connect('row-changed',
self.on_emoticons_treemodel_row_changed) self.on_emoticons_treemodel_row_changed)
self.emot_tree.get_model().connect('row-deleted', \ self.emot_tree.get_model().connect('row-deleted',
self.on_emoticons_treemodel_row_deleted) self.on_emoticons_treemodel_row_deleted)
self.plugin = plugin self.plugin = plugin
@ -1599,7 +1597,6 @@ class Service_discovery_window:
'''Class for Service Discovery Window: '''Class for Service Discovery Window:
to know the services on a 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'''
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):
@ -1674,7 +1671,7 @@ class Service_discovery_window:
gajim.connections[self.account].request_agents(jid, node) gajim.connections[self.account].request_agents(jid, node)
def agents(self, agents): def agents(self, agents):
'''When list of available agent arrive : '''When list of available agent arrive:
Fill the treeview with it''' Fill the treeview with it'''
model = self.services_treeview.get_model() model = self.services_treeview.get_model()
for agent in agents: for agent in agents:
@ -1823,7 +1820,7 @@ class Service_discovery_window:
self.plugin.windows[self.account]['join_gc'].window.present() self.plugin.windows[self.account]['join_gc'].window.present()
def on_register_button_clicked(self, widget): def on_register_button_clicked(self, widget):
'''When we want to register an agent : '''When we want to register an agent:
Ask specific informations about the selected agent and close the window''' Ask specific informations about the selected agent and close the window'''
model, iter = self.services_treeview.get_selection().get_selected() model, iter = self.services_treeview.get_selection().get_selected()
if not iter : if not iter :
@ -1864,7 +1861,7 @@ class Service_discovery_window:
self.address_comboboxentry.get_model().clear() self.address_comboboxentry.get_model().clear()
for j in self.latest_addresses: for j in self.latest_addresses:
self.address_comboboxentry.append_text(j) self.address_comboboxentry.append_text(j)
gajim.config.set('latest_disco_addresses', \ gajim.config.set('latest_disco_addresses',
' '.join(self.latest_addresses)) ' '.join(self.latest_addresses))
self.services_treeview.get_model().clear() self.services_treeview.get_model().clear()
self.browse(server_address) self.browse(server_address)
@ -1912,7 +1909,7 @@ class Groupchat_config_window:
if self.config.has_key('title'): if self.config.has_key('title'):
self.window.set_title(self.config['title']) self.window.set_title(self.config['title'])
if self.config.has_key('instructions'): if self.config.has_key('instructions'):
self.xml.get_widget('instructions_label').set_text(\ self.xml.get_widget('instructions_label').set_text(
self.config['instructions']) self.config['instructions'])
i = 0 i = 0
while self.config.has_key(i): while self.config.has_key(i):
@ -1928,8 +1925,8 @@ class Groupchat_config_window:
if self.config[i].has_key('label'): if self.config[i].has_key('label'):
label = gtk.Label(self.config[i]['label']) label = gtk.Label(self.config[i]['label'])
label.set_alignment(0.0, 0.5) label.set_alignment(0.0, 0.5)
self.config_table.attach(label, 0, 1, nbrows, nbrows + 1, gtk.FILL \ self.config_table.attach(label, 0, 1, nbrows, nbrows + 1,
| gtk.SHRINK) gtk.FILL | gtk.SHRINK)
desc = None desc = None
if self.config[i].has_key('desc'): if self.config[i].has_key('desc'):
desc = self.config[i]['desc'] desc = self.config[i]['desc']
@ -2001,7 +1998,6 @@ class Remove_account_window:
and do removing of the account given''' and do removing of the account given'''
def on_remove_account_window_destroy(self, widget): def on_remove_account_window_destroy(self, widget):
'''close window'''
if self.plugin.windows.has_key(self.account): if self.plugin.windows.has_key(self.account):
del self.plugin.windows[self.account]['remove_account'] del self.plugin.windows[self.account]['remove_account']
@ -2013,14 +2009,18 @@ class Remove_account_window:
self.account = account self.account = account
xml = gtk.glade.XML(GTKGUI_GLADE, 'remove_account_window', APP) xml = gtk.glade.XML(GTKGUI_GLADE, 'remove_account_window', APP)
self.window = xml.get_widget('remove_account_window') self.window = xml.get_widget('remove_account_window')
self.remove_and_unregister_radiobutton = xml.get_widget(\ self.remove_and_unregister_radiobutton = xml.get_widget(
'remove_and_unregister_radiobutton') 'remove_and_unregister_radiobutton')
self.window.set_title(_('Removing %s account') % self.account) self.window.set_title(_('Removing %s account') % self.account)
xml.signal_autoconnect(self) xml.signal_autoconnect(self)
self.window.show_all() self.window.show_all()
def on_remove_button_clicked(self, widget): def on_remove_button_clicked(self, widget):
if gajim.connections[self.account].connected: #FIXME: user unfriendly?? if gajim.connections[self.account].connected:
message = _("You're currently connected with %s.\nAre you sure you want to remove this account?") % self.account
dialog = dialogs.Confirmation_dialog(message)
if dialog.get_response() != gtk.RESPONSE_YES:
return
gajim.connections[self.account].change_status('offline', 'offline') gajim.connections[self.account].change_status('offline', 'offline')
if self.remove_and_unregister_radiobutton.get_active(): if self.remove_and_unregister_radiobutton.get_active():