ProjectDjango/DjangoMigrationSelectionDialog.py

changeset 148
4cb7aa43845d
parent 145
104b14713e9e
child 161
208fced62e00
equal deleted inserted replaced
147:17a08bd37c2b 148:4cb7aa43845d
22 class DjangoMigrationSelectionDialog(QDialog, 22 class DjangoMigrationSelectionDialog(QDialog,
23 Ui_DjangoMigrationSelectionDialog): 23 Ui_DjangoMigrationSelectionDialog):
24 """ 24 """
25 Class implementing a dialog to select an application and migration. 25 Class implementing a dialog to select an application and migration.
26 """ 26 """
27 def __init__(self, migrations, migrationRequired=False, parent=None): 27 def __init__(self, migrations, migrationRequired=False, suffix="",
28 parent=None):
28 """ 29 """
29 Constructor 30 Constructor
30 31
31 @param migrations dictionary containing the available migrations 32 @param migrations dictionary containing the available migrations
32 @type dict 33 @type dict
33 @param migrationRequired flag indicating that a migration must be 34 @param migrationRequired flag indicating that a migration must be
34 selected 35 selected
35 @type bool 36 @type bool
37 @param suffix icon suffix
38 @type str
36 @param parent reference to the parent widget 39 @param parent reference to the parent widget
37 @type QWidget 40 @type QWidget
38 """ 41 """
39 super(DjangoMigrationSelectionDialog, self).__init__(parent) 42 super(DjangoMigrationSelectionDialog, self).__init__(parent)
40 self.setupUi(self) 43 self.setupUi(self)
41 44
42 self.__appliedIcon = QIcon(os.path.join( 45 self.__appliedIcon = QIcon(os.path.join(
43 os.path.dirname(__file__), "icons", "applied.png")) 46 os.path.dirname(__file__), "icons", "applied-{0}".format(suffix)
47 ))
44 48
45 self.__migrationRequired = migrationRequired 49 self.__migrationRequired = migrationRequired
46 50
47 self.__migrations = migrations 51 self.__migrations = migrations
48 self.applicationComboBox.addItems(sorted(self.__migrations.keys())) 52 self.applicationComboBox.addItems(sorted(self.__migrations.keys()))

eric ide

mercurial