aboutsummaryrefslogtreecommitdiff
path: root/lumina-config/mainUI.h
blob: 2dbcc2abdf056c0c7497cc2800e8a94b0c6865c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
//===========================================
//  Lumina-DE source code
//  Copyright (c) 2014-2015, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
#ifndef _LUMINA_CONFIG_MAIN_UI_H
#define _LUMINA_CONFIG_MAIN_UI_H

// Qt includes
#include <QMainWindow>
#include <QDir>
#include <QDesktopWidget>
#include <QSettings>
#include <QStringList>
#include <QString>
#include <QIcon>
#include <QTimer>
#include <QFileDialog>
#include <QFile>
#include <QTextStream>
#include <QMessageBox>
#include <QColorDialog>
#include <QColor>
#include <QInputDialog>
#include <QListWidgetItem>

// libLumina includes
#include <LuminaXDG.h>
#include <LuminaThemes.h>

// local includes
#include "LPlugins.h"
//#include "KeyCatch.h"
#include "AppDialog.h"
#include "ColorDialog.h"
#include "ThemeDialog.h"
#include "GetPluginDialog.h"
#include "PanelWidget.h"

//namespace for using the *.ui file
namespace Ui{
	class MainUI;
};

class MainUI : public QMainWindow{
	Q_OBJECT
public:
	MainUI();
	~MainUI();

	//Panels Page simplifications
	QString getColorStyle(QString current, bool allowTransparency = true);

	//Get an application on the system
	XDGDesktop getSysApp(bool allowreset = false);

private:
	Ui::MainUI *ui; //the *.ui file access
	QSettings *settings, *appsettings, *sessionsettings;
	QDesktopWidget *desktop;
	LPlugins *PINFO;
	QMenu *ppmenu, *mpmenu;
	QString panelcolor;
	QString DEFAULTBG;
	QList<XDGDesktop> sysApps;
	QList<XDGDesktop> STARTAPPS;
	bool loading, panadjust;
	bool moddesk, modpan, modmenu, modshort, moddef, modses; //page modified flags
	int panelnumber;
	QList<PanelWidget*> PANELS;

	//General purpose functions (not connected to buttons)
	void setupMenus(); //called during initialization
	void setupConnections(); //called during intialization

	int currentDesktop(); //the number for the current desktop

	//Convert to/from fluxbox keyboard shortcuts
	QString dispToFluxKeys(QString);
	QString fluxToDispKeys(QString);

	//Read/overwrite a text file
	QStringList readFile(QString path);
	bool overwriteFile(QString path, QStringList contents);

public slots:
	void setupIcons(); //called during initialization

private slots:
	void slotSingleInstance();

	//General UI Behavior
	void slotChangePage(bool enabled);
	void slotChangeScreen();
	void saveAndQuit();

	//General Utility Functions
	void loadCurrentSettings(bool screenonly = false);
	void saveCurrentSettings(bool screenonly = false);

	//Desktop Page
	//void deskplugchanged();
	void deskbgchanged();
	void desktimechanged();
	void deskbgremoved();
	void deskbgadded();
	void deskbgcoloradded();
	void deskplugadded();
	void deskplugremoved();


	//Panels Page
	void panelValChanged();
	void newPanel();
	void removePanel(int); //connected to a signal from the panel widget
	void loadPanels();
	void savePanels();

	//Menu Page/Tab
	void addmenuplugin();
	void rmmenuplugin();
	void upmenuplugin();
	void downmenuplugin();
	void checkmenuicons();

	//Shortcuts Page
	void loadKeyboardShortcuts();
	void saveKeyboardShortcuts();
	void clearKeyBinding();
	void applyKeyBinding();
	void updateKeyConfig();
	//void getKeyPress();

	//Defaults Page
	void changeDefaultBrowser();
	void changeDefaultEmail();
	void changeDefaultFileManager();
	void changeDefaultTerminal();
	void loadDefaultSettings();
	//void saveDefaultSettings();
	void cleardefaultitem();
	void setdefaultitem();
	void setdefaultbinary();
	void checkdefaulticons();

	//Session Page
	void loadSessionSettings();
	void saveSessionSettings();
	void rmsessionstartitem();
	void addsessionstartapp();
	void addsessionstartbin();
	void addsessionstartfile();
	void sessionoptchanged();
	void sessionthemechanged();
	void sessionCursorChanged();
	//void sessionstartchanged();
	void sessionEditColor();
	void sessionEditTheme();
	void sessionChangeUserIcon();
	void sessionResetSys();
	void sessionResetLumina();
	void sessionLoadTimeSample();
	void sessionShowTimeCodes();
	void sessionLoadDateSample();
	void sessionShowDateCodes();
};

#endif
bgstack15