ProjectWeb/Html5ToCss3ConverterParameterDialog.py

Tue, 25 May 2021 20:12:47 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 25 May 2021 20:12:47 +0200
branch
eric7
changeset 38
6a12561fc0b5
parent 35
a3f1dcf94fe4
child 40
a9b17341d181
permissions
-rw-r--r--

Ported the plug-in to PyQt6 for eric7.

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
34
a6d8718f37b5 Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 30
diff changeset
3 # Copyright (c) 2014 - 2021 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
38
6a12561fc0b5 Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 35
diff changeset
10 from PyQt6.QtWidgets import QDialog
1
e3a92a671aa5 Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11
30
38092622e612 Removed support for Python2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 29
diff changeset
12 from .Ui_Html5ToCss3ConverterParameterDialog import (
1
e3a92a671aa5 Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 Ui_Html5ToCss3ConverterParameterDialog
30
38092622e612 Removed support for Python2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 29
diff changeset
14 )
1
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
e3a92a671aa5 Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 class Html5ToCss3ConverterParameterDialog(
e3a92a671aa5 Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 QDialog, Ui_Html5ToCss3ConverterParameterDialog):
e3a92a671aa5 Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 """
e3a92a671aa5 Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 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
21 """
e3a92a671aa5 Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 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
23 """
e3a92a671aa5 Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 Constructor
e3a92a671aa5 Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25
38
6a12561fc0b5 Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 35
diff changeset
26 @param parent reference to the parent widget
6a12561fc0b5 Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 35
diff changeset
27 @type QWidget
1
e3a92a671aa5 Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 """
35
a3f1dcf94fe4 Implemented some code simplifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 34
diff changeset
29 super().__init__(parent)
1
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
38
6a12561fc0b5 Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 35
diff changeset
39 @return tuple of indentation string and a flag indicating to use CSS
6a12561fc0b5 Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 35
diff changeset
40 placeholders
6a12561fc0b5 Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 35
diff changeset
41 @rtype tuple of (str, bool)
1
e3a92a671aa5 Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 """
e3a92a671aa5 Added the 'Web' project type and the HTML5 to CSS3 converter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 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
44 return " " * self.indentationSpinBox.value(), placeholders

eric ide

mercurial