aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core-utils/lumina-config/pages
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core-utils/lumina-config/pages')
-rw-r--r--src-qt5/core-utils/lumina-config/pages/PageWidget.h2
-rw-r--r--src-qt5/core-utils/lumina-config/pages/getPage.h29
-rw-r--r--src-qt5/core-utils/lumina-config/pages/page_main.cpp13
-rw-r--r--src-qt5/core-utils/lumina-config/pages/page_main.h2
4 files changed, 32 insertions, 14 deletions
diff --git a/src-qt5/core-utils/lumina-config/pages/PageWidget.h b/src-qt5/core-utils/lumina-config/pages/PageWidget.h
index 66fce36a..81ebe0cc 100644
--- a/src-qt5/core-utils/lumina-config/pages/PageWidget.h
+++ b/src-qt5/core-utils/lumina-config/pages/PageWidget.h
@@ -34,7 +34,7 @@ public:
~PageWidget(){}
virtual bool needsScreenSelector(){ return false; } //change this to true for pages which load/set options on a per-screen basis
-
+ virtual void setPreviousPage(QString){ } //re-implement this if the page needs knowledge of what the previous page was
signals:
//emit this when the page has changes which are waiting to be saved
void HasPendingChanges(bool);
diff --git a/src-qt5/core-utils/lumina-config/pages/getPage.h b/src-qt5/core-utils/lumina-config/pages/getPage.h
index 6a35dbae..f77a72c8 100644
--- a/src-qt5/core-utils/lumina-config/pages/getPage.h
+++ b/src-qt5/core-utils/lumina-config/pages/getPage.h
@@ -58,20 +58,23 @@ static QList<PAGEINFO> KnownPages(){
static PageWidget* GetNewPage(QString id, QWidget *parent){
//Find the page that matches this "id"
- if(id=="wallpaper"){ return new page_wallpaper(parent); }
- else if(id=="theme"){ return new page_theme(parent); }
- else if(id=="autostart"){ return new page_autostart(parent); }
- else if(id=="defaultapps"){ return new page_defaultapps(parent); }
- else if(id=="fluxbox-keys"){ return new page_fluxbox_keys(parent); }
- else if(id=="fluxbox-settings"){ return new page_fluxbox_settings(parent); }
- else if(id=="interface-desktop"){ return new page_interface_desktop(parent); }
- else if(id=="interface-panel"){ return new page_interface_panels(parent); }
- else if(id=="interface-menu"){ return new page_interface_menu(parent); }
- else if(id=="session-locale"){ return new page_session_locale(parent); }
- else if(id=="session-options"){ return new page_session_options(parent); }
- else if(id=="compton"){ return new page_compton(parent); }
+ PageWidget* page = 0;
+ if(id=="wallpaper"){ page = new page_wallpaper(parent); }
+ else if(id=="theme"){ page = new page_theme(parent); }
+ else if(id=="autostart"){ page = new page_autostart(parent); }
+ else if(id=="defaultapps"){ page = new page_defaultapps(parent); }
+ else if(id=="fluxbox-keys"){ page = new page_fluxbox_keys(parent); }
+ else if(id=="fluxbox-settings"){ page = new page_fluxbox_settings(parent); }
+ else if(id=="interface-desktop"){ page = new page_interface_desktop(parent); }
+ else if(id=="interface-panel"){ page = new page_interface_panels(parent); }
+ else if(id=="interface-menu"){ page = new page_interface_menu(parent); }
+ else if(id=="session-locale"){ page = new page_session_locale(parent); }
+ else if(id=="session-options"){ page = new page_session_options(parent); }
+ else if(id=="compton"){ page = new page_compton(parent); }
//Return the main control_panel page as the fallback/default
- return new page_main(parent);
+ if(page==0){ id.clear(); page = new page_main(parent); }
+ page->setWhatsThis(id);
+ return page;
}
#endif
diff --git a/src-qt5/core-utils/lumina-config/pages/page_main.cpp b/src-qt5/core-utils/lumina-config/pages/page_main.cpp
index 976e7c69..1bdd3107 100644
--- a/src-qt5/core-utils/lumina-config/pages/page_main.cpp
+++ b/src-qt5/core-utils/lumina-config/pages/page_main.cpp
@@ -24,6 +24,19 @@ page_main::~page_main(){
}
+void page_main::setPreviousPage(QString id){
+ for(int i=0; i<ui->treeWidget->topLevelItemCount(); i++){
+ for(int j=0; j<ui->treeWidget->topLevelItem(i)->childCount(); j++){
+ if(ui->treeWidget->topLevelItem(i)->child(j)->whatsThis(0)==id){
+ ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(i)->child(j));
+ ui->treeWidget->scrollToItem(ui->treeWidget->topLevelItem(i)->child(j));
+ return; //found item - done
+ }
+ }
+ }
+
+}
+
void page_main::UpdateItems(QString search){
ui->treeWidget->clear();
//First create the categories
diff --git a/src-qt5/core-utils/lumina-config/pages/page_main.h b/src-qt5/core-utils/lumina-config/pages/page_main.h
index 2e38eb64..7c7539a3 100644
--- a/src-qt5/core-utils/lumina-config/pages/page_main.h
+++ b/src-qt5/core-utils/lumina-config/pages/page_main.h
@@ -19,6 +19,8 @@ public:
page_main(QWidget *parent);
~page_main();
+ virtual void setPreviousPage(QString id);
+
public slots:
void SaveSettings();
void LoadSettings(int screennum);
bgstack15