diff options
author | Ken Moore <ken@ixsystems.com> | 2017-08-28 13:46:11 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-08-28 13:46:11 -0400 |
commit | ec9533d155f8b1a9595666ee2b1f14aedaec0e60 (patch) | |
tree | 107b318a5c5af8334a6672ccd57ef1e22683157c /src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart | |
parent | A bunch more work on Lumina 2 mouse focus settings and such. (diff) | |
download | lumina-ec9533d155f8b1a9595666ee2b1f14aedaec0e60.tar.gz lumina-ec9533d155f8b1a9595666ee2b1f14aedaec0e60.tar.bz2 lumina-ec9533d155f8b1a9595666ee2b1f14aedaec0e60.zip |
Remove the src-DE directory from lumina-desktop-unified. No need for this old copy of the files.
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart')
7 files changed, 0 insertions, 2600 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/ItemWidget.cpp b/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/ItemWidget.cpp deleted file mode 100644 index ea074a59..00000000 --- a/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/ItemWidget.cpp +++ /dev/null @@ -1,279 +0,0 @@ -//=========================================== -// Lumina-DE source code -// Copyright (c) 2014-2015, Ken Moore -// Available under the 3-clause BSD license -// See the LICENSE file for full details -//=========================================== -#include "ItemWidget.h" -#include <LUtils.h> -#include <QMenu> -#include "../../LSession.h" - - -ItemWidget::ItemWidget(QWidget *parent, QString itemPath, QString type, bool goback) : QFrame(parent){ - createWidget(); - //Now fill it appropriately - bool inHome = type.endsWith("-home"); //internal code - if(inHome){ type = type.remove("-home"); } - if(itemPath.endsWith(".desktop") || type=="app"){ - XDGDesktop item(itemPath, this); - gooditem = item.isValid(); - //qDebug() << "Good Item:" << gooditem << itemPath; - if(gooditem){ - icon->setPixmap( LXDG::findIcon(item.icon, "preferences-system-windows-actions").pixmap(32,32) ); - iconPath = item.icon; - text = item.name; - if(!item.genericName.isEmpty() && item.name!=item.genericName){ text.append("<br><i> -- "+item.genericName+"</i>"); } - name->setText(text); - name->setToolTip(item.comment); - setupActions(&item); - }else{ - return; - } - }else if(type=="dir"){ - actButton->setVisible(false); - if(itemPath.endsWith("/")){ itemPath.chop(1); } - if(goback){ - icon->setPixmap( LXDG::findIcon("go-previous","").pixmap(64,64) ); - iconPath = "go-previous"; - text = tr("Go Back"); - name->setText( text ); - }else{ - icon->setPixmap( LXDG::findIcon("folder","").pixmap(64,64) ); - iconPath = "folder"; - name->setText( itemPath.section("/",-1)); - text = itemPath.section("/",-1); - } - }else if(type.startsWith("chcat::::")){ - //Category given - actButton->setVisible(false); - iconPath = LXDG::DesktopCatToIcon(type.section("::::",1,50)); - if(goback){ iconPath = "go-previous"; type = "chcat::::"; itemPath = "<B>("+itemPath+")</B>"; } - icon->setPixmap( LXDG::findIcon(iconPath,"applications-other").pixmap(64,64) ); - name->setText(itemPath); - text = itemPath; - icon->setWhatsThis(type); - linkPath = type; - }else{ - actButton->setVisible(false); - if(itemPath.endsWith("/")){ itemPath.chop(1); } - if(QFileInfo(itemPath).isDir()){ - type = "dir"; - icon->setPixmap( LXDG::findIcon("folder","").pixmap(64,64) ); - iconPath = "folder"; - }else if(LUtils::imageExtensions().contains(itemPath.section("/",-1).section(".",-1).toLower()) ){ - icon->setPixmap( QIcon(itemPath).pixmap(64,64) ); - }else{ - if( LUtils::isValidBinary(itemPath) ){ icon->setPixmap( LXDG::findIcon(type, "application-x-executable").pixmap(64,64) ); } - else{ icon->setPixmap( LXDG::findMimeIcon(itemPath.section("/",-1)).pixmap(64,64) ); } - } - name->setText( itemPath.section("/",-1) ); //this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, TEXTCUTOFF) ); - text = itemPath.section("/",-1) ; - } - icon->setWhatsThis(itemPath); - if(!goback){ this->setWhatsThis(name->text()); } - isDirectory = (type=="dir"); //save this for later - if(LDesktopUtils::isFavorite(itemPath)){ - linkPath = itemPath; - isShortcut=true; - }else if( inHome ){//|| itemPath.section("/",0,-2)==QDir::homePath()+"/Desktop" ){ - isShortcut = true; - }else{ - isShortcut = false; - } - if(isShortcut && name->toolTip().isEmpty()){ - name->setToolTip(icon->whatsThis()); //also allow the user to see the full shortcut path - } - //Now setup the button appropriately - setupContextMenu(); -} - -// - Application constructor -ItemWidget::ItemWidget(QWidget *parent, XDGDesktop *item) : QFrame(parent){ - createWidget(); - if(item==0){ gooditem = false; return; } - isDirectory = false; - if(LDesktopUtils::isFavorite(item->filePath)){ - linkPath = item->filePath; - isShortcut=true; - }else if( item->filePath.section("/",0,-2)==QDir::homePath()+"/Desktop" ){ - isShortcut = true; - }else{ - isShortcut = false; - } - if(isShortcut){ - name->setToolTip(icon->whatsThis()); //also allow the user to see the full shortcut path - } - //Now fill it appropriately - icon->setPixmap( LXDG::findIcon(item->icon,"preferences-system-windows-actions").pixmap(64,64) ); - text = item->name; - if(!item->genericName.isEmpty() && item->name!=item->genericName){ text.append("<br><i> -- "+item->genericName+"</i>"); } - name->setText(text); - name->setToolTip(item->comment); - this->setWhatsThis(item->name); - icon->setWhatsThis(item->filePath); - iconPath = item->icon; - //Now setup the buttons appropriately - setupContextMenu(); - setupActions(item); -} - -ItemWidget::~ItemWidget(){ - icon->setPixmap(QPixmap()); //make sure the pixmap is cleared from memory too - actButton->deleteLater(); - contextMenu->clear(); - contextMenu->deleteLater(); - if(actButton->menu()!=0){ - for(int i=0; i<actButton->menu()->actions().length(); i++){ - actButton->menu()->actions().at(i)->deleteLater(); - } - actButton->menu()->deleteLater(); - } - actButton->deleteLater(); - icon->deleteLater(); - name->deleteLater(); - menureset->deleteLater(); - linkPath.clear(); iconPath.clear(); text.clear(); -} - -void ItemWidget::triggerItem(){ - ItemClicked(); -} - -void ItemWidget::createWidget(){ - //Initialize the widgets - gooditem = true; - menuopen = false; - menureset = new QTimer(this); - menureset->setSingleShot(true); - menureset->setInterval(1000); //1 second - this->setContentsMargins(0,0,0,0); - contextMenu = new QMenu(this); - connect(contextMenu, SIGNAL(aboutToShow()), this, SLOT(actionMenuOpen()) ); - connect(contextMenu, SIGNAL(aboutToHide()), this, SLOT(actionMenuClosed()) ); - actButton = new QToolButton(this); - actButton->setPopupMode(QToolButton::InstantPopup); - actButton->setArrowType(Qt::DownArrow); - icon = new QLabel(this); - name = new QLabel(this); - name->setWordWrap(true); - name->setTextFormat(Qt::RichText); - name->setTextInteractionFlags(Qt::NoTextInteraction); - //Add them to the layout - this->setLayout(new QHBoxLayout(this)); - this->layout()->setContentsMargins(1,1,1,1); - this->layout()->addWidget(icon); - this->layout()->addWidget(actButton); - this->layout()->addWidget(name); - //Set a custom object name so this can be tied into the Lumina Theme stylesheets - this->setObjectName("LuminaItemWidget"); -} - -void ItemWidget::setupContextMenu(){ - //Now refresh the context menu - contextMenu->clear(); - if(!QFile::exists(QDir::homePath()+"/Desktop/"+icon->whatsThis().section("/",-1)) ){ - //Does not have a desktop link - contextMenu->addAction( LXDG::findIcon("preferences-desktop-icons",""), tr("Pin to Desktop"), this, SLOT(PinToDesktop()) ); - } - //Favorite Item - if( LDesktopUtils::isFavorite(icon->whatsThis()) ){ //Favorite Item - can always remove this - contextMenu->addAction( LXDG::findIcon("edit-delete",""), tr("Remove from Favorites"), this, SLOT(RemoveFavorite()) ); - }else{ - //This file does not have a shortcut yet -- allow the user to add it - contextMenu->addAction( LXDG::findIcon("bookmark-toolbar",""), tr("Add to Favorites"), this, SLOT(AddFavorite()) ); - } - //QuickLaunch Item - if(LSession::handle()->sessionSettings()->value("QuicklaunchApps",QStringList()).toStringList().contains(icon->whatsThis()) ){ //Favorite Item - can always remove this - contextMenu->addAction( LXDG::findIcon("edit-delete",""), tr("Remove from Quicklaunch"), this, SLOT(RemoveQL()) ); - }else{ - //This file does not have a shortcut yet -- allow the user to add it - contextMenu->addAction( LXDG::findIcon("quickopen",""), tr("Add to Quicklaunch"), this, SLOT(AddQL()) ); - } -} - -void ItemWidget::setupActions(XDGDesktop *app){ - if(app==0 || app->actions.isEmpty()){ actButton->setVisible(false); return; } - //Actions Available - go ahead and list them all - actButton->setMenu( new QMenu(this) ); - for(int i=0; i<app->actions.length(); i++){ - QAction *act = new QAction(LXDG::findIcon(app->actions[i].icon, app->icon), app->actions[i].name, this); - act->setToolTip(app->actions[i].ID); - act->setWhatsThis(app->actions[i].ID); - actButton->menu()->addAction(act); - } - connect(actButton->menu(), SIGNAL(triggered(QAction*)), this, SLOT(actionClicked(QAction*)) ); - connect(actButton->menu(), SIGNAL(aboutToShow()), this, SLOT(actionMenuOpen()) ); - connect(actButton->menu(), SIGNAL(aboutToHide()), this, SLOT(actionMenuClosed()) ); - connect(menureset, SIGNAL(timeout()), this, SLOT(resetmenuflag()) ); -} - -void ItemWidget::updateItems(){ - //update the text/icon to match sizes - int H = 2.3*name->fontMetrics().height(); //make sure the height is large enough for two lines - icon->setFixedSize(QSize(H-4, H-4)); - actButton->setFixedSize( QSize( (H-4)/2, H-4) ); - QStringList newname = text.split("<br>"); - for(int i=0; i<newname.length(); i++){ newname[i] = name->fontMetrics().elidedText(newname[i], Qt::ElideRight, name->width()); } - name->setText( newname.join("<br>") ); - //Now reload the icon if necessary - if(icon->pixmap()!=0){ - if(icon->pixmap()->size().height() < (H-4) ){ - if(iconPath.isEmpty()){ - //Use item path (thumbnail or mimetype) - if(LUtils::imageExtensions().contains(icon->whatsThis().section("/",-1).section(".",-1).toLower()) ){ - icon->setPixmap( QIcon(icon->whatsThis()).pixmap(H-4,H-4).scaledToHeight(H-4,Qt::SmoothTransformation) ); - }else{ - icon->setPixmap( LXDG::findMimeIcon(icon->whatsThis().section("/",-1)).pixmap(H-4,H-4).scaledToHeight(H-4,Qt::SmoothTransformation) ); - } - }else{ - icon->setPixmap( LXDG::findIcon(iconPath,"preferences-system-windows-actions").pixmap(H-4,H-4).scaledToHeight(H-4,Qt::SmoothTransformation) ); - } - }else if(icon->pixmap()->size().height() > (H-4) ){ - icon->setPixmap( icon->pixmap()->scaled(H-4, H-4, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) ); - } - } -} - -void ItemWidget::PinToDesktop(){ - qDebug() << "Create Link on Desktop:" << icon->whatsThis(); - bool ok = QFile::link(icon->whatsThis(), QDir::homePath()+"/Desktop/"+icon->whatsThis().section("/",-1)); - qDebug() << " - " << (ok ? "Success": "Failure"); -} - -void ItemWidget::RemoveFavorite(){ - LDesktopUtils::removeFavorite(icon->whatsThis()); - linkPath.clear(); - emit RemovedShortcut(); -} - -void ItemWidget::AddFavorite(){ - if( LDesktopUtils::addFavorite(icon->whatsThis()) ){ - linkPath = icon->whatsThis(); - emit NewShortcut(); - } - -} -void ItemWidget::RemoveQL(){ - qDebug() << "Remove QuickLaunch Button:" << icon->whatsThis(); - emit toggleQuickLaunch(icon->whatsThis(), false); -} - -void ItemWidget::AddQL(){ - qDebug() << "Add QuickLaunch Button:" << icon->whatsThis(); - emit toggleQuickLaunch(icon->whatsThis(), true); -} - - -void ItemWidget::ItemClicked(){ - if(!linkPath.isEmpty()){ emit RunItem(linkPath); } - else{ emit RunItem(icon->whatsThis()); } -} - -void ItemWidget::actionClicked(QAction *act){ - actButton->menu()->hide(); - QString cmd = "lumina-open -action \""+act->whatsThis()+"\" \"%1\""; - if(!linkPath.isEmpty()){ cmd = cmd.arg(linkPath); } - else{ cmd = cmd.arg(icon->whatsThis()); } - emit RunItem(cmd); -} diff --git a/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/ItemWidget.h b/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/ItemWidget.h deleted file mode 100644 index 11394dd6..00000000 --- a/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/ItemWidget.h +++ /dev/null @@ -1,98 +0,0 @@ -//=========================================== -// Lumina-DE source code -// Copyright (c) 2014-2015, Ken Moore -// Available under the 3-clause BSD license -// See the LICENSE file for full details -//=========================================== -// This item widget manages a single file/directory -//=========================================== -#ifndef _LUMINA_PANEL_SYSTEM_START_ITEM_WIDGET_H -#define _LUMINA_PANEL_SYSTEM_START_ITEM_WIDGET_H - -#include <QFrame> -#include <QLabel> -#include <QToolButton> -#include <QString> -#include <QHBoxLayout> -#include <QSize> -#include <QDir> -#include <QFile> -#include <QMouseEvent> -#include <QAction> -#include <QMenu> -#include <QTimer> -#include <QResizeEvent> - -#include <LuminaXDG.h> - -class ItemWidget : public QFrame{ - Q_OBJECT -public: - //Overloaded Constructors for various uses - // - Favorites (path/type) - ItemWidget(QWidget *parent=0, QString itemPath="", QString type="unknown", bool goback=false); - // - Generic Apps - ItemWidget(QWidget *parent=0, XDGDesktop *item= 0); - - ~ItemWidget(); - - bool gooditem; - - void triggerItem(); //trigger this item - just as if it was clicked on - -private: - QToolButton *actButton; - QMenu *contextMenu; - QLabel *icon, *name; - bool isDirectory, isShortcut, menuopen; - QString linkPath, iconPath, text; - QTimer *menureset; - - void createWidget(); - - void setupContextMenu(); - void setupActions(XDGDesktop*); - - void updateItems(); //update the text/icon to match sizes - -private slots: - void PinToDesktop(); - void RemoveFavorite(); - void AddFavorite(); - void RemoveQL(); - void AddQL(); - void ItemClicked(); - void actionClicked(QAction*); - //Functions to fix the submenu open/close issues - void actionMenuOpen(){ - if(menureset->isActive()){ menureset->stop(); } - menuopen = true; - } - void resetmenuflag(){ menuopen = false; } //tied to the "menureset" timer - void actionMenuClosed(){ menureset->start(); } - - -protected: - void mouseReleaseEvent(QMouseEvent *event){ - if(menuopen){ resetmenuflag(); } //skip this event if a submenu was open - else if(event->button() == Qt::RightButton && !icon->whatsThis().startsWith("chcat::::") ){ - menuopen = true; - setupContextMenu(); - contextMenu->popup(event->globalPos()); - }else if(event->button() != Qt::NoButton){ ItemClicked(); } - } - - void resizeEvent(QResizeEvent *ev){ - updateItems(); //update the sizing of everything - QFrame::resizeEvent(ev); // do the normal procedures - } - -signals: - void NewShortcut(); - void RemovedShortcut(); - void RunItem(QString cmd); - void toggleQuickLaunch(QString path, bool ok); - -}; - -#endif diff --git a/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/LStartButton.cpp b/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/LStartButton.cpp deleted file mode 100644 index f44add77..00000000 --- a/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/LStartButton.cpp +++ /dev/null @@ -1,137 +0,0 @@ -//=========================================== -// Lumina-DE source code -// Copyright (c) 2015, Ken Moore -// Available under the 3-clause BSD license -// See the LICENSE file for full details -//=========================================== -#include "LStartButton.h" -#include "../../LSession.h" - -#include <LuminaXDG.h> -#include <LUtils.h> //This contains the "ResizeMenu" class - -LStartButtonPlugin::LStartButtonPlugin(QWidget *parent, QString id, bool horizontal) : LPPlugin(parent, id, horizontal){ - button = new QToolButton(this); - button->setAutoRaise(true); - button->setToolButtonStyle(Qt::ToolButtonIconOnly); - button->setPopupMode(QToolButton::DelayedPopup); //make sure it runs the update routine first - connect(button, SIGNAL(clicked()), this, SLOT(openMenu())); - this->layout()->setContentsMargins(0,0,0,0); - this->layout()->addWidget(button); - menu = new ResizeMenu(this); - menu->setContentsMargins(1,1,1,1); - connect(menu, SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed())); - connect(menu, SIGNAL(MenuResized(QSize)), this, SLOT(SaveMenuSize(QSize)) ); - startmenu = new StartMenu(this); - connect(startmenu, SIGNAL(CloseMenu()), this, SLOT(closeMenu()) ); - connect(startmenu, SIGNAL(UpdateQuickLaunch(QStringList)), this, SLOT(updateQuickLaunch(QStringList))); - menu->setContents(startmenu); - QSize saved = LSession::handle()->DesktopPluginSettings()->value("panelPlugs/"+this->type()+"/MenuSize", QSize(0,0)).toSize(); - if(!saved.isNull()){ startmenu->setFixedSize(saved); } //re-load the previously saved value - - button->setMenu(menu); - connect(menu, SIGNAL(aboutToHide()), this, SLOT(updateButtonVisuals()) ); - QTimer::singleShot(0,this, SLOT(OrientationChange())); //Update icons/sizes - QTimer::singleShot(0, startmenu, SLOT(ReLoadQuickLaunch()) ); - //Setup the global shortcut handling for opening the start menu - connect(QApplication::instance(), SIGNAL(StartButtonActivated()), this, SLOT(shortcutActivated()) ); - LSession::handle()->registerStartButton(this->type()); -} - -LStartButtonPlugin::~LStartButtonPlugin(){ - LSession::handle()->unregisterStartButton(this->type()); -} - -void LStartButtonPlugin::updateButtonVisuals(){ - button->setToolTip(tr("")); - button->setText( SYSTEM::user() ); - button->setIcon( LXDG::findIcon("start-here-lumina","Lumina-DE") ); //force icon refresh -} - -void LStartButtonPlugin::updateQuickLaunch(QStringList apps){ - //First clear any obsolete apps - QStringList old; - //qDebug() << "Update QuickLaunch Buttons"; - for(int i=0; i<QUICKL.length(); i++){ - if( !apps.contains(QUICKL[i]->whatsThis()) ){ - //App was removed - QUICKL.takeAt(i)->deleteLater(); - i--; - }else{ - //App still listed - update the button - old << QUICKL[i]->whatsThis(); //add the list of current buttons - LFileInfo info(QUICKL[i]->whatsThis()); - QUICKL[i]->setIcon( LXDG::findIcon(info.iconfile(),"unknown") ); - if(info.isDesktopFile()){ QUICKL[i]->setToolTip( info.XDG()->name ); } - else{ QUICKL[i]->setToolTip( info.fileName() ); } - } - } - //Now go through and create any new buttons - for(int i=0; i<apps.length(); i++){ - if( !old.contains(apps[i]) ){ - //New App - LQuickLaunchButton *tmp = new LQuickLaunchButton(apps[i], this); - QUICKL << tmp; - LFileInfo info(apps[i]); - tmp->setIcon( LXDG::findIcon( info.iconfile() ) ); - if(info.isDesktopFile()){ tmp->setToolTip( info.XDG()->name ); } - else{ tmp->setToolTip( info.fileName() ); } - //Now add the button to the layout and connect the signal/slots - this->layout()->insertWidget(i+1,tmp); //"button" is always in slot 0 - connect(tmp, SIGNAL(Launch(QString)), this, SLOT(LaunchQuick(QString)) ); - connect(tmp, SIGNAL(Remove(QString)), this, SLOT(RemoveQuick(QString)) ); - } - } - //qDebug() << " - Done updateing QuickLaunch Buttons"; - QTimer::singleShot(0,this, SLOT(OrientationChange())); //Update icons/sizes -} - -void LStartButtonPlugin::LaunchQuick(QString file){ - //Need to get which button was clicked - //qDebug() << "Quick Launch triggered:" << file; - if(!file.isEmpty()){ - LSession::LaunchApplication("lumina-open \""+file+"\""); - emit MenuClosed(); - } -} - -void LStartButtonPlugin::RemoveQuick(QString file){ - //qDebug() << "Remove Quicklaunch Button:" << file; - if(!file.isEmpty()){ - startmenu->UpdateQuickLaunch(file, false); //always a removal - emit MenuClosed(); - } -} - -void LStartButtonPlugin::SaveMenuSize(QSize sz){ - //Save this size for the menu - LSession::handle()->DesktopPluginSettings()->setValue("panelPlugs/"+this->type()+"/MenuSize", sz); -} - -// ======================== -// PRIVATE FUNCTIONS -// ======================== -void LStartButtonPlugin::openMenu(){ - if(menu->isVisible()){ return; } //don't re-show it - already open - //TESTING CODE TO SEE IF THIS MAKES IT RECOVER MEMORY - /*StartMenu *old = startmenu; - startmenu = new StartMenu(this); - connect(startmenu, SIGNAL(CloseMenu()), this, SLOT(closeMenu()) ); - connect(startmenu, SIGNAL(UpdateQuickLaunch(QStringList)), this, SLOT(updateQuickLaunch(QStringList))); - menu->setContents(startmenu); - if(old!=0){ old->deleteLater(); }*/ -//-------- - startmenu->UpdateMenu(); - button->showMenu(); -} - -void LStartButtonPlugin::closeMenu(){ - menu->hide(); -} - -void LStartButtonPlugin::shortcutActivated(){ - if(LSession::handle()->registerStartButton(this->type())){ - if(menu->isVisible()){ closeMenu(); } - else{ this->activateWindow(); openMenu(); } - } -} diff --git a/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/LStartButton.h b/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/LStartButton.h deleted file mode 100644 index d46bb1be..00000000 --- a/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/LStartButton.h +++ /dev/null @@ -1,113 +0,0 @@ -//=========================================== -// Lumina-DE source code -// Copyright (c) 2015, Ken Moore -// Available under the 3-clause BSD license -// See the LICENSE file for full details -//=========================================== -// This panel plugin is the main button that allow the user to run -// applications or logout of the desktop -//=========================================== -#ifndef _LUMINA_DESKTOP_START_MENU_PLUGIN_H -#define _LUMINA_DESKTOP_START_MENU_PLUGIN_H - -// Qt includes -#include <QMenu> -#include <QWidgetAction> -#include <QToolButton> -#include <QString> -#include <QWidget> -#include <QMenu> - -// Lumina-desktop includes -//#include "../../Globals.h" -#include "../LPPlugin.h" //main plugin widget - -// libLumina includes -#include <LuminaXDG.h> -#include <LUtils.h> -#include <ResizeMenu.h> - -#include "StartMenu.h" - -//Simple Tool Button For QuickLaunch Items -class LQuickLaunchButton : public QToolButton{ - Q_OBJECT -signals: - void Launch(QString); - void Remove(QString); - -private slots: - void rmentry(){ - emit Remove(this->whatsThis()); - } - void launchentry(){ - emit Launch(this->whatsThis()); - } - -public: - LQuickLaunchButton(QString path, QWidget* parent = 0) : QToolButton(parent){ - this->setWhatsThis(path); - this->setMenu(new QMenu(this)); - this->setContextMenuPolicy(Qt::CustomContextMenu); - this->menu()->addAction( LXDG::findIcon("edit-delete",""), tr("Remove from Quicklaunch"), this, SLOT(rmentry()) ); - connect(this, SIGNAL(clicked()), this, SLOT(launchentry()) ); - connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showMenu()) ); - } - ~LQuickLaunchButton(){} - -}; - -// PANEL PLUGIN BUTTON -class LStartButtonPlugin : public LPPlugin{ - Q_OBJECT - -public: - LStartButtonPlugin(QWidget *parent = 0, QString id = "systemstart", bool horizontal=true); - ~LStartButtonPlugin(); - -private: - ResizeMenu *menu; - //QWidgetAction *mact; - StartMenu *startmenu; - QToolButton *button; - QList<LQuickLaunchButton*> QUICKL; - -private slots: - void openMenu(); - void closeMenu(); - void shortcutActivated(); - - void updateButtonVisuals(); - - void updateQuickLaunch(QStringList); - void LaunchQuick(QString); - void RemoveQuick(QString); - void SaveMenuSize(QSize); - -public slots: - void OrientationChange(){ - if(this->layout()->direction()==QBoxLayout::LeftToRight){ - this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); - button->setIconSize( QSize(this->height(), this->height()) ); - for(int i=0; i<QUICKL.length(); i++){ QUICKL[i]->setIconSize(QSize(this->height(), this->height())); } - }else{ - this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); - button->setIconSize( QSize(this->width(), this->width()) ); - for(int i=0; i<QUICKL.length(); i++){ QUICKL[i]->setIconSize(QSize(this->width(), this->width())); } - } - this->layout()->update(); - updateButtonVisuals(); - } - - void LocaleChange(){ - updateButtonVisuals(); - if(startmenu!=0){ startmenu->UpdateAll(); } - } - - void ThemeChange(){ - updateButtonVisuals(); - if(startmenu!=0){ startmenu->UpdateAll(); } - } -}; - -#endif diff --git a/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/StartMenu.cpp b/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/StartMenu.cpp deleted file mode 100644 index d05ba22f..00000000 --- a/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/StartMenu.cpp +++ /dev/null @@ -1,720 +0,0 @@ -//=========================================== -// Lumina-DE source code -// Copyright (c) 2015, Ken Moore -// Available under the 3-clause BSD license -// See the LICENSE file for full details -//=========================================== -#include "StartMenu.h" -#include "ui_StartMenu.h" -//#include <QtConcurrent> - -#include <LuminaOS.h> -#include "../../LSession.h" -#include <QtConcurrent> -#include <QMessageBox> - -#include "ItemWidget.h" -//#define SSAVER QString("xscreensaver-demo") - -StartMenu::StartMenu(QWidget *parent) : QWidget(parent), ui(new Ui::StartMenu){ - ui->setupUi(this); //load the designer file - this->setMouseTracking(true); - searchTimer = new QTimer(this); - searchTimer->setInterval(300); //~1/3 second - searchTimer->setSingleShot(true); - connect(searchTimer, SIGNAL(timeout()), this, SLOT(startSearch()) ); - connect(LSession::handle()->applicationMenu(), SIGNAL(AppMenuUpdated()), this, SLOT(UpdateApps()) ); - connect(LSession::handle(), SIGNAL(FavoritesChanged()), this, SLOT(UpdateFavs()) ); - //Need to load the last used setting of the application list - QString state = LSession::handle()->DesktopPluginSettings()->value("panelPlugs/systemstart/showcategories", "partial").toString(); - if(state=="partial"){ui->check_apps_showcats->setCheckState(Qt::PartiallyChecked); } - else if(state=="true"){ ui->check_apps_showcats->setCheckState(Qt::Checked); } - else{ ui->check_apps_showcats->setCheckState(Qt::Unchecked); } - connect(ui->check_apps_showcats, SIGNAL(stateChanged(int)), this, SLOT(catViewChanged()) ); - UpdateAll(); - QTimer::singleShot(10, this,SLOT(UpdateApps())); - QTimer::singleShot(10, this, SLOT(UpdateFavs())); -} - -StartMenu::~StartMenu(){ - -} - -void StartMenu::UpdateAll(){ - //Update all the icons/text on all the pages - - // Update Text - ui->retranslateUi(this); - - //Update Icons - ui->tool_goto_apps->setIcon(LXDG::findIcon("system-run","")); - ui->tool_goto_settings->setIcon(LXDG::findIcon("preferences-system","")); - ui->tool_launch_fm->setIcon(LXDG::findIcon("user-home","")); - ui->tool_launch_desksettings->setIcon(LXDG::findIcon("preferences-desktop","")); - ui->tool_lock->setIcon(LXDG::findIcon("system-lock-screen","")); - ui->tool_goto_logout->setIcon(LXDG::findIcon("system-log-out","")); - ui->tool_back->setIcon(LXDG::findIcon("go-previous","")); - ui->tool_launch_deskinfo->setIcon(LXDG::findIcon("system-help","")); - - ui->tool_launch_mixer->setIcon( LXDG::findIcon("preferences-desktop-sound","") ); - ui->label_bright_icon->setPixmap( LXDG::findIcon("preferences-system-power-management","").pixmap(ui->tool_goto_apps->iconSize()) ); - ui->label_locale_icon->setPixmap( LXDG::findIcon("preferences-desktop-locale","").pixmap(ui->tool_goto_apps->iconSize()) ); - ui->tool_set_nextwkspace->setIcon(LXDG::findIcon("go-next-view","")); - ui->tool_set_prevwkspace->setIcon(LXDG::findIcon("go-previous-view","")); - ui->tool_logout->setIcon(LXDG::findIcon("system-log-out","")); - ui->tool_restart->setIcon(LXDG::findIcon("system-reboot","")); - ui->tool_shutdown->setIcon(LXDG::findIcon("system-shutdown","")); - ui->tool_suspend->setIcon(LXDG::findIcon("system-suspend","")); - - //Update Visibility of system/session/OS options - // -- Control Panel - QString tmp = LOS::ControlPanelShortcut(); - if(QFile::exists(tmp)){ - ui->tool_launch_controlpanel->setWhatsThis(tmp); - //Now read the file to see which icon to use - XDGDesktop desk(tmp); - if(desk.isValid()){ - ui->tool_launch_controlpanel->setIcon(LXDG::findIcon(desk.icon,"preferences-other")); - }else{ ui->tool_launch_controlpanel->setVisible(false); } - }else{ ui->tool_launch_controlpanel->setVisible(false); } - // -- App Store - tmp = LOS::AppStoreShortcut(); - if(QFile::exists(tmp)){ - ui->tool_launch_store->setWhatsThis(tmp); - //Now read the file to see which icon to use - XDGDesktop desk(tmp); - if(desk.isValid()){ - ui->tool_launch_store->setIcon(LXDG::findIcon(desk.icon,"utilities-file-archiver")); - }else{ ui->tool_launch_store->setVisible(false); } - }else{ ui->tool_launch_store->setVisible(false); } - //Audio Controls - ui->frame_audio->setVisible( LOS::audioVolume() >=0 ); - //Brightness controls - ui->frame_bright->setVisible( LOS::ScreenBrightness() >=0 ); - //Shutdown/restart - bool ok = LOS::userHasShutdownAccess(); - ui->frame_leave_system->setWhatsThis(ok ? "allowed": ""); - ui->frame_leave_system->setVisible(ok); - //Battery Availability - ok = LOS::hasBattery(); - ui->label_status_battery->setWhatsThis(ok ? "allowed": ""); - ui->label_status_battery->setVisible(ok); - //Locale availability - QStringList locales = LUtils::knownLocales(); - ui->stackedWidget->setCurrentWidget(ui->page_main); //need to ensure the settings page is not active - ui->combo_locale->clear(); - QString curr = LUtils::currentLocale(); - //qDebug() << "Update Locales:" << locales; - //qDebug() << "Current Locale:" << curr; - for(int i=0; i<locales.length(); i++){ - QLocale loc( (locales[i]=="pt") ? "pt_PT" : locales[i] ); - ui->combo_locale->addItem(loc.nativeLanguageName() +" ("+locales[i]+")", locales[i]); //Make the display text prettier later - if(locales[i] == curr || locales[i] == curr.section("_",0,0) ){ - //Current Locale - ui->combo_locale->setCurrentIndex(ui->combo_locale->count()-1); //the last item in the list right now - } - } - ui->frame_locale->setVisible(locales.length() > 1); - //User Name in status bar - ui->label_status->setText( QString::fromLocal8Bit(getlogin()) ); - //Lumina Utilities - ui->tool_launch_desksettings->setVisible(LUtils::isValidBinary("lumina-config")); - ui->tool_launch_deskinfo->setVisible(LUtils::isValidBinary("lumina-info")); - -} - -void StartMenu::UpdateMenu(bool forceall){ - //qDebug() << "Update Menu" << forceall; - ui->line_search->clear(); - if(forceall){ UpdateAll(); } - //Quick update routine before the menu is made visible - //qDebug() << "update favs"; - //UpdateFavs(); - //qDebug() << "check page"; - if(ui->stackedWidget->currentWidget() != ui->page_main){ - ui->stackedWidget->setCurrentWidget(ui->page_main); //just show the main page - }else{ - on_stackedWidget_currentChanged(0); //refresh/update the main page every time - } - //qDebug() << "done"; -} - -void StartMenu::ReLoadQuickLaunch(){ - emit UpdateQuickLaunch( LSession::handle()->sessionSettings()->value("QuicklaunchApps",QStringList()).toStringList() ); -} - -void StartMenu::UpdateQuickLaunch(QString path, bool keep){ - QStringList QL = LSession::handle()->sessionSettings()->value("QuicklaunchApps",QStringList()).toStringList(); - if(keep){QL << path; } - else{ QL.removeAll(path); } - QL.removeDuplicates(); - LSession::handle()->sessionSettings()->setValue("QuicklaunchApps",QL); - //LSession::handle()->sessionSettings()->sync(); - emit UpdateQuickLaunch(QL); -} - -// ========================== -// PRIVATE FUNCTIONS -// ========================== -/*void StartMenu::deleteChildren(QWidget *obj){ - if(obj->layout()==0){ - for(int i=0; i<obj->children().count(); i++){ - obj->children().at(i)->deleteLater(); - } - }else{ - - } -}*/ - -void StartMenu::ClearScrollArea(QScrollArea *area){ - //QWidget *old = area->takeWidget(); - //qDebug() << "Clear Scroll Area:"; - //if(old->layout()!=0){ qDebug() << " - Number of items in layout:" << old->layout()->count(); } - //qDebug() << " - Number of Children:" << old->children().count(); - //deleteChildren(old); //make sure we *fully* delete these items to save memory - //old->deleteLater(); - if(area == ui->scroll_favs){ - area->takeWidget()->deleteLater(); - } - if(area->widget()==0){ - area->setWidget( new QWidget(area) ); //create a new widget in the scroll area - } - if(area->widget()->layout()==0){ - QVBoxLayout *layout = new QVBoxLayout(area->widget()); - layout->setSpacing(2); - layout->setContentsMargins(3,1,3,1); - layout->setDirection(QBoxLayout::TopToBottom); - layout->setAlignment(Qt::AlignTop); - area->widget()->setContentsMargins(0,0,0,0); - area->widget()->setLayout(layout); - } - //Now clear the items in the layout - while( area->widget()->layout()->count() >0 ){ - QLayoutItem *it = area->widget()->layout()->takeAt(0); - //Need to delete both the widget and the layout item - if(it->widget()!=0){ it->widget()->deleteLater(); } - delete it; - } -} - -void StartMenu::SortScrollArea(QScrollArea *area){ - //qDebug() << "Sorting Scroll Area:"; - //Sort all the items in the scroll area alphabetically - QLayout *lay = area->widget()->layout(); - QStringList items; - for(int i=0; i<lay->count(); i++){ - items << lay->itemAt(i)->widget()->whatsThis(); - } - - items.sort(); - //qDebug() << " - Sorted Items:" << items; - for(int i=0; i<items.length(); i++){ - if(items[i].isEmpty()){ continue; } - //QLayouts are weird in that they can only add items to the end - need to re-insert almost every item - for(int j=0; j<lay->count(); j++){ - //Find this item - if(lay->itemAt(j)->widget()->whatsThis()==items[i]){ - //Found it - now move it if necessary - //qDebug() << "Found Item:" << items[i] << i << j; - lay->addItem( lay->takeAt(j) ); - break; - } - } - } -} - -void StartMenu::do_search(QString search, bool force){ - search = search.simplified(); //remove unneccesary whitespace - if(search == CSearch && !force){ - //nothing new - just ensure the page is visible - if(ui->stackedWidget->currentWidget()!=ui->page_search ){ ui->stackedWidget->setCurrentWidget(ui->page_search); } - return; - }else if(search.isEmpty()){ - CSearch.clear(); - if(ui->stackedWidget->currentWidget()==ui->page_search ){ on_tool_back_clicked(); } - return; - } - //Got a search term - check it - CSearch = search; //save this for comparison later - qDebug() << "Search for term:" << search; - ClearScrollArea(ui->scroll_search); - topsearch.clear(); - //Now find any items which match the search - QStringList found; //syntax: [<sorter>::::<mimetype>::::<filepath>] - QString tmp = search; - if(LUtils::isValidBinary(tmp)){ found << "0::::application/x-executable::::"+tmp; } - QList<XDGDesktop*> apps = LSession::handle()->applicationMenu()->currentAppHash()->value("All"); - for(int i=0; i<apps.length(); i++){ - int priority = -1; - if(apps[i]->name.toLower()==search.toLower()){ priority = 10; } - else if(apps[i]->name.startsWith(search, Qt::CaseInsensitive)){ priority = 15; } - else if(apps[i]->name.contains(search, Qt::CaseInsensitive)){ priority = 19; } - else if(apps[i]->genericName.contains(search, Qt::CaseInsensitive)){ priority = 20; } - else if(apps[i]->comment.contains(search, Qt::CaseInsensitive)){ priority = 30; } - //Can add other filters here later - - if(priority>0){ - found << QString::number(priority)+"::::app::::"+apps[i]->filePath; - } - } - found.sort(Qt::CaseInsensitive); //sort by priority/type (lower numbers are higher on list) - //qDebug() << "Sorted Items:" << found; - //Now add the items to the menu in order - for(int i=0; i<found.length(); i++){ - if( !QFile::exists(found[i].section("::::",2,-1)) ){ continue; } //invalid favorite - skip it - if(topsearch.isEmpty()){ topsearch = found[i].section("::::",2,-1); } - ItemWidget *it = 0; - if( found[i].section("::::",2,-1).endsWith(".desktop")){ - XDGDesktop item(found[i].section("::::",2,-1)); - if(item.isValid()){ it = new ItemWidget(ui->scroll_favs->widget(), &item); } - }else{ - it = new ItemWidget(ui->scroll_favs->widget(), found[i].section("::::",2,-1), found[i].section("::::",1,1) ); - } - if(it==0){ continue; } - if(!it->gooditem){ it->deleteLater(); continue; } //invalid for some reason - ui->scroll_search->widget()->layout()->addWidget(it); - connect(it, SIGNAL(NewShortcut()), this, SLOT(UpdateFavs()) ); - connect(it, SIGNAL(RemovedShortcut()), this, SLOT(UpdateFavs()) ); - connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) ); - connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) ); - if(i%3==0){ - QApplication::processEvents(); - if(searchTimer->isActive()){ return; } //search changed - go ahead and stop here - } - } - ui->stackedWidget->setCurrentWidget(ui->page_search); -} - -bool StartMenu::promptAboutUpdates(bool &skip){ - QString pending = LOS::systemPendingUpdates(); - if(pending.isEmpty()){ skip = false; } //continue without skip - else{ - QMessageBox dlg(QMessageBox::Question, tr("Apply Updates?"), tr("You have system updates waiting to be applied! Do you wish to install them now?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, this); - dlg.setDetailedText(pending); - dlg.setDefaultButton(QMessageBox::Yes); - dlg.show(); - int ret = dlg.exec(); - if(ret == QMessageBox::Cancel){ return false; } //do not continue - else{ skip = (ret==QMessageBox::No); } - } - return true; -} - -// ======================== -// PRIVATE SLOTS -// ======================== -void StartMenu::LaunchItem(QString path, bool fix){ - if(path.startsWith("chcat::::")){ - ChangeCategory(path.section("::::",1,50)); - return; - } - qDebug() << "Launching Item:" << path << fix; - if(!path.isEmpty()){ - qDebug() << "Launch Application:" << path; - if( fix && !path.startsWith("lumina-open") ){ LSession::LaunchApplication("lumina-open \""+path+"\""); } - else{ LSession::LaunchApplication(path); } - emit CloseMenu(); //so the menu container will close - } -} - -void StartMenu::ChangeCategory(QString cat){ - //This only happens on user interaction - make sure to run the update routine in a separate thread - CCat = cat; - UpdateApps(); - //QtConcurrent::run(this, &StartMenu::UpdateApps); -} - -//Listing Update routines -void StartMenu::UpdateApps(){ - ClearScrollArea(ui->scroll_apps); - //Now assemble the apps list - //qDebug() << "Update Apps:";// << CCat << ui->check_apps_showcats->checkState(); - if(ui->check_apps_showcats->checkState() == Qt::PartiallyChecked){ - //qDebug() << " - Partially Checked"; - //Show a single page of apps, but still divided up by categories - CCat.clear(); - QStringList cats = LSession::handle()->applicationMenu()->currentAppHash()->keys(); - cats.sort(); - cats.removeAll("All"); - for(int c=0; c<cats.length(); c++){ - QList<XDGDesktop*> apps = LSession::handle()->applicationMenu()->currentAppHash()->value(cats[c]); - if(apps.isEmpty()){ continue; } - //Add the category label to the scroll - QLabel *catlabel = new QLabel("<b>"+cats[c]+"</b>",ui->scroll_apps->widget()); - catlabel->setAlignment(Qt::AlignCenter); - ui->scroll_apps->widget()->layout()->addWidget(catlabel); - //Now add all the apps for this category - for(int i=0; i<apps.length(); i++){ - ItemWidget *it = new ItemWidget(ui->scroll_apps->widget(), apps[i] ); - if(!it->gooditem){ qDebug() << "Invalid Item:"; it->deleteLater(); continue; } //invalid for some reason - ui->scroll_apps->widget()->layout()->addWidget(it); - connect(it, SIGNAL(NewShortcut()), this, SLOT(UpdateFavs()) ); - connect(it, SIGNAL(RemovedShortcut()), this, SLOT(UpdateFavs()) ); - connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) ); - connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) ); - } - } - - }else if(ui->check_apps_showcats->checkState() == Qt::Checked){ - //qDebug() << " - Checked"; - //Only show categories to start with - and have the user click-into a cat to see apps - if(CCat.isEmpty()){ - //No cat selected yet - show cats only - QStringList cats = LSession::handle()->applicationMenu()->currentAppHash()->keys(); - cats.sort(); - cats.removeAll("All"); //This is not a "real" category - for(int c=0; c<cats.length(); c++){ - ItemWidget *it = new ItemWidget(ui->scroll_apps->widget(), cats[c], "chcat::::"+cats[c] ); - if(!it->gooditem){ qDebug() << "Invalid Item:";it->deleteLater(); continue; } //invalid for some reason - ui->scroll_apps->widget()->layout()->addWidget(it); - connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) ); - } - }else{ - //qDebug() << "Show Apps For category:" << CCat; - //Show the "go back" button - ItemWidget *it = new ItemWidget(ui->scroll_apps->widget(), CCat, "chcat::::"+CCat, true); - //if(!it->gooditem){ continue; } //invalid for some reason - ui->scroll_apps->widget()->layout()->addWidget(it); - connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) ); - //Show apps for this cat - QList<XDGDesktop*> apps = LSession::handle()->applicationMenu()->currentAppHash()->value(CCat); - for(int i=0; i<apps.length(); i++){ - //qDebug() << " - App:" << apps[i].name; - ItemWidget *it = new ItemWidget(ui->scroll_apps->widget(), apps[i] ); - if(!it->gooditem){ qDebug() << "Invalid Item:"; it->deleteLater(); continue; } //invalid for some reason - ui->scroll_apps->widget()->layout()->addWidget(it); - connect(it, SIGNAL(NewShortcut()), this, SLOT(UpdateFavs()) ); - connect(it, SIGNAL(RemovedShortcut()), this, SLOT(UpdateFavs()) ); - connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) ); - connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) ); - } - } - - }else{ - //qDebug() << " - Not Checked"; - //No categories at all - just alphabetize all the apps - QList<XDGDesktop*> apps = LSession::handle()->applicationMenu()->currentAppHash()->value("All"); - CCat.clear(); - //Now add all the apps for this category - for(int i=0; i<apps.length(); i++){ - ItemWidget *it = new ItemWidget(ui->scroll_apps->widget(), apps[i] ); - if(!it->gooditem){ it->deleteLater(); continue; } //invalid for some reason - ui->scroll_apps->widget()->layout()->addWidget(it); - connect(it, SIGNAL(NewShortcut()), this, SLOT(UpdateFavs()) ); - connect(it, SIGNAL(RemovedShortcut()), this, SLOT(UpdateFavs()) ); - connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) ); - connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) ); - } - } - - -} - -void StartMenu::UpdateFavs(){ - //SYNTAX NOTE: (per-line) "<name>::::[dir/app/<mimetype>]::::<path>" - QStringList newfavs = LDesktopUtils::listFavorites(); - if(favs == newfavs){ return; } //nothing to do - same as before - favs = newfavs; - ClearScrollArea(ui->scroll_favs); - favs.sort(); - //Iterate over types of favorites - QStringList rest = favs; - QStringList tmp; - for(int type = 0; type<3; type++){ - if(type==0){ tmp = favs.filter("::::app::::"); } //apps first - else if(type==1){ tmp = favs.filter("::::dir::::"); } //dirs next - else{ tmp = rest; } //everything left over - if(type==1){ - SortScrollArea(ui->scroll_favs); - //Need to run a special routine for sorting the apps (already in the widget) - //qDebug() << "Sort App Widgets..."; - // Since each app actually might have a different name listed within the file - /*QLayout *lay = ui->scroll_favs->widget()->layout(); - QStringList items; - for(int i=0; i<lay->count(); i++){ - items << lay->itemAt(i)->widget()->whatsThis().toLower(); - } - - items.sort(); - // qDebug() << " - Sorted Items:" << items; - for(int i=0; i<items.length(); i++){ - if(items[i].isEmpty()){ continue; } - //QLayouts are weird in that they can only add items to the end - need to re-insert almost every item - for(int j=0; j<lay->count(); j++){ - //Find this item - if(lay->itemAt(j)->widget()->whatsThis().toLower()==items[i]){ - //Found it - now move it if necessary - //qDebug() << "Found Item:" << items[i] << i << j; - lay->addItem( lay->takeAt(j) ); - break; - } - } - }*/ - - }//end of special app sorting routine - tmp.sort(); //Sort alphabetically by name (dirs/files) - for(int i=0; i<tmp.length(); i++){ - if(type<2){ rest.removeAll(tmp[i]); } - if( !QFile::exists(tmp[i].section("::::",2,-1)) ){ continue; } //invalid favorite - skip it - ItemWidget *it = 0; - if( tmp[i].section("::::",2,-1).endsWith(".desktop")){ - XDGDesktop item(tmp[i].section("::::",2,-1)); - if(item.isValid()){ it = new ItemWidget(ui->scroll_favs->widget(), &item); } - }else{ - it = new ItemWidget(ui->scroll_favs->widget(), tmp[i].section("::::",2,-1), tmp[i].section("::::",1,1) ); - } - if(it==0){ continue; } - if(!it->gooditem){ it->deleteLater(); continue; } //invalid for some reason - ui->scroll_favs->widget()->layout()->addWidget(it); - connect(it, SIGNAL(NewShortcut()), this, SLOT(UpdateFavs()) ); - connect(it, SIGNAL(RemovedShortcut()), this, SLOT(UpdateFavs()) ); - connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) ); - connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) ); - } - //QApplication::processEvents(); - } //end loop over types - ui->scroll_favs->update(); - //qDebug() << "End updateFavs"; -} - -// Page update routines -void StartMenu::on_stackedWidget_currentChanged(int val){ - QWidget *page = ui->stackedWidget->widget(val); - ui->tool_back->setVisible(page != ui->page_main); - ui->line_search->setFocus(); - - //Now the page specific updates - if(page == ui->page_main){ - if(!ui->label_status_battery->whatsThis().isEmpty()){ - //Battery available - update the status button - int charge = LOS::batteryCharge(); - QString TT, ICON; - if(charge<=5){ ICON="-caution"; } - else if(charge<=20){ ICON="-040"; } - else if(charge<=70){ ICON="-060"; } - else if(charge<=90){ ICON="-080"; } - else{ ICON="-100"; } - if(LOS::batteryIsCharging()){ - if(charge>=80){ ICON.clear(); } //for charging, there is no suffix to the icon name over 80% - ICON.prepend("battery-charging"); - TT = QString(tr("%1% (Plugged In)")).arg(QString::number(charge)); - }else{ - ICON.prepend("battery"); - int secs = LOS::batterySecondsLeft(); - if(secs>1){ TT = QString(tr("%1% (%2 Estimated)")).arg(QString::number(charge), LUtils::SecondsToDisplay(secs)); } - else{ TT = QString(tr("%1% Remaining")).arg(QString::number(charge)); } - } - //qDebug() << " Battery Icon:" << ICON << val << TT - ui->label_status_battery->setPixmap( LXDG::findIcon(ICON,"").pixmap(ui->tool_goto_apps->iconSize()/2) ); - ui->label_status_battery->setToolTip(TT); - } - //Network Status - ui->label_status_network->clear(); //not implemented yet - }else if(page == ui->page_apps){ - //Nothing needed for this page explicitly - }else if( page == ui->page_settings){ - // -- Workspaces - int tot = LSession::handle()->XCB->NumberOfWorkspaces(); - if(tot>1){ - ui->frame_wkspace->setVisible(true); - int cur = LSession::handle()->XCB->CurrentWorkspace(); - ui->label_wkspace->setText( QString(tr("Workspace %1/%2")).arg(QString::number(cur+1), QString::number(tot)) ); - }else{ - ui->frame_wkspace->setVisible(false); - } - // -- Brightness Controls - int tmp = LOS::ScreenBrightness(); - ui->frame_bright->setVisible(tmp >= 0); - if(tmp >= 0){ ui->slider_bright->setValue(tmp); } - // -- Audio Controls - tmp = LOS::audioVolume(); - ui->frame_audio->setVisible(tmp >= 0); - if(tmp >= 0){ ui->slider_volume->setValue(tmp); } - }else if(page == ui->page_leave){ - if( !ui->frame_leave_system->whatsThis().isEmpty() ){ - //This frame is allowed/visible - need to adjust the shutdown detection - bool updating = LOS::systemPerformingUpdates(); - ui->tool_restart->setEnabled(!updating); - ui->tool_shutdown->setEnabled(!updating); - ui->label_updating->setVisible(updating); //to let the user know *why* they can't shutdown/restart right now - } - ui->frame_leave_suspend->setVisible( LOS::systemCanSuspend() ); - } - -} - -void StartMenu::catViewChanged(){ - QString state; - switch(ui->check_apps_showcats->checkState()){ - case Qt::Checked: - state = "true"; - break; - case Qt::PartiallyChecked: - state = "partial"; - break; - default: - state = "false"; - } - LSession::handle()->DesktopPluginSettings()->setValue("panelPlugs/systemstart/showcategories", state); - //Now kick off the reload of the apps list - UpdateApps(); - //QtConcurrent::run(this, &StartMenu::UpdateApps); //this was a direct user change - keep it thread safe -} -//Page Change Buttons -void StartMenu::on_tool_goto_apps_clicked(){ - ui->stackedWidget->setCurrentWidget(ui->page_apps); -} - -void StartMenu::on_tool_goto_settings_clicked(){ - ui->stackedWidget->setCurrentWidget(ui->page_settings); -} - -void StartMenu::on_tool_goto_logout_clicked(){ - ui->stackedWidget->setCurrentWidget(ui->page_leave); -} - -void StartMenu::on_tool_back_clicked(){ - ui->stackedWidget->setCurrentWidget(ui->page_main); -} - - -//Launch Buttons -void StartMenu::on_tool_launch_controlpanel_clicked(){ - LaunchItem(ui->tool_launch_controlpanel->whatsThis()); -} - -void StartMenu::on_tool_launch_fm_clicked(){ - LaunchItem(QDir::homePath()); -} - -void StartMenu::on_tool_launch_store_clicked(){ - LaunchItem(ui->tool_launch_store->whatsThis()); -} - -void StartMenu::on_tool_launch_desksettings_clicked(){ - LaunchItem("lumina-config", false); -} - -void StartMenu::on_tool_launch_deskinfo_clicked(){ - LaunchItem("lumina-info",false); -} - -//Logout Buttons -void StartMenu::on_tool_lock_clicked(){ - //QProcess::startDetached("xscreensaver-command -lock"); - LaunchItem("xscreensaver-command -lock",false); -} - -void StartMenu::on_tool_logout_clicked(){ - emit CloseMenu(); - LSession::handle()->StartLogout(); -} - -void StartMenu::on_tool_restart_clicked(){ - emit CloseMenu(); - QCoreApplication::processEvents(); - bool skipupdates = false; - if( !promptAboutUpdates(skipupdates) ){ return; } - LSession::handle()->StartReboot(skipupdates); -} - -void StartMenu::on_tool_shutdown_clicked(){ - emit CloseMenu(); - QCoreApplication::processEvents(); - bool skipupdates = false; - if( !promptAboutUpdates(skipupdates) ){ return; } - LSession::handle()->StartShutdown(skipupdates); -} - -void StartMenu::on_tool_suspend_clicked(){ - //Make sure to lock the system first (otherwise anybody can access it again) - emit CloseMenu(); - LUtils::runCmd("xscreensaver-command -lock"); - LOS::systemSuspend(); -} - - -//Audio Volume -void StartMenu::on_slider_volume_valueChanged(int val){ - ui->label_vol->setText(QString::number(val)+"%"); - LOS::setAudioVolume(val); - //Also adjust the icon for the volume - if(val<1){ ui->tool_mute_audio->setIcon(LXDG::findIcon("audio-volume-muted","")); } - else if(val<33){ ui->tool_mute_audio->setIcon(LXDG::findIcon("audio-volume-low","")); } - else if(val<66){ ui->tool_mute_audio->setIcon(LXDG::findIcon("audio-volume-medium","")); } - else{ ui->tool_mute_audio->setIcon(LXDG::findIcon("audio-volume-high","")); } -} - -void StartMenu::on_tool_launch_mixer_clicked(){ - if(LOS::hasMixerUtility()){ - emit CloseMenu(); - LOS::startMixerUtility(); - } -} - -void StartMenu::on_tool_mute_audio_clicked(){ - static int lastvol = 50; - if(ui->slider_volume->value()==0){ ui->slider_volume->setValue(lastvol); } - else{ - lastvol = ui->slider_volume->value(); - ui->slider_volume->setValue(0); - } -} - -//Screen Brightness -void StartMenu::on_slider_bright_valueChanged(int val){ - ui->label_bright->setText(QString::number(val)+"%"); - LOS::setScreenBrightness(val); -} - - -//Workspace -void StartMenu::on_tool_set_nextwkspace_clicked(){ - int cur = LSession::handle()->XCB->CurrentWorkspace(); - int tot = LSession::handle()->XCB->NumberOfWorkspaces(); - //qDebug()<< "Next Workspace:" << cur << tot; - cur++; - if(cur>=tot){ cur = 0; } //back to beginning - //qDebug() << " - New Current:" << cur; - LSession::handle()->XCB->SetCurrentWorkspace(cur); - ui->label_wkspace->setText( QString(tr("Workspace %1/%2")).arg(QString::number(cur+1), QString::number(tot)) ); -} - -void StartMenu::on_tool_set_prevwkspace_clicked(){ - int cur = LSession::handle()->XCB->CurrentWorkspace(); - int tot = LSession::handle()->XCB->NumberOfWorkspaces(); - //qDebug()<< "Next Workspace:" << cur << tot; - cur--; - if(cur<0){ cur = tot-1; } //back to end - //qDebug() << " - New Current:" << cur; - LSession::handle()->XCB->SetCurrentWorkspace(cur); - ui->label_wkspace->setText( QString(tr("Workspace %1/%2")).arg(QString::number(cur+1), QString::number(tot)) ); -} - - -//Locale -void StartMenu::on_combo_locale_currentIndexChanged(int){ - //Get the currently selected Locale - if(ui->stackedWidget->currentWidget()!=ui->page_settings){ return; } - QString locale = ui->combo_locale->currentData().toString(); - emit CloseMenu(); - LSession::processEvents(); - LSession::handle()->switchLocale(locale); -} - - -//Search -void StartMenu::on_line_search_textEdited(QString){ - if(searchTimer->isActive()){ searchTimer->stop(); } - searchTimer->start(); -} - -void StartMenu::startSearch(){ - if(!this->isVisible()){ return; } //menu closed while timer was active - do_search(ui->line_search->text(),false); //auto-launched -} - -void StartMenu::on_line_search_returnPressed(){ - if(topsearch.isEmpty()){ return; } - LaunchItem(topsearch); -} diff --git a/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/StartMenu.h b/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/StartMenu.h deleted file mode 100644 index 8ab04d94..00000000 --- a/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/StartMenu.h +++ /dev/null @@ -1,105 +0,0 @@ -//=========================================== -// Lumina-DE source code -// Copyright (c) 2015, Ken Moore -// Available under the 3-clause BSD license -// See the LICENSE file for full details -//=========================================== -#ifndef _LUMINA_DESKTOP_SYSTEM_START_PANEL_PLUGIN_H -#define _LUMINA_DESKTOP_SYSTEM_START_PANEL_PLUGIN_H - -#include <QWidget> -#include <QScrollArea> -#include <QMouseEvent> - -#include <LuminaXDG.h> - -namespace Ui{ - class StartMenu; -}; - -class StartMenu : public QWidget{ - Q_OBJECT -public: - StartMenu(QWidget *parent = 0); - ~StartMenu(); - -public slots: - void UpdateAll(); //for re-translation/icon changes - void UpdateMenu(bool forceall = false); //for item changes - - void ReLoadQuickLaunch(); - void UpdateQuickLaunch(QString, bool); - -private: - Ui::StartMenu *ui; - QStringList favs; - QString CCat, CSearch, topsearch; //current category/search - QTimer *searchTimer; - - //Simple utility functions - //void deleteChildren(QWidget *obj); //recursive function - void ClearScrollArea(QScrollArea *area); - void SortScrollArea(QScrollArea *area); - void do_search(QString search, bool force); - - bool promptAboutUpdates(bool &skip); - -private slots: - void LaunchItem(QString path, bool fix = true); - - //Application/Favorite Listings - void ChangeCategory(QString cat); - void UpdateApps(); - void UpdateFavs(); - - // Page update routines - void on_stackedWidget_currentChanged(int); //page changed - void catViewChanged(); //application categorization view mode changed - - //Page Change Buttons - void on_tool_goto_apps_clicked(); - void on_tool_goto_settings_clicked(); - void on_tool_goto_logout_clicked(); - void on_tool_back_clicked(); - - //Launch Buttons - void on_tool_launch_controlpanel_clicked(); - void on_tool_launch_fm_clicked(); - void on_tool_launch_store_clicked(); - void on_tool_launch_desksettings_clicked(); - void on_tool_launch_deskinfo_clicked(); - - //Logout Buttons - void on_tool_lock_clicked(); - void on_tool_logout_clicked(); - void on_tool_restart_clicked(); - void on_tool_shutdown_clicked(); - void on_tool_suspend_clicked(); - - //Audio Volume - void on_slider_volume_valueChanged(int); - void on_tool_launch_mixer_clicked(); - void on_tool_mute_audio_clicked(); - - //Screen Brightness - void on_slider_bright_valueChanged(int); - - //Workspace - void on_tool_set_nextwkspace_clicked(); - void on_tool_set_prevwkspace_clicked(); - - //Locale - void on_combo_locale_currentIndexChanged(int); - - //Search - void on_line_search_textEdited(QString); - void startSearch(); - void on_line_search_returnPressed(); - -signals: - void CloseMenu(); - void UpdateQuickLaunch(QStringList); - -}; - -#endif diff --git a/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/StartMenu.ui b/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/StartMenu.ui deleted file mode 100644 index 74f61d7f..00000000 --- a/src-qt5/core/lumina-desktop-unified/src-DE/panel-plugins/systemstart/StartMenu.ui +++ /dev/null @@ -1,1148 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>StartMenu</class> - <widget class="QWidget" name="StartMenu"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>181</width> - <height>405</height> - </rect> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <property name="styleSheet"> - <string notr="true">QScrollArea{background: transparent; border: none; }</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>2</number> - </property> - <property name="leftMargin"> - <number>1</number> - </property> - <property name="topMargin"> - <number>1</number> - </property> - <property name="rightMargin"> - <number>1</number> - </property> - <property name="bottomMargin"> - <number>1</number> - </property> - <item> - <widget class="QLineEdit" name="line_search"> - <property name="placeholderText"> - <string>Type to search</string> - </property> - </widget> - </item> - <item> - <widget class="QStackedWidget" name="stackedWidget"> - <property name="currentIndex"> - <number>4</number> - </property> - <widget class="QWidget" name="page_main"> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <property name="spacing"> - <number>2</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="label_status_battery"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string notr="true">bat%</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_status_network"> - <property name="text"> - <string notr="true">netstat</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_status"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string notr="true"/> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="Line" name="line_14"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QScrollArea" name="scroll_favs"> - <property name="contextMenuPolicy"> - <enum>Qt::CustomContextMenu</enum> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Plain</enum> - </property> - <property name="verticalScrollBarPolicy"> - <enum>Qt::ScrollBarAsNeeded</enum> - </property> - <property name="horizontalScrollBarPolicy"> - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="sizeAdjustPolicy"> - <enum>QAbstractScrollArea::AdjustToContents</enum> - </property> - <property name="widgetResizable"> - <bool>true</bool> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - <widget class="QWidget" name="scrollAreaWidgetContents"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>179</width> - <height>177</height> - </rect> - </property> - </widget> - </widget> - </item> - <item> - <widget class="Line" name="line_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="tool_launch_fm"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string>Browse Files</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="tool_goto_apps"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string>Browse Applications</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="tool_launch_controlpanel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string>Control Panel</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="tool_goto_settings"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string>Preferences</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="popupMode"> - <enum>QToolButton::InstantPopup</enum> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <item> - <widget class="QToolButton" name="tool_goto_logout"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="styleSheet"> - <string notr="true">QToolButton::menu-arrow{ image: rightarrow-icon; }</string> - </property> - <property name="text"> - <string>Leave</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="popupMode"> - <enum>QToolButton::DelayedPopup</enum> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - <property name="arrowType"> - <enum>Qt::NoArrow</enum> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="tool_lock"> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string notr="true">lock</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_apps"> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <property name="spacing"> - <number>2</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QToolButton" name="tool_launch_store"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string>Manage Applications</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_15"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="check_apps_showcats"> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string>Show Categories</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - <property name="tristate"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QScrollArea" name="scroll_apps"> - <property name="horizontalScrollBarPolicy"> - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="sizeAdjustPolicy"> - <enum>QAbstractScrollArea::AdjustToContents</enum> - </property> - <property name="widgetResizable"> - <bool>true</bool> - </property> - <widget class="QWidget" name="scrollAreaWidgetContents_2"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>179</width> - <height>284</height> - </rect> - </property> - </widget> - </widget> - </item> - <item> - <widget class="Line" name="line_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_settings"> - <layout class="QVBoxLayout" name="verticalLayout_9"> - <property name="spacing"> - <number>2</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_7"> - <item> - <widget class="QToolButton" name="tool_launch_desksettings"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string>Configure Desktop</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="tool_launch_deskinfo"> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string notr="true">info</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="Line" name="line_8"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QFrame" name="frame_audio"> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QVBoxLayout" name="verticalLayout_8"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <item> - <widget class="QToolButton" name="tool_mute_audio"> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string notr="true"/> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_11"> - <item> - <widget class="QSlider" name="slider_volume"> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="maximum"> - <number>100</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_vol"> - <property name="text"> - <string notr="true">vol%</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QToolButton" name="tool_launch_mixer"> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string notr="true"/> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="autoRaise"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="Line" name="line_7"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QFrame" name="frame_bright"> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QVBoxLayout" name="verticalLayout_7"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QLabel" name="label_bright_icon"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="text"> - <string notr="true"/> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item> - <widget class="QSlider" name="slider_bright"> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="minimum"> - <number>10</number> - </property> - <property name="maximum"> - <number>100</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_bright"> - <property name="text"> - <string notr="true">br%</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="Line" name="line_9"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QFrame" name="frame_wkspace"> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> - <widget class="QToolButton" name="tool_set_prevwkspace"> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string notr="true">prev</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_wkspace"> - <property name="text"> - <string notr="true">workspace #</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="tool_set_nextwkspace"> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string notr="true">next</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="Line" name="line_10"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QFrame" name="frame_locale"> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QLabel" name="label_locale_icon"> - <property name="text"> - <string notr="true">Locale:</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="combo_locale"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>161</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="Line" name="line_6"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_leave"> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <property name="spacing"> - <number>2</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>185</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QFrame" name="frame_leave_suspend"> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QVBoxLayout" name="verticalLayout_10"> - <property name="spacing"> - <number>2</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QToolButton" name="tool_suspend"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string>Suspend System</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_11"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QFrame" name="frame_leave_system"> - <property name="styleSheet"> - <string notr="true">QFrame#frame_leave_system{border: none; background: transparent; }</string> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <property name="spacing"> - <number>2</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QToolButton" name="tool_restart"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string>Restart System</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="tool_shutdown"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string>Power Off System</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_updating"> - <property name="text"> - <string>(System Performing Updates)</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="Line" name="line_13"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="tool_logout"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string>Sign Out User</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_12"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_search"> - <layout class="QVBoxLayout" name="verticalLayout_12"> - <item> - <widget class="QScrollArea" name="scroll_search"> - <property name="widgetResizable"> - <bool>true</bool> - </property> - <widget class="QWidget" name="scrollAreaWidgetContents_3"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>161</width> - <height>332</height> - </rect> - </property> - </widget> - </widget> - </item> - </layout> - </widget> - </widget> - </item> - <item> - <widget class="QToolButton" name="tool_back"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="text"> - <string>Back</string> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - <property name="arrowType"> - <enum>Qt::NoArrow</enum> - </property> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> |