~ubuntu-branches/debian/wheezy/calibre/wheezy

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2010-08-11 11:30:57 UTC
  • mfrom: (1.3.14 upstream)
  • mto: (29.3.2 oneiric)
  • mto: This revision was merged to the branch mainline in revision 31.
  • Revision ID: james.westby@ubuntu.com-20100811113057-2jhbcbavxw7wlt0c
Tags: 0.7.13+dfsg-1
* New upstream version.
* debian/control: Add python-routes recommends. (Closes: #590561)
* Convert to 3.0 (quilt) source format.
* Bump debhelper compat level to 7, and drop now obsolete
  DEB_DH_INSTALL_SOURCEDIR in debian/rules.
* debian/control: Add missing ${misc:Depends}.
* debian/control: Bump Standards-Version to 3.9.1.
* debian/copyright: Replace obsolete reference to
  /usr/share/common-licenses/BSD with their verbatim text from the original
  source.
* debian/rules: Remove invalid hashbang lines from *.recipe, these have no
  __main__.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
from calibre.gui2 import dynamic
7
7
from calibre.gui2.dialogs.confirm_delete_ui import Ui_Dialog
8
 
from PyQt4.Qt import QDialog, SIGNAL, Qt
 
8
from PyQt4.Qt import QDialog, Qt, QPixmap, QIcon
9
9
 
10
10
def _config_name(name):
11
11
    return name + '_again'
18
18
 
19
19
        self.msg.setText(msg)
20
20
        self.name = name
21
 
        self.connect(self.again, SIGNAL('stateChanged(int)'), self.toggle)
 
21
        self.again.stateChanged.connect(self.toggle)
22
22
        self.buttonBox.setFocus(Qt.OtherFocusReason)
23
23
 
24
24
 
25
 
    def toggle(self, x):
 
25
    def toggle(self, *args):
26
26
        dynamic[_config_name(self.name)] = self.again.isChecked()
27
27
 
28
 
def confirm(msg, name, parent=None):
 
28
def confirm(msg, name, parent=None, pixmap='dialog_warning.svg'):
29
29
    if not dynamic.get(_config_name(name), True):
30
30
        return True
31
31
    d = Dialog(msg, name, parent)
 
32
    d.label.setPixmap(QPixmap(I(pixmap)))
 
33
    d.setWindowIcon(QIcon(I(pixmap)))
32
34
    return d.exec_() == d.Accepted