From b312fcd85c5c3569ebe5c6622ba31c915cdf1dde Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 25 May 2015 06:55:36 +0000 Subject: added feature to restore default shortcuts git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5019 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Ui/skinned/actionmanager.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/plugins/Ui/skinned/actionmanager.cpp') diff --git a/src/plugins/Ui/skinned/actionmanager.cpp b/src/plugins/Ui/skinned/actionmanager.cpp index b92866afe..9d8d72de7 100644 --- a/src/plugins/Ui/skinned/actionmanager.cpp +++ b/src/plugins/Ui/skinned/actionmanager.cpp @@ -136,6 +136,7 @@ QAction *ActionManager::createAction(QString name, QString confKey, QString key, { QAction *action = new QAction(name, this); action->setShortcut(m_settings->value(confKey, key).toString()); + action->setProperty("defaultShortcut", key); action->setObjectName(confKey); if(iconName.isEmpty()) return action; @@ -176,3 +177,12 @@ void ActionManager::saveActions() settings.setValue(QString("SkinnedShortcuts/")+action->objectName(), action->shortcut()); } } + +void ActionManager::resetShortcuts() +{ + foreach (QAction *action, m_actions.values()) + { + action->setShortcut(action->property("defaultShortcut").toString()); + qDebug("=%s=",qPrintable(action->property("defaultShortcut").toString())); + } +} -- cgit v1.2.3-13-gbd6f