buttonmanager Ctrl+S
This commit is contained in:
parent
018ff05990
commit
c8ce6cc0d1
|
@ -36,6 +36,7 @@ private slots:
|
|||
void itemChanged(QTreeWidgetItem* item, int column);
|
||||
void itemDoubleClicked(QTreeWidgetItem* item);
|
||||
void dialogButtonPressed(QAbstractButton* btn);
|
||||
void saveChanges();
|
||||
|
||||
private:
|
||||
Ui::ButtonManager *ui;
|
||||
|
@ -45,7 +46,6 @@ private:
|
|||
Config::RootConfig workingConfig;
|
||||
|
||||
void loadConfig();
|
||||
void saveChanges();
|
||||
|
||||
void select(QTreeWidgetItem* item);
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "sound.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QShortcut>
|
||||
|
||||
#include <Log.h>
|
||||
|
||||
|
@ -21,6 +22,10 @@ ButtonManager::ButtonManager(Config& conf, MainWindow* parent) : QDialog(parent)
|
|||
labels.push_back("File");
|
||||
|
||||
ui->buttonTreeWidget->setHeaderLabels(labels);
|
||||
|
||||
QShortcut* sc = new QShortcut(QKeySequence(QKeySequence::Save), this);
|
||||
|
||||
QObject::connect(sc, SIGNAL( activated() ), this, SLOT( saveChanges() ));
|
||||
}
|
||||
|
||||
ButtonManager::~ButtonManager() {
|
||||
|
@ -203,6 +208,14 @@ void ButtonManager::dialogButtonPressed(QAbstractButton* btn) {
|
|||
}
|
||||
}
|
||||
|
||||
void ButtonManager::saveChanges() {
|
||||
// store working config to main config and save
|
||||
mainConfig.rootConfig = workingConfig;
|
||||
mainConfig.save();
|
||||
|
||||
mainW->reloadButtonConfig();
|
||||
}
|
||||
|
||||
void ButtonManager::loadConfig() {
|
||||
workingConfig = mainConfig.rootConfig;
|
||||
|
||||
|
@ -218,14 +231,6 @@ void ButtonManager::loadConfig() {
|
|||
}
|
||||
}
|
||||
|
||||
void ButtonManager::saveChanges() {
|
||||
// store working config to main config and save
|
||||
mainConfig.rootConfig = workingConfig;
|
||||
mainConfig.save();
|
||||
|
||||
mainW->reloadButtonConfig();
|
||||
}
|
||||
|
||||
void ButtonManager::select(QTreeWidgetItem* item) {
|
||||
QList<QTreeWidgetItem*> selected = ui->buttonTreeWidget->selectedItems();
|
||||
for(QTreeWidgetItem* selectedItem : selected) {
|
||||
|
|
Loading…
Reference in New Issue