2022-10-21 02:22:09 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
2022-11-17 07:45:08 +08:00
|
|
|
#include <QByteArray>
|
2022-10-28 05:48:40 +08:00
|
|
|
#include <QComboBox>
|
2022-10-21 02:22:09 +08:00
|
|
|
#include <QDialog>
|
2023-04-14 10:53:39 +08:00
|
|
|
#include <QGroupBox>
|
|
|
|
|
#include <QLineEdit>
|
2022-10-21 02:22:09 +08:00
|
|
|
#include <QSpinBox>
|
|
|
|
|
|
2023-04-11 06:53:50 +08:00
|
|
|
#define LIGHT_THEME 1
|
|
|
|
|
#define DARK_THEME 2
|
|
|
|
|
|
2022-10-21 02:22:09 +08:00
|
|
|
class Settings : public QObject {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2023-04-17 18:52:45 +02:00
|
|
|
enum DragDirection {
|
|
|
|
|
MsbFirst,
|
|
|
|
|
LsbFirst,
|
|
|
|
|
AlwaysLE,
|
|
|
|
|
AlwaysBE,
|
|
|
|
|
};
|
|
|
|
|
|
2023-10-26 05:39:41 +08:00
|
|
|
Settings();
|
|
|
|
|
~Settings();
|
2022-10-21 02:22:09 +08:00
|
|
|
|
2023-10-26 01:57:09 +08:00
|
|
|
bool absolute_time = false;
|
2022-10-21 02:22:09 +08:00
|
|
|
int fps = 10;
|
2023-03-11 21:47:53 +01:00
|
|
|
int max_cached_minutes = 30;
|
2022-10-21 02:22:09 +08:00
|
|
|
int chart_height = 200;
|
2023-01-20 05:51:55 +08:00
|
|
|
int chart_column_count = 1;
|
2023-03-30 03:43:43 +08:00
|
|
|
int chart_range = 3 * 60; // 3 minutes
|
2023-02-03 05:16:32 +08:00
|
|
|
int chart_series_type = 0;
|
2023-04-03 02:34:10 +08:00
|
|
|
int theme = 0;
|
2023-03-30 03:43:43 +08:00
|
|
|
int sparkline_range = 15; // 15 seconds
|
2023-10-31 00:47:23 +08:00
|
|
|
bool multiple_lines_hex = false;
|
2023-04-14 10:53:39 +08:00
|
|
|
bool log_livestream = true;
|
2023-05-04 19:50:28 +02:00
|
|
|
bool suppress_defined_signals = false;
|
2023-04-14 10:53:39 +08:00
|
|
|
QString log_path;
|
2022-11-11 02:37:52 +08:00
|
|
|
QString last_dir;
|
2023-02-04 04:47:26 +08:00
|
|
|
QString last_route_dir;
|
2023-01-19 03:40:44 +08:00
|
|
|
QByteArray geometry;
|
|
|
|
|
QByteArray video_splitter_state;
|
|
|
|
|
QByteArray window_state;
|
2023-01-27 12:29:28 +08:00
|
|
|
QStringList recent_files;
|
2023-01-27 04:56:38 +08:00
|
|
|
QByteArray message_header_state;
|
2023-10-26 05:39:41 +08:00
|
|
|
DragDirection drag_direction = MsbFirst;
|
2022-10-21 02:22:09 +08:00
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void changed();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class SettingsDlg : public QDialog {
|
|
|
|
|
public:
|
|
|
|
|
SettingsDlg(QWidget *parent);
|
|
|
|
|
void save();
|
|
|
|
|
QSpinBox *fps;
|
2023-01-21 03:47:29 +08:00
|
|
|
QSpinBox *cached_minutes;
|
2022-10-21 02:22:09 +08:00
|
|
|
QSpinBox *chart_height;
|
2023-02-03 05:16:32 +08:00
|
|
|
QComboBox *chart_series_type;
|
2023-04-03 02:34:10 +08:00
|
|
|
QComboBox *theme;
|
2023-04-14 10:53:39 +08:00
|
|
|
QGroupBox *log_livestream;
|
|
|
|
|
QLineEdit *log_path;
|
2023-04-17 18:52:45 +02:00
|
|
|
QComboBox *drag_direction;
|
2022-10-21 02:22:09 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern Settings settings;
|