13 import os |
13 import os |
14 import sys |
14 import sys |
15 |
15 |
16 import pysvn |
16 import pysvn |
17 |
17 |
18 from PyQt5.QtCore import QMutexLocker, Qt |
18 from PyQt5.QtCore import pyqtSlot, QMutexLocker, Qt |
19 from PyQt5.QtWidgets import QWidget, QHeaderView, QApplication, \ |
19 from PyQt5.QtWidgets import QWidget, QHeaderView, QApplication, \ |
20 QDialogButtonBox, QTreeWidgetItem |
20 QDialogButtonBox, QTreeWidgetItem |
21 |
21 |
22 from .SvnDialogMixin import SvnDialogMixin |
22 from .SvnDialogMixin import SvnDialogMixin |
23 from .Ui_SvnPropListDialog import Ui_SvnPropListDialog |
23 from .Ui_SvnPropListDialog import Ui_SvnPropListDialog |
37 """ |
37 """ |
38 super(SvnPropListDialog, self).__init__(parent) |
38 super(SvnPropListDialog, self).__init__(parent) |
39 self.setupUi(self) |
39 self.setupUi(self) |
40 SvnDialogMixin.__init__(self) |
40 SvnDialogMixin.__init__(self) |
41 |
41 |
|
42 self.refreshButton = \ |
|
43 self.buttonBox.addButton(self.tr("Refresh"), |
|
44 QDialogButtonBox.ActionRole) |
|
45 self.refreshButton.setToolTip( |
|
46 self.tr("Press to refresh the properties display")) |
|
47 self.refreshButton.setEnabled(False) |
42 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
48 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
43 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
49 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
44 |
50 |
45 self.vcs = vcs |
51 self.vcs = vcs |
46 |
52 |
86 |
92 |
87 @param fn filename(s) (string or list of strings) |
93 @param fn filename(s) (string or list of strings) |
88 @param recursive flag indicating a recursive list is requested |
94 @param recursive flag indicating a recursive list is requested |
89 """ |
95 """ |
90 self.errorGroup.hide() |
96 self.errorGroup.hide() |
|
97 |
|
98 self.propsList.clear() |
|
99 |
|
100 self.__args = fn |
|
101 self.__recursive = recursive |
|
102 |
|
103 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
|
104 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True) |
|
105 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
|
106 self.refreshButton.setEnabled(False) |
91 |
107 |
92 QApplication.processEvents() |
108 QApplication.processEvents() |
93 self.propsFound = False |
109 self.propsFound = False |
94 if isinstance(fn, list): |
110 if isinstance(fn, list): |
95 dname, fnames = self.vcs.splitPathList(fn) |
111 dname, fnames = self.vcs.splitPathList(fn) |
140 |
156 |
141 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
157 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
142 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
158 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
143 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
159 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
144 |
160 |
|
161 self.refreshButton.setEnabled(True) |
|
162 |
145 self._cancel() |
163 self._cancel() |
146 |
164 |
147 def on_buttonBox_clicked(self, button): |
165 def on_buttonBox_clicked(self, button): |
148 """ |
166 """ |
149 Private slot called by a button of the button box clicked. |
167 Private slot called by a button of the button box clicked. |
152 """ |
170 """ |
153 if button == self.buttonBox.button(QDialogButtonBox.Close): |
171 if button == self.buttonBox.button(QDialogButtonBox.Close): |
154 self.close() |
172 self.close() |
155 elif button == self.buttonBox.button(QDialogButtonBox.Cancel): |
173 elif button == self.buttonBox.button(QDialogButtonBox.Cancel): |
156 self.__finish() |
174 self.__finish() |
|
175 elif button == self.refreshButton: |
|
176 self.on_refreshButton_clicked() |
|
177 |
|
178 @pyqtSlot() |
|
179 def on_refreshButton_clicked(self): |
|
180 """ |
|
181 Private slot to refresh the status display. |
|
182 """ |
|
183 self.start(self.__args, recursive=self.__recursive) |
157 |
184 |
158 def __showError(self, msg): |
185 def __showError(self, msg): |
159 """ |
186 """ |
160 Private slot to show an error message. |
187 Private slot to show an error message. |
161 |
188 |