table->headerItem()->setText( 1, qtr( "Hotkey" ) );
table->headerItem()->setText( 2, qtr( "Global" ) );
table->setAlternatingRowColors( true );
+ table->setSelectionBehavior( QAbstractItemView::SelectItems );
shortcutValue = new KeyShortcutEdit;
shortcutValue->setReadOnly(true);
QPushButton *clearButton = new QPushButton( qtr( "Clear" ) );
- QPushButton *setButton = new QPushButton( qtr( "Set" ) );
+ QPushButton *setButton = new QPushButton( qtr( "Apply" ) );
setButton->setDefault( true );
finish();
CONNECT( table, itemDoubleClicked( QTreeWidgetItem *, int ),
this, selectKey( QTreeWidgetItem *, int ) );
+ CONNECT( table, itemClicked( QTreeWidgetItem *, int ),
+ this, select( QTreeWidgetItem *, int) );
CONNECT( table, itemSelectionChanged(),
this, select1Key() );
}
}
+void KeySelectorControl::select( QTreeWidgetItem *keyItem, int column )
+{
+ shortcutValue->setGlobal( column == 2 );
+}
+
/* Show the key selected from the table in the keySelector */
void KeySelectorControl::select1Key()
{
void setGlobal( bool _value ) { b_global = _value; }
bool getGlobal() const { return b_global; }
public slots:
- virtual void clear(void) { value = 0; QLineEdit::clear(); b_global = false;}
+ virtual void clear(void) { value = 0; QLineEdit::clear(); }
private:
int value;
bool b_global;
private slots:
void setTheKey();
void selectKey( QTreeWidgetItem * = NULL, int column = 1 );
+ void select( QTreeWidgetItem * = NULL, int column = 1 );
void select1Key();
void filter( const QString & );
};