1 //============================================================================= 2 // MusE Score 3 // Linux Music Score Editor 4 // 5 // Copyright (C) 2002-2009 Werner Schweer and others 6 // Copyright (C) 2003 Mathias Lundgren <lunar_shuttle@users.sourceforge.net> 7 // 8 // This program is free software; you can redistribute it and/or modify 9 // it under the terms of the GNU General Public License version 2. 10 // 11 // This program is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU General Public License for more details. 15 // 16 // You should have received a copy of the GNU General Public License 17 // along with this program; if not, write to the Free Software 18 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 //============================================================================= 20 21 // 22 // C++ Interface: shortcutcapturedialog 23 // 24 // Description: 25 // Dialog window for capturing keyboard shortcuts 26 // 27 28 #include "ui_shortcutcapturedialog.h" 29 30 namespace Ms { 31 32 class Shortcut; 33 34 //--------------------------------------------------------- 35 // ShortcutCaptureDialog 36 //--------------------------------------------------------- 37 38 class ShortcutCaptureDialog : public QDialog, public Ui::ShortcutCaptureDialogBase 39 { 40 Q_OBJECT 41 42 Shortcut* s; 43 void keyPress(QKeyEvent* e); 44 virtual bool eventFilter(QObject* o, QEvent* e); 45 QKeySequence key; 46 QMap<QString, Shortcut*> localShortcuts; 47 48 virtual void hideEvent(QHideEvent*); 49 private slots: 50 void clearClicked(); 51 void addClicked(); 52 void replaceClicked(); 53 54 public: 55 ShortcutCaptureDialog(Shortcut* s, QMap<QString, Shortcut*> localShortcuts, QWidget* parent = 0); 56 ~ShortcutCaptureDialog(); getKey()57 QKeySequence getKey() const { return key; } 58 }; 59 60 } // namespace Ms 61 62