Sayonara Player
Signals | Public Member Functions | Protected Member Functions | Protected Slots | Protected Attributes | List of all members
GUI_PreferenceDialog Class Reference

#include <GUI_PreferenceDialog.h>

Detailed Description

The Preference Dialog. Register new Preference dialogs with the register_preference_dialog() method.

Signals

void sig_closed ()
 emitted when closed
 

Public Member Functions

 GUI_PreferenceDialog (QWidget *parent=0)
 
void commit () override
 This method is called, when OK or apply is pressed. So all settings should be written there.
 
void revert () override
 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.
 
QString get_action_name () const override
 has to be implemented and should return the translated action text More...
 
void register_preference_dialog (PreferenceWidgetInterface *dialog)
 
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...
 

Protected Member Functions

void init_ui () override
 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
 
void retranslate_ui () override
 call the Qt retranslateUi method here
 
void showEvent (QShowEvent *e) override
 
void hide_all ()
 
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 closeEvent (QCloseEvent *e) override
 closes the widget More...
 

Protected Slots

void commit_and_close ()
 
void row_changed (int row)
 
virtual void skin_changed ()
 

Protected Attributes

Settings_settings =nullptr
 

Member Function Documentation

void PreferenceInterface< SayonaraDialog >::closeEvent ( QCloseEvent *  e)
inlineoverrideprotectedvirtualinherited

closes the widget

Parameters
e

Reimplemented from SayonaraDialog.

virtual QAction* PreferenceInterface< SayonaraDialog >::get_action ( )
inlinefinalvirtualinherited

get action with translated text

Returns
QString GUI_PreferenceDialog::get_action_name ( ) const
overridevirtual

has to be implemented and should return the translated action text

Returns
translated action name

Implements PreferenceInterface< SayonaraDialog >.

virtual bool PreferenceInterface< SayonaraDialog >::is_ui_initialized ( ) const
inlinefinalvirtualinherited

checks if ui has already been initialized.

Returns
false, if the widget has never been activated before, true else
virtual void PreferenceInterface< SayonaraDialog >::language_changed ( )
inlinefinaloverrideprotectedvirtualinherited

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 SayonaraDialog.

void PreferenceInterface< SayonaraDialog >::setup_parent ( W *  widget,
UiClass **  ui 
)
inlineprotectedinherited

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
widgetshould always be "this"
Inheritance diagram for GUI_PreferenceDialog:
PreferenceDialogInterface PreferenceInterface< SayonaraDialog > SayonaraDialog SayonaraWidgetTemplate< QDialog > SayonaraClass