Wed, 31 Dec 2014 19:16:39 +0100
A little improvement to the HTML5 to CSS3 conversion parameter dialog.
1
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
3 | # Copyright (c) 2014 Detlev Offenbach <detlev@die-offenbachs.de> |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing a dialog to enter the CSS conversion parameters. |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | from PyQt5.QtWidgets import QDialog |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | from .Ui_Html5ToCss3ConverterParameterDialog import \ |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | Ui_Html5ToCss3ConverterParameterDialog |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | class Html5ToCss3ConverterParameterDialog( |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | QDialog, Ui_Html5ToCss3ConverterParameterDialog): |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | """ |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | Class implementing a dialog to enter the CSS conversion parameters. |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | """ |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | def __init__(self, parent=None): |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | """ |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | Constructor |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | @param parent reference to the parent widget (QWidget) |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | """ |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | super(Html5ToCss3ConverterParameterDialog, self).__init__(parent) |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | self.setupUi(self) |
2
917f93fc61dd
A little improvement to the HTML5 to CSS3 conversion parameter dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1
diff
changeset
|
29 | |
917f93fc61dd
A little improvement to the HTML5 to CSS3 conversion parameter dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1
diff
changeset
|
30 | msh = self.minimumSizeHint() |
917f93fc61dd
A little improvement to the HTML5 to CSS3 conversion parameter dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1
diff
changeset
|
31 | self.resize(max(self.width(), msh.width()), msh.height()) |
1
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | def getData(self): |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | """ |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | Public method to get the entered data. |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | @return tuple of indentation string (string) and a flag indicating to |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | use CSS placeholders (boolean) |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | """ |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | placeholders = self.placeholderComboBox.currentIndex() == 1 |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | return " " * self.indentationSpinBox.value(), placeholders |