~ubuntu-branches/debian/sid/calibre/sid

« back to all changes in this revision

Viewing changes to src/calibre/gui2/dialogs/password.py

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-05-14 18:17:50 UTC
  • mfrom: (1.5.10)
  • Revision ID: package-import@ubuntu.com-20140514181750-xyrxqa47dbw0qfhu
Tags: 1.36.0+dfsg-1
* New upstream release:
  - Fixes editing of metadata (Closes: #741638)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
3
3
import re
4
4
from PyQt4.QtGui import QDialog, QLineEdit
5
 
from PyQt4.QtCore import SIGNAL, Qt
 
5
from PyQt4.QtCore import Qt
6
6
 
7
7
from calibre.gui2.dialogs.password_ui import Ui_Dialog
8
8
from calibre.gui2 import dynamic
17
17
 
18
18
        un = dynamic[self.cfg_key+'__un']
19
19
        pw = dynamic[self.cfg_key+'__pw']
20
 
        if not un: un = ''
21
 
        if not pw: pw = ''
 
20
        if not un:
 
21
            un = ''
 
22
        if not pw:
 
23
            pw = ''
22
24
        self.gui_username.setText(un)
23
25
        self.gui_password.setText(pw)
24
26
        self.sname = name
25
27
        self.msg.setText(msg)
26
 
        self.connect(self.show_password, SIGNAL('stateChanged(int)'), self.toggle_password)
 
28
        self.show_password.stateChanged[(int)].connect(self.toggle_password)
27
29
 
28
30
    def toggle_password(self, state):
29
31
        if state == Qt.Unchecked:
41
43
        dynamic.set(self.cfg_key+'__un', unicode(self.gui_username.text()))
42
44
        dynamic.set(self.cfg_key+'__pw', unicode(self.gui_password.text()))
43
45
        QDialog.accept(self)
 
46