59 errMsg = self.tr( |
59 errMsg = self.tr( |
60 "The pcreate command did not finish within 30s.") |
60 "The pcreate command did not finish within 30s.") |
61 else: |
61 else: |
62 errMsg = self.tr("Could not start the pcreate executable.") |
62 errMsg = self.tr("Could not start the pcreate executable.") |
63 if not errMsg: |
63 if not errMsg: |
64 scaffolds = output.splitlines() |
64 lines = output.splitlines() |
65 self.scaffoldCombo.addItem("") |
65 self.scaffoldCombo.addItem("") |
66 for scaffold in sorted(scaffolds[1:]): |
66 for line in sorted(lines[1:]): |
67 self.scaffoldCombo.addItem(scaffold.strip()) |
67 self.scaffoldCombo.addItem( |
|
68 self.__prepareScaffoldString(line)) |
68 self.scaffoldCombo.setCurrentIndex(0) |
69 self.scaffoldCombo.setCurrentIndex(0) |
69 else: |
70 else: |
70 E5MessageBox.critical( |
71 E5MessageBox.critical( |
71 None, |
72 None, |
72 self.tr('Process Generation Error'), |
73 self.tr('Process Generation Error'), |
100 self.__okButton.setEnabled( |
101 self.__okButton.setEnabled( |
101 bool(self.scaffoldCombo.currentText()) and |
102 bool(self.scaffoldCombo.currentText()) and |
102 bool(self.nameEdit.text()) |
103 bool(self.nameEdit.text()) |
103 ) |
104 ) |
104 |
105 |
|
106 def __prepareScaffoldString(self, line): |
|
107 """ |
|
108 Private method to prepare a scaffold string for the combo box. |
|
109 |
|
110 @param line output line containing the scaffold name and some |
|
111 explanatory text |
|
112 @type str |
|
113 @return prepared scaffold text |
|
114 @rtype str |
|
115 """ |
|
116 parts = [part.strip() for part in line.split(":", 1)] |
|
117 return self.tr("{0} ({1})", "scaffold name, explanatory text")\ |
|
118 .format(*parts) |
|
119 |
105 def getData(self): |
120 def getData(self): |
106 """ |
121 """ |
107 Public method to get the data. |
122 Public method to get the data. |
108 |
123 |
109 @return tuple giving the scaffold (string), the project name (string), |
124 @return tuple giving the scaffold (string), the project name (string), |