Add Verbose Logging Setting

This commit is contained in:
Florian Märkl 2019-08-16 18:59:20 +02:00
commit 862c11bc8f
No known key found for this signature in database
GPG key ID: 125BC8A5A6A1E857
10 changed files with 93 additions and 23 deletions

View file

@ -21,6 +21,7 @@
#include <chiaki/log.h>
#include <QString>
#include <QDir>
#include <QMutex>
class QFile;
@ -45,6 +46,7 @@ class SessionLog
ChiakiLog *GetChiakiLog() { return &log; }
};
QString GetLogBaseDir();
QString CreateLogFilename();
#endif //CHIAKI_SESSIONLOG_H

View file

@ -39,9 +39,13 @@ class Settings : public QObject
public:
explicit Settings(QObject *parent = nullptr);
bool GetDiscoveryEnabled() { return settings.value("settings/auto_discovery", true).toBool(); }
bool GetDiscoveryEnabled() const { return settings.value("settings/auto_discovery", true).toBool(); }
void SetDiscoveryEnabled(bool enabled) { settings.setValue("settings/auto_discovery", enabled); }
bool GetLogVerbose() const { return settings.value("settings/log_verbose", false).toBool(); }
void SetLogVerbose(bool enabled) { settings.setValue("settings/log_verbose", enabled); }
uint32_t GetLogLevelMask();
ChiakiVideoResolutionPreset GetResolution() const;
void SetResolution(ChiakiVideoResolutionPreset resolution);

View file

@ -23,6 +23,7 @@
class Settings;
class QListWidget;
class QComboBox;
class QCheckBox;
class SettingsDialog : public QDialog
{
@ -31,6 +32,8 @@ class SettingsDialog : public QDialog
private:
Settings *settings;
QCheckBox *log_verbose_check_box;
QComboBox *resolution_combo_box;
QComboBox *fps_combo_box;
@ -38,6 +41,8 @@ class SettingsDialog : public QDialog
QPushButton *delete_registered_host_button;
private slots:
void LogVerboseChanged();
void ResolutionSelected();
void FPSSelected();

View file

@ -34,6 +34,7 @@ class QGamepad;
class QAudioOutput;
class QIODevice;
class QKeyEvent;
class Settings;
class ChiakiException: public Exception
{
@ -49,6 +50,9 @@ struct StreamSessionConnectInfo
QByteArray regist_key;
QByteArray morning;
ChiakiConnectVideoProfile video_profile;
StreamSessionConnectInfo();
StreamSessionConnectInfo(Settings *settings, QString host, QByteArray regist_key, QByteArray morning);
};
class StreamSession : public QObject