diff options
author | Ken Moore <ken@pcbsd.org> | 2015-06-14 18:27:45 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-06-14 18:27:45 -0400 |
commit | 5f537166a4af31db171711d9cedeb318ac7443b5 (patch) | |
tree | e08c446ab3622e709d2aa75ec10ec67a91fc195f /lumina-desktop | |
parent | Re-work quite a bit of the background procedures for desktop plugins and watc... (diff) | |
download | lumina-5f537166a4af31db171711d9cedeb318ac7443b5.tar.gz lumina-5f537166a4af31db171711d9cedeb318ac7443b5.tar.bz2 lumina-5f537166a4af31db171711d9cedeb318ac7443b5.zip |
Disable some debugging and fix up the context menu on the applauncher plugins.
Diffstat (limited to 'lumina-desktop')
-rw-r--r-- | lumina-desktop/LDesktop.cpp | 2 | ||||
-rw-r--r-- | lumina-desktop/desktop-plugins/LDPlugin.h | 1 | ||||
-rw-r--r-- | lumina-desktop/desktop-plugins/NewDP.h | 4 | ||||
-rw-r--r-- | lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp | 15 |
4 files changed, 13 insertions, 9 deletions
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp index 4268664f..5e359df7 100644 --- a/lumina-desktop/LDesktop.cpp +++ b/lumina-desktop/LDesktop.cpp @@ -11,7 +11,7 @@ #include <LuminaX11.h> #include "LWinInfo.h" -#define DEBUG 1 +#define DEBUG 0 LDesktop::LDesktop(int deskNum, bool setdefault) : QObject(){ diff --git a/lumina-desktop/desktop-plugins/LDPlugin.h b/lumina-desktop/desktop-plugins/LDPlugin.h index 349bfd86..a69ca9c2 100644 --- a/lumina-desktop/desktop-plugins/LDPlugin.h +++ b/lumina-desktop/desktop-plugins/LDPlugin.h @@ -44,6 +44,7 @@ public: void saveSetting(QString var, QVariant val){ settings->setValue(prefix+var, val); + settings->sync(); } QVariant readSetting(QString var, QVariant defaultval){ diff --git a/lumina-desktop/desktop-plugins/NewDP.h b/lumina-desktop/desktop-plugins/NewDP.h index d2f9450e..b5881c4e 100644 --- a/lumina-desktop/desktop-plugins/NewDP.h +++ b/lumina-desktop/desktop-plugins/NewDP.h @@ -26,7 +26,7 @@ class NewDP{ public: static LDPlugin* createPlugin(QString plugin, QWidget* parent=0){ - qDebug() << "Create Plugin:" << plugin; + //qDebug() << "Create Plugin:" << plugin; LDPlugin *plug = 0; if(plugin.section("---",0,0)=="sample"){ plug = new SamplePlugin(parent, plugin); @@ -50,7 +50,7 @@ public: }else{ qWarning() << "Invalid Desktop Plugin:"<<plugin << " -- Ignored"; } - qDebug() << " -- done"; + //qDebug() << " -- done"; return plug; } diff --git a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp index 5d610148..4dee95ca 100644 --- a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp +++ b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp @@ -13,11 +13,6 @@ AppLauncherPlugin::AppLauncherPlugin(QWidget* parent, QString ID) : LDPlugin(par lay->addWidget(button, 0, Qt::AlignCenter); connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked()) ); menu = new QMenu(this); - menu->addAction(LXDG::findIcon("zoom-in",""), tr("Increase Size"), this, SLOT(increaseIconSize())); - menu->addAction(LXDG::findIcon("zoom-out",""), tr("Decrease Size"), this, SLOT(decreaseIconSize())); - if( !ID.isEmpty() && ID.contains(QDir::homePath()+"/Desktop") ){ - menu->addAction(LXDG::findIcon("list-remove",""), tr("Delete File"), this, SLOT(deleteFile()) ); - } int icosize = this->readSetting("iconsize",64).toInt(); button->setIconSize(QSize(icosize,icosize)); this->setContextMenuPolicy(Qt::CustomContextMenu); @@ -49,7 +44,7 @@ void AppLauncherPlugin::loadButton(){ } }else if(ok){ QFileInfo info(path); - button->setWhatsThis(info.fileName()); + button->setWhatsThis(info.absoluteFilePath()); if(info.isDir()){ button->setIcon( LXDG::findIcon("folder","") ); }else if(LUtils::imageExtensions().contains(info.suffix().toLower()) ){ @@ -88,6 +83,13 @@ void AppLauncherPlugin::loadButton(){ } //qDebug() << " - Setting Button Text:" << txt; button->setText(txt); + //Now setup the menu again + menu->clear(); + menu->addAction(LXDG::findIcon("zoom-in",""), tr("Increase Size"), this, SLOT(increaseIconSize())); + menu->addAction(LXDG::findIcon("zoom-out",""), tr("Decrease Size"), this, SLOT(decreaseIconSize())); + if( !button->whatsThis().isEmpty() && button->whatsThis().startsWith(QDir::homePath()+"/Desktop") ){ + menu->addAction(LXDG::findIcon("list-remove",""), tr("Delete File"), this, SLOT(deleteFile()) ); + } button->setFixedSize(icosize+4, icosize+8+(2*button->fontMetrics().height()) ); //make sure to adjust the button on first show. this->setInitialSize(button->width()+4, button->height()+4); @@ -125,6 +127,7 @@ void AppLauncherPlugin::increaseIconSize(){ icosize += 16; button->setIconSize(QSize(icosize,icosize)); this->saveSetting("iconsize",icosize); + } void AppLauncherPlugin::decreaseIconSize(){ |