diff --git a/src/dynamic-shortcuts/dynamicshortcutswidget.cpp b/src/dynamic-shortcuts/dynamicshortcutswidget.cpp index b7b206825..12ad5fac8 100755 --- a/src/dynamic-shortcuts/dynamicshortcutswidget.cpp +++ b/src/dynamic-shortcuts/dynamicshortcutswidget.cpp @@ -71,6 +71,13 @@ void DynamicShortcutsWidget::populate(QList actions) { int row_id = 0; + // TODO: Maybe separate actions into "categories". Each category will start with label. + // I will assign each QAaction a property called "category" with some enum value. + // Like: + // File, FeedsCategories, Messages, Tools, WebBrowser, Help + // This will be setup in FormMain::allActions(). + // Then here I will process actions into categories. + foreach (QAction *action, actions) { // Create shortcut catcher for this action and set default shortcut. ShortcutCatcher *catcher = new ShortcutCatcher(this); diff --git a/src/dynamic-shortcuts/shortcutbutton.cpp b/src/dynamic-shortcuts/shortcutbutton.cpp index b4136473f..ff857cadf 100644 --- a/src/dynamic-shortcuts/shortcutbutton.cpp +++ b/src/dynamic-shortcuts/shortcutbutton.cpp @@ -1,3 +1,20 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2015 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + /****************************************************************************** Copyright (c) 2010, Artem Galichkin All rights reserved. @@ -35,6 +52,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ShortcutButton::ShortcutButton(ShortcutCatcher *catcher, QWidget *parent) : QPushButton(parent), m_catcher(catcher) { + setMinimumWidth(100); } ShortcutButton::~ShortcutButton() { @@ -47,8 +65,7 @@ void ShortcutButton::keyPressEvent(QKeyEvent *event) { m_catcher->doneRecording(); } - Qt::KeyboardModifiers new_modifiers = event->modifiers() & - (Qt::SHIFT | Qt::CTRL | Qt::ALT | Qt::META); + Qt::KeyboardModifiers new_modifiers = event->modifiers() & (Qt::SHIFT | Qt::CTRL | Qt::ALT | Qt::META); if (!m_catcher->m_isRecording && (pressed_key == Qt::Key_Return || pressed_key == Qt::Key_Space)) { return; @@ -64,6 +81,7 @@ void ShortcutButton::keyPressEvent(QKeyEvent *event) { switch(pressed_key) { case Qt::Key_AltGr: return; + case Qt::Key_Shift: case Qt::Key_Control: case Qt::Key_Alt: @@ -72,9 +90,8 @@ void ShortcutButton::keyPressEvent(QKeyEvent *event) { m_catcher->controlModifierlessTimout(); m_catcher->updateDisplayShortcut(); break; - default: { - } + default: // We now have a valid key press. if (pressed_key) { if ((pressed_key == Qt::Key_Backtab) && (m_catcher->m_modifierKeys & Qt::SHIFT)) { diff --git a/src/dynamic-shortcuts/shortcutbutton.h b/src/dynamic-shortcuts/shortcutbutton.h index 21581b03a..6a459feee 100644 --- a/src/dynamic-shortcuts/shortcutbutton.h +++ b/src/dynamic-shortcuts/shortcutbutton.h @@ -1,3 +1,20 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2015 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + /****************************************************************************** Copyright (c) 2010, Artem Galichkin All rights reserved. diff --git a/src/dynamic-shortcuts/shortcutcatcher.cpp b/src/dynamic-shortcuts/shortcutcatcher.cpp index 20cb9f8e5..dd9b52800 100755 --- a/src/dynamic-shortcuts/shortcutcatcher.cpp +++ b/src/dynamic-shortcuts/shortcutcatcher.cpp @@ -1,3 +1,20 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2015 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + /****************************************************************************** Copyright (c) 2010, Artem Galichkin All rights reserved. diff --git a/src/dynamic-shortcuts/shortcutcatcher.h b/src/dynamic-shortcuts/shortcutcatcher.h index 018ae9c2d..fb9d0998f 100644 --- a/src/dynamic-shortcuts/shortcutcatcher.h +++ b/src/dynamic-shortcuts/shortcutcatcher.h @@ -1,3 +1,20 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2015 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + /****************************************************************************** Copyright (c) 2010, Artem Galichkin All rights reserved.