|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2002 - 2009 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing a dialog to select the zoom scale. |
|
8 """ |
|
9 |
|
10 from PyQt4.QtGui import QDialog |
|
11 |
|
12 from Ui_ZoomDialog import Ui_ZoomDialog |
|
13 |
|
14 class ZoomDialog(QDialog, Ui_ZoomDialog): |
|
15 """ |
|
16 Class implementing a dialog to select the zoom scale. |
|
17 """ |
|
18 def __init__(self, zoom, parent, name = None, modal = False): |
|
19 """ |
|
20 Constructor |
|
21 |
|
22 @param zoom zoom factor to show in the spinbox |
|
23 @param parent parent widget of this dialog (QWidget) |
|
24 @param name name of this dialog (string) |
|
25 """ |
|
26 QDialog.__init__(self, parent) |
|
27 if name: |
|
28 self.setObjectName(name) |
|
29 self.setupUi(self) |
|
30 self.setModal(modal) |
|
31 |
|
32 self.zoomSpinBox.setValue(zoom) |
|
33 self.zoomSpinBox.selectAll() |
|
34 |
|
35 def getZoomSize(self): |
|
36 """ |
|
37 Public method to retrieve the zoom size. |
|
38 |
|
39 @return zoom size (int) |
|
40 """ |
|
41 return self.zoomSpinBox.value() |