39 def __init__(self, vcs, parent=None): |
39 def __init__(self, vcs, parent=None): |
40 """ |
40 """ |
41 Constructor |
41 Constructor |
42 |
42 |
43 @param vcs reference to the vcs object |
43 @param vcs reference to the vcs object |
44 @param parent parent widget (QWidget) |
44 @type Subversion |
|
45 @param parent parent widget |
|
46 @type QWidget |
45 """ |
47 """ |
46 super().__init__(parent) |
48 super().__init__(parent) |
47 self.setupUi(self) |
49 self.setupUi(self) |
48 |
50 |
49 self.__toBeCommittedColumn = 0 |
51 self.__toBeCommittedColumn = 0 |
264 path, |
266 path, |
265 ): |
267 ): |
266 """ |
268 """ |
267 Private method to generate a status item in the status list. |
269 Private method to generate a status item in the status list. |
268 |
270 |
269 @param status status indicator (string) |
271 @param status status indicator |
270 @param propStatus property status indicator (string) |
272 @type str |
271 @param locked locked indicator (string) |
273 @param propStatus property status indicator |
272 @param history history indicator (string) |
274 @type str |
273 @param switched switched indicator (string) |
275 @param locked locked indicator |
274 @param lockinfo lock indicator (string) |
276 @type str |
275 @param uptodate up to date indicator (string) |
277 @param history history indicator |
276 @param revision revision string (string) |
278 @type str |
277 @param change revision of last change (string) |
279 @param switched switched indicator |
278 @param author author of the last change (string) |
280 @type str |
279 @param path path of the file or directory (string) |
281 @param lockinfo lock indicator |
|
282 @type str |
|
283 @param uptodate up to date indicator |
|
284 @type str |
|
285 @param revision revision string |
|
286 @type str |
|
287 @param change revision of last change |
|
288 @type str |
|
289 @param author author of the last change |
|
290 @type str |
|
291 @param path path of the file or directory |
|
292 @type str |
280 """ |
293 """ |
281 if ( |
294 if ( |
282 self.__nonverbose |
295 self.__nonverbose |
283 and status == " " |
296 and status == " " |
284 and propStatus == " " |
297 and propStatus == " " |
356 |
369 |
357 def closeEvent(self, e): |
370 def closeEvent(self, e): |
358 """ |
371 """ |
359 Protected slot implementing a close event handler. |
372 Protected slot implementing a close event handler. |
360 |
373 |
361 @param e close event (QCloseEvent) |
374 @param e close event |
|
375 @type QCloseEvent |
362 """ |
376 """ |
363 if ( |
377 if ( |
364 self.process is not None |
378 self.process is not None |
365 and self.process.state() != QProcess.ProcessState.NotRunning |
379 and self.process.state() != QProcess.ProcessState.NotRunning |
366 ): |
380 ): |
373 def start(self, fn): |
387 def start(self, fn): |
374 """ |
388 """ |
375 Public slot to start the svn status command. |
389 Public slot to start the svn status command. |
376 |
390 |
377 @param fn filename(s)/directoryname(s) to show the status of |
391 @param fn filename(s)/directoryname(s) to show the status of |
378 (string or list of strings) |
392 @type str or list of str |
379 """ |
393 """ |
380 self.errorGroup.hide() |
394 self.errorGroup.hide() |
381 self.intercept = False |
395 self.intercept = False |
382 self.args = fn |
396 self.args = fn |
383 |
397 |
514 |
528 |
515 def on_buttonBox_clicked(self, button): |
529 def on_buttonBox_clicked(self, button): |
516 """ |
530 """ |
517 Private slot called by a button of the button box clicked. |
531 Private slot called by a button of the button box clicked. |
518 |
532 |
519 @param button button that was clicked (QAbstractButton) |
533 @param button button that was clicked |
|
534 @type QAbstractButton |
520 """ |
535 """ |
521 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): |
536 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): |
522 self.close() |
537 self.close() |
523 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): |
538 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): |
524 self.__finish() |
539 self.__finish() |
528 @pyqtSlot(int, QProcess.ExitStatus) |
543 @pyqtSlot(int, QProcess.ExitStatus) |
529 def __procFinished(self, exitCode, exitStatus): |
544 def __procFinished(self, exitCode, exitStatus): |
530 """ |
545 """ |
531 Private slot connected to the finished signal. |
546 Private slot connected to the finished signal. |
532 |
547 |
533 @param exitCode exit code of the process (integer) |
548 @param exitCode exit code of the process |
534 @param exitStatus exit status of the process (QProcess.ExitStatus) |
549 @type int |
|
550 @param exitStatus exit status of the process |
|
551 @type QProcess.ExitStatus |
535 """ |
552 """ |
536 self.__finish() |
553 self.__finish() |
537 |
554 |
538 def __readStdout(self): |
555 def __readStdout(self): |
539 """ |
556 """ |
617 |
634 |
618 def on_passwordCheckBox_toggled(self, isOn): |
635 def on_passwordCheckBox_toggled(self, isOn): |
619 """ |
636 """ |
620 Private slot to handle the password checkbox toggled. |
637 Private slot to handle the password checkbox toggled. |
621 |
638 |
622 @param isOn flag indicating the status of the check box (boolean) |
639 @param isOn flag indicating the status of the check box |
|
640 @type bool |
623 """ |
641 """ |
624 if isOn: |
642 if isOn: |
625 self.input.setEchoMode(QLineEdit.EchoMode.Password) |
643 self.input.setEchoMode(QLineEdit.EchoMode.Password) |
626 else: |
644 else: |
627 self.input.setEchoMode(QLineEdit.EchoMode.Normal) |
645 self.input.setEchoMode(QLineEdit.EchoMode.Normal) |
714 @pyqtSlot(QTreeWidgetItem, int) |
733 @pyqtSlot(QTreeWidgetItem, int) |
715 def on_statusList_itemChanged(self, item, column): |
734 def on_statusList_itemChanged(self, item, column): |
716 """ |
735 """ |
717 Private slot to act upon item changes. |
736 Private slot to act upon item changes. |
718 |
737 |
719 @param item reference to the changed item (QTreeWidgetItem) |
738 @param item reference to the changed item |
720 @param column index of column that changed (integer) |
739 @type QTreeWidgetItem |
|
740 @param column index of column that changed |
|
741 @type int |
721 """ |
742 """ |
722 if column == self.__toBeCommittedColumn: |
743 if column == self.__toBeCommittedColumn: |
723 self.__updateCommitButton() |
744 self.__updateCommitButton() |
724 |
745 |
725 @pyqtSlot() |
746 @pyqtSlot() |
1044 self.vcs.svnAddToChangelist(names) |
1066 self.vcs.svnAddToChangelist(names) |
1045 self.on_refreshButton_clicked() |
1067 self.on_refreshButton_clicked() |
1046 |
1068 |
1047 def __removeFromChangelist(self): |
1069 def __removeFromChangelist(self): |
1048 """ |
1070 """ |
1049 Private slot to remove entries from their changelists. |
1071 Private slot to remove entries from their change lists. |
1050 """ |
1072 """ |
1051 names = [ |
1073 names = [ |
1052 os.path.join(self.dname, itm.text(self.__pathColumn)) |
1074 os.path.join(self.dname, itm.text(self.__pathColumn)) |
1053 for itm in self.__getChangelistItems() |
1075 for itm in self.__getChangelistItems() |
1054 ] |
1076 ] |
1068 def __getCommitableItems(self): |
1090 def __getCommitableItems(self): |
1069 """ |
1091 """ |
1070 Private method to retrieve all entries the user wants to commit. |
1092 Private method to retrieve all entries the user wants to commit. |
1071 |
1093 |
1072 @return list of all items, the user has checked |
1094 @return list of all items, the user has checked |
|
1095 @rtype list of QTreeWidgetItem |
1073 """ |
1096 """ |
1074 commitableItems = [] |
1097 commitableItems = [] |
1075 for index in range(self.statusList.topLevelItemCount()): |
1098 for index in range(self.statusList.topLevelItemCount()): |
1076 itm = self.statusList.topLevelItem(index) |
1099 itm = self.statusList.topLevelItem(index) |
1077 if itm.checkState(self.__toBeCommittedColumn) == Qt.CheckState.Checked: |
1100 if itm.checkState(self.__toBeCommittedColumn) == Qt.CheckState.Checked: |
1081 def __getModifiedItems(self): |
1104 def __getModifiedItems(self): |
1082 """ |
1105 """ |
1083 Private method to retrieve all entries, that have a modified status. |
1106 Private method to retrieve all entries, that have a modified status. |
1084 |
1107 |
1085 @return list of all items with a modified status |
1108 @return list of all items with a modified status |
|
1109 @rtype list of QTreeWidgetItem |
1086 """ |
1110 """ |
1087 modifiedItems = [] |
1111 modifiedItems = [] |
1088 for itm in self.statusList.selectedItems(): |
1112 for itm in self.statusList.selectedItems(): |
1089 if ( |
1113 if ( |
1090 itm.text(self.__statusColumn) in self.modifiedIndicators |
1114 itm.text(self.__statusColumn) in self.modifiedIndicators |
1097 """ |
1121 """ |
1098 Private method to retrieve all entries, that have an unversioned |
1122 Private method to retrieve all entries, that have an unversioned |
1099 status. |
1123 status. |
1100 |
1124 |
1101 @return list of all items with an unversioned status |
1125 @return list of all items with an unversioned status |
|
1126 @rtype list of QTreeWidgetItem |
1102 """ |
1127 """ |
1103 unversionedItems = [] |
1128 unversionedItems = [] |
1104 for itm in self.statusList.selectedItems(): |
1129 for itm in self.statusList.selectedItems(): |
1105 if itm.text(self.__statusColumn) in self.unversionedIndicators: |
1130 if itm.text(self.__statusColumn) in self.unversionedIndicators: |
1106 unversionedItems.append(itm) |
1131 unversionedItems.append(itm) |
1109 def __getMissingItems(self): |
1134 def __getMissingItems(self): |
1110 """ |
1135 """ |
1111 Private method to retrieve all entries, that have a missing status. |
1136 Private method to retrieve all entries, that have a missing status. |
1112 |
1137 |
1113 @return list of all items with a missing status |
1138 @return list of all items with a missing status |
|
1139 @rtype list of QTreeWidgetItem |
1114 """ |
1140 """ |
1115 missingItems = [] |
1141 missingItems = [] |
1116 for itm in self.statusList.selectedItems(): |
1142 for itm in self.statusList.selectedItems(): |
1117 if itm.text(self.__statusColumn) in self.missingIndicators: |
1143 if itm.text(self.__statusColumn) in self.missingIndicators: |
1118 missingItems.append(itm) |
1144 missingItems.append(itm) |
1120 |
1146 |
1121 def __getLockActionItems(self, indicators): |
1147 def __getLockActionItems(self, indicators): |
1122 """ |
1148 """ |
1123 Private method to retrieve all emtries, that have a locked status. |
1149 Private method to retrieve all emtries, that have a locked status. |
1124 |
1150 |
1125 @param indicators list of indicators to check against (list of strings) |
1151 @param indicators list of indicators to check against |
|
1152 @type list of str |
1126 @return list of all items with a locked status |
1153 @return list of all items with a locked status |
|
1154 @rtype list of QTreeWidgetItem |
1127 """ |
1155 """ |
1128 lockitems = [] |
1156 lockitems = [] |
1129 for itm in self.statusList.selectedItems(): |
1157 for itm in self.statusList.selectedItems(): |
1130 if itm.text(self.__lockinfoColumn) in indicators: |
1158 if itm.text(self.__lockinfoColumn) in indicators: |
1131 lockitems.append(itm) |
1159 lockitems.append(itm) |
1135 """ |
1163 """ |
1136 Private method to retrieve all entries, that are members of |
1164 Private method to retrieve all entries, that are members of |
1137 a changelist. |
1165 a changelist. |
1138 |
1166 |
1139 @return list of all items belonging to a changelist |
1167 @return list of all items belonging to a changelist |
|
1168 @rtype list of QTreeWidgetItem |
1140 """ |
1169 """ |
1141 clitems = [] |
1170 clitems = [] |
1142 for itm in self.statusList.selectedItems(): |
1171 for itm in self.statusList.selectedItems(): |
1143 if itm.text(self.__changelistColumn) != "": |
1172 if itm.text(self.__changelistColumn) != "": |
1144 clitems.append(itm) |
1173 clitems.append(itm) |
1148 """ |
1177 """ |
1149 Private method to retrieve all entries, that are not members of |
1178 Private method to retrieve all entries, that are not members of |
1150 a changelist. |
1179 a changelist. |
1151 |
1180 |
1152 @return list of all items not belonging to a changelist |
1181 @return list of all items not belonging to a changelist |
|
1182 @rtype list of QTreeWidgetItem |
1153 """ |
1183 """ |
1154 clitems = [] |
1184 clitems = [] |
1155 for itm in self.statusList.selectedItems(): |
1185 for itm in self.statusList.selectedItems(): |
1156 if itm.text(self.__changelistColumn) == "": |
1186 if itm.text(self.__changelistColumn) == "": |
1157 clitems.append(itm) |
1187 clitems.append(itm) |
1159 |
1189 |
1160 def __commitSelect(self, selected): |
1190 def __commitSelect(self, selected): |
1161 """ |
1191 """ |
1162 Private slot to select or deselect all entries. |
1192 Private slot to select or deselect all entries. |
1163 |
1193 |
1164 @param selected commit selection state to be set (boolean) |
1194 @param selected commit selection state to be set |
|
1195 @type bool |
1165 """ |
1196 """ |
1166 for index in range(self.statusList.topLevelItemCount()): |
1197 for index in range(self.statusList.topLevelItemCount()): |
1167 itm = self.statusList.topLevelItem(index) |
1198 itm = self.statusList.topLevelItem(index) |
1168 if ( |
1199 if ( |
1169 itm.flags() & Qt.ItemFlag.ItemIsUserCheckable |
1200 itm.flags() & Qt.ItemFlag.ItemIsUserCheckable |