File: serveritemwidget.h

package info (click to toggle)
chiaki 2.2.0-1.2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 5,312 kB
  • sloc: ansic: 17,616; cpp: 7,901; xml: 2,691; sh: 395; python: 96; makefile: 6
file content (46 lines) | stat: -rw-r--r-- 882 bytes parent folder | download | duplicates (3)
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
// SPDX-License-Identifier: LicenseRef-AGPL-3.0-only-OpenSSL

#ifndef CHIAKI_SERVERITEMWIDGET_H
#define CHIAKI_SERVERITEMWIDGET_H

#include <QFrame>

class QLabel;

class ServerIconWidget;
struct DisplayServer;

class ServerItemWidget : public QFrame
{
	Q_OBJECT

	private:
		bool selected;

		QLabel *top_label;
		QLabel *bottom_label;
		ServerIconWidget *icon_widget;

		QAction *delete_action;
		QAction *wake_action;

	protected:
		void mousePressEvent(QMouseEvent *event) override;
		void mouseDoubleClickEvent(QMouseEvent *event) override;

	public:
		explicit ServerItemWidget(QWidget *parent = nullptr);

		bool IsSelected() { return selected; }
		void SetSelected(bool selected);

		void Update(const DisplayServer &display_server);

	signals:
		void Selected();
		void Triggered();
		void DeleteTriggered();
		void WakeTriggered();
};

#endif //CHIAKI_CONSOLEITEMWIDGET_H