#include <PreferenceWidgetInterface.h>
Abstract Interface you should use when creating a preferences item.
For methods to be implemented see also PreferenceInterface. If you wish to subclass, reimplement void get_action_name() and void init_ui().
In every function that makes use of the widgets call bool is_ui_initialized() first.
Call setup_parent(this) in init_ui() first.
If you wish to reimplement void language_changed(), call PreferenceWidgetInterface::language_changed at the end.
|
class | PreferenceInterface< SayonaraDialog > |
|
|
| PreferenceWidgetInterface (QWidget *parent=nullptr) |
| Standard constructor. More...
|
|
virtual bool | is_ui_initialized () const final |
| checks if ui has already been initialized. More...
|
|
virtual QAction * | get_action () final |
| get action with translated text More...
|
|
virtual QString | get_action_name () const=0 |
| has to be implemented and should return the translated action text More...
|
|
virtual void | commit ()=0 |
| This method is called, when OK or apply is pressed. So all settings should be written there.
|
|
virtual void | revert ()=0 |
| This method is called, when cancel is clicked. So the gui should be re-initialized when this method is called. This method should also be called in the init_ui() method.
|
|
SayonaraDialog * | box_into_dialog () |
|
|
virtual void | skin_changed () |
|
◆ PreferenceWidgetInterface()
PreferenceWidgetInterface::PreferenceWidgetInterface |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
Standard constructor.
- Parameters
-
◆ closeEvent()
|
inlineoverrideprotectedinherited |
closes the widget
- Parameters
-
◆ get_action()
|
inlinefinalvirtualinherited |
get action with translated text
- Returns
◆ get_action_name()
has to be implemented and should return the translated action text
- Returns
- translated action name
Implemented in GUI_LastFM, GUI_RemoteControl, GUI_Shortcuts, GUI_PlaylistPreferences, GUI_Notifications, GUI_StartupDialog, GUI_StreamRecorder, GUI_PlayerPreferences, GUI_FontConfig, GUI_LanguageChooser, GUI_Covers, GUI_BroadcastSetup, and GUI_LibraryPreferences.
◆ is_ui_initialized()
|
inlinefinalvirtualinherited |
checks if ui has already been initialized.
- Returns
- false, if the widget has never been activated before, true else
◆ language_changed()
|
inlinefinaloverrideprotectedvirtualinherited |
◆ setup_parent()
Sets up the Preference dialog. After this method, the dialog is "ready to use"
This method should be the first to be called when calling init_ui()
- Parameters
-
widget | should always be "this" |
◆ showEvent()
|
inlineoverrideprotectedinherited |
shows the widget and automatically calls init_ui()
- Parameters
-