OSDN Git Service

Implemented experimental dark mode, based on QDarkStyleSheet.
[x264-launcher/x264-launcher.git] / src / win_preferences.h
index aee5e44..1015d2a 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // Simple x264 Launcher
-// Copyright (C) 2004-2012 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2020 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 
 #pragma once
 
-#include "uic_win_preferences.h"
+#include <QDialog>
 
-class PreferencesDialog : public QDialog, private Ui::PreferencesDialog
+class PreferencesModel;
+class SysinfoModel;
+
+namespace Ui
+{
+       class PreferencesDialog;
+}
+
+class PreferencesDialog : public QDialog
 {
        Q_OBJECT
 
 public:
-       typedef struct
-       {
-               bool autoRunNextJob;
-               unsigned int maxRunningJobCount;
-       }
-       Preferences;
-
-       PreferencesDialog(QWidget *parent, Preferences *preferences);
+       PreferencesDialog(QWidget *parent, PreferencesModel *preferences, const SysinfoModel *sysinfo);
        ~PreferencesDialog(void);
 
-       static void loadPreferences(Preferences *preferences);
-       static void savePreferences(Preferences *preferences);
-
 protected:
-       virtual void accept(void);
+       virtual void done(int n);
        virtual void showEvent(QShowEvent *event);
+       virtual bool eventFilter(QObject *o, QEvent *e);
+
+       inline static void emulateMouseEvent(QObject *object, QEvent *event, QWidget *source, QWidget *target);
 
 private:
-       Preferences *m_preferences;
+       Ui::PreferencesDialog *const ui;
+       const SysinfoModel *const m_sysinfo;
+       PreferencesModel *m_preferences;
+
+private slots:
+       void resetButtonPressed(void);
+       void disableWarningsToggled(bool checked);
 };