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