Sayonara Player
Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GUI_LanguagePreferences Class Reference
Inheritance diagram for GUI_LanguagePreferences:
Preferences::Base Gui::Widget Gui::WidgetTemplate< QWidget > Gui::WidgetTemplateParent

Signals

void sig_shown ()
 
void sig_closed ()
 

Public Member Functions

 GUI_LanguagePreferences (const QString &identifier)
 
bool 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 action_name () const override
 has to be implemented and should return the translated action text More...
 
QString identifier () const
 return the unique identifier More...
 
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 bool has_error () const
 indicates if there was an error on the settings page like an invalid expression or combination of settings More...
 
virtual QString error_string () const
 A closer description of the error. More...
 
Dialog * box_into_dialog ()
 

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 skin_changed () override
 
void showEvent (QShowEvent *) override
 
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.
 
virtual void closeEvent (QCloseEvent *e)
 

Protected Attributes

Dialog * _boxed_dialog =nullptr
 

Member Function Documentation

◆ action()

virtual QAction* Preferences::Base::action ( )
finalvirtualinherited

get action with translated text

Returns

◆ action_name()

QString GUI_LanguagePreferences::action_name ( ) const
overridevirtual

has to be implemented and should return the translated action text

Returns
translated action name

Implements Preferences::Base.

◆ error_string()

virtual QString Preferences::Base::error_string ( ) const
virtualinherited

A closer description of the error.

Returns

Reimplemented in GUI_StreamRecorderPreferences, GUI_ShortcutPreferences, GUI_LibraryPreferences, and GUI_PlaylistPreferences.

◆ has_error()

virtual bool Preferences::Base::has_error ( ) const
virtualinherited

indicates if there was an error on the settings page like an invalid expression or combination of settings

Returns

◆ identifier()

QString Preferences::Base::identifier ( ) const
inherited

return the unique identifier

Returns

◆ is_ui_initialized()

virtual bool Preferences::Base::is_ui_initialized ( ) const
finalvirtualinherited

checks if ui has already been initialized.

Returns
false, if the widget has never been activated before, true else

◆ language_changed()

virtual void Preferences::Base::language_changed ( )
finaloverrideprotectedvirtualinherited

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::WidgetTemplateParent.

◆ setup_parent()

template<typename W , typename UiClass >
void Preferences::Base::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"