12 import os |
12 import os |
13 |
13 |
14 import pysvn |
14 import pysvn |
15 |
15 |
16 from PyQt4.QtCore import pyqtSlot, Qt, QMutexLocker |
16 from PyQt4.QtCore import pyqtSlot, Qt, QMutexLocker |
17 from PyQt4.QtGui import QDialog, QDialogButtonBox, QListWidgetItem, QApplication, \ |
17 from PyQt4.QtGui import QDialog, QDialogButtonBox, QListWidgetItem, \ |
18 QCursor |
18 QApplication, QCursor |
19 |
19 |
20 from .SvnDialogMixin import SvnDialogMixin |
20 from .SvnDialogMixin import SvnDialogMixin |
21 |
21 |
22 from .Ui_SvnChangeListsDialog import Ui_SvnChangeListsDialog |
22 from .Ui_SvnChangeListsDialog import Ui_SvnChangeListsDialog |
23 |
23 |
60 """ |
60 """ |
61 self.filesList.clear() |
61 self.filesList.clear() |
62 if current is not None: |
62 if current is not None: |
63 changelist = current.text() |
63 changelist = current.text() |
64 if changelist in self.changeListsDict: |
64 if changelist in self.changeListsDict: |
65 self.filesList.addItems(sorted(self.changeListsDict[changelist])) |
65 self.filesList.addItems( |
|
66 sorted(self.changeListsDict[changelist])) |
66 |
67 |
67 def start(self, path): |
68 def start(self, path): |
68 """ |
69 """ |
69 Public slot to populate the data. |
70 Public slot to populate the data. |
70 |
71 |
71 @param path directory name to show change lists for (string) |
72 @param path directory name to show change lists for (string) |
72 """ |
73 """ |
73 self.changeListsDict = {} |
74 self.changeListsDict = {} |
74 self.cancelled = False |
75 self.cancelled = False |
75 |
76 |
76 self.filesLabel.setText(self.trUtf8("Files (relative to {0}):").format(path)) |
77 self.filesLabel.setText( |
|
78 self.trUtf8("Files (relative to {0}):").format(path)) |
77 |
79 |
78 QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) |
80 QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) |
79 QApplication.processEvents() |
81 QApplication.processEvents() |
80 |
82 |
81 locker = QMutexLocker(self.vcs.vcsExecutionMutex) |
83 locker = QMutexLocker(self.vcs.vcsExecutionMutex) |
82 try: |
84 try: |
83 entries = self.client.get_changelist(path, depth=pysvn.depth.infinity) |
85 entries = self.client.get_changelist( |
|
86 path, depth=pysvn.depth.infinity) |
84 for entry in entries: |
87 for entry in entries: |
85 file = entry[0] |
88 file = entry[0] |
86 changelist = entry[1] |
89 changelist = entry[1] |
87 if changelist not in self.changeListsDict: |
90 if changelist not in self.changeListsDict: |
88 self.changeListsDict[changelist] = [] |
91 self.changeListsDict[changelist] = [] |
105 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
108 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
106 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
109 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
107 |
110 |
108 if len(self.changeListsDict) == 0: |
111 if len(self.changeListsDict) == 0: |
109 self.changeLists.addItem(self.trUtf8("No changelists found")) |
112 self.changeLists.addItem(self.trUtf8("No changelists found")) |
110 self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) |
113 self.buttonBox.button(QDialogButtonBox.Close).setFocus( |
|
114 Qt.OtherFocusReason) |
111 else: |
115 else: |
112 self.changeLists.setCurrentRow(0) |
116 self.changeLists.setCurrentRow(0) |
113 self.changeLists.setFocus(Qt.OtherFocusReason) |
117 self.changeLists.setFocus(Qt.OtherFocusReason) |
114 |
118 |
115 def on_buttonBox_clicked(self, button): |
119 def on_buttonBox_clicked(self, button): |