2013-05-24 18:19:48 +00:00
|
|
|
#ifndef PREFERENCES_DIALOG_H
|
|
|
|
#define PREFERENCES_DIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
2013-05-28 18:21:27 +00:00
|
|
|
#include "../dive.h"
|
|
|
|
#include "../pref.h"
|
2013-05-24 18:19:48 +00:00
|
|
|
|
|
|
|
namespace Ui{
|
2013-06-02 20:58:50 +00:00
|
|
|
class PreferencesDialog;
|
2013-05-24 18:19:48 +00:00
|
|
|
}
|
2013-06-02 20:58:50 +00:00
|
|
|
class QAbstractButton;
|
2013-05-24 18:19:48 +00:00
|
|
|
|
|
|
|
class PreferencesDialog :public QDialog{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
static PreferencesDialog* instance();
|
2013-06-02 20:58:50 +00:00
|
|
|
void showEvent(QShowEvent* );
|
2013-05-24 18:19:48 +00:00
|
|
|
signals:
|
|
|
|
void settingsChanged();
|
|
|
|
public slots:
|
2013-06-02 20:58:50 +00:00
|
|
|
void buttonClicked(QAbstractButton* button);
|
2013-05-24 18:19:48 +00:00
|
|
|
void syncSettings();
|
2013-06-03 12:08:49 +00:00
|
|
|
void restorePrefs();
|
|
|
|
void rememberPrefs();
|
2013-05-28 18:21:27 +00:00
|
|
|
|
2013-05-24 18:19:48 +00:00
|
|
|
private:
|
|
|
|
explicit PreferencesDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
2013-06-03 12:08:49 +00:00
|
|
|
void setUiFromPrefs();
|
|
|
|
void setPrefsFromUi();
|
|
|
|
void setUIFromSettings();
|
2013-05-28 18:21:27 +00:00
|
|
|
Ui::PreferencesDialog* ui;
|
|
|
|
struct preferences oldPrefs;
|
2013-05-24 18:19:48 +00:00
|
|
|
};
|
|
|
|
|
2013-05-28 18:21:27 +00:00
|
|
|
#endif
|