diff options
author | Ken Moore <moorekou@gmail.com> | 2015-12-03 11:29:04 -0500 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-12-03 11:29:04 -0500 |
commit | 2ff60bb1b3f2de6e5a0da09cbe53fc72205fb640 (patch) | |
tree | 06ee5ff9ffecac1b0e2426308d8802fe4800b4bd /lumina-config/mainUI.cpp | |
parent | Oops, forgot to append the ".note" suffix before running the new name through... (diff) | |
download | lumina-2ff60bb1b3f2de6e5a0da09cbe53fc72205fb640.tar.gz lumina-2ff60bb1b3f2de6e5a0da09cbe53fc72205fb640.tar.bz2 lumina-2ff60bb1b3f2de6e5a0da09cbe53fc72205fb640.zip |
Replace the "KeyCatch" dialog with a QKeySequenceEdit (added in Qt 5.2). The keycatch dialog is still there in source (just commented out) until we can verify that the Qt widget picks up all the special keys properly.
Diffstat (limited to 'lumina-config/mainUI.cpp')
-rw-r--r-- | lumina-config/mainUI.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp index 87a0447c..6bcaa1b6 100644 --- a/lumina-config/mainUI.cpp +++ b/lumina-config/mainUI.cpp @@ -163,8 +163,9 @@ void MainUI::setupConnections(){ //Shortcuts Page connect(ui->tool_shortcut_clear, SIGNAL(clicked()), this, SLOT(clearKeyBinding()) ); - connect(ui->tool_shortcut_set, SIGNAL(clicked()), this, SLOT(getKeyPress()) ); - + connect(ui->tool_shortcut_set, SIGNAL(clicked()), this, SLOT(applyKeyBinding()) ); + connect(ui->tree_shortcut, SIGNAL(itemSelectionChanged()), this, SLOT(updateKeyConfig()) ); + //Defaults Page connect(ui->tool_default_filemanager, SIGNAL(clicked()), this, SLOT(changeDefaultFileManager()) ); connect(ui->tool_default_terminal, SIGNAL(clicked()), this, SLOT(changeDefaultTerminal()) ); @@ -1007,7 +1008,31 @@ void MainUI::clearKeyBinding(){ modshort=true; } -void MainUI::getKeyPress(){ +void MainUI::applyKeyBinding(){ + QKeySequence seq = ui->keyEdit_shortcut->keySequence(); + qDebug() << "New Key Sequence:" << seq.toString(QKeySequence::NativeText) << seq.toString(QKeySequence::PortableText); + if(seq.isEmpty()){ + //Verify removal of the action first + + //Now remove the action + delete ui->tree_shortcut->currentItem(); + }else{ + QTreeWidgetItem *it = ui->tree_shortcut->currentItem(); + it->setText(1,seq.toString(QKeySequence::NativeText)); + it->setWhatsThis(1,dispToFluxKeys(seq.toString(QKeySequence::PortableText))); + qDebug() << " - Flux Sequence:" << it->whatsThis(1); + } + ui->keyEdit_shortcut->clear(); + ui->push_save->setEnabled(true); + modshort=true; +} + +void MainUI::updateKeyConfig(){ + ui->group_shortcut_modify->setEnabled(ui->tree_shortcut->currentItem()!=0); + ui->keyEdit_shortcut->clear(); +} + +/*void MainUI::getKeyPress(){ if(ui->tree_shortcut->currentItem()==0){ return; } //nothing selected KeyCatch dlg(this); dlg.exec(); @@ -1020,7 +1045,7 @@ void MainUI::getKeyPress(){ it->setWhatsThis(1,dispToFluxKeys(dlg.xkeys)); ui->push_save->setEnabled(true); modshort=true; -} +}*/ //=========== // Defaults Page |