diff options
author | Anton Khirnov <wyskas@gmail.com> | 2009-08-31 15:12:45 +0200 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2009-08-31 15:12:45 +0200 |
commit | b674c1a0fbc4612e65139fc0f4f6d0b0a41329cb (patch) | |
tree | eecf9147c0023366cc519608d3ef358d09db1377 /nephilim/connect_wg.py | |
parent | a77aecbee177152d61df3666015bfb6035606779 (diff) |
switch to PyQt4 API v2 for QStrings
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() |