1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-04-18 14:42:27 +00:00

Merge pull request #2666 from Capostrophic/keybindings

Editor: Add a reset to defaults button to keybindings (feature #4068)
This commit is contained in:
Andrei Kortunov 2020-01-13 10:28:38 +04:00 committed by GitHub
commit 8bfca9830f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 0 deletions

View File

@ -205,6 +205,7 @@
Feature #3980: In-game option to disable controller Feature #3980: In-game option to disable controller
Feature #3999: Shift + Double Click should maximize/restore menu size Feature #3999: Shift + Double Click should maximize/restore menu size
Feature #4001: Toggle sneak controller shortcut Feature #4001: Toggle sneak controller shortcut
Feature #4068: OpenMW-CS: Add a button to reset key bindings to defaults
Feature #4129: Beta Comment to File Feature #4129: Beta Comment to File
Feature #4209: Editor: Faction rank sub-table Feature #4209: Editor: Faction rank sub-table
Feature #4255: Handle broken RepairedOnMe script function Feature #4255: Handle broken RepairedOnMe script function

View File

@ -4,11 +4,13 @@
#include <QComboBox> #include <QComboBox>
#include <QGridLayout> #include <QGridLayout>
#include <QPushButton>
#include <QStackedLayout> #include <QStackedLayout>
#include <QVBoxLayout> #include <QVBoxLayout>
#include "../../model/prefs/setting.hpp" #include "../../model/prefs/setting.hpp"
#include "../../model/prefs/category.hpp" #include "../../model/prefs/category.hpp"
#include "../../model/prefs/state.hpp"
namespace CSVPrefs namespace CSVPrefs
{ {
@ -29,8 +31,18 @@ namespace CSVPrefs
mPageSelector = new QComboBox(); mPageSelector = new QComboBox();
connect(mPageSelector, SIGNAL(currentIndexChanged(int)), mStackedLayout, SLOT(setCurrentIndex(int))); connect(mPageSelector, SIGNAL(currentIndexChanged(int)), mStackedLayout, SLOT(setCurrentIndex(int)));
QFrame* lineSeparator = new QFrame(topWidget);
lineSeparator->setFrameShape(QFrame::HLine);
lineSeparator->setFrameShadow(QFrame::Sunken);
// Reset key bindings button
QPushButton* resetButton = new QPushButton ("Reset to Defaults", topWidget);
connect(resetButton, SIGNAL(clicked()), this, SLOT(resetKeyBindings()));
topLayout->addWidget(mPageSelector); topLayout->addWidget(mPageSelector);
topLayout->addWidget(stackedWidget); topLayout->addWidget(stackedWidget);
topLayout->addWidget(lineSeparator);
topLayout->addWidget(resetButton);
topLayout->setSizeConstraint(QLayout::SetMinAndMaxSize); topLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
// Add each option // Add each option
@ -85,4 +97,9 @@ namespace CSVPrefs
} }
} }
} }
void KeyBindingPage::resetKeyBindings()
{
CSMPrefs::State::get().resetCategory("Key Bindings");
}
} }

View File

@ -29,6 +29,10 @@ namespace CSVPrefs
QStackedLayout* mStackedLayout; QStackedLayout* mStackedLayout;
QGridLayout* mPageLayout; QGridLayout* mPageLayout;
QComboBox* mPageSelector; QComboBox* mPageSelector;
private slots:
void resetKeyBindings();
}; };
} }