Project/RccCompilerOptionsDialog.py

branch
maintenance
changeset 6646
51eefa621de4
parent 6645
ad476851d7e0
equal deleted inserted replaced
6603:77189681b787 6646:51eefa621de4
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2018 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing a dialog to enter some non-common rcc compiler options.
8 """
9
10 from __future__ import unicode_literals
11
12 from PyQt5.QtWidgets import QDialog
13
14 from .Ui_RccCompilerOptionsDialog import Ui_RccCompilerOptionsDialog
15
16
17 class RccCompilerOptionsDialog(QDialog, Ui_RccCompilerOptionsDialog):
18 """
19 Class implementing a dialog to enter some non-common rcc compiler options.
20 """
21 def __init__(self, compilerOptions, parent=None):
22 """
23 Constructor
24
25 @param compilerOptions dictionary containing the rcc compiler options
26 @type dict
27 @param parent reference to the parent widget
28 @type QWidget
29 """
30 super(RccCompilerOptionsDialog, self).__init__(parent)
31 self.setupUi(self)
32
33 self.thresholdSpinBox.setValue(compilerOptions["CompressionThreshold"])
34 self.compressionSpinBox.setValue(compilerOptions["CompressLevel"])
35 self.disableCheckBox.setChecked(compilerOptions["CompressionDisable"])
36 self.rootEdit.setText(compilerOptions["PathPrefix"])
37
38 msh = self.minimumSizeHint()
39 self.resize(max(self.width(), msh.width()), msh.height())
40
41 def getData(self):
42 """
43 Public method to get the entered data.
44
45 @return tuple containing the compression threshold, compression level,
46 flag indicating to disable compression and the resource access path
47 prefix
48 @rtype tuple of (int, int, bool, str)
49 """
50 return (
51 self.thresholdSpinBox.value(),
52 self.compressionSpinBox.value(),
53 self.disableCheckBox.isChecked(),
54 self.rootEdit.text().strip(),
55 )

eric ide

mercurial