446 |
andreas |
1 |
/*
|
|
|
2 |
* Copyright (C) 2020, 2023 by Andreas Theofilu <andreas@theosys.at>
|
|
|
3 |
*
|
|
|
4 |
* This program is free software; you can redistribute it and/or modify
|
|
|
5 |
* it under the terms of the GNU General Public License as published by
|
|
|
6 |
* the Free Software Foundation; either version 3 of the License, or
|
|
|
7 |
* (at your option) any later version.
|
|
|
8 |
*
|
|
|
9 |
* This program is distributed in the hope that it will be useful,
|
|
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
* GNU General Public License for more details.
|
|
|
13 |
*
|
|
|
14 |
* You should have received a copy of the GNU General Public License
|
|
|
15 |
* along with this program; if not, write to the Free Software Foundation,
|
|
|
16 |
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
17 |
*/
|
|
|
18 |
|
|
|
19 |
#ifndef __TQTSETTINGS_H__
|
|
|
20 |
#define __TQTSETTINGS_H__
|
|
|
21 |
|
|
|
22 |
#include <QDialog>
|
|
|
23 |
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
|
24 |
#include <QAudio>
|
|
|
25 |
#endif
|
|
|
26 |
|
|
|
27 |
#include <vector>
|
|
|
28 |
|
|
|
29 |
#include "ttpinit.h"
|
|
|
30 |
|
|
|
31 |
namespace Ui
|
|
|
32 |
{
|
|
|
33 |
class TQtSettings;
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
class QAudioOutput;
|
|
|
37 |
|
|
|
38 |
class TQtSettings : public QDialog
|
|
|
39 |
{
|
|
|
40 |
Q_OBJECT
|
|
|
41 |
|
|
|
42 |
public:
|
|
|
43 |
explicit TQtSettings(QWidget *parent = nullptr);
|
|
|
44 |
~TQtSettings();
|
|
|
45 |
bool hasChanged() { return mSetChanged; }
|
|
|
46 |
void setScaleFactor(double sf) { mScaleFactor = sf; }
|
|
|
47 |
void doResize();
|
|
|
48 |
uint getLogLevel() { return mLogLevel; }
|
|
|
49 |
bool downloadForce() { return mDownloadForce; }
|
|
|
50 |
std::string getSelectedFtpFile();
|
|
|
51 |
size_t getSelectedFtpFileSize();
|
|
|
52 |
|
|
|
53 |
private slots:
|
|
|
54 |
// Logging
|
|
|
55 |
void on_kiconbutton_logFile_clicked();
|
|
|
56 |
void on_lineEdit_logFile_textChanged(const QString &arg1);
|
|
|
57 |
void on_checkBox_Format_toggled(bool checked);
|
|
|
58 |
void on_checkBox_Profiling_toggled(bool checked);
|
|
|
59 |
void on_checkBox_LogInfo_toggled(bool checked);
|
|
|
60 |
void on_checkBox_LogWarning_toggled(bool checked);
|
|
|
61 |
void on_checkBox_LogError_toggled(bool checked);
|
|
|
62 |
void on_checkBox_LogTrace_toggled(bool checked);
|
|
|
63 |
void on_checkBox_LogDebug_toggled(bool checked);
|
|
|
64 |
void on_checkBox_LogProtocol_toggled(bool checked);
|
|
|
65 |
void on_checkBox_LogAll_toggled(bool checked);
|
|
|
66 |
void on_kiconbutton_reset_clicked();
|
|
|
67 |
// Controller
|
|
|
68 |
void on_lineEdit_Controller_textChanged(const QString &arg1);
|
|
|
69 |
void on_spinBox_Port_valueChanged(int arg1);
|
|
|
70 |
void on_spinBox_Channel_valueChanged(int arg1);
|
|
|
71 |
void on_lineEdit_PType_textChanged(const QString &arg1);
|
|
|
72 |
void on_lineEdit_FTPuser_textChanged(const QString &arg1);
|
|
|
73 |
void on_lineEdit_FTPpassword_textChanged(const QString &arg1);
|
|
|
74 |
void on_comboBox_FTPsurface_currentTextChanged(const QString &arg1);
|
|
|
75 |
void on_toolButton_Download_clicked();
|
|
|
76 |
void on_checkBox_FTPpassive_toggled(bool checked);
|
|
|
77 |
// SIP
|
|
|
78 |
void on_lineEdit_SIPproxy_textChanged(const QString &arg1);
|
|
|
79 |
void on_spinBox_SIPport_valueChanged(int arg1);
|
|
|
80 |
void on_spinBox_SIPportTLS_valueChanged(int arg1);
|
|
|
81 |
void on_lineEdit_SIPstun_textChanged(const QString &arg1);
|
|
|
82 |
void on_lineEdit_SIPdomain_textChanged(const QString &arg1);
|
|
|
83 |
void on_lineEdit_SIPuser_textChanged(const QString &arg1);
|
|
|
84 |
void on_lineEdit_SIPpassword_textChanged(const QString &arg1);
|
|
|
85 |
void on_checkBox_SIPnetworkIPv4_toggled(bool checked);
|
|
|
86 |
void on_checkBox_SIPnetworkIPv6_toggled(bool checked);
|
|
|
87 |
void on_comboBox_SIPfirewall_currentIndexChanged(int index);
|
|
|
88 |
void on_checkBox_SIPenabled_toggled(bool checked);
|
|
|
89 |
void on_checkBox_SIPiphone_toggled(bool checked);
|
|
|
90 |
// View
|
|
|
91 |
void on_checkBox_Scale_toggled(bool checked);
|
|
|
92 |
void on_checkBox_Banner_toggled(bool checked);
|
|
|
93 |
void on_checkBox_ToolbarSuppress_toggled(bool checked);
|
|
|
94 |
void on_checkBox_Toolbar_toggled(bool checked);
|
|
|
95 |
void on_checkBox_Rotation_toggled(bool checked);
|
|
|
96 |
// Sound
|
|
|
97 |
void on_comboBox_SystemSound_currentTextChanged(const QString& arg1);
|
|
|
98 |
void on_toolButton_SystemSound_clicked();
|
|
|
99 |
void on_comboBox_SingleBeep_currentTextChanged(const QString& arg1);
|
|
|
100 |
void on_toolButton_SingleBeep_clicked();
|
|
|
101 |
void on_comboBox_DoubleBeep_currentTextChanged(const QString& arg1);
|
|
|
102 |
void on_toolButton_DoubleBeep_clicked();
|
|
|
103 |
void on_checkBox_SystemSound_toggled(bool checked);
|
|
|
104 |
void on_toolButton_TestSound_clicked();
|
|
|
105 |
void on_horizontalSlider_Volume_valueChanged(int value);
|
|
|
106 |
void on_horizontalSlider_Gain_valueChanged(int value);
|
|
|
107 |
// Passwords
|
|
|
108 |
void on_lineEdit_Password1_textChanged(const QString& arg);
|
|
|
109 |
void on_lineEdit_Password2_textChanged(const QString& arg);
|
|
|
110 |
void on_lineEdit_Password3_textChanged(const QString& arg);
|
|
|
111 |
void on_lineEdit_Password4_textChanged(const QString& arg);
|
|
|
112 |
void on_pushButton_ViewPW1_clicked();
|
|
|
113 |
void on_pushButton_ViewPW2_clicked();
|
|
|
114 |
void on_pushButton_ViewPW3_clicked();
|
|
|
115 |
void on_pushButton_ViewPW4_clicked();
|
|
|
116 |
|
|
|
117 |
private:
|
|
|
118 |
int scale(int value);
|
|
|
119 |
|
|
|
120 |
#ifdef __ANDROID__
|
|
|
121 |
QPalette qt_fusionPalette();
|
|
|
122 |
#endif
|
|
|
123 |
template <typename T>
|
|
|
124 |
void scaleObject(T *obj);
|
|
|
125 |
|
|
|
126 |
Ui::TQtSettings *ui{nullptr};
|
|
|
127 |
bool mSetChanged{false};
|
|
|
128 |
double mScaleFactor{1.0};
|
|
|
129 |
uint mLogLevel{0};
|
|
|
130 |
bool mInitRun{false};
|
|
|
131 |
bool mDownloadForce{false};
|
|
|
132 |
double mRatioFont{1.0};
|
|
|
133 |
int mIndex{0};
|
|
|
134 |
std::vector<TTPInit::FILELIST_t> mFileList;
|
|
|
135 |
};
|
|
|
136 |
|
|
|
137 |
#endif
|