![]() |
Sayonara Player
|
#include <PreferenceWidget.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.
Signals | |
void | sig_shown () |
void | sig_closed () |
Public Member Functions | |
Base (const QString &identifier) | |
Standard constructor. More... | |
QString | identifier () const |
virtual bool | is_ui_initialized () const final |
checks if ui has already been initialized. More... | |
virtual QAction * | action () final |
get action with translated text More... | |
virtual QString | action_name () const =0 |
has to be implemented and should return the translated action text More... | |
virtual bool | 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. | |
virtual void | init_ui ()=0 |
call setup_parent(this) here. initialize compoenents and connections here. After calling setup_parent(this), the preference Dialog is ready to use, language_changed() is called automatically | |
virtual void | retranslate_ui ()=0 |
call the Qt retranslateUi method here | |
virtual bool | has_error () const |
virtual QString | error_string () const |
Dialog * | box_into_dialog () |
virtual void | skin_changed () |
Protected Member Functions | |
template<typename W , typename UiClass > | |
void | setup_parent (W *widget, UiClass **ui) |
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() More... | |
virtual void | language_changed () override final |
automatically called when language has changed. When overriding this method. Overriding this method should look like this: void GUI_FontConfig::language_changed() { translate_action(); More... | |
void | translate_action () |
Sets the new translated action name. | |
void | showEvent (QShowEvent *e) override |
shows the widget and automatically calls init_ui() More... | |
virtual void | closeEvent (QCloseEvent *e) |
Protected Attributes | |
Dialog * | _boxed_dialog =nullptr |
Settings * | _settings =nullptr |
|
explicit |
Standard constructor.
parent |
|
finalvirtual |
get action with translated text
|
pure virtual |
has to be implemented and should return the translated action text
Implemented in GUI_StreamRecorder, GUI_LastFM, GUI_IconPreferences, GUI_Shortcuts, GUI_Proxy, GUI_FontConfig, GUI_RemoteControl, GUI_LanguageChooser, GUI_PlaylistPreferences, GUI_LibraryPreferences, GUI_Notifications, GUI_StreamPreferences, GUI_SearchPreferences, GUI_BroadcastSetup, GUI_Covers, GUI_EnginePreferences, and GUI_PlayerPreferences.
|
finalvirtual |
checks if ui has already been initialized.
|
finaloverrideprotectedvirtual |
automatically called when language has changed. When overriding this method. Overriding this method should look like this: void GUI_FontConfig::language_changed()
{
translate_action();
if(!is_ui_initialized()){
return;
}
retranslateUi(this);
PreferenceWidgetInterface::language_changed();
}
Reimplemented from Gui::WidgetTemplate< QWidget >.
|
inlineprotected |
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()
widget | should always be "this" |
|
overrideprotectedvirtual |