diff options
author | Ken Moore <ken@pcbsd.org> | 2015-02-12 11:09:26 -0500 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-02-12 11:09:26 -0500 |
commit | e48ebe39d11153cedf9301fd6c2733a94403597f (patch) | |
tree | ff8c16e67f06c00b9f49d0be632dcc1946264be3 /lumina-desktop | |
parent | Update the Lumina port makefile for FreeBSD to add a multimedia option (enabl... (diff) | |
download | lumina-e48ebe39d11153cedf9301fd6c2733a94403597f.tar.gz lumina-e48ebe39d11153cedf9301fd6c2733a94403597f.tar.bz2 lumina-e48ebe39d11153cedf9301fd6c2733a94403597f.zip |
Clean up some plugin interactions (including an OpenBSD crash with desktop plugin interactions).
Diffstat (limited to 'lumina-desktop')
-rw-r--r-- | lumina-desktop/desktop-plugins/LDPluginContainer.h | 27 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/LPPlugin.h | 3 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/userbutton/LUserButton.cpp | 1 |
3 files changed, 25 insertions, 6 deletions
diff --git a/lumina-desktop/desktop-plugins/LDPluginContainer.h b/lumina-desktop/desktop-plugins/LDPluginContainer.h index 2145f49b..2353995c 100644 --- a/lumina-desktop/desktop-plugins/LDPluginContainer.h +++ b/lumina-desktop/desktop-plugins/LDPluginContainer.h @@ -19,6 +19,7 @@ #include <QString> #include <QFile> #include <QIcon> +#include <QTimer> #include "LDPlugin.h" @@ -27,12 +28,26 @@ class LDPluginContainer : public QMdiSubWindow{ private: QSettings *settings; + QTimer *syncTimer; bool locked, setup; +private slots: + void saveGeometry(){ + settings->setValue("location/x", this->pos().x()); + settings->setValue("location/y", this->pos().y()); + settings->setValue("location/width", this->size().width()); + settings->setValue("location/height", this->size().height()); + settings->sync(); + } + public: LDPluginContainer(LDPlugin *plugin = 0, bool islocked = true) : QMdiSubWindow(){ locked = islocked; setup=true; + syncTimer = new QTimer(this); + syncTimer->setInterval(1000); //save settings 1 second after it is moved + syncTimer->setSingleShot(true); //no repeats + connect(syncTimer, SIGNAL(timeout()), this, SLOT(saveGeometry()) ); this->setWhatsThis(plugin->ID()); if(locked){ this->setWindowFlags(Qt::FramelessWindowHint); } else{ this->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint); } @@ -82,20 +97,19 @@ protected: void moveEvent(QMoveEvent *event){ //Save this location to the settings if(!locked && !setup){ + if(syncTimer->isActive()){ syncTimer->stop(); } + syncTimer->start(); //qDebug() << "DP Move:" << event->pos().x() << event->pos().y(); - settings->setValue("location/x", event->pos().x()); - settings->setValue("location/y", event->pos().y()); - settings->sync(); } + QMdiSubWindow::moveEvent(event); //be sure to pass this event along to the container } void resizeEvent(QResizeEvent *event){ //Save this size info to the settings if(!locked && !setup){ //qDebug() << "DP Resize:" << event->size().width() << event->size().height(); - settings->setValue("location/width", event->size().width()); - settings->setValue("location/height", event->size().height()); - settings->sync(); + if(syncTimer->isActive()){ syncTimer->stop(); } + syncTimer->start(); } QMdiSubWindow::resizeEvent(event); //be sure to pass this event along to the container } @@ -103,6 +117,7 @@ protected: void closeEvent(QCloseEvent *event){ if( !this->whatsThis().isEmpty() ){ //Plugin removed by the user - delete the settings file + locked = true; //ensure that the save settings routines don't do anything during the close QFile::remove( settings->fileName() ); emit PluginRemoved( this->whatsThis() ); } diff --git a/lumina-desktop/panel-plugins/LPPlugin.h b/lumina-desktop/panel-plugins/LPPlugin.h index c8347a8e..dc1c490e 100644 --- a/lumina-desktop/panel-plugins/LPPlugin.h +++ b/lumina-desktop/panel-plugins/LPPlugin.h @@ -61,6 +61,9 @@ public slots: //This is where any horizontal/vertical orientations can be changed appropriately } + /*virtual void ResetMouseFocus(){ + // + }*/ }; #endif
\ No newline at end of file diff --git a/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp b/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp index c33f9023..2ee2b494 100644 --- a/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp +++ b/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp @@ -24,6 +24,7 @@ LUserButtonPlugin::LUserButtonPlugin(QWidget *parent, QString id, bool horizonta menu->addAction(mact); button->setMenu(menu); + connect(menu, SIGNAL(aboutToHide()), this, SLOT(updateButtonVisuals()) ); QTimer::singleShot(0,this, SLOT(OrientationChange())); //Update icons/sizes } |