add plasmoid helper integration

This commit is contained in:
arcan1s
2014-08-10 22:29:42 +04:00
parent 501b43002e
commit fe672aa8cc
7 changed files with 208 additions and 51 deletions

View File

@ -435,6 +435,20 @@ void MainWindow::reportABug()
}
void MainWindow::checkHelperStatus()
{
if (debug) qDebug() << "[MainWindow]" << "[checkHelperStatus]";
if (useHelper) useHelper = isHelperActive();
if (useHelper)
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
DBUS_HELPER_INTERFACE, QString("Update"),
QList<QVariant>(), true, debug);
if (isHelperServiceActive())
configuration[QString("CLOSE_HELPER")] = QString("false");
}
// main tab slots
void MainWindow::mainTabContextualMenu(const QPoint &pos)
{

View File

@ -21,6 +21,7 @@
#include <QDBusConnection>
#include <QDBusMessage>
#include <QDebug>
#include <QTimer>
#include <QTranslator>
#include "aboutwindow.h"
@ -495,6 +496,9 @@ void MainWindow::updateConfiguration(const QMap<QString, QVariant> args)
useHelper = false;
configuration[QString("USE_HELPER")] = QString("false");
}
// some helper fixs
// because interface will be created with a delay
QTimer::singleShot(1000, this, SLOT(checkHelperStatus()));
// update translation
qApp->removeTranslator(translator);
@ -506,14 +510,6 @@ void MainWindow::updateConfiguration(const QMap<QString, QVariant> args)
delete settingsWin;
createObjects();
// some helper fixs
if (useHelper) useHelper = isHelperActive();
if (useHelper)
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
DBUS_HELPER_INTERFACE, QString("Update"),
QList<QVariant>(), true, debug);
if (isHelperServiceActive())
configuration[QString("CLOSE_HELPER")] = QString("false");
// update ui
setTab(args[QString("tab")].toInt() - 1);
createActions();

View File

@ -96,6 +96,7 @@ public slots:
void setHiddenName(const QString name);
private slots:
void checkHelperStatus();
void reportABug();
// menu update slots
void setMenuActionsShown(const bool state = true);