|
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 |
|
13 |
|
14 from E5Gui.E5PathPicker import E5PathPickerModes |
|
15 |
|
16 from .Ui_SvnPropSetDialog import Ui_SvnPropSetDialog |
|
17 |
|
18 |
|
19 class SvnPropSetDialog(QDialog, Ui_SvnPropSetDialog): |
|
20 """ |
|
21 Class implementing a dialog to enter the data for a new property. |
|
22 """ |
|
23 def __init__(self, parent=None): |
|
24 """ |
|
25 Constructor |
|
26 |
|
27 @param parent parent widget (QWidget) |
|
28 """ |
|
29 super(SvnPropSetDialog, self).__init__(parent) |
|
30 self.setupUi(self) |
|
31 |
|
32 self.propFilePicker.setMode(E5PathPickerModes.OpenFileMode) |
|
33 |
|
34 def getData(self): |
|
35 """ |
|
36 Public slot used to retrieve the data entered into the dialog. |
|
37 |
|
38 @return tuple of three values giving the property name, a flag |
|
39 indicating a file was selected and the text of the property |
|
40 or the selected filename. (string, boolean, string) |
|
41 """ |
|
42 if self.fileRadioButton.isChecked(): |
|
43 return (self.propNameEdit.text(), True, self.propFilePicker.text()) |
|
44 else: |
|
45 return (self.propNameEdit.text(), False, |
|
46 self.propTextEdit.toPlainText()) |