65 """ |
65 """ |
66 data = [input.text().strip() for input in self.__inputs] |
66 data = [input.text().strip() for input in self.__inputs] |
67 return tuple(data) |
67 return tuple(data) |
68 |
68 |
69 @staticmethod |
69 @staticmethod |
70 def getText(parent, title, labels, defaults=[]): |
70 def getText(parent, title, labels, defaults=None): |
71 """ |
71 """ |
72 Public static method to create the dialog and return the entered data. |
72 Public static method to create the dialog and return the entered data. |
73 |
73 |
74 @param parent reference to the parent widget (QWidget) |
74 @param parent reference to the parent widget (QWidget) |
75 @param title title of the dialog (string) |
75 @param title title of the dialog (string) |
78 of string) |
78 of string) |
79 @return tuple of a tuple containing the text of all entries |
79 @return tuple of a tuple containing the text of all entries |
80 (tuple of string) and a flag indicating the acceptance |
80 (tuple of string) and a flag indicating the acceptance |
81 state (boolean) |
81 state (boolean) |
82 """ |
82 """ |
|
83 if defaults is None: |
|
84 defaults = [] |
|
85 |
83 dlg = DjangoTagInputDialog(labels, defaults, parent) |
86 dlg = DjangoTagInputDialog(labels, defaults, parent) |
84 dlg.setWindowTitle(title) |
87 dlg.setWindowTitle(title) |
85 if dlg.exec_() == QDialog.Accepted: |
88 if dlg.exec_() == QDialog.Accepted: |
86 return dlg.getData(), True |
89 return dlg.getData(), True |
87 else: |
90 else: |