Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Preferences Buttons #2664

Merged
merged 10 commits into from
Apr 17, 2020
52 changes: 25 additions & 27 deletions src/preferences/dlgpreferencepage.h
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
#ifndef DLGPREFERENCEPAGE_H
#define DLGPREFERENCEPAGE_H
#pragma once

#include <QWidget>

// API that all preference pages should implement.
/// Interface that all preference pages have to implement.
class DlgPreferencePage : public QWidget {
Q_OBJECT
public:
DlgPreferencePage(QWidget* pParent);
virtual ~DlgPreferencePage();

public slots:
// Called when the preference dialog is shown to the user (not necessarily
// when this PreferencePage is shown to the user). At this point, the
// PreferencePage should update all of its setting to the latest values.
virtual void slotUpdate() {}

// Called when the user clicks the global "Apply" button. The preference
// dialog should make all of the current setting of the UI widgets active.
virtual void slotApply() {}

// Called when the user clicks the global "Cancel" button. The preference
// dialog should revert all of the changes the user made since the last
// slotUpdate.
virtual void slotCancel() {}

// Called when the user clicks the global "Reset to Defaults" button. The
// preference dialog should revert settings to their default values.
virtual void slotResetToDefaults() {}

// Called when the preferences dialog is shown to the user (not necessarily
// when this PreferencePage is shown to the user).
/// Called when the preference dialog is shown to the user (not necessarily
/// when this PreferencePage is shown to the user). At this point, the
/// PreferencePage should update all of its setting to the latest values.
virtual void slotUpdate() = 0;
Be-ing marked this conversation as resolved.
Show resolved Hide resolved

/// Called when the user clicks the global "Apply" button. The preference
/// dialog should make all of the current setting of the UI widgets active.
virtual void slotApply() = 0;

/// Called when the user clicks the global "Cancel" button. The preference
/// dialog should revert all of the changes the user made since the last
/// slotUpdate. The default implementation just class slotUpdate.
virtual void slotCancel() {
slotUpdate();
}

/// Called when the user clicks the global "Reset to Defaults" button. The
/// preference dialog should revert settings to their default values.
virtual void slotResetToDefaults() = 0;

/// Called when the preferences dialog is shown to the user (not necessarily
/// when this PreferencePage is shown to the user).
virtual void slotShow() {}

// Called when the preferences dialog is hidden from the user.
/// Called when the preferences dialog is hidden from the user.
virtual void slotHide() {}
};


#endif /* DLGPREFERENCEPAGE_H */