ProjectDjangoTagsMenu/DjangoTagInputDialog.py

changeset 5
e2b08694e945
parent 4
ba04ed0b14a1
child 10
ef5694c0bf3a
equal deleted inserted replaced
4:ba04ed0b14a1 5:e2b08694e945
16 class DjangoTagInputDialog(QDialog): 16 class DjangoTagInputDialog(QDialog):
17 """ 17 """
18 Class implementing a dialog to enter data for the creation of a tag. 18 Class implementing a dialog to enter data for the creation of a tag.
19 """ 19 """
20 def __init__(self, labels, defaults=None, parent=None): 20 def __init__(self, labels, defaults=None, parent=None):
21 """
22 Constructor
23
24 @param labels list of labels for the entry fields (list of string)
25 @param defaults list of default values for the entry fields (list
26 of string)
27 @param parent reference to the parent widget (QWidget)
28 """
21 super(DjangoTagInputDialog, self).__init__(parent) 29 super(DjangoTagInputDialog, self).__init__(parent)
22 30
23 assert 0 < len(labels) < 6 # max 5 entries allowed 31 assert 0 < len(labels) < 6 # max 5 entries allowed
24 self.__inputs = [] 32 self.__inputs = []
25 33
59 @staticmethod 67 @staticmethod
60 def getText(parent, title, labels, defaults=[]): 68 def getText(parent, title, labels, defaults=[]):
61 """ 69 """
62 Static method to create the dialog and return the entered data. 70 Static method to create the dialog and return the entered data.
63 71
72 @param parent reference to the parent widget (QWidget)
73 @param title title of the dialog (string)
74 @param labels list of labels for the entry fields (list of string)
75 @param defaults list of default values for the entry fields (list
76 of string)
64 @return tuple of a tuple containing the text of all entries 77 @return tuple of a tuple containing the text of all entries
65 (tuple of string) and a flag indicating the acceptance 78 (tuple of string) and a flag indicating the acceptance
66 state (boolean) 79 state (boolean)
67 """ 80 """
68 dlg = DjangoTagInputDialog(labels, defaults, parent) 81 dlg = DjangoTagInputDialog(labels, defaults, parent)

eric ide

mercurial