From 951668fff9a9c1613c3384bc729099772478acc4 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 25 Aug 2020 18:16:20 +0300 Subject: [PATCH] single informative window for activating layouts --- app/layouts/synchronizer.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/layouts/synchronizer.cpp b/app/layouts/synchronizer.cpp index 3cb3beefe..6a7e7c1a4 100644 --- a/app/layouts/synchronizer.cpp +++ b/app/layouts/synchronizer.cpp @@ -590,6 +590,8 @@ void Synchronizer::syncMultipleLayoutsToActivities() defaultForcedLayout = layoutsToLoad[0]; } + QStringList newlyActivatedLayouts; + //! Add needed Layouts based on Activities settings for (const auto &layoutName : layoutsToLoad) { if (!centralLayout(layoutName)) { @@ -604,13 +606,19 @@ void Synchronizer::syncMultipleLayoutsToActivities() newLayout->setActivities(QStringList(Data::Layout::ALLACTIVITIESID)); } - if (m_manager->corona()->universalSettings()->showInfoWindow()) { - m_manager->showInfoWindow(i18n("Activating layout: %0 ...").arg(newLayout->name()), 5000, newLayout->appliedActivities()); - } + newlyActivatedLayouts << newLayout->name(); } } } + if (m_manager->corona()->universalSettings()->showInfoWindow()) { + if (newlyActivatedLayouts.count() == 1) { + m_manager->showInfoWindow(i18n("Activating layout: %0 ...").arg(newlyActivatedLayouts[0]), 4000, QStringList(Data::Layout::ALLACTIVITIESID)); + } else if (newlyActivatedLayouts.count() > 1) { + m_manager->showInfoWindow(i18n("Activating layouts: %0 ...").arg(newlyActivatedLayouts.join(", ")), 4000, QStringList(Data::Layout::ALLACTIVITIESID)); + } + } + //! Unload no needed Layouts for (const auto &layoutName : layoutsToUnload) { CentralLayout *layout = centralLayout(layoutName);