Q3270
A Qt-based 3270 Terminal Emulator
Loading...
Searching...
No Matches
PreferencesDialog.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 PREFERENCESDIALOG_H
12#define PREFERENCESDIALOG_H
13
14#include <QDialog>
15#include <QColorDialog>
16#include <QFontDialog>
17#include <QFontDatabase>
18#include <QSettings>
19#include <QMessageBox>
20#include <QTableWidgetItem>
21#include <QMap>
22
23#include "CodePage.h"
24#include "ActiveSettings.h"
25
26#include "Stores/KeyboardStore.h"
27#include "Stores/ColourStore.h"
28
29#include "KeyboardThemeDialog.h"
30#include "ColourTheme.h"
31
32namespace Ui {
34}
35
36class PreferencesDialog : public QDialog
37{
38 Q_OBJECT
39
40 typedef QMap<QString, QStringList> KeyboardMap;
41
42// Q_ENUM(RulerStyle);
43
44 public:
45
46 explicit PreferencesDialog(CodePage &codepages, ActiveSettings &activeSettings, KeyboardStore &keyboardStore, ColourStore &colourStore, QWidget *parent = nullptr);
48
49 void showForm();
50
51 signals:
52
53 void tempFontChange(QFont f);
54 void tempFontTweakChange(Q3270::FontTweak f);
55
56 // Forwarded when keyboard themes are applied from the KeyboardThemeDialog
57 void themesApplied(const QString &name);
58
59 // Emitted when hostname field is not blank
60 // TODO: Is this the right place for this?
61 void connectValid(bool state);
62
63 public slots:
64
65 void connected();
66 void disconnected();
67
68 private slots:
69
70 void changeFont(QFont f);
71 void changeFontTweak(int index);
72
73 void terminalModelDropDownChanged(int m);
74
75 void colourThemeDropDownChanged(int index);
76 void keyboardThemeDropDownChanged(int index);
77
78 void populateColourThemeNames();
79 void populateKeyboardThemeNames();
80
81 void manageColourThemes();
82 void manageKeyboardThemes();
83
84 void securityChanged(int state);
85
86 private:
87
88 KeyboardStore &keyboardStore;
89 ColourStore &colourStore;
90
91 Ui::PreferencesDialog *ui;
92
93 CodePage &codepages;
94 ActiveSettings &activeSettings;
95
96 QString colourThemeName;
97 Colours colourTheme;
98
99 QString keyboardThemeName;
100 KeyboardMap keyboardTheme;
101
102 // Used to populate the combobox with nice names
103 QMap<QString, Q3270::RulerStyle> comboRulerStyle;
104 QMap<QString, Q3270::FontTweak> comboFontTweak;
105
106 void accept();
107 void reject();
108};
109
110#endif // PREFERENCESDIALOG_H
Definition ActiveSettings.h:20
The CodePage class.
Definition CodePage.h:27
Definition ColourStore.h:21
Definition KeyboardStore.h:21
Definition PreferencesDialog.h:37
~PreferencesDialog()
PreferencesDialog::~PreferencesDialog - destructor.
Definition PreferencesDialog.cpp:71
void connected()
PreferencesDialog::connected - disable some settings when connected to a host.
Definition PreferencesDialog.cpp:82
void showForm()
PreferencesDialog::showForm - display the Preferences dialog.
Definition PreferencesDialog.cpp:134
void disconnected()
PreferencesDialog::disconnected - enable some settings when not connected to a host.
Definition PreferencesDialog.cpp:103
Definition Colours.h:19
Definition KeyboardMap.h:26