ProjectDjango/DjangoDiffsettingsDataDialog.py

Fri, 31 Dec 2021 13:16:39 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 31 Dec 2021 13:16:39 +0100
branch
eric7
changeset 178
60c87e256fc7
parent 175
30cb5e553e7e
child 180
64339135bd61
permissions
-rw-r--r--

Fixed bug related to detection of django-admin reported in issue 413.

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

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

"""
Module implementing a dialog to enter the data for the 'diffsettings' command.
"""

from PyQt6.QtWidgets import QDialog

from .Ui_DjangoDiffsettingsDataDialog import Ui_DjangoDiffsettingsDataDialog


class DjangoDiffsettingsDataDialog(QDialog, Ui_DjangoDiffsettingsDataDialog):
    """
    Class implementing a dialog to enter the data for the 'diffsettings'
    command.
    """
    def __init__(self, django, parent=None):
        """
        Constructor
        
        @param django reference to the Django project object
        @type Project
        @param parent reference to the parent widget
        @type QWidget
        """
        super().__init__(parent)
        self.setupUi(self)
        
        self.formatComboBox.addItem(self.tr("Hash Format"), "hash")
        self.formatComboBox.addItem(self.tr("Unified Diff"), "unified")
        
        msh = self.minimumSizeHint()
        self.resize(max(self.width(), msh.width()), msh.height())
    
    def getData(self):
        """
        Public method to get the dialog data.
        
        @return tuple containing a flag indicating to show all settings,
            the name of a module containing the default settings and the
            output format
        @rtype tuple of (bool, str, str)
        """
        outputFormat = self.formatComboBox.itemData(
            self.formatComboBox.currentIndex())
        
        return (self.allCheckBox.isChecked(), self.defaultEdit.text(),
                outputFormat)

eric ide

mercurial