Commit 2391b36f authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Prefs, cleanig again.

parent 036838fa
...@@ -48,17 +48,17 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) ...@@ -48,17 +48,17 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
resize( 750, 550 ); resize( 750, 550 );
/* Create Panels */ /* Create Panels */
tree_panel = new QWidget( 0 ); tree_panel = new QWidget;
tree_panel_l = new QHBoxLayout; tree_panel_l = new QHBoxLayout;
tree_panel->setLayout( tree_panel_l ); tree_panel->setLayout( tree_panel_l );
main_panel = new QWidget( 0 ); main_panel = new QWidget;
main_panel_l = new QHBoxLayout; main_panel_l = new QHBoxLayout;
main_panel->setLayout( main_panel_l ); main_panel->setLayout( main_panel_l );
/* Choice for types */ /* Choice for types */
types = new QGroupBox( "Show settings" ); types = new QGroupBox( "Show settings" );
types->setAlignment( Qt::AlignHCenter ); types->setAlignment( Qt::AlignHCenter );
QHBoxLayout *types_l = new QHBoxLayout(0); QHBoxLayout *types_l = new QHBoxLayout;
types_l->setSpacing( 3 ); types_l->setMargin( 3 ); types_l->setSpacing( 3 ); types_l->setMargin( 3 );
small = new QRadioButton( qtr("Basic"), types ); small = new QRadioButton( qtr("Basic"), types );
types_l->addWidget( small ); types_l->addWidget( small );
...@@ -103,7 +103,7 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) ...@@ -103,7 +103,7 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
for( int i = 0; i < SPrefsMax ; i++ ) simple_panels[i] = NULL; for( int i = 0; i < SPrefsMax ; i++ ) simple_panels[i] = NULL;
if( config_GetInt( p_intf, "qt-advanced-pref") == 1 ) if( config_GetInt( p_intf, "qt-advanced-pref") == 1 )
SetAdvanced(); setAdvanced();
else else
setSmall(); setSmall();
...@@ -112,10 +112,10 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) ...@@ -112,10 +112,10 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
BUTTONACT( reset, reset() ); BUTTONACT( reset, reset() );
BUTTONACT( small, setSmall() ); BUTTONACT( small, setSmall() );
BUTTONACT( all, SetAdvanced() ); BUTTONACT( all, setAdvanced() );
} }
void PrefsDialog::SetAdvanced() void PrefsDialog::setAdvanced()
{ {
/* We already have a simple TREE, and we just want to hide it */ /* We already have a simple TREE, and we just want to hide it */
if( simple_tree ) if( simple_tree )
...@@ -229,7 +229,7 @@ void PrefsDialog::changeAdvPanel( QTreeWidgetItem *item ) ...@@ -229,7 +229,7 @@ void PrefsDialog::changeAdvPanel( QTreeWidgetItem *item )
/*Called from extended settings, is not used anymore, but could be useful one day*/ /*Called from extended settings, is not used anymore, but could be useful one day*/
void PrefsDialog::showModulePrefs( char *psz_module ) void PrefsDialog::showModulePrefs( char *psz_module )
{ {
SetAdvanced(); setAdvanced();
all->setChecked( true ); all->setChecked( true );
for( int i_cat_index = 0 ; i_cat_index < advanced_tree->topLevelItemCount(); for( int i_cat_index = 0 ; i_cat_index < advanced_tree->topLevelItemCount();
i_cat_index++ ) i_cat_index++ )
......
...@@ -58,8 +58,10 @@ public: ...@@ -58,8 +58,10 @@ public:
/*Called from extended settings, is not used anymore, but could be useful one day*/ /*Called from extended settings, is not used anymore, but could be useful one day*/
void showModulePrefs( char* ); void showModulePrefs( char* );
#endif #endif
private: private:
PrefsDialog( intf_thread_t * ); PrefsDialog( intf_thread_t * );
QGridLayout *main_layout;
QWidget *main_panel; QWidget *main_panel;
QHBoxLayout *main_panel_l; QHBoxLayout *main_panel_l;
...@@ -70,18 +72,17 @@ private: ...@@ -70,18 +72,17 @@ private:
QWidget *tree_panel; QWidget *tree_panel;
QHBoxLayout *tree_panel_l; QHBoxLayout *tree_panel_l;
SPrefsCatList *simple_tree; SPrefsCatList *simple_tree;
PrefsTree *advanced_tree; PrefsTree *advanced_tree;
QGroupBox *types; QGroupBox *types;
QRadioButton *small,*all; QRadioButton *small,*all;
QGridLayout *main_layout;
static PrefsDialog *instance; static PrefsDialog *instance;
private slots: private slots:
void SetAdvanced(); void setAdvanced();
void setSmall(); void setSmall();
void changeAdvPanel( QTreeWidgetItem * ); void changeAdvPanel( QTreeWidgetItem * );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment