|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2017 - 2021 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing a dialog to enter submodule synchronization options. |
|
8 """ |
|
9 |
|
10 from PyQt5.QtWidgets import QDialog |
|
11 |
|
12 from .Ui_GitSubmodulesSyncDialog import Ui_GitSubmodulesSyncDialog |
|
13 |
|
14 |
|
15 class GitSubmodulesSyncDialog(QDialog, Ui_GitSubmodulesSyncDialog): |
|
16 """ |
|
17 Class implementing a dialog to enter submodule synchronization options. |
|
18 """ |
|
19 def __init__(self, submodulePaths, parent=None): |
|
20 """ |
|
21 Constructor |
|
22 |
|
23 @param submodulePaths list of submodule paths |
|
24 @type list of str |
|
25 @param parent reference to the parent widget |
|
26 @type QWidget |
|
27 """ |
|
28 super().__init__(parent) |
|
29 self.setupUi(self) |
|
30 |
|
31 self.submodulesList.addItems(sorted(submodulePaths)) |
|
32 |
|
33 def getData(self): |
|
34 """ |
|
35 Public method to get the entered data. |
|
36 |
|
37 @return tuple containing a list of selected submodules and a flag |
|
38 indicating a recursive operation |
|
39 @rtype tuple of (list of str, bool) |
|
40 """ |
|
41 submodulePaths = [] |
|
42 for itm in self.submodulesList.selectedItems(): |
|
43 submodulePaths.append(itm.text()) |
|
44 |
|
45 return submodulePaths, self.recursiveCheckBox.isChecked() |