ProjectDjango/DjangoDiffsettingsDataDialog.py

changeset 169
b8f263e05c39
parent 168
c6182aab51e9
child 172
ea7980ded4f3
equal deleted inserted replaced
168:c6182aab51e9 169:b8f263e05c39
24 @param django reference to the Django project object 24 @param django reference to the Django project object
25 @type Project 25 @type Project
26 @param parent reference to the parent widget 26 @param parent reference to the parent widget
27 @type QWidget 27 @type QWidget
28 """ 28 """
29 super(DjangoDiffsettingsDataDialog, self).__init__(parent) 29 super().__init__(parent)
30 self.setupUi(self) 30 self.setupUi(self)
31 31
32 self.__version = django.getDjangoVersion() 32 self.formatComboBox.addItem(self.tr("Hash Format"), "hash")
33 if self.__version < (1, 11, 0): 33 self.formatComboBox.addItem(self.tr("Unified Diff"), "unified")
34 self.defaultEdit.setEnabled(False)
35 if self.__version < (2, 0, 0):
36 self.formatComboBox.setEnabled(False)
37 else:
38 self.formatComboBox.addItem(self.tr("Hash Format"), "hash")
39 self.formatComboBox.addItem(self.tr("Unified Diff"), "unified")
40 34
41 msh = self.minimumSizeHint() 35 msh = self.minimumSizeHint()
42 self.resize(max(self.width(), msh.width()), msh.height()) 36 self.resize(max(self.width(), msh.width()), msh.height())
43 37
44 def getData(self): 38 def getData(self):
48 @return tuple containing a flag indicating to show all settings, 42 @return tuple containing a flag indicating to show all settings,
49 the name of a module containing the default settings and the 43 the name of a module containing the default settings and the
50 output format (Django 2.0.0+) 44 output format (Django 2.0.0+)
51 @rtype tuple of (bool, str, str) 45 @rtype tuple of (bool, str, str)
52 """ 46 """
53 if self.__version < (2, 0, 0): 47 outputFormat = self.formatComboBox.itemData(
54 outputFormat = "" 48 self.formatComboBox.currentIndex())
55 else:
56 outputFormat = self.formatComboBox.itemData(
57 self.formatComboBox.currentIndex())
58 49
59 return (self.allCheckBox.isChecked(), self.defaultEdit.text(), 50 return (self.allCheckBox.isChecked(), self.defaultEdit.text(),
60 outputFormat) 51 outputFormat)

eric ide

mercurial