|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2003 - 2019 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing a dialog to enter the data for a new property. |
|
8 """ |
|
9 |
|
10 from __future__ import unicode_literals |
|
11 |
|
12 from PyQt5.QtWidgets import QDialog, QDialogButtonBox |
|
13 |
|
14 from .Ui_SvnPropDelDialog import Ui_SvnPropDelDialog |
|
15 |
|
16 |
|
17 class SvnPropDelDialog(QDialog, Ui_SvnPropDelDialog): |
|
18 """ |
|
19 Class implementing a dialog to enter the data for a new property. |
|
20 """ |
|
21 def __init__(self, recursive, parent=None): |
|
22 """ |
|
23 Constructor |
|
24 |
|
25 @param recursive flag indicating a recursive set is requested |
|
26 @param parent parent widget (QWidget) |
|
27 """ |
|
28 super(SvnPropDelDialog, self).__init__(parent) |
|
29 self.setupUi(self) |
|
30 |
|
31 self.okButton = self.buttonBox.button(QDialogButtonBox.Ok) |
|
32 self.okButton.setEnabled(False) |
|
33 |
|
34 self.recurseCheckBox.setChecked(recursive) |
|
35 |
|
36 msh = self.minimumSizeHint() |
|
37 self.resize(max(self.width(), msh.width()), msh.height()) |
|
38 |
|
39 def on_propNameEdit_textChanged(self, text): |
|
40 """ |
|
41 Private method used to enable/disable the OK-button. |
|
42 |
|
43 @param text ignored |
|
44 """ |
|
45 self.okButton.setDisabled(text == "") |
|
46 |
|
47 def getData(self): |
|
48 """ |
|
49 Public slot used to retrieve the data entered into the dialog. |
|
50 |
|
51 @return tuple of two values giving the property name and a flag |
|
52 indicating, that this property should be applied recursively. |
|
53 (string, boolean) |
|
54 """ |
|
55 return (self.propNameEdit.text(), |
|
56 self.recurseCheckBox.isChecked()) |