Show a real error box when unable to bind to port

Fixes #1941.
This commit is contained in:
Jean-Marie Traissard 2006-06-05 17:07:48 +00:00
parent 936b99cc3e
commit 9ed43cf6d1
2 changed files with 10 additions and 6 deletions

View File

@ -32,6 +32,7 @@ import os
import struct
import sha
import time
from dialogs import BindPortError
from errno import EWOULDBLOCK
from errno import ENOBUFS
@ -84,12 +85,9 @@ class SocksQueue:
self.listener.bind()
if self.listener.started is False:
self.listener = None
import sys
print >> sys.stderr, '================================================='
print >> sys.stderr, 'Unable to bind to port %s.' % port
print >> sys.stderr, 'Maybe you have another running instance of Gajim.'
print >> sys.stderr, 'File Transfer will be canceled.'
print >> sys.stderr, '================================================='
# We cannot bind port, call error
# dialog from dialogs.py and fail
BindPortError(port)
return None
self.connected += 1
return self.listener

View File

@ -731,6 +731,12 @@ class FileChooserDialog(gtk.FileChooserDialog):
def just_destroy(self, widget):
self.destroy()
class BindPortError(HigDialog):
def __init__(self, port):
ErrorDialog(_('Unable to bind to port %s.' % port),
_('Maybe you have another running instance of Gajim. '
'File Transfer will be canceled.'))
class ConfirmationDialog(HigDialog):
'''HIG compliant confirmation dialog.'''
def __init__(self, pritext, sectext='', on_response_ok = None,