 |
Sayonara Player
|
21 #ifndef PREFERENCEWIDGETINTERFACE_H
22 #define PREFERENCEWIDGETINTERFACE_H
24 #include "Gui/Utils/GuiClass.h"
25 #include "Gui/Utils/Widgets/Widget.h"
26 #include "Utils/Pimpl.h"
52 virtual ~
Base()
override;
61 void setInitialized();
65 template<
typename W,
typename UiClass>
74 (*ui)->setupUi(widget);
78 widget->languageChanged();
114 void closeEvent(QCloseEvent* e) override;
182 #endif // PREFERENCEWIDGETINTERFACE_H
void showEvent(QShowEvent *e) override
shows the widget and automatically calls init_ui()
virtual bool isUiInitialized() const final
checks if ui has already been initialized.
virtual void languageChanged() override final
automatically called when language has changed. When overriding this method. Overriding this method s...
virtual void initUi()=0
call setup_parent(this) here. initialize compoenents and connections here. After calling setup_parent...
Base(const QString &identifier)
Standard constructor.
void setupParent(W *widget, UiClass **ui)
Sets up the Preference dialog. After this method, the dialog is "ready to use" This method should be ...
Definition: PreferenceWidget.h:71
virtual void retranslate()=0
call the Qt retranslateUi method here
void translationAction()
Sets the new translated action name.
virtual QString errorString() const
A closer description of the error.
virtual bool commit()=0
This method is called, when OK or apply is pressed. So all settings should be written there.
virtual QString actionName() const =0
has to be implemented and should return the translated action text
virtual void revert()=0
This method is called, when cancel is clicked. So the gui should be re-initialized when this method i...
Abstract Interface you should use when creating a preferences item.
Definition: PreferenceWidget.h:42
virtual bool hasError() const
indicates if there was an error on the settings page like an invalid expression or combination of set...
virtual QAction * action() final
get action with translated text
QString identifier() const
return the unique identifier