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