+/**********************************************************************
+ * Key selector widget
+ **********************************************************************/
+class KeyShortcutEdit: public QLineEdit
+{
+ Q_OBJECT
+public:
+ void setValue( int _value ){ value = _value; }
+ int getValue() const { return value; }
+
+ void setGlobal( bool _value ) { b_global = _value; }
+ bool getGlobal() const { return b_global; }
+public slots:
+ virtual void clear(void) { value = 0; QLineEdit::clear(); }
+private:
+ int value;
+ bool b_global;
+ virtual void mousePressEvent( QMouseEvent *event );
+signals:
+ void pressed();
+};
+
+class SearchLineEdit;
+class KeySelectorControl : public ConfigControl
+{
+ Q_OBJECT
+public:
+ KeySelectorControl( vlc_object_t *, module_config_t *, QWidget *,
+ QGridLayout*, int& );
+ virtual int getType() { return CONFIG_ITEM_KEY; }
+ virtual ~KeySelectorControl() {};
+ virtual void hide() { table->hide(); if( label ) label->hide(); }
+ virtual void show() { table->show(); if( label ) label->show(); }
+ void doApply();
+private:
+ void finish();
+ QLabel *label;
+ QTreeWidget *table;
+ KeyShortcutEdit *shortcutValue;
+ QList<module_config_t *> values;
+ SearchLineEdit *actionSearch;
+private slots:
+ void setTheKey();
+ void selectKey( QTreeWidgetItem * = NULL, int column = 1 );
+ void select( QTreeWidgetItem * = NULL, int column = 1 );
+ void select1Key();
+ void filter( const QString & );
+};
+
+class KeyInputDialog : public QDialog
+{
+public:
+ KeyInputDialog( QTreeWidget *, const QString&, QWidget *, bool b_global = false);
+ int keyValue;
+ bool conflicts;
+private:
+ QTreeWidget *table;
+ void checkForConflicts( int i_vlckey );
+ void keyPressEvent( QKeyEvent *);
+ void wheelEvent( QWheelEvent *);
+ QLabel *selected, *warning;
+ QVBoxLayout *vLayout;
+ QDialogButtonBox *buttonBox;
+ bool b_global;
+};