diff options
Diffstat (limited to 'nephilim/connect_wg.py')
-rw-r--r-- | nephilim/connect_wg.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/nephilim/connect_wg.py b/nephilim/connect_wg.py index 8df84f1..9884cd0 100644 --- a/nephilim/connect_wg.py +++ b/nephilim/connect_wg.py @@ -57,7 +57,7 @@ class ConnectWidget(QtGui.QWidget): self.setWindowTitle('Connect to MPD') self.center() - self.connect(self.mpclient, QtCore.SIGNAL('connected'), self.on_connected) + self.mpclient.connect_changed.connect(self.on_connected) def center(self): screen = QtGui.QDesktopWidget().screenGeometry() @@ -78,9 +78,10 @@ class ConnectWidget(QtGui.QWidget): self.mpclient.connect_mpd(host, port, passw) - def on_connected(self): - self.settings.setValue('MPD/host', QVariant(self.host_txt.text())) - self.settings.setValue('MPD/port', QVariant(self.port_txt.text())) - self.settings.setValue('MPD/password', QVariant(self.pass_txt.text())) - self.hide() + def on_connected(self, val): + if val: + self.settings.setValue('MPD/host', QVariant(self.host_txt.text())) + self.settings.setValue('MPD/port', QVariant(self.port_txt.text())) + self.settings.setValue('MPD/password', QVariant(self.pass_txt.text())) + self.hide() |