From ca225b7bd525ea961bf5aec2fa3f8c05e8307e4e Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 22 Aug 2017 13:35:07 -0400 Subject: Get 90% of the work for adding profiles to lumina-xconfig finished. Still need to work out a few small issues when loading a profile into the preview pane. --- .../core-utils/lumina-xconfig/ScreenSettings.cpp | 108 +++++++++++++-------- 1 file changed, 67 insertions(+), 41 deletions(-) (limited to 'src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp') diff --git a/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp b/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp index 99cfc918..f962f7d7 100644 --- a/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp +++ b/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp @@ -11,46 +11,11 @@ //Reset current screen config to match previously-saved settings void RRSettings::ApplyPrevious(){ + QList screens; QSettings set("lumina-desktop","lumina-xconfig"); - set.beginGroup("MonitorSettings"); - //Setup a couple lists - QStringList devs = set.childGroups(); //known/saved devices - QList screens = RRSettings::CurrentScreens(); - QStringList lastactive = set.value("lastActive",QStringList()).toStringList(); - //Now go through all the saved settings and put that info into the array - QString primary; - QStringList avail; - for(int i=0; i RRSettings::CurrentScreens(){ return SCREENS; } +QList RRSettings::PreviousSettings(QString profile){ + QSettings set("lumina-desktop","lumina-xconfig"); + if(profile.isEmpty()){ set.beginGroup("MonitorSettings"); } + else{ set.beginGroup("MonitorProfiles/"+profile); } + //Setup a couple lists + QStringList devs = set.childGroups(); //known/saved devices + QList screens = RRSettings::CurrentScreens(); + QStringList lastactive = set.value("lastActive",QStringList()).toStringList(); + //Now go through all the saved settings and put that info into the array + QString primary; + QStringList avail; + for(int i=0; i screens){ +bool RRSettings::SaveScreens(QList screens, QString profile){ QSettings set("lumina-desktop","lumina-xconfig"); - set.beginGroup("MonitorSettings"); + if(profile.isEmpty()){ set.beginGroup("MonitorSettings"); } + else{ set.beginGroup("MonitorProfiles/"+profile); } //Setup a couple lists QStringList olddevs = set.childGroups(); QStringList active; -- cgit From 810a6cced9efcfd156d9156780e8f7e65a850cc2 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 22 Aug 2017 14:26:49 -0400 Subject: Fix a list which was not getting populated properly. --- src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp') diff --git a/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp b/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp index f962f7d7..3c0edc76 100644 --- a/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp +++ b/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp @@ -91,6 +91,7 @@ QList RRSettings::PreviousSettings(QString profile){ QStringList avail; for(int i=0; i RRSettings::PreviousSettings(QString profile){ QStringList filter = avail.filter(priority[i]); if(!filter.isEmpty()){ filter.sort(); primary = filter.first(); } } - if(primary.isEmpty()){ primary = avail.first(); } + if(primary.isEmpty() && !avail.isEmpty()){ primary = avail.first(); } } //Ensure only one monitor is primary, and reset a few flags for(int i=0; i