aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/coreplugin/actionmanager/commandmappings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/coreplugin/actionmanager/commandmappings.cpp')
-rw-r--r--src/plugins/coreplugin/actionmanager/commandmappings.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/coreplugin/actionmanager/commandmappings.cpp b/src/plugins/coreplugin/actionmanager/commandmappings.cpp
index 0280217dab..4cec7e69a4 100644
--- a/src/plugins/coreplugin/actionmanager/commandmappings.cpp
+++ b/src/plugins/coreplugin/actionmanager/commandmappings.cpp
@@ -74,11 +74,16 @@ public:
defaultButton = new QPushButton(CommandMappings::tr("Reset All"), groupBox);
defaultButton->setToolTip(CommandMappings::tr("Reset all to default."));
+ resetButton = new QPushButton(CommandMappings::tr("Reset"), groupBox);
+ resetButton->setToolTip(CommandMappings::tr("Reset to default."));
+ resetButton->setVisible(false);
+
importButton = new QPushButton(CommandMappings::tr("Import..."), groupBox);
exportButton = new QPushButton(CommandMappings::tr("Export..."), groupBox);
auto hboxLayout1 = new QHBoxLayout();
hboxLayout1->addWidget(defaultButton);
+ hboxLayout1->addWidget(resetButton);
hboxLayout1->addStretch();
hboxLayout1->addWidget(importButton);
hboxLayout1->addWidget(exportButton);
@@ -100,6 +105,7 @@ public:
q, &CommandMappings::importAction);
q->connect(defaultButton, &QPushButton::clicked,
q, &CommandMappings::defaultAction);
+ q->connect(resetButton, &QPushButton::clicked, q, &CommandMappings::resetRequested);
commandList->sortByColumn(0, Qt::AscendingOrder);
@@ -117,6 +123,7 @@ public:
FancyLineEdit *filterEdit;
QTreeWidget *commandList;
QPushButton *defaultButton;
+ QPushButton *resetButton;
QPushButton *importButton;
QPushButton *exportButton;
};
@@ -145,6 +152,11 @@ void CommandMappings::setImportExportEnabled(bool enabled)
d->exportButton->setVisible(enabled);
}
+void CommandMappings::setResetVisible(bool visible)
+{
+ d->resetButton->setVisible(visible);
+}
+
QTreeWidget *CommandMappings::commandList() const
{
return d->commandList;