QTfrontend/ui/widget/keybinder.cpp
changeset 15370 5a934f83d5eb
parent 15251 9be05ae1b726
child 15455 1ee2736de636
equal deleted inserted replaced
15369:0f2fd8d12734 15370:5a934f83d5eb
   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         if (cbinds[i].action != "!MULTI")
   212         // Check if the bind text is bad. This was discovered after the 1.0.0,
       
   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))
   213         {
   218         {
   214             bindCell = new QTableWidgetItem(comboBox->currentText());
   219             bindCell = new QTableWidgetItem(comboBox->currentText());
   215             nameCell->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
   220             nameCell->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
   216             bindCell->setIcon(*dropDownIcon);
   221             bindCell->setIcon(*dropDownIcon);
   217             bindCell->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
   222             bindCell->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
   218         }
   223         }
   219         else
   224         else
   220         {
   225         {
   221             bindCell = new QTableWidgetItem(HWApplication::translate("binds (combination)", cbinds[i].strbind.toUtf8().constData()));
   226             // Apply workaround for the broken 1.0.0 strbind
       
   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()));
   222             nameCell->setFlags(Qt::NoItemFlags);
   239             nameCell->setFlags(Qt::NoItemFlags);
   223             bindCell->setFlags(Qt::NoItemFlags);
   240             bindCell->setFlags(Qt::NoItemFlags);
   224             bindCell->setIcon(emptyIcon);
   241             bindCell->setIcon(emptyIcon);
   225         }
   242         }
   226         curTable->setItem(row, 1, bindCell);
   243         curTable->setItem(row, 1, bindCell);