Wed, 01 Jan 2020 11:58:59 +0100
Updated copyright for 2020.
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 | |
29
38577502d613
Updated copyright for 2020.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
28
diff
changeset
|
3 | # Copyright (c) 2014 - 2020 Detlev Offenbach <detlev@die-offenbachs.de> |
1
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 | |
5
31bc1ef6f624
Added the HTML prettifier.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4
diff
changeset
|
10 | from __future__ import unicode_literals |
31bc1ef6f624
Added the HTML prettifier.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4
diff
changeset
|
11 | |
1
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | 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
|
13 | |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | 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
|
15 | Ui_Html5ToCss3ConverterParameterDialog |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | class Html5ToCss3ConverterParameterDialog( |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | QDialog, Ui_Html5ToCss3ConverterParameterDialog): |
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 | 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
|
22 | """ |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | 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
|
24 | """ |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | Constructor |
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 | @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
|
28 | """ |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | 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
|
30 | 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
|
31 | |
917f93fc61dd
A little improvement to the HTML5 to CSS3 conversion parameter dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1
diff
changeset
|
32 | 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
|
33 | 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
|
34 | |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | def getData(self): |
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 | 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
|
38 | |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | @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
|
40 | 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
|
41 | """ |
e3a92a671aa5
Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | 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
|
43 | return " " * self.indentationSpinBox.value(), placeholders |