|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2005 - 2019 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing a dialog for entering a single template variable. |
|
8 """ |
|
9 |
|
10 from __future__ import unicode_literals |
|
11 |
|
12 from PyQt5.QtWidgets import QDialog |
|
13 |
|
14 from .Ui_TemplateSingleVariableDialog import Ui_TemplateSingleVariableDialog |
|
15 |
|
16 |
|
17 class TemplateSingleVariableDialog(QDialog, Ui_TemplateSingleVariableDialog): |
|
18 """ |
|
19 Class implementing a dialog for entering a single template variable. |
|
20 """ |
|
21 def __init__(self, variable, parent=None): |
|
22 """ |
|
23 Constructor |
|
24 |
|
25 @param variable template variable name (string) |
|
26 @param parent parent widget of this dialog (QWidget) |
|
27 """ |
|
28 super(TemplateSingleVariableDialog, self).__init__(parent) |
|
29 self.setupUi(self) |
|
30 |
|
31 self.variableLabel.setText(variable) |
|
32 |
|
33 def getVariable(self): |
|
34 """ |
|
35 Public method to get the value for the variable. |
|
36 |
|
37 @return value for the template variable (string) |
|
38 """ |
|
39 return self.variableEdit.toPlainText() |