Sayonara Player
Friends | Signals | Public Member Functions | Protected Member Functions | Protected Slots | Protected Attributes | Private Member Functions | Private 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.

Friends

class PreferenceDialogInterface
 
class PreferenceInterface< SayonaraDialog >
 

Signals

void sig_closed ()
 emitted when closed
 

Public Member Functions

 GUI_PreferenceDialog (QWidget *parent=0)
 
QString get_action_name () const override
 has to be implemented and should return the translated action text More...
 
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 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...
 
bool is_dark () const
 Returns, if the current skin is dark. More...
 

Protected Member Functions

void hide_all ()
 
void setup_parent (W *widget)
 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...
 
void translate_action ()
 Sets the new translated action name.
 
void showEvent (QShowEvent *e) override
 shows the widget and automatically calls init_ui() More...
 
void closeEvent (QCloseEvent *e) override
 closes the widget More...
 
QString elide_text (const QString &text, QWidget *widget, int max_lines)
 

Protected Slots

void language_changed () override
 
void commit_and_close ()
 
void commit () override
 
void revert () override
 
void row_changed (int row)
 
virtual void skin_changed ()
 

Protected Attributes

Settings_settings =nullptr
 

Private Member Functions

void setupUi (QWidget *GUI_PreferenceDialog)
 
void retranslateUi (QWidget *GUI_PreferenceDialog)
 

Private Attributes

QGridLayout * gridLayout
 
QLabel * lab_title
 
QFrame * line
 
QSplitter * splitter
 
QListWidget * list_preferences
 
QWidget * widget
 
QVBoxLayout * verticalLayout_3
 
QLabel * lab_pref_title
 
QFrame * line_3
 
QWidget * widget_preferences
 
QVBoxLayout * verticalLayout_2
 
QFrame * line_2
 
QHBoxLayout * horizontalLayout
 
QSpacerItem * horizontalSpacer
 
QPushButton * btn_cancel
 
QPushButton * btn_apply
 
QPushButton * btn_ok
 

Member Function Documentation

◆ closeEvent()

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

closes the widget

Parameters
e

Reimplemented from SayonaraDialog.

◆ get_action()

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

get action with translated text

Returns

◆ get_action_name()

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

◆ is_dark()

bool SayonaraWidgetTemplate< QDialog >::is_dark ( ) const
inlineinherited

Returns, if the current skin is dark.

Returns
true, if dark. false else

◆ is_ui_initialized()

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

◆ setup_parent()

void PreferenceInterface< SayonaraDialog >::setup_parent ( W *  widget)
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"

◆ showEvent()

void PreferenceInterface< SayonaraDialog >::showEvent ( QShowEvent *  e)
inlineoverrideprotectedinherited

shows the widget and automatically calls init_ui()

Parameters
e
Inheritance diagram for GUI_PreferenceDialog:
PreferenceDialogInterface Ui::GUI_PreferenceDialog PreferenceInterface< SayonaraDialog > SayonaraDialog SayonaraWidgetTemplate< QDialog > SayonaraClass