aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-terminal/TrayIcon.h
blob: 961aaa908b21f5bab3ab14b6300a6cd97401c94d (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
//===========================================
//  Lumina-DE source code
//  Copyright (c) 2015, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
#ifndef _LUMINA_DESKTOP_UTILITIES_TERMINAL_TRAY_ICON_H
#define _LUMINA_DESKTOP_UTILITIES_TERMINAL_TRAY_ICON_H
// QT Includes
#include <QApplication>
#include <QSystemTrayIcon>
#include <QMenu>
#include <QTimer>
#include <QSettings>

#include <LuminaXDG.h>

#include "TermWindow.h"

class TrayIcon : public QSystemTrayIcon {
   Q_OBJECT
   
public:
	TrayIcon();
	~TrayIcon();
	
	//First run
	void parseInputs(QStringList); //Note that this is only run on the primary process - otherwise it gets sent to the singleInstance slot below
	   
public slots:
	void slotSingleInstance(QStringList inputs = QStringList());
	void updateIcons();
	
private:
	bool termVisible;
	TermWindow *TERM;
	QMenu *ScreenMenu;
	QStringList adjustInputs(QStringList);
	QSettings *settings;
private slots:
	//Action Buttons
	void startCleanup();
	void stopApplication();
	void ChangeTopBottom(bool ontop);
	void ChangeScreen(QAction*);

	//Tray Updates
	void setupContextMenu();
	void updateScreenMenu();
	void TrayActivated(QSystemTrayIcon::ActivationReason);

	//Slots for the window visibility
	void ToggleVisibility();
	void TermHidden();
	void TermVisible();

};

#endif
bgstack15