-
Notifications
You must be signed in to change notification settings - Fork 8
/
wingmenuconfiguration.h
81 lines (68 loc) · 2.03 KB
/
wingmenuconfiguration.h
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
#pragma once
#include <QAbstractButton>
#include <QDialog>
#include <QStandardItemModel>
#include <lxqtpanelglobals.h>
#include <pluginsettings.h>
class XdgDesktopFile;
class XdgMenu;
// class QComboBox;
namespace Ui
{
class WingMenuConfiguration;
};
namespace GlobalKeyShortcut
{
class Action;
}
class WingMenuConfiguration : public QDialog
{
Q_OBJECT
public:
explicit WingMenuConfiguration(
PluginSettings& settings,
GlobalKeyShortcut::Action* shortcut,
XdgMenu* xdgMenu,
QWidget* parent = nullptr);
explicit WingMenuConfiguration(
PluginSettings* settings,
GlobalKeyShortcut::Action* shortcut,
XdgMenu* xdgMenu,
QWidget* parent = nullptr) : WingMenuConfiguration(
*settings,
shortcut,
xdgMenu,
parent) {};
~WingMenuConfiguration() = default;
PluginSettings& settings() const;
protected slots:
void loadSettings() const;
void dialogButtonsAction(QAbstractButton* btn);
private:
Ui::WingMenuConfiguration* ui;
PluginSettings& mSettings;
XdgMenu* mXdgMenu;
GlobalKeyShortcut::Action* mShortcut;
QStandardItemModel* mLeaveActionsModel;
QString mDesktopFilesDir;
void globalShortcutChanged(const QString& oldShortcut, const QString& newShortcut);
void shortcutChanged(const QString& value);
void shortcutReset();
void chooseMenuFile();
void actionActivated(const QModelIndex& index);
QStandardItem* createItem(const QString& fileName) const;
void copyDesktopFile(const QString& fileName);
void loadLeaveActions() const;
void saveLeaveActions();
void customizeLeave(bool customize);
void loadFromMenu();
void addDesktopFile();
void newAction();
void editAction();
void upAction();
void downAction();
void removeAction();
void openEditDialog(const QString& fileName = QString());
void saveDesktopFile(const QString& name, const QString& icon, const QString& exec, const QString& fileName);
QString newFileName();
};