test server name in discover services windows. Fixes #4314
This commit is contained in:
parent
f640e7c860
commit
85d5748800
13
src/disco.py
13
src/disco.py
|
@ -61,6 +61,7 @@ import search_window
|
|||
from common import gajim
|
||||
from common import xmpp
|
||||
from common.exceptions import GajimGeneralException
|
||||
from common import helpers
|
||||
|
||||
# Dictionary mapping category, type pairs to browser class, image pairs.
|
||||
# This is a function, so we can call it after the classes are declared.
|
||||
|
@ -692,10 +693,22 @@ _('This type of service does not contain any items to browse.'))
|
|||
if self.address_comboboxentry.get_active() != -1:
|
||||
# user selected one of the entries so do auto-visit
|
||||
jid = self.address_comboboxentry.child.get_text().decode('utf-8')
|
||||
try:
|
||||
jid = helpers.parse_jid(jid)
|
||||
except helpers.InvalidFormat, s:
|
||||
pritext = _('Invalid Server Name')
|
||||
dialogs.ErrorDialog(pritext, str(s))
|
||||
return
|
||||
self.travel(jid, '')
|
||||
|
||||
def on_go_button_clicked(self, widget):
|
||||
jid = self.address_comboboxentry.child.get_text().decode('utf-8')
|
||||
try:
|
||||
jid = helpers.parse_jid(jid)
|
||||
except helpers.InvalidFormat, s:
|
||||
pritext = _('Invalid Server Name')
|
||||
dialogs.ErrorDialog(pritext, str(s))
|
||||
return
|
||||
if jid == self.jid: # jid has not changed
|
||||
return
|
||||
if jid in self.latest_addresses:
|
||||
|
|
Loading…
Reference in New Issue