Q3270
A Qt-based 3270 Terminal Emulator
Loading...
Searching...
No Matches
ColourTheme.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 COLOURTHEME_H
12#define COLOURTHEME_H
13
14#include <QDialog>
15#include <QList>
16#include <QVector>
17#include <QSettings>
18#include <QColorDialog>
19#include <QComboBox>
20#include <QDebug>
21#include <QLineEdit>
22#include <QDialogButtonBox>
23#include <QLabel>
24#include <QMap>
25
26#include "Q3270.h"
27#include "Stores/ColourStore.h"
28
29namespace Ui {
30 class ColourTheme;
31}
32
33class ColourTheme : public QDialog
34{
35 Q_OBJECT
36
37 public:
38
39 explicit ColourTheme(ColourStore &store, QWidget *parent = nullptr);
41
42// void setButtonColours(Colours theme, QString themeName);
43// void setButtonColours(QString themeName);
44// QList<QString> getThemes();
45
46 int exec() override;
47
48 void setTheme(const QString &themeName);
49
50 private:
51
52 ColourStore &store;
53
54 Ui::ColourTheme *ui;
55
56 QMap<QString, Colours>themes;
57 Colours *currentTheme;
58
59 // Variables used to restore state, should the user presss cancel
60 QMap<QString, Colours>restoreThemes;
61 QString restoreThemeName;
62
63 bool dirty;
64 bool unapplied;
65
66 void updateUiState();
67
68 signals:
69
70 void themesApplied(const QString &name);
71
72 private slots:
73
74 void handleThemeChanged(const QString &name);
75 void handleColourModified(Q3270::Colour, QColor);
76
77 void checkThemeName(const QString &name);
78
79 void createNewTheme();
80 void saveTheme();
81 void removeTheme();
82
83 void revertTheme();
84 void applyTheme();
85};
86
87#endif // COLOURTHEME_H
Definition ColourStore.h:21
Definition ColourTheme.h:34
void setTheme(const QString &themeName)
ColourTheme::setTheme - set colour theme.
Definition ColourTheme.cpp:104
int exec() override
ColourTheme::exec - dialog display.
Definition ColourTheme.cpp:84
~ColourTheme()
ColourTheme::~ColourTheme - destructor.
Definition ColourTheme.cpp:75
Definition Colours.h:19