diff options
author | Ken Moore <moorekou@gmail.com> | 2016-06-30 15:05:54 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-06-30 15:05:54 -0400 |
commit | 70a35d68f5db7abd57210bc289a334df8dbc1dd2 (patch) | |
tree | 93fcc923e1ba4dabf6d8fac04188a00618dff73e /src-qt5/core-utils/lumina-config/pages | |
parent | Fix some whitespace issues with the ls.json.sh script. (diff) | |
download | lumina-70a35d68f5db7abd57210bc289a334df8dbc1dd2.tar.gz lumina-70a35d68f5db7abd57210bc289a334df8dbc1dd2.tar.bz2 lumina-70a35d68f5db7abd57210bc289a334df8dbc1dd2.zip |
Add the new jsonmenu menu plugin to lumina-config, with a new dialog for setting it up.
Diffstat (limited to 'src-qt5/core-utils/lumina-config/pages')
-rw-r--r-- | src-qt5/core-utils/lumina-config/pages/page_interface_menu.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src-qt5/core-utils/lumina-config/pages/page_interface_menu.cpp b/src-qt5/core-utils/lumina-config/pages/page_interface_menu.cpp index 742c5728..d211d380 100644 --- a/src-qt5/core-utils/lumina-config/pages/page_interface_menu.cpp +++ b/src-qt5/core-utils/lumina-config/pages/page_interface_menu.cpp @@ -9,7 +9,7 @@ #include "getPage.h" #include "../AppDialog.h" #include "../GetPluginDialog.h" - +#include "../ScriptDialog.h" //========== // PUBLIC //========== @@ -52,7 +52,6 @@ QStringList items = settings.value("menu/itemlist", QStringList() ).toStringList //qDebug() << "Menu Items:" << items; ui->list_menu->clear(); for(int i=0; i<items.length(); i++){ - LPI info = PINFO->menuPluginInfo(items[i]); if(items[i].startsWith("app::::")){ bool ok = false; XDGDesktop desk = LXDG::loadDesktopFile(items[i].section("::::",1,1), ok); @@ -64,7 +63,20 @@ QStringList items = settings.value("menu/itemlist", QStringList() ).toStringList item->setToolTip( desk.comment ); ui->list_menu->addItem(item); continue; //now go to the next item + }else if(items[i].startsWith("jsonmenu::::")){ + LPI info = PINFO->menuPluginInfo( items[i].section("::::",0,0) ); + if(info.ID.isEmpty()){ continue; } //invalid plugin type (no longer available?) + QString exec = items[i].section("::::",1,1); + + QListWidgetItem *item = new QListWidgetItem(); + item->setWhatsThis( items[i] ); + item->setIcon( LXDG::findIcon(items[i].section("::::",3,3),info.icon) ); + item->setText( items[i].section("::::",2,2) +" ("+info.name+")" ); + item->setToolTip( info.description ); + ui->list_menu->addItem(item); + continue; //now go to the next item } + LPI info = PINFO->menuPluginInfo(items[i]); if(info.ID.isEmpty()){ continue; } //invalid plugin //qDebug() << "Add Menu Item:" << info.ID; QListWidgetItem *item = new QListWidgetItem(); @@ -121,6 +133,15 @@ void page_interface_menu::addmenuplugin(){ it = new QListWidgetItem(LXDG::findIcon(desk.icon,""), desk.name ); it->setWhatsThis(info.ID+"::::"+desk.filePath); it->setToolTip( desk.comment ); + }else if(info.ID=="jsonmenu"){ + //Need to prompt for the script file, name, and icon to use + //new ID format: "jsonmenu"::::<exec to run>::::<name>::::<icon> + ScriptDialog SD(this); + SD.exec(); + if(!SD.isValid()){ return; } + it = new QListWidgetItem( LXDG::findIcon(SD.icon(),"text-x-script"), SD.name()+" ("+info.ID+")" ); + it->setWhatsThis(info.ID+"::::"+SD.command()+"::::"+SD.name()+"::::"+SD.icon()); + it->setToolTip( info.description ); }else{ it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name ); it->setWhatsThis(info.ID); |