try again later
This commit is contained in:
parent
ea4eca20b3
commit
78c7ca566f
9 changed files with 202 additions and 114 deletions
|
@ -243,7 +243,7 @@ class Chat:
|
||||||
try:
|
try:
|
||||||
gtkspell.Spell(message_textview)
|
gtkspell.Spell(message_textview)
|
||||||
except gobject.GError, msg:
|
except gobject.GError, msg:
|
||||||
dialogs.Error_dialog(str(msg) + '\n\n' + _('If that is not your language for which you want to highlight misspelled words, then please set your $LANG as appropriate. Eg. for French do export LANG=fr_FR or export LANG=fr_FR.UTF-8 in ~/.bash_profile or to make it global in /etc/profile.\n\nHighlighting misspelled words will not be used'))
|
dialogs.Error_dialog(str(msg), _('If that is not your language for which you want to highlight misspelled words, then please set your $LANG as appropriate. Eg. for French do export LANG=fr_FR or export LANG=fr_FR.UTF-8 in ~/.bash_profile or to make it global in /etc/profile.\n\nHighlighting misspelled words feature will not be used')).get_response()
|
||||||
gajim.config.set('use_speller', False)
|
gajim.config.set('use_speller', False)
|
||||||
|
|
||||||
conversation_textview = self.xmls[jid].get_widget(
|
conversation_textview = self.xmls[jid].get_widget(
|
||||||
|
|
|
@ -134,11 +134,14 @@ class Connection:
|
||||||
gajim.config.set('usegpg', False)
|
gajim.config.set('usegpg', False)
|
||||||
# END __init__
|
# END __init__
|
||||||
|
|
||||||
def dispatch(self, event, data):
|
def dispatch(self, event, pritext, sectext=''):
|
||||||
if not event in self.handlers:
|
if not event in self.handlers:
|
||||||
return
|
return
|
||||||
for handler in self.handlers[event]:
|
for handler in self.handlers[event]:
|
||||||
handler(self.name, data)
|
if len(sectext):
|
||||||
|
handler(self.name, pritext, sectext)
|
||||||
|
else:
|
||||||
|
handler(self.name, pritext)
|
||||||
|
|
||||||
# this is in features.py but it is blocking
|
# this is in features.py but it is blocking
|
||||||
def _discover(self, ns, jid, node = None):
|
def _discover(self, ns, jid, node = None):
|
||||||
|
@ -161,7 +164,7 @@ class Connection:
|
||||||
self._discover(common.xmpp.NS_DISCO_INFO, jid, node)
|
self._discover(common.xmpp.NS_DISCO_INFO, jid, node)
|
||||||
|
|
||||||
def _vCardCB(self, con, vc):
|
def _vCardCB(self, con, vc):
|
||||||
"""Called when we recieve a vCard
|
"""Called when we receive a vCard
|
||||||
Parse the vCard and send it to plugins"""
|
Parse the vCard and send it to plugins"""
|
||||||
frm = vc.getFrom()
|
frm = vc.getFrom()
|
||||||
if frm:
|
if frm:
|
||||||
|
@ -188,7 +191,7 @@ class Connection:
|
||||||
|
|
||||||
|
|
||||||
def _messageCB(self, con, msg):
|
def _messageCB(self, con, msg):
|
||||||
"""Called when we recieve a message"""
|
"""Called when we receive a message"""
|
||||||
msgtxt = msg.getBody()
|
msgtxt = msg.getBody()
|
||||||
if not msg.getTag('body'): #no <body>
|
if not msg.getTag('body'): #no <body>
|
||||||
return
|
return
|
||||||
|
@ -230,7 +233,7 @@ class Connection:
|
||||||
# END messageCB
|
# END messageCB
|
||||||
|
|
||||||
def _presenceCB(self, con, prs):
|
def _presenceCB(self, con, prs):
|
||||||
"""Called when we recieve a presence"""
|
"""Called when we receive a presence"""
|
||||||
who = str(prs.getFrom())
|
who = str(prs.getFrom())
|
||||||
prio = prs.getPriority()
|
prio = prs.getPriority()
|
||||||
if not prio:
|
if not prio:
|
||||||
|
@ -314,7 +317,7 @@ class Connection:
|
||||||
self.dispatch('STATUS', 'offline')
|
self.dispatch('STATUS', 'offline')
|
||||||
self.connection = None
|
self.connection = None
|
||||||
if not self.on_purpose:
|
if not self.on_purpose:
|
||||||
self.dispatch('ERROR', _('You have been disconnected from %s') % self.name)
|
self.dispatch('ERROR', _('Connection with account "%s" has been lost') %\ self.name, _('To continue sending and receiving messages, you will need to reconnect.'))
|
||||||
self.on_purpose = False
|
self.on_purpose = False
|
||||||
# END disconenctedCB
|
# END disconenctedCB
|
||||||
|
|
||||||
|
@ -575,7 +578,7 @@ class Connection:
|
||||||
gajim.log.debug("Couldn't connect to %s" % self.name)
|
gajim.log.debug("Couldn't connect to %s" % self.name)
|
||||||
self.connected = 0
|
self.connected = 0
|
||||||
self.dispatch('STATUS', 'offline')
|
self.dispatch('STATUS', 'offline')
|
||||||
self.dispatch('ERROR', _("Couldn't connect to %s") % self.name)
|
self.dispatch('ERROR', _('Could not connect to "%s"') % self.name)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
con.RegisterHandler('message', self._messageCB)
|
con.RegisterHandler('message', self._messageCB)
|
||||||
|
@ -610,7 +613,7 @@ class Connection:
|
||||||
except IOError: #probably a timeout
|
except IOError: #probably a timeout
|
||||||
self.connected = 0
|
self.connected = 0
|
||||||
self.dispatch('STATUS', 'offline')
|
self.dispatch('STATUS', 'offline')
|
||||||
self.dispatch('ERROR', _("Couldn't connect to %s") % self.name)
|
self.dispatch('ERROR', _('Could not connect to "%s"') % self.name)
|
||||||
return None
|
return None
|
||||||
if auth:
|
if auth:
|
||||||
con.initRoster()
|
con.initRoster()
|
||||||
|
@ -620,7 +623,8 @@ class Connection:
|
||||||
gajim.log.debug("Couldn't authenticate to %s" % self.name)
|
gajim.log.debug("Couldn't authenticate to %s" % self.name)
|
||||||
self.connected = 0
|
self.connected = 0
|
||||||
self.dispatch('STATUS', 'offline')
|
self.dispatch('STATUS', 'offline')
|
||||||
self.dispatch('ERROR', _('Authentication failed with %s, check your login and password') % name)
|
self.dispatch('ERROR', _('Authentication failed with "%s"' % name), \
|
||||||
|
_('Please check your login and password for correctness.'))
|
||||||
return None
|
return None
|
||||||
# END connect
|
# END connect
|
||||||
|
|
||||||
|
@ -840,7 +844,8 @@ class Connection:
|
||||||
con_type = c.connect((config['hostname'], port), proxy = proxy)
|
con_type = c.connect((config['hostname'], port), proxy = proxy)
|
||||||
if not con_type:
|
if not con_type:
|
||||||
gajim.log.debug("Couldn't connect to %s" % name)
|
gajim.log.debug("Couldn't connect to %s" % name)
|
||||||
self.dispatch('ERROR', _("Couldn't connect to %s") % name)
|
self.dispatch('ERROR', _('Could not connect to "%s"') % name,
|
||||||
|
_('Please try again later'))
|
||||||
return False
|
return False
|
||||||
gajim.log.debug('Connected to server')
|
gajim.log.debug('Connected to server')
|
||||||
# FIXME! This blocks!
|
# FIXME! This blocks!
|
||||||
|
|
|
@ -1140,10 +1140,10 @@ class Account_modification_window:
|
||||||
self.xml.get_widget('gpg_choose_button').set_sensitive(False)
|
self.xml.get_widget('gpg_choose_button').set_sensitive(False)
|
||||||
self.xml.get_widget('autoconnect_checkbutton').set_active(gajim.config.\
|
self.xml.get_widget('autoconnect_checkbutton').set_active(gajim.config.\
|
||||||
get_per('accounts', self.account, 'autoconnect'))
|
get_per('accounts', self.account, 'autoconnect'))
|
||||||
self.xml.get_widget('sync_with_global_status_checkbutton').set_active( \
|
self.xml.get_widget('sync_with_global_status_checkbutton').set_active(
|
||||||
gajim.config.get_per('accounts', self.account, \
|
gajim.config.get_per('accounts', self.account, \
|
||||||
'sync_with_global_status'))
|
'sync_with_global_status'))
|
||||||
list_no_log_for = gajim.config.get_per('accounts', self.account, \
|
list_no_log_for = gajim.config.get_per('accounts', self.account,
|
||||||
'no_log_for').split()
|
'no_log_for').split()
|
||||||
if self.account in list_no_log_for:
|
if self.account in list_no_log_for:
|
||||||
self.xml.get_widget('log_history_checkbutton').set_active(0)
|
self.xml.get_widget('log_history_checkbutton').set_active(0)
|
||||||
|
@ -1155,24 +1155,29 @@ class Account_modification_window:
|
||||||
if gajim.connections.has_key(self.account):
|
if gajim.connections.has_key(self.account):
|
||||||
if name != self.account and \
|
if name != self.account and \
|
||||||
gajim.connections[self.account].connected != 0:
|
gajim.connections[self.account].connected != 0:
|
||||||
dialogs.Error_dialog(_('You must be offline to change the account\'s name'))
|
dialogs.Error_dialog(_('You are connected to the server'),
|
||||||
|
_('To change the account name, it must be disconnected.')).get_response()
|
||||||
return
|
return
|
||||||
if (name == ''):
|
if (name == ''):
|
||||||
dialogs.Error_dialog(_('You must enter a name for this account'))
|
dialogs.Error_dialog(_('Invalid account name'),
|
||||||
|
_('Account names cannot be empty.')).get_response()
|
||||||
return
|
return
|
||||||
if name.find(' ') != -1:
|
if name.find(' ') != -1:
|
||||||
dialogs.Error_dialog(_('Spaces are not permited in account name'))
|
dialogs.Error_dialog(_('Invalid account name'),
|
||||||
|
_('Account names cannot contain spaces.')).get_response()
|
||||||
return
|
return
|
||||||
jid = self.xml.get_widget('jid_entry').get_text()
|
jid = self.xml.get_widget('jid_entry').get_text()
|
||||||
if jid == '' or jid.count('@') != 1:
|
if jid == '' or jid.count('@') != 1:
|
||||||
dialogs.Error_dialog(_('You must enter a Jabber ID for this account\nFor example: someone@someserver.org'))
|
dialogs.Error_dialog(_('Invalid Jabber ID'),
|
||||||
|
_('A Jabber ID must be in the form "user@servername".')).get_response()
|
||||||
return
|
return
|
||||||
new_account = self.xml.get_widget('new_account_checkbutton').get_active()
|
new_account = self.xml.get_widget('new_account_checkbutton').get_active()
|
||||||
config['savepass'] = self.xml.get_widget(
|
config['savepass'] = self.xml.get_widget(
|
||||||
'save_password_checkbutton').get_active()
|
'save_password_checkbutton').get_active()
|
||||||
config['password'] = self.xml.get_widget('password_entry').get_text()
|
config['password'] = self.xml.get_widget('password_entry').get_text()
|
||||||
if new_account and config['password'] == '':
|
if new_account and config['password'] == '':
|
||||||
dialogs.Error_dialog(_('You must enter a password to register a new account'))
|
dialogs.Error_dialog(_('Invalid password'),
|
||||||
|
_('You must enter a password for the new account.')).get_response()
|
||||||
return
|
return
|
||||||
config['resource'] = self.xml.get_widget('resource_entry').get_text()
|
config['resource'] = self.xml.get_widget('resource_entry').get_text()
|
||||||
config['priority'] = self.xml.get_widget('priority_spinbutton').\
|
config['priority'] = self.xml.get_widget('priority_spinbutton').\
|
||||||
|
@ -1203,15 +1208,18 @@ class Account_modification_window:
|
||||||
if config['use_proxy']:
|
if config['use_proxy']:
|
||||||
if config['proxyport'] != '':
|
if config['proxyport'] != '':
|
||||||
if not config['proxyport'].isdigit():
|
if not config['proxyport'].isdigit():
|
||||||
dialogs.Error_dialog(_('Proxy port must be a port number'))
|
dialogs.Error_dialog(_('Invalid proxy port'),
|
||||||
|
_('Port numbers must contain digits only.')).get_response()
|
||||||
return
|
return
|
||||||
config['proxyport'] = int(config['proxyport'])
|
config['proxyport'] = int(config['proxyport'])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
dialogs.Error_dialog(_('You must enter a proxy port to use proxy'))
|
dialogs.Error_dialog(_('Invalid proxy port'),
|
||||||
|
_('You must enter a port number to use a proxy.')).get_response()
|
||||||
return
|
return
|
||||||
if config['proxyhost'] == '':
|
if config['proxyhost'] == '':
|
||||||
dialogs.Error_dialog(_('You must enter a proxy host to use proxy'))
|
dialogs.Error_dialog(_('Invalid proxy host'),
|
||||||
|
_('You must enter a proxy host to use a proxy.')).get_response()
|
||||||
return
|
return
|
||||||
|
|
||||||
config['usessl'] = self.xml.get_widget('use_ssl_checkbutton').get_active()
|
config['usessl'] = self.xml.get_widget('use_ssl_checkbutton').get_active()
|
||||||
|
@ -1283,7 +1291,8 @@ class Account_modification_window:
|
||||||
return
|
return
|
||||||
#if it's a new account
|
#if it's a new account
|
||||||
if name in gajim.connections:
|
if name in gajim.connections:
|
||||||
dialogs.Error_dialog(_('This name is taken by an another account of yours'))
|
dialogs.Error_dialog(_('Account name is in use'),
|
||||||
|
_('You already have an account using this name.')).get_response()
|
||||||
return
|
return
|
||||||
con = connection.Connection(name)
|
con = connection.Connection(name)
|
||||||
self.plugin.register_handlers(con)
|
self.plugin.register_handlers(con)
|
||||||
|
@ -1335,11 +1344,13 @@ class Account_modification_window:
|
||||||
|
|
||||||
def on_edit_details_button_clicked(self, widget):
|
def on_edit_details_button_clicked(self, widget):
|
||||||
if not self.plugin.windows.has_key(self.account):
|
if not self.plugin.windows.has_key(self.account):
|
||||||
dialogs.Error_dialog(_('You must first create your account before editing your personal information'))
|
dialogs.Error_dialog(_('No such account available'),
|
||||||
|
_('You must create your account before editing your personal information.')).get_response()
|
||||||
return
|
return
|
||||||
jid = self.xml.get_widget('jid_entry').get_text()
|
jid = self.xml.get_widget('jid_entry').get_text()
|
||||||
if gajim.connections[self.account].connected < 2:
|
if gajim.connections[self.account].connected < 2:
|
||||||
dialogs.Error_dialog(_('You must be connected to edit your personal information'))
|
dialogs.Error_dialog(_('You are not connected to the server'),
|
||||||
|
_('Without a connection, you can not edit your personal information.')).get_response()
|
||||||
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] = \
|
||||||
|
@ -1349,7 +1360,8 @@ class Account_modification_window:
|
||||||
def on_gpg_choose_button_clicked(self, widget, data = None):
|
def on_gpg_choose_button_clicked(self, widget, data = None):
|
||||||
secret_keys = gajim.connections[self.account].ask_gpg_secrete_keys()
|
secret_keys = gajim.connections[self.account].ask_gpg_secrete_keys()
|
||||||
if not secret_keys:
|
if not secret_keys:
|
||||||
dialogs.Error_dialog(_('Error while getting secret keys'))
|
dialogs.Error_dialog(_('Failed to get secret keys'),
|
||||||
|
_('There was a problem retrieving your GPG secret keys.')).get_response()
|
||||||
return
|
return
|
||||||
secret_keys['None'] = 'None'
|
secret_keys['None'] = 'None'
|
||||||
w = dialogs.choose_gpg_key_dialog(secret_keys)
|
w = dialogs.choose_gpg_key_dialog(secret_keys)
|
||||||
|
@ -1727,7 +1739,8 @@ class Service_discovery_window:
|
||||||
self.account = account
|
self.account = account
|
||||||
self.agent_infos = {}
|
self.agent_infos = {}
|
||||||
if gajim.connections[account].connected < 2:
|
if gajim.connections[account].connected < 2:
|
||||||
dialogs.Error_dialog(_('You must be connected to browse services'))
|
dialogs.Error_dialog(_('You are not connected to the server'),
|
||||||
|
_('Without a connection, you can not browse available services')).get_response()
|
||||||
raise RuntimeError, 'You must be connected to browse services'
|
raise RuntimeError, 'You must be connected to browse services'
|
||||||
xml = gtk.glade.XML(GTKGUI_GLADE, 'service_discovery_window', APP)
|
xml = gtk.glade.XML(GTKGUI_GLADE, 'service_discovery_window', APP)
|
||||||
self.window = xml.get_widget('service_discovery_window')
|
self.window = xml.get_widget('service_discovery_window')
|
||||||
|
@ -2134,9 +2147,10 @@ class Remove_account_window:
|
||||||
|
|
||||||
def on_remove_button_clicked(self, widget):
|
def on_remove_button_clicked(self, widget):
|
||||||
if gajim.connections[self.account].connected:
|
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(
|
||||||
dialog = dialogs.Confirmation_dialog(message)
|
_('Account "%s" is connected to the server' % self.account),
|
||||||
if dialog.get_response() != gtk.RESPONSE_YES:
|
_('If you remove it, the connection will be lost.'))
|
||||||
|
if dialog.get_response() != gtk.RESPONSE_OK:
|
||||||
return
|
return
|
||||||
gajim.connections[self.account].change_status('offline', 'offline')
|
gajim.connections[self.account].change_status('offline', 'offline')
|
||||||
|
|
||||||
|
|
156
src/dialogs.py
156
src/dialogs.py
|
@ -87,7 +87,8 @@ class Edit_groups_dialog:
|
||||||
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 last group
|
# the last group
|
||||||
Error_dialog(_('A contact must belong at least to one group'))
|
Error_dialog(_("Can't remove last group"),
|
||||||
|
_('At least one contact group must be present.')).get_response()
|
||||||
return
|
return
|
||||||
model[path][1] = not model[path][1]
|
model[path][1] = not model[path][1]
|
||||||
if model[path][1]:
|
if model[path][1]:
|
||||||
|
@ -241,7 +242,8 @@ class Add_new_contact_window:
|
||||||
'''Class for Add_new_contact_window'''
|
'''Class for Add_new_contact_window'''
|
||||||
def __init__(self, plugin, account, jid = None):
|
def __init__(self, plugin, account, jid = None):
|
||||||
if gajim.connections[account].connected < 2:
|
if gajim.connections[account].connected < 2:
|
||||||
Error_dialog(_('You must be connected to add a contact'))
|
Error_dialog(_('You are not connected to the server.'), \
|
||||||
|
_('Without a connection, you can not add a contact')).get_response()
|
||||||
return
|
return
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.account = account
|
self.account = account
|
||||||
|
@ -315,7 +317,8 @@ class Add_new_contact_window:
|
||||||
if not jid:
|
if not jid:
|
||||||
return
|
return
|
||||||
if jid.find('@') < 0:
|
if jid.find('@') < 0:
|
||||||
Error_dialog(_("The contact's name must be something like login@hostname"))
|
Error_dialog(_("Invalid user name"),
|
||||||
|
_('User names must be of the form "user@servername".')).get_response()
|
||||||
return
|
return
|
||||||
message_buffer = self.xml.get_widget('message_textview').get_buffer()
|
message_buffer = self.xml.get_widget('message_textview').get_buffer()
|
||||||
start_iter = message_buffer.get_start_iter()
|
start_iter = message_buffer.get_start_iter()
|
||||||
|
@ -369,8 +372,8 @@ class About_dialog:
|
||||||
'''Class for about dialog'''
|
'''Class for about dialog'''
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
if gtk.pygtk_version < (2, 6, 0) or gtk.gtk_version < (2, 6, 0):
|
if gtk.pygtk_version < (2, 6, 0) or gtk.gtk_version < (2, 6, 0):
|
||||||
Information_dialog(_('Gajim - a GTK+ Jabber client\nVersion %s') \
|
Information_dialog(_('Gajim - a GTK+ Jabber client'),
|
||||||
% gajim.version)
|
'Version %s' % gajim.version).get_response()
|
||||||
return
|
return
|
||||||
|
|
||||||
dlg = gtk.AboutDialog()
|
dlg = gtk.AboutDialog()
|
||||||
|
@ -395,41 +398,86 @@ class About_dialog:
|
||||||
rep = dlg.run()
|
rep = dlg.run()
|
||||||
dlg.destroy()
|
dlg.destroy()
|
||||||
|
|
||||||
class Confirmation_dialog:
|
class Dialog(gtk.Dialog):
|
||||||
'''Class for confirmation dialog'''
|
def __init__(self, parent, title, buttons, default = None):
|
||||||
def get_response(self):
|
gtk.Dialog.__init__(self, title, parent, gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_MODAL | gtk.DIALOG_NO_SEPARATOR)
|
||||||
response = self.dialog.run()
|
|
||||||
self.dialog.destroy()
|
|
||||||
return response
|
|
||||||
|
|
||||||
def __init__(self, label):
|
self.set_border_width(6)
|
||||||
self.dialog = gtk.MessageDialog(None,
|
self.vbox.set_spacing(12)
|
||||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
self.set_resizable(False)
|
||||||
gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, label)
|
|
||||||
|
|
||||||
class Warning_dialog:
|
for stock, response in buttons:
|
||||||
'''Class for warning dialog'''
|
self.add_button(stock, response)
|
||||||
def on_response(self, dialog, response_id):
|
|
||||||
dialog.destroy()
|
|
||||||
|
|
||||||
def __init__(self, label):
|
if default is not None:
|
||||||
dialog = gtk.MessageDialog(None,
|
self.set_default_response(default)
|
||||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
else:
|
||||||
gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, label)
|
self.set_default_response(buttons[-1][1])
|
||||||
dialog.connect('response', self.on_response)
|
|
||||||
dialog.show()
|
|
||||||
|
|
||||||
class Information_dialog:
|
def get_button(self, index):
|
||||||
'''Class for information dialog'''
|
buttons = self.action_area.get_children()
|
||||||
def on_response(self, dialog, response_id):
|
return index < len(buttons) and buttons[index] or None
|
||||||
dialog.destroy()
|
|
||||||
|
|
||||||
def __init__(self, label):
|
class HigDialog(Dialog):
|
||||||
dialog = gtk.MessageDialog(None,
|
def __init__(self, parent, pritext, sectext, stockimage, buttons, default = None):
|
||||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
"""GNOME higified version of the Dialog object. Inherit
|
||||||
gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE, label)
|
from here if possible when you need a new dialog."""
|
||||||
dialog.connect('response', self.on_response)
|
Dialog.__init__(self, parent, "", buttons, default)
|
||||||
dialog.show()
|
|
||||||
|
# hbox separating dialog image and contents
|
||||||
|
hbox = gtk.HBox()
|
||||||
|
hbox.set_spacing(12)
|
||||||
|
hbox.set_border_width(6)
|
||||||
|
self.vbox.pack_start(hbox)
|
||||||
|
|
||||||
|
# set up image
|
||||||
|
if stockimage is not None:
|
||||||
|
image = gtk.Image()
|
||||||
|
image.set_from_stock(stockimage, gtk.ICON_SIZE_DIALOG)
|
||||||
|
image.set_alignment(0.5, 0)
|
||||||
|
hbox.pack_start(image, False, False)
|
||||||
|
|
||||||
|
# set up main content area
|
||||||
|
self.contents = gtk.VBox()
|
||||||
|
self.contents.set_spacing(10)
|
||||||
|
hbox.pack_start(self.contents)
|
||||||
|
|
||||||
|
label = gtk.Label()
|
||||||
|
label.set_markup("<span size=\"larger\" weight=\"bold\">" + pritext + "</span>\n\n" + sectext)
|
||||||
|
label.set_line_wrap(True)
|
||||||
|
label.set_alignment(0, 0)
|
||||||
|
label.set_selectable(True)
|
||||||
|
self.contents.pack_start(label)
|
||||||
|
|
||||||
|
def get_response(self):
|
||||||
|
self.show_all()
|
||||||
|
response = gtk.Dialog.run(self)
|
||||||
|
self.destroy()
|
||||||
|
return response
|
||||||
|
|
||||||
|
class Confirmation_dialog(HigDialog):
|
||||||
|
def __init__(self, pritext, sectext=''):
|
||||||
|
"""HIG compliant confirmation dialog."""
|
||||||
|
HigDialog.__init__(
|
||||||
|
self, None, pritext, sectext, gtk.STOCK_DIALOG_WARNING,
|
||||||
|
[ [gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL], [ gtk.STOCK_OK, gtk.RESPONSE_OK ] ]
|
||||||
|
)
|
||||||
|
|
||||||
|
class Warning_dialog(HigDialog):
|
||||||
|
def __init__(self, pritext, sectext=''):
|
||||||
|
"""HIG compliant warning dialog."""
|
||||||
|
HigDialog.__init__(
|
||||||
|
self, None, pritext, sectext, gtk.STOCK_DIALOG_WARNING,
|
||||||
|
[ [ gtk.STOCK_OK, gtk.RESPONSE_OK ] ]
|
||||||
|
)
|
||||||
|
|
||||||
|
class Information_dialog(HigDialog):
|
||||||
|
def __init__(self, pritext, sectext=''):
|
||||||
|
"""HIG compliant info dialog."""
|
||||||
|
HigDialog.__init__(
|
||||||
|
self, None, pritext, sectext, gtk.STOCK_DIALOG_INFO,
|
||||||
|
[ [ gtk.STOCK_OK, gtk.RESPONSE_OK ] ]
|
||||||
|
)
|
||||||
|
|
||||||
class Input_dialog:
|
class Input_dialog:
|
||||||
'''Class for Input dialog'''
|
'''Class for Input dialog'''
|
||||||
|
@ -444,17 +492,13 @@ class Input_dialog:
|
||||||
self.input_entry.set_text(input_str)
|
self.input_entry.set_text(input_str)
|
||||||
self.input_entry.select_region(0, -1) # select all
|
self.input_entry.select_region(0, -1) # select all
|
||||||
|
|
||||||
class Error_dialog:
|
class Error_dialog(HigDialog):
|
||||||
'''Class for error dialog'''
|
def __init__(self, pritext, sectext=''):
|
||||||
def on_response(self, dialog, response_id):
|
"""HIG compliant error dialog."""
|
||||||
dialog.destroy()
|
HigDialog.__init__(
|
||||||
|
self, None, pritext, sectext, gtk.STOCK_DIALOG_ERROR,
|
||||||
def __init__(self, label):
|
[ [ gtk.STOCK_OK, gtk.RESPONSE_OK ] ]
|
||||||
dialog = gtk.MessageDialog(None,
|
)
|
||||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
|
||||||
gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, label)
|
|
||||||
dialog.connect('response', self.on_response)
|
|
||||||
dialog.show()
|
|
||||||
|
|
||||||
class Subscription_request_window:
|
class Subscription_request_window:
|
||||||
def __init__(self, plugin, jid, text, account):
|
def __init__(self, plugin, jid, text, account):
|
||||||
|
@ -505,7 +549,8 @@ class Join_groupchat_window:
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.account = account
|
self.account = account
|
||||||
if gajim.connections[account].connected < 2:
|
if gajim.connections[account].connected < 2:
|
||||||
Error_dialog(_('You must be connected to join a groupchat'))
|
Error_dialog(_('You are not connected to the server'),
|
||||||
|
_('You can not join a group chat unless you are connected.')).get_response()
|
||||||
raise RuntimeError, 'You must be connected to join a groupchat'
|
raise RuntimeError, 'You must be connected to join a groupchat'
|
||||||
|
|
||||||
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'join_groupchat_window', APP)
|
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'join_groupchat_window', APP)
|
||||||
|
@ -563,7 +608,7 @@ class Join_groupchat_window:
|
||||||
password = self.xml.get_widget('password_entry').get_text()
|
password = self.xml.get_widget('password_entry').get_text()
|
||||||
jid = '%s@%s' % (room, server)
|
jid = '%s@%s' % (room, server)
|
||||||
if jid in self.plugin.windows[self.account]['gc']:
|
if jid in self.plugin.windows[self.account]['gc']:
|
||||||
Error_dialog(_('You are already in room ' + jid))
|
Error_dialog(_('You are already in room ' + jid)).get_response()
|
||||||
return
|
return
|
||||||
if jid in self.recently_groupchat:
|
if jid in self.recently_groupchat:
|
||||||
self.recently_groupchat.remove(jid)
|
self.recently_groupchat.remove(jid)
|
||||||
|
@ -581,7 +626,8 @@ class Join_groupchat_window:
|
||||||
class New_message_dialog:
|
class New_message_dialog:
|
||||||
def __init__(self, plugin, account):
|
def __init__(self, plugin, account):
|
||||||
if gajim.connections[account].connected < 2:
|
if gajim.connections[account].connected < 2:
|
||||||
Error_dialog(_('You must be connected to send a message to a contact'))
|
Error_dialog(_('You are not connected to the server'),
|
||||||
|
_('Without a connection, you can not send messages.')).get_response()
|
||||||
return
|
return
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.account = account
|
self.account = account
|
||||||
|
@ -608,7 +654,8 @@ class New_message_dialog:
|
||||||
'''When Chat button is clicked'''
|
'''When Chat button is clicked'''
|
||||||
jid = self.jid_entry.get_text()
|
jid = self.jid_entry.get_text()
|
||||||
if jid.find('@') == -1: # if no @ was given
|
if jid.find('@') == -1: # if no @ was given
|
||||||
Error_dialog(_('User ID is not valid'))
|
Error_dialog(_('Invalid user ID'),
|
||||||
|
_('User ID must be of the form "username@servername".')).get_response()
|
||||||
return
|
return
|
||||||
self.window.destroy()
|
self.window.destroy()
|
||||||
# use User class, new_chat expects it that way
|
# use User class, new_chat expects it that way
|
||||||
|
@ -634,7 +681,8 @@ class New_message_dialog:
|
||||||
class Change_password_dialog:
|
class Change_password_dialog:
|
||||||
def __init__(self, plugin, account):
|
def __init__(self, plugin, account):
|
||||||
if gajim.connections[account].connected < 2:
|
if gajim.connections[account].connected < 2:
|
||||||
Error_dialog(_('You must be connected to change your password'))
|
Error_dialog(_('You are not connected to the server'),
|
||||||
|
_('Without a connection, you can not change your password.')).get_response()
|
||||||
return
|
return
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.account = account
|
self.account = account
|
||||||
|
@ -653,11 +701,13 @@ class Change_password_dialog:
|
||||||
if rep == gtk.RESPONSE_OK:
|
if rep == gtk.RESPONSE_OK:
|
||||||
password1 = self.password1_entry.get_text()
|
password1 = self.password1_entry.get_text()
|
||||||
if not password1:
|
if not password1:
|
||||||
Error_dialog(_('Your password cannot be empty'))
|
Error_dialog(_('Invalid password.'), \
|
||||||
|
_('You must enter a password.')).get_response()
|
||||||
continue
|
continue
|
||||||
password2 = self.password2_entry.get_text()
|
password2 = self.password2_entry.get_text()
|
||||||
if password1 != password2:
|
if password1 != password2:
|
||||||
Error_dialog(_('Confirmation password is not the same'))
|
Error_dialog(_("Passwords don't match."), \
|
||||||
|
_('The passwords typed in both fields must be identical.')).get_response()
|
||||||
continue
|
continue
|
||||||
message = password1
|
message = password1
|
||||||
else:
|
else:
|
||||||
|
|
24
src/gajim.py
24
src/gajim.py
|
@ -189,11 +189,11 @@ class Interface:
|
||||||
self.roster.mklists(data, account)
|
self.roster.mklists(data, account)
|
||||||
self.roster.draw_roster()
|
self.roster.draw_roster()
|
||||||
|
|
||||||
def handle_event_warning(self, unused, msg):
|
def handle_event_warning(self, unused, msg, sectext=''):
|
||||||
dialogs.Warning_dialog(msg)
|
dialogs.Warning_dialog(msg, sectext).get_response()
|
||||||
|
|
||||||
def handle_event_error(self, unused, msg):
|
def handle_event_error(self, unused, msg, sectext=''):
|
||||||
dialogs.Error_dialog(msg)
|
dialogs.Error_dialog(msg, sectext).get_response()
|
||||||
|
|
||||||
def handle_event_error_answer(self, account, array):
|
def handle_event_error_answer(self, account, array):
|
||||||
#('ERROR_ANSWER', account, (jid_from. errmsg, errcode))
|
#('ERROR_ANSWER', account, (jid_from. errmsg, errcode))
|
||||||
|
@ -412,10 +412,13 @@ class Interface:
|
||||||
'online', 'to', '', array[1], 0, keyID)
|
'online', 'to', '', array[1], 0, keyID)
|
||||||
self.roster.contacts[account][jid] = [user1]
|
self.roster.contacts[account][jid] = [user1]
|
||||||
self.roster.add_user_to_roster(jid, account)
|
self.roster.add_user_to_roster(jid, account)
|
||||||
dialogs.Information_dialog(_('You are now authorized by %s') % jid)
|
dialogs.Information_dialog(_('Authorization accepted'),
|
||||||
|
_('The contact "%s" has authorized you to see his status.')
|
||||||
|
% jid).get_response()
|
||||||
|
|
||||||
def handle_event_unsubscribed(self, account, jid):
|
def handle_event_unsubscribed(self, account, jid):
|
||||||
dialogs.Information_dialog(_('You are now unsubscribed by %s') % jid)
|
dialogs.Information_dialog(_('Contact "%s" removed subscription' % jid),
|
||||||
|
_('You will always see contact "%s" as offline.')).get_response()
|
||||||
|
|
||||||
def handle_event_agent_info(self, account, array):
|
def handle_event_agent_info(self, account, array):
|
||||||
#('AGENT_INFO', account, (agent, identities, features, items))
|
#('AGENT_INFO', account, (agent, identities, features, items))
|
||||||
|
@ -428,7 +431,8 @@ class Interface:
|
||||||
if array[1].has_key('instructions'):
|
if array[1].has_key('instructions'):
|
||||||
config.Service_registration_window(array[0], array[1], self, account)
|
config.Service_registration_window(array[0], array[1], self, account)
|
||||||
else:
|
else:
|
||||||
dialogs.Error_dialog(_('error contacting %s') % array[0])
|
dialogs.Error_dialog(_('Contact with "%s" cannot be established'\
|
||||||
|
% array[0]), _('Check your connection or try again later.')).get_response()
|
||||||
|
|
||||||
def handle_event_agent_info_items(self, account, array):
|
def handle_event_agent_info_items(self, account, array):
|
||||||
#('AGENT_INFO_ITEMS', account, (agent, node, items))
|
#('AGENT_INFO_ITEMS', account, (agent, node, items))
|
||||||
|
@ -445,7 +449,8 @@ class Interface:
|
||||||
def handle_event_acc_ok(self, account, array):
|
def handle_event_acc_ok(self, account, array):
|
||||||
#('ACC_OK', account, (name, config))
|
#('ACC_OK', account, (name, config))
|
||||||
name = array[0]
|
name = array[0]
|
||||||
dialogs.Information_dialog(_('The account %s has been successfully registered') % name)
|
dialogs.Information_dialog(_('Account registration successful'),
|
||||||
|
_('The account "%s" has been registered with the Jabber server.') % name).get_response()
|
||||||
gajim.config.add_per('accounts', name)
|
gajim.config.add_per('accounts', name)
|
||||||
for opt in array[1]:
|
for opt in array[1]:
|
||||||
gajim.config.set_per('accounts', name, opt, array[1][opt])
|
gajim.config.set_per('accounts', name, opt, array[1][opt])
|
||||||
|
@ -519,7 +524,8 @@ class Interface:
|
||||||
config.Groupchat_config_window(self, account, jid, array[1])
|
config.Groupchat_config_window(self, account, jid, array[1])
|
||||||
|
|
||||||
def handle_event_bad_passphrase(self, account, array):
|
def handle_event_bad_passphrase(self, account, array):
|
||||||
dialogs.Warning_dialog(_('Your GPG passphrase is wrong, so you are connected without your GPG key'))
|
dialogs.Warning_dialog(_('Your GPG passphrase is incorrect'),
|
||||||
|
_('You are currently connected without your GPG key.')).get_response()
|
||||||
|
|
||||||
def handle_event_roster_info(self, account, array):
|
def handle_event_roster_info(self, account, array):
|
||||||
#('ROSTER_INFO', account, (jid, name, sub, ask, groups))
|
#('ROSTER_INFO', account, (jid, name, sub, ask, groups))
|
||||||
|
|
|
@ -90,9 +90,10 @@ class Groupchat_window(chat.Chat):
|
||||||
"""close window"""
|
"""close window"""
|
||||||
for room_jid in self.xmls:
|
for room_jid in self.xmls:
|
||||||
if time.time() - self.last_message_time[room_jid] < 2:
|
if time.time() - self.last_message_time[room_jid] < 2:
|
||||||
dialog = dialogs.Confirmation_dialog(_('You received a message in the room %s in the last two seconds.\nDo you still want to close this window?') % \
|
dialog = dialogs.Confirmation_dialog(_('You have unread messages in room "%s".'), \
|
||||||
|
_('If you close this window, these messages will be lost.') % \
|
||||||
room_jid.split('@')[0])
|
room_jid.split('@')[0])
|
||||||
if dialog.get_response() != gtk.RESPONSE_YES:
|
if dialog.get_response() != gtk.RESPONSE_OK:
|
||||||
return True #stop the propagation of the event
|
return True #stop the propagation of the event
|
||||||
for room_jid in self.xmls:
|
for room_jid in self.xmls:
|
||||||
gajim.connections[self.account].send_gc_status(self.nicks[room_jid], \
|
gajim.connections[self.account].send_gc_status(self.nicks[room_jid], \
|
||||||
|
@ -508,9 +509,11 @@ class Groupchat_window(chat.Chat):
|
||||||
|
|
||||||
def remove_tab(self, room_jid):
|
def remove_tab(self, room_jid):
|
||||||
if time.time() - self.last_message_time[room_jid] < 2:
|
if time.time() - self.last_message_time[room_jid] < 2:
|
||||||
dialog = dialogs.Confirmation_dialog(_('You received a message in the room %s in the last two seconds.\nDo you still want to close this tab?') % \
|
dialog = dialogs.Confirmation_dialog(
|
||||||
|
_('You have unread messages in room "%s"'),
|
||||||
|
_('If you close this tab, the messages will be lost.') % \
|
||||||
room_jid.split('@')[0])
|
room_jid.split('@')[0])
|
||||||
if dialog.get_response() != gtk.RESPONSE_YES:
|
if dialog.get_response() != gtk.RESPONSE_OK:
|
||||||
return
|
return
|
||||||
|
|
||||||
chat.Chat.remove_tab(self, room_jid, 'gc')
|
chat.Chat.remove_tab(self, room_jid, 'gc')
|
||||||
|
|
|
@ -446,7 +446,7 @@ class Roster_window:
|
||||||
|
|
||||||
def on_remove_agent(self, widget, user, account):
|
def on_remove_agent(self, widget, user, account):
|
||||||
'''When an agent is requested to log in or off'''
|
'''When an agent is requested to log in or off'''
|
||||||
window = dialogs.Confirmation_dialog(_('Are you sure you want to unregister from "%s" transport?\nContacts from that transport will also be removed') % user.jid)
|
window = dialogs.Confirmation_dialog(_('Transport "%s" will be removed') % user.jid, _('You will no longer be able to send and receive messages to contacts from %s.' % user.jid))
|
||||||
if window.get_response() == gtk.RESPONSE_YES:
|
if window.get_response() == gtk.RESPONSE_YES:
|
||||||
gajim.connections[account].unsubscribe_agent(user.jid + '/' \
|
gajim.connections[account].unsubscribe_agent(user.jid + '/' \
|
||||||
+ user.resource)
|
+ user.resource)
|
||||||
|
@ -786,8 +786,10 @@ class Roster_window:
|
||||||
|
|
||||||
def on_req_usub(self, widget, user, account):
|
def on_req_usub(self, widget, user, account):
|
||||||
'''Remove a user'''
|
'''Remove a user'''
|
||||||
window = dialogs.Confirmation_dialog(_('Are you sure you want to remove %s (%s) from your roster?') % (user.name, user.jid))
|
window = dialogs.Confirmation_dialog(\
|
||||||
if window.get_response() == gtk.RESPONSE_YES:
|
_('Contact "%s" will be removed from your roster') % (user.name),
|
||||||
|
_('By removing this contact you also remove authorization. Contact "%s" will always see you as offline.') % user.name)
|
||||||
|
if window.get_response() == gtk.RESPONSE_OK:
|
||||||
gajim.connections[account].unsubscribe(user.jid)
|
gajim.connections[account].unsubscribe(user.jid)
|
||||||
for u in self.contacts[account][user.jid]:
|
for u in self.contacts[account][user.jid]:
|
||||||
self.remove_user(u, account)
|
self.remove_user(u, account)
|
||||||
|
@ -894,7 +896,8 @@ class Roster_window:
|
||||||
return
|
return
|
||||||
accounts = gajim.connections.keys()
|
accounts = gajim.connections.keys()
|
||||||
if len(accounts) == 0:
|
if len(accounts) == 0:
|
||||||
dialogs.Error_dialog(_('You must create an account before connecting to jabber network.'))
|
dialogs.Error_dialog(_('No accounts created'),
|
||||||
|
_('You must create Jabber account before connecting the server.')).get_response()
|
||||||
self.update_status_comboxbox()
|
self.update_status_comboxbox()
|
||||||
return
|
return
|
||||||
status = model[active][2]
|
status = model[active][2]
|
||||||
|
@ -1142,13 +1145,13 @@ class Roster_window:
|
||||||
recent = True
|
recent = True
|
||||||
break
|
break
|
||||||
if unread:
|
if unread:
|
||||||
dialog = dialogs.Confirmation_dialog(_('You have unread messages.\nAre you sure you want to quit Gajim?'))
|
dialog = dialogs.Confirmation_dialog(_('You have unread messages'), _('If you exit Gajim these messages will be lost.'))
|
||||||
if dialog.get_response() != gtk.RESPONSE_YES:
|
if dialog.get_response() != gtk.RESPONSE_OK:
|
||||||
return
|
return
|
||||||
|
|
||||||
if recent:
|
if recent:
|
||||||
dialog = dialogs.Confirmation_dialog(_('You received a message in the last two seconds.\nAre you sure you want to quit Gajim?'))
|
dialog = dialogs.Confirmation_dialog(_('You have unread messages'), _('If you exit Gajim these messages will be lost.'))
|
||||||
if dialog.get_response() != gtk.RESPONSE_YES:
|
if dialog.get_response() != gtk.RESPONSE_OK:
|
||||||
return
|
return
|
||||||
for acct in accounts:
|
for acct in accounts:
|
||||||
if gajim.connections[acct].connected:
|
if gajim.connections[acct].connected:
|
||||||
|
|
|
@ -123,8 +123,10 @@ class Tabbed_chat_window(chat.Chat):
|
||||||
"""close window"""
|
"""close window"""
|
||||||
for jid in self.users:
|
for jid in self.users:
|
||||||
if time.time() - self.last_message_time[jid] < 2: # 2 seconds
|
if time.time() - self.last_message_time[jid] < 2: # 2 seconds
|
||||||
dialog = dialogs.Confirmation_dialog(_('You received a message from %s in the last two seconds.\nDo you still want to close this window?') % jid)
|
dialog = dialogs.Confirmation_dialog(
|
||||||
if dialog.get_response() != gtk.RESPONSE_YES:
|
_('You have an unread message from "%s"' % jid),
|
||||||
|
_('If you close the window, this message will be lost.'))
|
||||||
|
if dialog.get_response() != gtk.RESPONSE_OK:
|
||||||
return True #stop the propagation of the event
|
return True #stop the propagation of the event
|
||||||
|
|
||||||
def on_tabbed_chat_window_destroy(self, widget):
|
def on_tabbed_chat_window_destroy(self, widget):
|
||||||
|
@ -154,8 +156,10 @@ class Tabbed_chat_window(chat.Chat):
|
||||||
|
|
||||||
def remove_tab(self, jid):
|
def remove_tab(self, jid):
|
||||||
if time.time() - self.last_message_time[jid] < 2:
|
if time.time() - self.last_message_time[jid] < 2:
|
||||||
dialog = dialogs.Confirmation_dialog(_('You received a message from %s in the last two seconds.\nDo you still want to close this tab?') % jid)
|
dialog = dialogs.Confirmation_dialog(
|
||||||
if dialog.get_response() != gtk.RESPONSE_YES:
|
_('You have an unread message from "%s"' % jid),
|
||||||
|
_('If you close this tab, the message will be lost.'))
|
||||||
|
if dialog.get_response() != gtk.RESPONSE_OK:
|
||||||
return
|
return
|
||||||
|
|
||||||
chat.Chat.remove_tab(self, jid, 'chats')
|
chat.Chat.remove_tab(self, jid, 'chats')
|
||||||
|
@ -228,7 +232,8 @@ class Tabbed_chat_window(chat.Chat):
|
||||||
elif (event.state & gtk.gdk.SHIFT_MASK):
|
elif (event.state & gtk.gdk.SHIFT_MASK):
|
||||||
return False
|
return False
|
||||||
if gajim.connections[self.account].connected < 2: #we are not connected
|
if gajim.connections[self.account].connected < 2: #we are not connected
|
||||||
dialogs.Error_dialog(_('You are not connected, so you cannot send a message'))
|
dialogs.Error_dialog(_("You're connection has been lost."), \
|
||||||
|
_("Your message can't be sent until you reconnect.")).get_response()
|
||||||
return True
|
return True
|
||||||
message_buffer = widget.get_buffer()
|
message_buffer = widget.get_buffer()
|
||||||
start_iter = message_buffer.get_start_iter()
|
start_iter = message_buffer.get_start_iter()
|
||||||
|
@ -304,10 +309,10 @@ class Tabbed_chat_window(chat.Chat):
|
||||||
|
|
||||||
def restore_conversation(self, jid):
|
def restore_conversation(self, jid):
|
||||||
# don't restore lines if it's a transport
|
# don't restore lines if it's a transport
|
||||||
is_transport = jid.startswith('aim.') or jid.startswith('gadugadu.') or\
|
is_transport = jid.startswith('aim') or jid.startswith('gadugadu') or\
|
||||||
jid.startswith('irc.') or jid.startswith('icq.') or\
|
jid.startswith('irc') or jid.startswith('icq') or\
|
||||||
jid.startswith('msn.') or jid.startswith('sms.') or\
|
jid.startswith('msn') or jid.startswith('sms') or\
|
||||||
jid.startswith('yahoo.')
|
jid.startswith('yahoo')
|
||||||
|
|
||||||
if is_transport:
|
if is_transport:
|
||||||
return
|
return
|
||||||
|
|
|
@ -281,7 +281,8 @@ class Vcard_window:
|
||||||
|
|
||||||
def on_publish_button_clicked(self, widget):
|
def on_publish_button_clicked(self, widget):
|
||||||
if gajim.connections[self.account].connected < 2:
|
if gajim.connections[self.account].connected < 2:
|
||||||
Error_dialog(_('You must be connected to publish your contact information'))
|
Error_dialog(_('You are not connected to the server'),
|
||||||
|
_('Without a connection you can not publish your contact information.')).get_response()
|
||||||
return
|
return
|
||||||
vcard = self.make_vcard()
|
vcard = self.make_vcard()
|
||||||
nick = ''
|
nick = ''
|
||||||
|
@ -307,7 +308,8 @@ class Vcard_window:
|
||||||
self.xml.get_widget('DESC_textview').get_buffer().set_text('')
|
self.xml.get_widget('DESC_textview').get_buffer().set_text('')
|
||||||
gajim.connections[self.account].request_vcard(self.jid)
|
gajim.connections[self.account].request_vcard(self.jid)
|
||||||
else:
|
else:
|
||||||
Error_dialog(_('You must be connected to get your contact information'))
|
Error_dialog(_('You are not connected to the server'),
|
||||||
|
_('Without a connection, you can not get your contact information.')).get_response()
|
||||||
|
|
||||||
def change_to_vcard(self):
|
def change_to_vcard(self):
|
||||||
self.xml.get_widget('information_notebook').remove_page(0)
|
self.xml.get_widget('information_notebook').remove_page(0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue