src/eric7/Plugins/VcsPlugins/vcsGit/GitSubmodulesSyncDialog.py

Thu, 07 Jul 2022 11:23:56 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 07 Jul 2022 11:23:56 +0200
branch
eric7
changeset 9209
b99e7fd55fd3
parent 8881
eric7/Plugins/VcsPlugins/vcsGit/GitSubmodulesSyncDialog.py@54e42bc2437a
child 9221
bf71ee032bb4
permissions
-rw-r--r--

Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".

# -*- coding: utf-8 -*-

# Copyright (c) 2017 - 2022 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing a dialog to enter submodule synchronization options.
"""

from PyQt6.QtWidgets import QDialog

from .Ui_GitSubmodulesSyncDialog import Ui_GitSubmodulesSyncDialog


class GitSubmodulesSyncDialog(QDialog, Ui_GitSubmodulesSyncDialog):
    """
    Class implementing a dialog to enter submodule synchronization options.
    """
    def __init__(self, submodulePaths, parent=None):
        """
        Constructor
        
        @param submodulePaths list of submodule paths
        @type list of str
        @param parent reference to the parent widget
        @type QWidget
        """
        super().__init__(parent)
        self.setupUi(self)
        
        self.submodulesList.addItems(sorted(submodulePaths))
    
    def getData(self):
        """
        Public method to get the entered data.
        
        @return tuple containing a list of selected submodules and a flag
            indicating a recursive operation
        @rtype tuple of (list of str, bool)
        """
        submodulePaths = []
        for itm in self.submodulesList.selectedItems():
            submodulePaths.append(itm.text())
        
        return submodulePaths, self.recursiveCheckBox.isChecked()

eric ide

mercurial