~ubuntu-branches/ubuntu/karmic/calibre/karmic

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-30 12:49:41 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730124941-qjdsmri25zt8zocn
Tags: 0.6.3+dfsg-0ubuntu1
* New upstream release. Please see http://calibre.kovidgoyal.net/new_in_6/
  for the list of new features and changes.
* remove_postinstall.patch: Update for new version.
* build_debug.patch: Does not apply any more, disable for now. Might not be
  necessary any more.
* debian/copyright: Fix reference to versionless GPL.
* debian/rules: Drop obsolete dh_desktop call.
* debian/rules: Add workaround for weird Python 2.6 setuptools behaviour of
  putting compiled .so files into src/calibre/plugins/calibre/plugins
  instead of src/calibre/plugins.
* debian/rules: Drop hal fdi moving, new upstream version does not use hal
  any more. Drop hal dependency, too.
* debian/rules: Install udev rules into /lib/udev/rules.d.
* Add debian/calibre.preinst: Remove unmodified
  /etc/udev/rules.d/95-calibre.rules on upgrade.
* debian/control: Bump Python dependencies to 2.6, since upstream needs
  it now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
from calibre.gui2.dialogs.progress_ui import Ui_Dialog
11
11
 
12
12
class ProgressDialog(QDialog, Ui_Dialog):
13
 
    
 
13
 
14
14
    def __init__(self, title, msg='', min=0, max=99, parent=None):
15
15
        QDialog.__init__(self, parent)
16
16
        self.setupUi(self)
22
22
        self.set_max(max)
23
23
        self.bar.setValue(min)
24
24
        self.canceled = False
25
 
        
 
25
 
26
26
        self.connect(self.button_box, SIGNAL('rejected()'), self._canceled)
27
 
        
 
27
 
28
28
    def set_msg(self, msg=''):
29
29
        self.message.setText(msg)
30
 
        
 
30
 
31
31
    def set_value(self, val):
32
32
        self.bar.setValue(val)
33
 
        
 
33
 
 
34
    @dynamic_property
 
35
    def value(self):
 
36
        def fset(self, val):
 
37
            return self.bar.setValue(val)
 
38
        def fget(self):
 
39
            return self.bar.value()
 
40
        return property(fget=fget, fset=fset)
 
41
 
 
42
 
 
43
 
34
44
    def set_min(self, min):
35
45
        self.bar.setMinimum(min)
36
 
        
 
46
 
37
47
    def set_max(self, max):
38
48
        self.bar.setMaximum(max)
39
 
    
 
49
 
40
50
    def _canceled(self, *args):
41
51
        self.canceled = True
42
52
        self.button_box.setDisabled(True)
43
53
        self.title.setText(_('Aborting...'))
44
 
        
 
54
        self.emit(SIGNAL('canceled()'))
 
55
 
45
56
    def keyPressEvent(self, ev):
46
57
        if ev.key() == Qt.Key_Escape:
47
58
            self._canceled()
48
59
        else:
49
 
            QDialog.keyPressEvent(self, ev)
 
 
b'\\ No newline at end of file'
 
60
            QDialog.keyPressEvent(self, ev)