diff options
Diffstat (limited to 'lumina-config')
-rw-r--r-- | lumina-config/mainUI.cpp | 33 | ||||
-rw-r--r-- | lumina-config/mainUI.h | 6 | ||||
-rw-r--r-- | lumina-config/mainUI.ui | 131 |
3 files changed, 99 insertions, 71 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 diff --git a/lumina-config/mainUI.h b/lumina-config/mainUI.h index 1810c7b6..2dbcc2ab 100644 --- a/lumina-config/mainUI.h +++ b/lumina-config/mainUI.h @@ -31,7 +31,7 @@ // local includes #include "LPlugins.h" -#include "KeyCatch.h" +//#include "KeyCatch.h" #include "AppDialog.h" #include "ColorDialog.h" #include "ThemeDialog.h" @@ -128,7 +128,9 @@ private slots: void loadKeyboardShortcuts(); void saveKeyboardShortcuts(); void clearKeyBinding(); - void getKeyPress(); + void applyKeyBinding(); + void updateKeyConfig(); + //void getKeyPress(); //Defaults Page void changeDefaultBrowser(); diff --git a/lumina-config/mainUI.ui b/lumina-config/mainUI.ui index a8181487..463102af 100644 --- a/lumina-config/mainUI.ui +++ b/lumina-config/mainUI.ui @@ -109,7 +109,7 @@ <enum>QFrame::StyledPanel</enum> </property> <property name="currentIndex"> - <number>0</number> + <number>2</number> </property> <widget class="QWidget" name="page_desktop"> <layout class="QVBoxLayout" name="verticalLayout_3"> @@ -666,8 +666,8 @@ <rect> <x>0</x> <y>0</y> - <width>98</width> - <height>28</height> + <width>523</width> + <height>304</height> </rect> </property> </widget> @@ -732,67 +732,68 @@ </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_15"> - <item> - <spacer name="horizontalSpacer_10"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QToolButton" name="tool_shortcut_clear"> - <property name="text"> - <string>Clear Shortcut</string> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_12"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QToolButton" name="tool_shortcut_set"> - <property name="text"> - <string>Change Shortcut</string> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_11"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + <widget class="QGroupBox" name="group_shortcut_modify"> + <property name="title"> + <string>Modify Shortcut</string> + </property> + <layout class="QGridLayout" name="gridLayout_4"> + <property name="leftMargin"> + <number>3</number> + </property> + <property name="topMargin"> + <number>3</number> + </property> + <property name="rightMargin"> + <number>3</number> + </property> + <property name="bottomMargin"> + <number>3</number> + </property> + <item row="0" column="3"> + <widget class="QKeySequenceEdit" name="keyEdit_shortcut"/> + </item> + <item row="0" column="0"> + <widget class="QToolButton" name="tool_shortcut_clear"> + <property name="text"> + <string>Clear Shortcut</string> + </property> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextBesideIcon</enum> + </property> + </widget> + </item> + <item row="0" column="4"> + <widget class="QToolButton" name="tool_shortcut_set"> + <property name="text"> + <string>Apply Change</string> + </property> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextBesideIcon</enum> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QLabel" name="label_32"> + <property name="text"> + <string>Change Key Binding:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <spacer name="horizontalSpacer_10"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> </item> <item> <widget class="QLabel" name="label_11"> @@ -1549,7 +1550,7 @@ <x>0</x> <y>0</y> <width>121</width> - <height>28</height> + <height>19</height> </rect> </property> <property name="sizePolicy"> |