mirror of
https://github.com/KDE/latte-dock.git
synced 2025-01-25 14:03:58 +03:00
complete containmentactions support
--this way the Layouts menu in now accesible even from plasma taskmanagers. The codebase is also the same for every component that is showing its menus.
This commit is contained in:
parent
f9afa1bc1f
commit
43cc5da6fa
@ -111,10 +111,6 @@ DockView::DockView(Plasma::Corona *corona, QScreen *targetScreen, bool dockWindo
|
||||
m_visibility = new VisibilityManager(this);
|
||||
}
|
||||
|
||||
//! Only way to be sure that actions are set correctly because of the old way to expose the menu actions
|
||||
//! an alternative would be for Layout to remove on startup ActionPlugins that are old style...
|
||||
this->containment()->setContainmentActions(QString("RightButton;NoModifier"), QString("org.kde.latte.contextmenu"));
|
||||
|
||||
connect(this->containment(), SIGNAL(statusChanged(Plasma::Types::ItemStatus)), SLOT(statusChanged(Plasma::Types::ItemStatus)));
|
||||
}, Qt::DirectConnection);
|
||||
|
||||
|
@ -554,6 +554,7 @@ void LayoutManager::loadLatteLayout(QString layoutPath)
|
||||
}
|
||||
|
||||
if (!layoutPath.isEmpty() && m_corona->containments().size() == 0) {
|
||||
cleanupOnStartup(layoutPath);
|
||||
qDebug() << "LOADING CORONA LAYOUT:" << layoutPath;
|
||||
m_corona->loadLayout(layoutPath);
|
||||
|
||||
@ -584,6 +585,31 @@ void LayoutManager::loadLatteLayout(QString layoutPath)
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutManager::cleanupOnStartup(QString path)
|
||||
{
|
||||
KSharedConfigPtr filePtr = KSharedConfig::openConfig(path);
|
||||
|
||||
KConfigGroup actionGroups = KConfigGroup(filePtr, "ActionPlugins");
|
||||
|
||||
QStringList deprecatedActionGroup;
|
||||
|
||||
foreach (auto actId, actionGroups.groupList()) {
|
||||
QString pluginId = actionGroups.group(actId).readEntry("RightButton;NoModifier", "");
|
||||
|
||||
if (pluginId == "org.kde.contextmenu") {
|
||||
deprecatedActionGroup << actId;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (auto pId, deprecatedActionGroup) {
|
||||
qDebug() << "!!!!!!!!!!!!!!!! !!!!!!!!!!!! !!!!!!! REMOVING :::: " << pId;
|
||||
actionGroups.group(pId).deleteGroup();
|
||||
}
|
||||
|
||||
actionGroups.sync();
|
||||
}
|
||||
|
||||
|
||||
void LayoutManager::showAboutDialog()
|
||||
{
|
||||
m_corona->aboutApplication();
|
||||
|
@ -138,6 +138,7 @@ private slots:
|
||||
void syncMultipleLayoutsToActivities(QString layoutForOrphans = QString());
|
||||
|
||||
private:
|
||||
void cleanupOnStartup(QString path); //!remove deprecated or oldstyle config options
|
||||
void clearUnloadedContainmentsFromLinkedFile(QStringList containmentsIds, bool bypassChecks = false);
|
||||
void confirmDynamicSwitch();
|
||||
//! it is used just in order to provide translations for the presets
|
||||
|
Loading…
x
Reference in New Issue
Block a user