1 //===========================================
2 //  Lumina Desktop Source Code
3 //  Copyright (c) 2016, Ken Moore
4 //  Available under the 3-clause BSD license
5 //  See the LICENSE file for full details
6 //===========================================
7 #include "getPage.h"
8 
9 //Add any sub-pages here
10 #include "page_main.h"
11 #include "page_wallpaper.h"
12 //#include "page_theme.h"
13 #include "page_autostart.h"
14 #include "page_defaultapps.h"
15 #include "page_fluxbox_keys.h"
16 #include "page_fluxbox_settings.h"
17 #include "page_interface_desktop.h"
18 #include "page_interface_panels.h"
19 #include "page_interface_menu.h"
20 #include "page_session_locale.h"
21 #include "page_session_options.h"
22 #include "page_compton.h"
23 #include "page_soundtheme.h"
24 
25 // #include "page_mouse_trueos.h"
26 // #include "page_bluetooth_trueos.h"
27 
28 //Simplification function for creating a PAGEINFO structure
PageInfo(QString ID,QString i_name,QString i_title,QString i_icon,QString i_comment,QString i_cat,QStringList i_sys,QStringList i_tags)29 PAGEINFO Pages::PageInfo(QString ID, QString i_name, QString i_title, QString i_icon, QString i_comment, QString i_cat, QStringList i_sys, QStringList i_tags){
30   PAGEINFO page;
31   page.id = ID; page.name = i_name; page.title = i_title; page.icon = i_icon;
32   page.comment = i_comment; page.category = i_cat; page.req_systems = i_sys;
33   page.search_tags = i_tags;
34   return page;
35 }
36 
37 //List all the known pages
38 // **** Add new page entries here ****
KnownPages()39 QList<PAGEINFO> Pages::KnownPages(){
40   // Valid Groups: ["appearance", "interface", "session", "user"]
41   QList<PAGEINFO> list;
42   //Reminder: <ID>, <name>, <title>, <icon>, <comment>, <category>, <server subsytem list>, <search tags>
43   list << Pages::PageInfo("wallpaper", QObject::tr("Wallpaper"), QObject::tr("Wallpaper Settings"), "preferences-desktop-wallpaper",QObject::tr("Change background image(s)"), "appearance", QStringList(), QStringList() << "background" << "wallpaper" << "color" << "image");
44   list << Pages::PageInfo(LUtils::AppToAbsolute("lthemeengine.desktop"), QObject::tr("Theme"), QObject::tr("Theme Settings"), "preferences-desktop-theme",QObject::tr("Change interface fonts and colors"), "appearance", QStringList(), QStringList() << "background" << "interface" << "color" << "theme" << "plugins");
45   list << Pages::PageInfo("compton", QObject::tr("Window Effects"), QObject::tr("Window Effects"), "window-duplicate",QObject::tr("Adjust transparency levels and window effects"), "appearance", QStringList(), QStringList() << "background" << "interface" << "color" << "transparency" << "windows" << "compositing");
46   list << Pages::PageInfo("autostart", QObject::tr("Autostart"), QObject::tr("Startup Settings"), "preferences-system-session-services",QObject::tr("Automatically start applications or services"), "session", QStringList(), QStringList() << "apps" << "autostart" << "services" << "xdg" << "startup" << "session");
47   list << Pages::PageInfo("defaultapps", QObject::tr("Applications"), QObject::tr("Mimetype Settings"), "preferences-desktop-default-applications",QObject::tr("Change default applications"), "session", QStringList(), QStringList() << "apps" << "default" << "services" << "xdg" << "session");
48   list << Pages::PageInfo("fluxbox-keys", QObject::tr("Keyboard Shortcuts"), QObject::tr("Keyboard Shortcuts"), "preferences-desktop-keyboard",QObject::tr("Change keyboard shortcuts"), "session", QStringList(), QStringList() << "apps" << "fluxbox" << "keys" << "keyboard" << "session" << "launch");
49   list << Pages::PageInfo("fluxbox-settings", QObject::tr("Window Manager"), QObject::tr("Window Settings"), "preferences-system-windows-actions",QObject::tr("Change window settings and appearances"), "appearance", QStringList(), QStringList() << "window" << "frame" << "border" << "workspace" << "theme" << "fluxbox" << "session");
50   list << Pages::PageInfo("interface-desktop", QObject::tr("Desktop"), QObject::tr("Desktop Plugins"), "preferences-desktop-icons",QObject::tr("Change what icons or tools are embedded on the desktop"), "interface", QStringList(), QStringList() << "desktop" << "plugins" << "embed" << "icons" << "utilities");
51   list << Pages::PageInfo("interface-panel", QObject::tr("Panels"), QObject::tr("Panels and Plugins"), "configure-toolbars",QObject::tr("Change any floating panels and what they show"), "interface", QStringList(), QStringList() << "desktop" << "toolbar" << "panel" << "floating" << "plugins");
52   list << Pages::PageInfo("interface-menu", QObject::tr("Menu"), QObject::tr("Menu Plugins"), "format-list-unordered",QObject::tr("Change what options are shown on the desktop context menu"), "interface", QStringList(), QStringList() << "desktop" << "menu" << "plugins" << "shortcuts");
53   list << Pages::PageInfo("session-locale", QObject::tr("Localization"), QObject::tr("Locale Settings"), "preferences-desktop-locale",QObject::tr("Change the default locale settings for this user"), "user", QStringList(), QStringList() << "user"<<"locale"<<"language"<<"translations");
54   list << Pages::PageInfo("session-options", QObject::tr("General Options"), QObject::tr("User Settings"), "configure",QObject::tr("Change basic user settings such as time/date formats"), "user", QStringList(), QStringList() << "user"<<"settings"<<"time"<<"date"<<"icon"<<"reset"<<"numlock"<<"clock");
55   list << Pages::PageInfo("soundtheme", QObject::tr("Sound Themeing"), QObject::tr("Theme"), "media-playlist-audio",QObject::tr("Change basic sound settings"), "session", QStringList(), QStringList() << "session"<<"settings"<<"sound"<<"theme");
56  // list << Pages::PageInfo("mouse-settings", QObject::tr("TrueOS Mouse Settings"), QObject::tr("TrueOS Mouse Settings"), "preferences-desktop-mouse",QObject::tr("Adjust mouse devices"), "user", QStringList(), QStringList() << "user"<<"speed"<<"accel"<<"mouse");
57  // list << Pages::PageInfo("bluetooth-settings", QObject::tr("TrueOS Bluetooth Settings"), QObject::tr("TrueOS Bluetooth Settings"), "preferences-desktop-bluetooth",QObject::tr("Setup Bluetooth devices"), "user", QStringList(), QStringList() << "user"<<"bluetooth"<<"audio");
58 
59   return list;
60 }
61 
GetNewPage(QString id,QWidget * parent)62 PageWidget* Pages::GetNewPage(QString id, QWidget *parent){
63   //Find the page that matches this "id"
64   PageWidget* page = 0;
65   if(id=="wallpaper"){ page = new page_wallpaper(parent); }
66   //else if(id=="theme"){ page = new page_theme(parent); }
67   else if(id=="autostart"){ page = new page_autostart(parent); }
68   else if(id=="defaultapps"){ page = new page_defaultapps(parent); }
69   else if(id=="fluxbox-keys"){ page = new page_fluxbox_keys(parent); }
70   else if(id=="fluxbox-settings"){ page = new page_fluxbox_settings(parent); }
71   else if(id=="interface-desktop"){ page = new page_interface_desktop(parent); }
72   else if(id=="interface-panel"){ page = new page_interface_panels(parent); }
73   else if(id=="interface-menu"){ page = new page_interface_menu(parent); }
74   else if(id=="session-locale"){ page = new page_session_locale(parent); }
75   else if(id=="session-options"){ page = new page_session_options(parent); }
76   else if(id=="compton"){ page = new page_compton(parent); }
77   else if(id=="soundtheme"){ page = new page_soundtheme(parent); }
78  // else if(id=="mouse-settings"){ page = new page_mouse_trueos(parent); }
79  // else if(id=="bluetooth-settings"){ page = new page_bluetooth_trueos(parent); }
80   //Return the main control_panel page as the fallback/default
81   if(page==0){ id.clear(); page = new page_main(parent); }
82   page->setWhatsThis(id);
83   return page;
84 }
85