summaryrefslogtreecommitdiff
path: root/libopie2/opieui/okeyconfigwidget.h
Side-by-side diff
Diffstat (limited to 'libopie2/opieui/okeyconfigwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/okeyconfigwidget.h41
1 files changed, 40 insertions, 1 deletions
diff --git a/libopie2/opieui/okeyconfigwidget.h b/libopie2/opieui/okeyconfigwidget.h
index a7a5f48..8d2a1ef 100644
--- a/libopie2/opieui/okeyconfigwidget.h
+++ b/libopie2/opieui/okeyconfigwidget.h
@@ -235,36 +235,75 @@ public:
OKeyConfigWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~OKeyConfigWidget();
void setChangeMode( enum ChangeMode );
ChangeMode changeMode()const;
void insert( const QString& name, OKeyConfigManager* );
void load();
void save();
private slots:
void slotListViewItem( QListViewItem* );
void slotNoKey();
void slotDefaultKey();
void slotCustomKey();
-
+ void slotConfigure();
private:
void initUi();
Opie::Ui::OListView *m_view;
Opie::Ui::Private::OKeyConfigWidgetPrivateList m_list;
QLabel *m_lbl;
QPushButton *m_btn;
QRadioButton *m_def, *m_cus, *m_none;
QWidget* m_box;
ChangeMode m_mode;
class Private;
Private *d;
};
+
+/**
+ * This is a small dialog that allows you to
+ * capture a key sequence.
+ * If you want it to close after a key was captured you
+ * can use this code snippet.
+ *
+ * \code
+ * OKeyChooserConfigDialog diag(0,0,true);
+ * connect(&diag,SIGNAL(keyCaptured()),
+ * this,SLOT(accept()));
+ * if( QPEApplication::execDialog(&diag) == QDialog::Accept ){
+ * take_the_key_and_do_something
+ * }
+ *
+ * \endcode
+ *
+ */
+class OKeyChooserConfigDialog : public QDialog {
+ Q_OBJECT
+public:
+ OKeyChooserConfigDialog( QWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );
+ ~OKeyChooserConfigDialog();
+
+ OKeyPair keyPair()const;
+
+protected:
+ void keyPressEvent( QKeyEvent* );
+ void keyReleaseEvent( QKeyEvent* );
+
+signals:
+ void keyCaptured();
+
+private:
+ OKeyPair m_keyPair;
+ class Private;
+ Private *d;
+};
+
}
}
#endif