Q3270
A Qt-based 3270 Terminal Emulator
Loading...
Searching...
No Matches
KeyboardThemeDialog.h
1/*
2 * Q3270 Terminal Emulator
3 *
4 * Copyright (c) 2020–2025 Andy Styles
5 * SPDX-License-Identifier: BSD-3-Clause
6 *
7 * This file is part of Q3270.
8 * See the LICENSE file in the project root for full license information.
9 */
10
11#ifndef KEYBOARDTHEMEDIALOG_H
12#define KEYBOARDTHEMEDIALOG_H
13
14#include <QDialog>
15#include <QObject>
16#include <QMap>
17#include <QSettings>
18#include <QDebug>
19#include <QLineEdit>
20#include <QLabel>
21#include <QDialogButtonBox>
22#include <QTableWidgetItem>
23
24#include "Models/KeyboardMap.h"
25#include "Stores/KeyboardStore.h"
26
27namespace Ui {
28 class KeyboardTheme;
29}
30
31class KeyboardThemeDialog : public QDialog
32{
33 Q_OBJECT
34
35 public:
36
37 explicit KeyboardThemeDialog(KeyboardStore &store, QWidget *parent = nullptr);
39
40 int exec();
41
42 private:
43
44 KeyboardMap factory;
45 KeyboardStore &store;
46
47 Ui::KeyboardTheme *ui;
48
49 QMap<QString, KeyboardMap> themes;
50
51 QStringList functionList;
52
53 KeyboardMap theme;
54 KeyboardMap *currentTheme;
55
56 int lastRow;
57 int lastSeq;
58
59 bool dirty;
60 bool unapplied;
61
62 // Variables used to store state, to be restored should the user press cancel
63 QString restoreThemeName;
64 QMap<QString, KeyboardMap> restoreThemes;
65 int restoreThemeIndex;
66
67 void setTheme(const QString &themeName);
68 void updateUiState();
69
70 signals:
71 void themesApplied(const QString &themeName);
72
73 private slots:
74
75 void handleThemeChanged(const QString &name);
76
77 void validateThemeName(const QString &name);
78
79 void createNewTheme();
80 void saveTheme();
81 void removeTheme();
82
83// void themeChanged(int index);
84// void addTheme();
85
86 void setKey();
87 void truncateShortcut();
88
89 void handleSpecialKey(const QString &symbolic);
90 void populateKeySequence(int row, const QString &functionName, const QStringList &keyList);
91
92 void revertTheme();
93 void applyTheme();
94};
95
96#endif // KEYBOARDTHEMEDIALOG_H
Definition KeyboardStore.h:21
Definition KeyboardThemeDialog.h:32
int exec()
KeyboardTheme::exec - display the dialog.
Definition KeyboardThemeDialog.cpp:97
~KeyboardThemeDialog()
KeyboardTheme::~KeyboardTheme - destructor.
Definition KeyboardThemeDialog.cpp:86
Definition KeyboardMap.h:26