diff options
Diffstat (limited to 'lumina-config')
-rw-r--r-- | lumina-config/AppDialog.h | 55 | ||||
-rw-r--r-- | lumina-config/AppDialog.ui | 106 | ||||
-rw-r--r-- | lumina-config/lumina-config.pro | 6 | ||||
-rw-r--r-- | lumina-config/mainUI.cpp | 8 | ||||
-rw-r--r-- | lumina-config/mainUI.h | 1 |
5 files changed, 172 insertions, 4 deletions
diff --git a/lumina-config/AppDialog.h b/lumina-config/AppDialog.h new file mode 100644 index 00000000..a5143a4b --- /dev/null +++ b/lumina-config/AppDialog.h @@ -0,0 +1,55 @@ +//=========================================== +// Lumina-DE source code +// Copyright (c) 2014, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +// This is the dialog for catching keyboard events and converting them to X11 keycodes +//=========================================== +#ifndef _LUMINA_FILE_MANAGER_APP_SELECT_DIALOG_H +#define _LUMINA_FILE_MANAGER_APP_SELECT_DIALOG_H + +#include <QDialog> +#include <QString> +#include <QList> +#include <LuminaXDG.h> + +#include "ui_AppDialog.h" + +namespace Ui{ + class AppDialog; +}; + +class AppDialog : public QDialog{ + Q_OBJECT +private: + Ui::AppDialog *ui; + QList<XDGDesktop> APPS; + +public: + AppDialog(QWidget *parent = 0, QList<XDGDesktop> applist = QList<XDGDesktop>()) : QDialog(parent), ui(new Ui::AppDialog){ + ui->setupUi(this); //load the designer file + APPS = applist; //save this for later + ui->comboBox->clear(); + for(int i=0; i<APPS.length(); i++){ + ui->comboBox->addItem( LXDG::findIcon(APPS[i].icon,"application-x-executable"), APPS[i].name ); + } + this->setWindowIcon( LXDG::findIcon("system-search","") ); + } + + ~AppDialog(){} + + XDGDesktop appselected; + +private slots: + void on_buttonBox_accepted(){ + appselected = APPS[ ui->comboBox->currentIndex() ]; + this->close(); + } + void on_buttonBox_rejected(){ + this->close(); + } + +}; + +#endif diff --git a/lumina-config/AppDialog.ui b/lumina-config/AppDialog.ui new file mode 100644 index 00000000..49a1e921 --- /dev/null +++ b/lumina-config/AppDialog.ui @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>AppDialog</class> + <widget class="QDialog" name="AppDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>303</width> + <height>88</height> + </rect> + </property> + <property name="windowTitle"> + <string>Select Application</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QComboBox" name="comboBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>AppDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>AppDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/lumina-config/lumina-config.pro b/lumina-config/lumina-config.pro index 766448d8..01203a36 100644 --- a/lumina-config/lumina-config.pro +++ b/lumina-config/lumina-config.pro @@ -12,10 +12,12 @@ SOURCES += main.cpp \ HEADERS += mainUI.h \ LPlugins.h \ - KeyCatch.h + KeyCatch.h \ + AppDialog.h FORMS += mainUI.ui \ - KeyCatch.ui + KeyCatch.ui \ + AppDialog.ui # RESOURCES+= lumina-config.qrc diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp index 37667f40..a29de699 100644 --- a/lumina-config/mainUI.cpp +++ b/lumina-config/mainUI.cpp @@ -271,7 +271,7 @@ QString MainUI::getNewPanelPlugin(){ XDGDesktop MainUI::getSysApp(){ //Prompt the user to select an application on the system - QStringList apps; + /*QStringList apps; for(int i=0; i<sysApps.length(); i++){ apps << sysApps[i].name; } @@ -279,7 +279,11 @@ XDGDesktop MainUI::getSysApp(){ QString app = QInputDialog::getItem(this, tr("Select Application"), tr("App Name:"), apps, 0, false, &ok); int index = apps.indexOf(app); if(app.isEmpty() || index < 0 || !ok){ return XDGDesktop(); } //nothing selected - else{ return sysApps[index]; } + else{ return sysApps[index]; }*/ + AppDialog dlg(this, sysApps); + dlg.exec(); + return dlg.appselected; + } //Convert to/from fluxbox key codes diff --git a/lumina-config/mainUI.h b/lumina-config/mainUI.h index 459bc9e7..24e7f72c 100644 --- a/lumina-config/mainUI.h +++ b/lumina-config/mainUI.h @@ -25,6 +25,7 @@ // local includes #include "LPlugins.h" #include "KeyCatch.h" +#include "AppDialog.h" #define DEFAULTBG QString("/usr/local/share/Lumina-DE/desktop-background.jpg") |