aboutsummaryrefslogtreecommitdiff
path: root/lumina-config/mainUI.h
blob: d40438dbb36921abf6cd351946cf72f6fafeda0c (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
#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>

// local includes
#include "LPlugins.h"
#include "KeyCatch.h"
#include "AppDialog.h"

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

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

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;
	bool loading;
	bool moddesk, modpan, modmenu, modshort, moddef, modses; //page modified flags
	int panelnumber;

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

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

	//Panels Page simplifications
	QString getColorStyle(QString current);
	QString getNewPanelPlugin();

	//Get an application on the system
	XDGDesktop getSysApp();

	//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);

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 deskplugadded();


	//Panels Page
	void addpanel1();
	void addpanel2();
	void rmpanel1();
	void rmpanel2();

	void checkpanels();
	void adjustpanel1();
	void adjustpanel2();

	void getpanel1color();
	void getpanel2color();
	void addpanel1plugin();
	void addpanel2plugin();
	void rmpanel1plugin();
	void rmpanel2plugin();
	void uppanel1plugin();
	void uppanel2plugin();
	void dnpanel1plugin();
	void dnpanel2plugin();

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

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

	//Defaults Page
	void loadDefaultSettings();
	void saveDefaultSettings();
	void adddefaultgroup();
	void adddefaultextension();
	void cleardefaultitem();
	void setdefaultitem();
	void checkdefaulticons();

	//Session Page
	void loadSessionSettings();
	void saveSessionSettings();
	void rmsessionstartitem();
	void addsessionstartapp();
	void addsessionstartbin();
	void addsessionstartfile();
	void sessionoptchanged();
	void sessionthemechanged();
	void sessionstartchanged();
};

#endif
bgstack15