This commit is contained in:
Kovid Goyal 2012-08-01 15:39:46 +05:30
parent 86d858488c
commit e63d76a300
2 changed files with 9 additions and 12 deletions

View File

@ -1,8 +1,11 @@
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
from PyQt4.QtGui import QDialog, QLineEdit
from PyQt4.QtCore import SIGNAL, Qt
from PyQt4.Qt import (QDialog, QLineEdit, Qt)
from calibre.gui2.dialogs.smartdevice_ui import Ui_Dialog
@ -24,7 +27,7 @@ class SmartdeviceDialog(QDialog, Ui_Dialog):
'smart device interface when calibre starts. You should not do '
'this if you are using a network that is not secure and you '
'are not setting a password.') + '</p>')
self.connect(self.show_password, SIGNAL('stateChanged(int)'), self.toggle_password)
self.show_password.stateChanged[int].connect(self.toggle_password)
self.device_manager = parent.device_manager
@ -34,6 +37,7 @@ class SmartdeviceDialog(QDialog, Ui_Dialog):
pw = self.device_manager.get_option('smartdevice', 'password')
if pw:
self.password_box.setText(pw)
self.resize(self.sizeHint())
def toggle_password(self, state):
if state == Qt.Unchecked:

View File

@ -71,7 +71,7 @@
</property>
</widget>
</item>
<item row="5" column="0" colspan="3">
<item row="4" column="0" colspan="3">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -81,20 +81,13 @@
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<item row="3" column="1" colspan="2">
<widget class="QCheckBox" name="autostart_box">
<property name="text">
<string>&amp;Automatically allow connections at startup</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QCheckBox" name="run_box">
<property name="text">
<string>&amp;Allow connections</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources>