207 int row = curTable->rowCount(); |
207 int row = curTable->rowCount(); |
208 QTableWidgetItem * nameCell = new QTableWidgetItem(HWApplication::translate("binds", cbinds[i].name)); |
208 QTableWidgetItem * nameCell = new QTableWidgetItem(HWApplication::translate("binds", cbinds[i].name)); |
209 curTable->insertRow(row); |
209 curTable->insertRow(row); |
210 curTable->setItem(row, 0, nameCell); |
210 curTable->setItem(row, 0, nameCell); |
211 QTableWidgetItem * bindCell; |
211 QTableWidgetItem * bindCell; |
212 // Check if the bind text is bad. This was discovered after the 1.0.0, |
212 if (cbinds[i].action != "!MULTI") |
213 // so we need a little workaround. |
|
214 bool is_broken_strbind = cbinds[i].strbind == "precise + switch + toggle hedgehog tags"; |
|
215 // ^ should be "precise + switch + toggle team bars" |
|
216 // TODO: Remove is_broken_strbind after 1.0.0 release. |
|
217 if (cbinds[i].action != "!MULTI" && (!is_broken_strbind)) |
|
218 { |
213 { |
219 bindCell = new QTableWidgetItem(comboBox->currentText()); |
214 bindCell = new QTableWidgetItem(comboBox->currentText()); |
220 nameCell->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); |
215 nameCell->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); |
221 bindCell->setIcon(*dropDownIcon); |
216 bindCell->setIcon(*dropDownIcon); |
222 bindCell->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); |
217 bindCell->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); |
223 } |
218 } |
224 else |
219 else |
225 { |
220 { |
226 // Apply workaround for the broken 1.0.0 strbind |
221 bindCell = new QTableWidgetItem(HWApplication::translate("binds (combination)", cbinds[i].strbind.toUtf8().constData())); |
227 // TODO: Remove the workaround after 1.0.0 release and fix binds.cpp accordingly. |
|
228 if (is_broken_strbind) |
|
229 { |
|
230 // We simply construct the string from other strings we *do* have. :-) |
|
231 QString cellText = |
|
232 HWApplication::translate("binds", "precise aim") + " + " + |
|
233 HWApplication::translate("binds", "switch") + " + " + |
|
234 HWApplication::translate("binds", "toggle team bars"); |
|
235 bindCell = new QTableWidgetItem(cellText); |
|
236 } |
|
237 else |
|
238 bindCell = new QTableWidgetItem(HWApplication::translate("binds (combination)", cbinds[i].strbind.toUtf8().constData())); |
|
239 nameCell->setFlags(Qt::NoItemFlags); |
222 nameCell->setFlags(Qt::NoItemFlags); |
240 bindCell->setFlags(Qt::NoItemFlags); |
223 bindCell->setFlags(Qt::NoItemFlags); |
241 bindCell->setIcon(emptyIcon); |
224 bindCell->setIcon(emptyIcon); |
242 } |
225 } |
243 curTable->setItem(row, 1, bindCell); |
226 curTable->setItem(row, 1, bindCell); |