|
|
|
@ -9,6 +9,8 @@
|
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
#include <QDesktopServices>
|
|
|
|
|
|
|
|
|
|
#include <QtDBus/QtDBus>
|
|
|
|
|
|
|
|
|
|
#include <KLocalizedString>
|
|
|
|
|
#include <KConfig>
|
|
|
|
|
#include <KArchive/KTar>
|
|
|
|
@ -33,6 +35,12 @@ GlobalSettings::GlobalSettings(QObject *parent)
|
|
|
|
|
connect(m_altSessionAction, &QAction::triggered, this, &GlobalSettings::enableAltSession);
|
|
|
|
|
connect(m_corona, &DockCorona::currentSessionChanged, this, &GlobalSettings::currentSessionChangedSlot);
|
|
|
|
|
|
|
|
|
|
//! create the add widgets action
|
|
|
|
|
const QIcon addWidIcon = QIcon::fromTheme("add");
|
|
|
|
|
m_addWidgetsAction = new QAction(addWidIcon, i18n("Add Widgets..."), this);
|
|
|
|
|
m_addWidgetsAction->setStatusTip(i18n("Show Plasma Widget Explorer"));
|
|
|
|
|
connect(m_addWidgetsAction, &QAction::triggered, this, &GlobalSettings::showWidgetsExplorer);
|
|
|
|
|
|
|
|
|
|
init();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -62,6 +70,15 @@ void GlobalSettings::initExtConfiguration()
|
|
|
|
|
m_externalGroup = KConfigGroup(extConfig, "External");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GlobalSettings::showWidgetsExplorer()
|
|
|
|
|
{
|
|
|
|
|
QDBusInterface iface("org.kde.plasmashell", "/PlasmaShell", "", QDBusConnection::sessionBus());
|
|
|
|
|
|
|
|
|
|
if (iface.isValid()) {
|
|
|
|
|
iface.call("toggleWidgetExplorer");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GlobalSettings::enableAltSession(bool enabled)
|
|
|
|
|
{
|
|
|
|
|
if (enabled) {
|
|
|
|
@ -102,6 +119,11 @@ QAction *GlobalSettings::altSessionAction() const
|
|
|
|
|
return m_altSessionAction;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QAction *GlobalSettings::addWidgetsAction() const
|
|
|
|
|
{
|
|
|
|
|
return m_addWidgetsAction;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool GlobalSettings::autostart() const
|
|
|
|
|
{
|
|
|
|
|
QFile autostartFile(QDir::homePath() + "/.config/autostart/latte-dock.desktop");
|
|
|
|
|