QTfrontend/ui/page/pageoptions.cpp
branchui-scaling
changeset 15304 c4fd2813b127
parent 13390 0135e64c6c66
parent 15268 647157250713
child 15685 d92eeb468dad
equal deleted inserted replaced
13390:0135e64c6c66 15304:c4fd2813b127
   140             BtnNewTeam = new QPushButton(groupTeams);
   140             BtnNewTeam = new QPushButton(groupTeams);
   141             BtnNewTeam->setWhatsThis(tr("New team"));
   141             BtnNewTeam->setWhatsThis(tr("New team"));
   142             BtnNewTeam->setIconSize(pmNew.size());
   142             BtnNewTeam->setIconSize(pmNew.size());
   143             BtnNewTeam->setIcon(pmNew);
   143             BtnNewTeam->setIcon(pmNew);
   144             BtnNewTeam->setMaximumWidth(pmNew.width() + 6);
   144             BtnNewTeam->setMaximumWidth(pmNew.width() + 6);
       
   145             BtnNewTeam->setStyleSheet("padding: 0px;");
   145             connect(BtnNewTeam, SIGNAL(clicked()), this, SIGNAL(newTeamRequested()));
   146             connect(BtnNewTeam, SIGNAL(clicked()), this, SIGNAL(newTeamRequested()));
   146             groupTeams->layout()->addWidget(BtnNewTeam, 0, 1);
   147             groupTeams->layout()->addWidget(BtnNewTeam, 0, 1);
   147 
   148 
   148             BtnEditTeam = new QPushButton(groupTeams);
   149             BtnEditTeam = new QPushButton(groupTeams);
   149             BtnEditTeam->setWhatsThis(tr("Edit team"));
   150             BtnEditTeam->setWhatsThis(tr("Edit team"));
   150             BtnEditTeam->setIconSize(pmEdit.size());
   151             BtnEditTeam->setIconSize(pmEdit.size());
   151             BtnEditTeam->setIcon(pmEdit);
   152             BtnEditTeam->setIcon(pmEdit);
   152             BtnEditTeam->setMaximumWidth(pmEdit.width() + 6);
   153             BtnEditTeam->setMaximumWidth(pmEdit.width() + 6);
       
   154             BtnEditTeam->setStyleSheet("padding: 0px;");
   153             connect(BtnEditTeam, SIGNAL(clicked()), this, SLOT(requestEditSelectedTeam()));
   155             connect(BtnEditTeam, SIGNAL(clicked()), this, SLOT(requestEditSelectedTeam()));
   154             groupTeams->layout()->addWidget(BtnEditTeam, 0, 2);
   156             groupTeams->layout()->addWidget(BtnEditTeam, 0, 2);
   155 
   157 
   156             BtnDeleteTeam = new QPushButton(groupTeams);
   158             BtnDeleteTeam = new QPushButton(groupTeams);
   157             BtnDeleteTeam->setWhatsThis(tr("Delete team"));
   159             BtnDeleteTeam->setWhatsThis(tr("Delete team"));
   158             BtnDeleteTeam->setIconSize(pmDelete.size());
   160             BtnDeleteTeam->setIconSize(pmDelete.size());
   159             BtnDeleteTeam->setIcon(pmDelete);
   161             BtnDeleteTeam->setIcon(pmDelete);
   160             BtnDeleteTeam->setMaximumWidth(pmDelete.width() + 6);
   162             BtnDeleteTeam->setMaximumWidth(pmDelete.width() + 6);
       
   163             BtnDeleteTeam->setStyleSheet("padding: 0px;");
   161             connect(BtnDeleteTeam, SIGNAL(clicked()), this, SLOT(requestDeleteSelectedTeam()));
   164             connect(BtnDeleteTeam, SIGNAL(clicked()), this, SLOT(requestDeleteSelectedTeam()));
   162             groupTeams->layout()->addWidget(BtnDeleteTeam, 0, 3);
   165             groupTeams->layout()->addWidget(BtnDeleteTeam, 0, 3);
   163 
   166 
   164             LblNoEditTeam = new QLabel(groupTeams);
   167             LblNoEditTeam = new QLabel(groupTeams);
   165             LblNoEditTeam->setText(tr("You can't edit teams from team selection. Go back to main menu to add, edit or delete teams."));
   168             LblNoEditTeam->setText(tr("You can't edit teams from team selection. Go back to main menu to add, edit or delete teams."));
   182             SchemeNew = new QPushButton(groupSchemes);
   185             SchemeNew = new QPushButton(groupSchemes);
   183             SchemeNew->setWhatsThis(tr("New scheme"));
   186             SchemeNew->setWhatsThis(tr("New scheme"));
   184             SchemeNew->setIconSize(pmNew.size());
   187             SchemeNew->setIconSize(pmNew.size());
   185             SchemeNew->setIcon(pmNew);
   188             SchemeNew->setIcon(pmNew);
   186             SchemeNew->setMaximumWidth(pmNew.width() + 6);
   189             SchemeNew->setMaximumWidth(pmNew.width() + 6);
       
   190             SchemeNew->setStyleSheet("padding: 0px;");
   187             groupSchemes->layout()->addWidget(SchemeNew, 0, 1);
   191             groupSchemes->layout()->addWidget(SchemeNew, 0, 1);
   188 
   192 
   189             SchemeEdit = new QPushButton(groupSchemes);
   193             SchemeEdit = new QPushButton(groupSchemes);
   190             SchemeEdit->setWhatsThis(tr("Edit scheme"));
   194             SchemeEdit->setWhatsThis(tr("Edit scheme"));
   191             SchemeEdit->setIconSize(pmEdit.size());
   195             SchemeEdit->setIconSize(pmEdit.size());
   192             SchemeEdit->setIcon(pmEdit);
   196             SchemeEdit->setIcon(pmEdit);
   193             SchemeEdit->setMaximumWidth(pmEdit.width() + 6);
   197             SchemeEdit->setMaximumWidth(pmEdit.width() + 6);
       
   198             SchemeEdit->setStyleSheet("padding: 0px;");
   194             groupSchemes->layout()->addWidget(SchemeEdit, 0, 2);
   199             groupSchemes->layout()->addWidget(SchemeEdit, 0, 2);
   195 
   200 
   196             SchemeDelete = new QPushButton(groupSchemes);
   201             SchemeDelete = new QPushButton(groupSchemes);
   197             SchemeDelete->setWhatsThis(tr("Delete scheme"));
   202             SchemeDelete->setWhatsThis(tr("Delete scheme"));
   198             SchemeDelete->setIconSize(pmDelete.size());
   203             SchemeDelete->setIconSize(pmDelete.size());
   199             SchemeDelete->setIcon(pmDelete);
   204             SchemeDelete->setIcon(pmDelete);
   200             SchemeDelete->setMaximumWidth(pmDelete.width() + 6);
   205             SchemeDelete->setMaximumWidth(pmDelete.width() + 6);
       
   206             SchemeDelete->setStyleSheet("padding: 0px;");
   201             groupSchemes->layout()->addWidget(SchemeDelete, 0, 3);
   207             groupSchemes->layout()->addWidget(SchemeDelete, 0, 3);
   202         }
   208         }
   203 
   209 
   204         { // group: weapons
   210         { // group: weapons
   205             OptionGroupBox * groupWeapons = new OptionGroupBox(":/res/weaponsicon.png", tr("Weapons"), this);
   211             OptionGroupBox * groupWeapons = new OptionGroupBox(":/res/weaponsicon.png", tr("Weapons"), this);
   215             WeaponNew = new QPushButton(groupWeapons);
   221             WeaponNew = new QPushButton(groupWeapons);
   216             WeaponNew->setWhatsThis(tr("New weapon set"));
   222             WeaponNew->setWhatsThis(tr("New weapon set"));
   217             WeaponNew->setIconSize(pmNew.size());
   223             WeaponNew->setIconSize(pmNew.size());
   218             WeaponNew->setIcon(pmNew);
   224             WeaponNew->setIcon(pmNew);
   219             WeaponNew->setMaximumWidth(pmNew.width() + 6);
   225             WeaponNew->setMaximumWidth(pmNew.width() + 6);
       
   226             WeaponNew->setStyleSheet("padding: 0px;");
   220             groupWeapons->layout()->addWidget(WeaponNew, 0, 1);
   227             groupWeapons->layout()->addWidget(WeaponNew, 0, 1);
   221 
   228 
   222             WeaponEdit = new QPushButton(groupWeapons);
   229             WeaponEdit = new QPushButton(groupWeapons);
   223             WeaponEdit->setWhatsThis(tr("Edit weapon set"));
   230             WeaponEdit->setWhatsThis(tr("Edit weapon set"));
   224             WeaponEdit->setIconSize(pmEdit.size());
   231             WeaponEdit->setIconSize(pmEdit.size());
   225             WeaponEdit->setIcon(pmEdit);
   232             WeaponEdit->setIcon(pmEdit);
   226             WeaponEdit->setMaximumWidth(pmEdit.width() + 6);
   233             WeaponEdit->setMaximumWidth(pmEdit.width() + 6);
       
   234             WeaponEdit->setStyleSheet("padding: 0px;");
   227             groupWeapons->layout()->addWidget(WeaponEdit, 0, 2);
   235             groupWeapons->layout()->addWidget(WeaponEdit, 0, 2);
   228 
   236 
   229             WeaponDelete = new QPushButton(groupWeapons);
   237             WeaponDelete = new QPushButton(groupWeapons);
   230             WeaponDelete->setWhatsThis(tr("Delete weapon set"));
   238             WeaponDelete->setWhatsThis(tr("Delete weapon set"));
   231             WeaponDelete->setIconSize(pmDelete.size());
   239             WeaponDelete->setIconSize(pmDelete.size());
   232             WeaponDelete->setIcon(pmDelete);
   240             WeaponDelete->setIcon(pmDelete);
   233             WeaponDelete->setMaximumWidth(pmDelete.width() + 6);
   241             WeaponDelete->setMaximumWidth(pmDelete.width() + 6);
       
   242             WeaponDelete->setStyleSheet("padding: 0px;");
   234             groupWeapons->layout()->addWidget(WeaponDelete, 0, 3);
   243             groupWeapons->layout()->addWidget(WeaponDelete, 0, 3);
   235         }
   244         }
   236 
   245 
   237         leftColumn->addStretch(1);
   246         leftColumn->addStretch(1);
   238         rightColumn->addStretch(1);
   247         rightColumn->addStretch(1);
   271 
   280 
   272             lblWinScreenRes = new QLabel(groupGame);
   281             lblWinScreenRes = new QLabel(groupGame);
   273             lblWinScreenRes->setText(QLabel::tr("Windowed Resolution"));
   282             lblWinScreenRes->setText(QLabel::tr("Windowed Resolution"));
   274             groupGame->layout()->addWidget(lblWinScreenRes, 2, 0);
   283             groupGame->layout()->addWidget(lblWinScreenRes, 2, 0);
   275 
   284 
   276             winResContainer = new QWidget();
   285             QHBoxLayout * winResLayout = new QHBoxLayout();
   277             QHBoxLayout * winResLayout = new QHBoxLayout(winResContainer);
       
   278             winResLayout->setSpacing(0);
   286             winResLayout->setSpacing(0);
   279             groupGame->layout()->addWidget(winResContainer, 2, 1);
   287             groupGame->layout()->addLayout(winResLayout, 2, 1, 1, 3);
   280 
   288 
   281             QLabel *winLabelX = new QLabel(groupGame);
   289             winLabelX = new QLabel(groupGame);
   282             //: Multiplication sign, to be used between two numbers. Note the “x” is only a dummy character, we recommend to use “×” if your language permits it
   290             //: Multiplication sign, to be used between two numbers. Note the “x” is only a dummy character, we recommend to use “×” if your language permits it
   283             winLabelX->setText(tr("x"));
   291             winLabelX->setText(tr("x"));
   284             winLabelX->setFixedWidth(40);
   292             winLabelX->setFixedWidth(40);
   285             winLabelX->setAlignment(Qt::AlignCenter);
   293             winLabelX->setAlignment(Qt::AlignCenter);
   286 
   294 
   305             lblQuality->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
   313             lblQuality->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
   306             groupGame->layout()->addWidget(lblQuality, 3, 0);
   314             groupGame->layout()->addWidget(lblQuality, 3, 0);
   307 
   315 
   308             SLQuality = new QSlider(Qt::Horizontal, groupGame);
   316             SLQuality = new QSlider(Qt::Horizontal, groupGame);
   309             SLQuality->setTickPosition(QSlider::TicksBelow);
   317             SLQuality->setTickPosition(QSlider::TicksBelow);
       
   318             SLQuality->setPageStep(2);
   310             SLQuality->setMaximum(5);
   319             SLQuality->setMaximum(5);
   311             SLQuality->setMinimum(0);
   320             SLQuality->setMinimum(0);
   312             SLQuality->setFixedWidth(150);
   321             SLQuality->setFixedWidth(150);
   313             groupGame->layout()->addWidget(SLQuality, 3, 1, Qt::AlignLeft);
   322             groupGame->layout()->addWidget(SLQuality, 3, 1, Qt::AlignLeft);
   314 
   323 
       
   324             // Zoom
       
   325             QLabel * lblZoom = new QLabel(groupGame);
       
   326             lblZoom->setText(QLabel::tr("Zoom (%)"));
       
   327             lblZoom->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
       
   328             groupGame->layout()->addWidget(lblZoom, 4, 0);
       
   329 
       
   330             SLZoom = new QSpinBox(groupGame);
       
   331             SLZoom->setSingleStep(5);
       
   332             SLZoom->setMaximum(150);
       
   333             SLZoom->setMinimum(50);
       
   334             groupGame->layout()->addWidget(SLZoom, 4, 1, Qt::AlignLeft);
       
   335 
   315             // Stereo spacing
   336             // Stereo spacing
   316 
   337 
   317             QLabel * lblStereo = new QLabel(groupGame);
   338             QLabel * lblStereo = new QLabel(groupGame);
   318             lblStereo->setText(QLabel::tr("Stereoscopy"));
   339             lblStereo->setText(QLabel::tr("Stereoscopy"));
   319             groupGame->layout()->addWidget(lblStereo, 4, 0);
   340             groupGame->layout()->addWidget(lblStereo, 5, 0);
   320 
   341 
   321             CBStereoMode = new QComboBox(groupGame);
   342             CBStereoMode = new QComboBox(groupGame);
   322             CBStereoMode->setWhatsThis(QComboBox::tr("Stereoscopy creates an illusion of depth when you wear 3D glasses."));
   343             CBStereoMode->setWhatsThis(QComboBox::tr("Stereoscopy creates an illusion of depth when you wear 3D glasses."));
   323             CBStereoMode->setMaxVisibleItems(50);
   344             CBStereoMode->setMaxVisibleItems(50);
   324             CBStereoMode->addItem(QComboBox::tr("Disabled"));
   345             CBStereoMode->addItem(QComboBox::tr("Disabled"));
   335             CBStereoMode->addItem(QComboBox::tr("Red/Green grayscale"));
   356             CBStereoMode->addItem(QComboBox::tr("Red/Green grayscale"));
   336             CBStereoMode->addItem(QComboBox::tr("Green/Red grayscale"));
   357             CBStereoMode->addItem(QComboBox::tr("Green/Red grayscale"));
   337             CBStereoMode->addItem(QComboBox::tr("Side-by-side"));
   358             CBStereoMode->addItem(QComboBox::tr("Side-by-side"));
   338             CBStereoMode->addItem(QComboBox::tr("Top-Bottom"));
   359             CBStereoMode->addItem(QComboBox::tr("Top-Bottom"));
   339             CBStereoMode->setFixedWidth(CBResolution->width());
   360             CBStereoMode->setFixedWidth(CBResolution->width());
   340             groupGame->layout()->addWidget(CBStereoMode, 4, 1);
   361             groupGame->layout()->addWidget(CBStereoMode, 5, 1);
   341 
   362 
   342             // Divider
   363             // Divider
   343 
   364 
   344             groupGame->addDivider(); // row 5
   365             groupGame->addDivider(); // row 6
   345 
   366 
   346             // FPS limit
   367             // FPS limit
   347 
   368 
   348             QHBoxLayout * fpsLayout = new QHBoxLayout();
   369             QHBoxLayout * fpsLayout = new QHBoxLayout();
   349             groupGame->layout()->addLayout(fpsLayout, 6, 0, 1, 2);
   370             groupGame->layout()->addLayout(fpsLayout, 7, 0, 1, 2);
   350             QLabel * maxfps = new QLabel(groupGame);
   371             QLabel * maxfps = new QLabel(groupGame);
   351             maxfps->setText(QLabel::tr("FPS limit"));
   372             maxfps->setText(QLabel::tr("FPS limit"));
   352             fpsLayout->addWidget(maxfps);
   373             fpsLayout->addWidget(maxfps);
   353             fpsLayout->addSpacing(30);
   374             fpsLayout->addSpacing(30);
   354             fpsedit = new FPSEdit(groupGame);
   375             fpsedit = new FPSEdit(groupGame);
   361             fpsLayout->addWidget(CBShowFPS);
   382             fpsLayout->addWidget(CBShowFPS);
   362             fpsLayout->addStretch(1);
   383             fpsLayout->addStretch(1);
   363 
   384 
   364             // Divider
   385             // Divider
   365 
   386 
   366             groupGame->addDivider(); // row 7
   387             groupGame->addDivider(); // row 8
   367 
   388 
   368             // Alternative damage show
   389             // Alternative damage show
   369 
   390 
   370             CBAltDamage = new QCheckBox(groupGame);
   391             CBAltDamage = new QCheckBox(groupGame);
   371             CBAltDamage->setText(QCheckBox::tr("Alternative damage show"));
   392             CBAltDamage->setText(QCheckBox::tr("Alternative damage show"));
   372             groupGame->layout()->addWidget(CBAltDamage, 8, 0, 1, 2);
   393             groupGame->layout()->addWidget(CBAltDamage, 9, 0, 1, 2);
   373 
   394 
   374             // Show ammo menu tooltips
   395             // Show ammo menu tooltips
   375 
   396 
   376             WeaponTooltip = new QCheckBox(groupGame);
   397             WeaponTooltip = new QCheckBox(groupGame);
   377             WeaponTooltip->setText(QCheckBox::tr("Show ammo menu tooltips"));
   398             WeaponTooltip->setText(QCheckBox::tr("Show ammo menu tooltips"));
   378             groupGame->layout()->addWidget(WeaponTooltip, 9, 0, 1, 2);
   399             groupGame->layout()->addWidget(WeaponTooltip, 10, 0, 1, 2);
   379 
   400 
   380             groupGame->addDivider();
   401             groupGame->addDivider();
   381 
   402 
   382             lblTags = new QLabel(groupGame);
   403             lblTags = new QLabel(groupGame);
   383             lblTags->setText(QLabel::tr("Displayed tags above hogs and translucent tags"));
   404             lblTags->setText(QLabel::tr("Displayed tags above hogs and translucent tags"));
   384             groupGame->layout()->addWidget(lblTags, 11, 0, 1, 2);
   405             groupGame->layout()->addWidget(lblTags, 12, 0, 1, 2);
   385 
   406 
   386             tagsContainer = new QWidget();
   407             tagsContainer = new QWidget();
   387             QHBoxLayout * tagsLayout = new QHBoxLayout(tagsContainer);
   408             QHBoxLayout * tagsLayout = new QHBoxLayout(tagsContainer);
   388             tagsLayout->setSpacing(0);
   409             tagsLayout->setSpacing(0);
   389             groupGame->layout()->addWidget(tagsContainer, 12, 0, 1, 2);
   410             groupGame->layout()->addWidget(tagsContainer, 13, 0, 1, 2);
   390 
   411 
   391             CBTeamTag = new QCheckBox(groupGame);
   412             CBTeamTag = new QCheckBox(groupGame);
   392             CBTeamTag->setText(QCheckBox::tr("Team"));
   413             CBTeamTag->setText(QCheckBox::tr("Team"));
   393             CBTeamTag->setWhatsThis(QCheckBox::tr("Enable team tags by default"));
   414             CBTeamTag->setWhatsThis(QCheckBox::tr("Enable team tags by default"));
   394 
   415 
   506 
   527 
   507             CBMusic = new QCheckBox(groupGame);
   528             CBMusic = new QCheckBox(groupGame);
   508             CBMusic->setText(QCheckBox::tr("Music"));
   529             CBMusic->setText(QCheckBox::tr("Music"));
   509             CBMusic->setWhatsThis(QCheckBox::tr("In-game music"));
   530             CBMusic->setWhatsThis(QCheckBox::tr("In-game music"));
   510             groupGame->layout()->addWidget(CBMusic, 1, 2, 1, 2, Qt::AlignLeft);
   531             groupGame->layout()->addWidget(CBMusic, 1, 2, 1, 2, Qt::AlignLeft);
       
   532 
       
   533             // Dampen
       
   534 
       
   535             CBDampenAudio = new QCheckBox(groupGame);
       
   536             //: Checkbox text. If checked, the in-game audio volume is reduced (=dampened) when the game window loses its focus
       
   537             CBDampenAudio->setText(QCheckBox::tr("Dampen when losing focus"));
       
   538             CBDampenAudio->setWhatsThis(QCheckBox::tr("Reduce the game audio volume if the game window has lost its focus"));
       
   539             groupGame->layout()->addWidget(CBDampenAudio, 2, 1, 1, 3, Qt::AlignLeft);
   511         }
   540         }
   512 
   541 
   513         { // group: frontend
   542         { // group: frontend
   514             OptionGroupBox * groupFrontend = new OptionGroupBox(":/res/audio.png", tr("Frontend audio"), this);
   543             OptionGroupBox * groupFrontend = new OptionGroupBox(":/res/audio.png", tr("Frontend audio"), this);
   515             rightColumn->addWidget(groupFrontend);
   544             rightColumn->addWidget(groupFrontend);
   654                 }
   683                 }
   655                 // Fallback code, if language name is empty for some reason. This should normally not happen
   684                 // Fallback code, if language name is empty for some reason. This should normally not happen
   656                 if(entryName.isEmpty())
   685                 if(entryName.isEmpty())
   657                 {
   686                 {
   658                     // Show error and the locale identifier
   687                     // Show error and the locale identifier
       
   688                     //: In the case of an error, this is shown in the language selection for a language with unknown name. %1 = language code
   659                     entryName = tr("MISSING LANGUAGE NAME [%1]").arg(lname);
   689                     entryName = tr("MISSING LANGUAGE NAME [%1]").arg(lname);
   660                 }
   690                 }
   661                 CBLanguage->addItem(entryName, lname);
   691                 CBLanguage->addItem(entryName, lname);
   662             }
   692             }
   663 
   693 
   959     Q_UNUSED(state);
   989     Q_UNUSED(state);
   960 
   990 
   961     lblFullScreenRes->setVisible(state);
   991     lblFullScreenRes->setVisible(state);
   962     CBResolution->setVisible(state);
   992     CBResolution->setVisible(state);
   963     lblWinScreenRes->setVisible(!state);
   993     lblWinScreenRes->setVisible(!state);
   964     winResContainer->setVisible(!state);
   994     windowWidthEdit->setVisible(!state);
       
   995     windowHeightEdit->setVisible(!state);
       
   996     winLabelX->setVisible(!state);
   965 
   997 
   966     int index = this->CBStereoMode->currentIndex();
   998     int index = this->CBStereoMode->currentIndex();
   967     if (index != 7 && index != 8 && index != 9)
   999     if (index != 7 && index != 8 && index != 9)
   968         previousFullscreenValue = this->CBFullscreen->isChecked();
  1000         previousFullscreenValue = this->CBFullscreen->isChecked();
   969 }
  1001 }
  1202         {
  1234         {
  1203             QString value = config->bind(i);
  1235             QString value = config->bind(i);
  1204             QModelIndexList mdl = binds->match(binds->index(0, 0), Qt::UserRole + 1, value, 1, Qt::MatchExactly);
  1236             QModelIndexList mdl = binds->match(binds->index(0, 0), Qt::UserRole + 1, value, 1, Qt::MatchExactly);
  1205             if(mdl.size() == 1) binder->setBindIndex(i, mdl[0].row());
  1237             if(mdl.size() == 1) binder->setBindIndex(i, mdl[0].row());
  1206         }
  1238         }
       
  1239         binder->checkConflicts();
  1207     }
  1240     }
  1208 
  1241 
  1209     currentTab = index;
  1242     currentTab = index;
  1210 }
  1243 }
  1211 
  1244 
  1224 
  1257 
  1225 // Changes a key bind (bindID) to its default value. This updates the bind's combo-box in the UI.
  1258 // Changes a key bind (bindID) to its default value. This updates the bind's combo-box in the UI.
  1226 // Returns: The bind model index of the default.
  1259 // Returns: The bind model index of the default.
  1227 int PageOptions::resetBindToDefault(int bindID)
  1260 int PageOptions::resetBindToDefault(int bindID)
  1228 {
  1261 {
       
  1262     if (QString(cbinds[bindID].action) == QString("!MULTI"))
       
  1263         return -1;
  1229     QStandardItemModel * binds = DataManager::instance().bindsModel();
  1264     QStandardItemModel * binds = DataManager::instance().bindsModel();
  1230     QModelIndexList mdl = binds->match(binds->index(0, 0), Qt::UserRole + 1, cbinds[bindID].strbind, 1, Qt::MatchExactly);
  1265     QModelIndexList mdl = binds->match(binds->index(0, 0), Qt::UserRole + 1, cbinds[bindID].strbind, 1, Qt::MatchExactly);
  1231     if(mdl.size() == 1) binder->setBindIndex(bindID, mdl[0].row());
  1266     if(mdl.size() == 1)
       
  1267         binder->setBindIndex(bindID, mdl[0].row());
  1232     return mdl[0].row();
  1268     return mdl[0].row();
  1233 }
  1269 }
  1234 
  1270 
  1235 // Called when "reset all binds" button is pressed
  1271 // Called when "reset all binds" button is pressed
  1236 void PageOptions::resetAllBinds()
  1272 void PageOptions::resetAllBinds()
  1237 {
  1273 {
  1238     for (int i = 0; i < BINDS_NUMBER; i++)
  1274     for (int i = 0; i < BINDS_NUMBER; i++)
  1239     {
  1275     {
  1240         resetBindToDefault(i);
  1276         int ret = resetBindToDefault(i);
  1241         bindUpdated(i);
  1277         if(ret != -1)
  1242     }
  1278             bindUpdated(i);
  1243 }
  1279     }
       
  1280     binder->checkConflicts();
       
  1281 }