1
0

network_dialog: do not use parent for signalling

This commit is contained in:
ThomasV
2017-07-08 15:35:48 +02:00
parent 5ae5c81c48
commit dd50259f68
3 changed files with 11 additions and 12 deletions

View File

@@ -38,21 +38,20 @@ protocol_names = ['TCP', 'SSL']
protocol_letters = 'ts'
class NetworkDialog(QDialog):
def __init__(self, network, config, parent):
QDialog.__init__(self, parent)
def __init__(self, network, config):
QDialog.__init__(self)
self.setWindowTitle(_('Network'))
self.setMinimumSize(400, 20)
self.nlayout = NetworkChoiceLayout(network, config)
vbox = QVBoxLayout(self)
vbox.addLayout(self.nlayout.layout())
vbox.addLayout(Buttons(CloseButton(self)))
self.connect(parent, QtCore.SIGNAL('updated'), self.on_update)
def do_exec(self):
result = self.exec_()
#if result:
# self.nlayout.accept()
return result
self.connect(self, QtCore.SIGNAL('updated'), self.on_update)
network.register_callback(self.on_network, ['updated'])
def on_network(self, event, *args):
self.emit(QtCore.SIGNAL('updated'), event, *args)
def on_update(self):
self.nlayout.update()