00001
00002
00003
00004
00005
00006 #ifndef BALL_VIEW_DIALOGS_EDITSINGLESHORTCUT_H
00007 #define BALL_VIEW_DIALOGS_EDITSINGLESHORTCUT_H
00008
00009 #ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
00010 # include <BALL/VIEW/KERNEL/preferencesEntry.h>
00011 #endif
00012
00013 #ifndef BALL_VIEW_KERNEL_SHORTCUTREGISTRY_H
00014 # include <BALL/VIEW/KERNEL/shortcutRegistry.h>
00015 #endif
00016
00017 #ifndef BALL_VIEW_KERNEL_MAINCONTROL_H
00018 # include <BALL/VIEW/KERNEL/mainControl.h>
00019 #endif
00020
00021 #ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
00022 # include <BALL/VIEW/KERNEL/modularWidget.h>
00023 #endif
00024
00025 #ifdef BALL_COMPILER_MSVC
00026 # include <BALL/VIEW/UIC/ui_editSingleShortcut.h>
00027 #else
00028 # include <BALL/VIEW/UIC/editSingleShortcutData.h>
00029 #endif
00030
00031 class QModelIndex;
00032
00033 namespace BALL
00034 {
00035 namespace VIEW
00036 {
00037
00041 class BALL_VIEW_EXPORT EditSingleShortcut
00042 : public QDialog,
00043 public Ui_EditSingleShortcutData
00044 {
00045
00046 Q_OBJECT
00047
00048 public:
00049
00051 EditSingleShortcut(QWidget* parent = NULL, const char* name = "EditSingleShortcut", Qt::WFlags fl = 0 );
00052
00053 QKeySequence const& getKeySequence() const { return new_sequence_; }
00054
00055 void setIndex(const QModelIndex& index);
00056 void reset();
00057 void setup(const QString& shortcut);
00058
00059 public slots:
00060 virtual void accept();
00061 virtual void reject();
00062
00063 protected slots:
00064 void modeChanged_(bool toggled);
00065
00066 protected:
00067 bool is_recording_;
00068
00069 unsigned int modifiers_;
00070 int key_;
00071 QKeySequence new_sequence_;
00072
00074 void setErrorText(QString error);
00075
00077 void setShortcutText(QString new_keysequence);
00078
00079 void updateText_();
00080 void changeMode_(bool mode);
00081
00082 void keyPressEvent(QKeyEvent* evt);
00083 void keyReleaseEvent(QKeyEvent* evt);
00084
00085 void startRecording_();
00086 void stopRecording_();
00087 };
00088
00089 }
00090 }
00091
00092 #endif
00093