Commit b1d9857c authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Complete preferences. Make ModuleList Clearer than it is now... Align...

Qt4 - Complete preferences. Make ModuleList Clearer than it is now... Align SpinBox correctly. Make directory and file use 2 column instead of three.

parent 4c9fbd0a
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <QSlider> #include <QSlider>
#include <QFileDialog> #include <QFileDialog>
#include <QFontDialog> #include <QFontDialog>
#include <QGroupBox>
#include <vlc_keys.h> #include <vlc_keys.h>
...@@ -226,6 +227,10 @@ FileConfigControl::FileConfigControl( vlc_object_t *_p_this, ...@@ -226,6 +227,10 @@ FileConfigControl::FileConfigControl( vlc_object_t *_p_this,
label = new QLabel( qfu(p_item->psz_text) ); label = new QLabel( qfu(p_item->psz_text) );
text = new QLineEdit( qfu(p_item->value.psz) ); text = new QLineEdit( qfu(p_item->value.psz) );
browse = new QPushButton( qtr( "Browse..." ) ); browse = new QPushButton( qtr( "Browse..." ) );
QHBoxLayout *textAndButton = new QHBoxLayout();
textAndButton->setMargin( 0 );
textAndButton->addWidget( text, 2 );
textAndButton->addWidget( browse, 0 );
BUTTONACT( browse, updateField() ); BUTTONACT( browse, updateField() );
...@@ -234,14 +239,14 @@ FileConfigControl::FileConfigControl( vlc_object_t *_p_this, ...@@ -234,14 +239,14 @@ FileConfigControl::FileConfigControl( vlc_object_t *_p_this,
if( !l ) if( !l )
{ {
QHBoxLayout *layout = new QHBoxLayout(); QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget( label, 0 ); layout->addWidget( text, 1 ); layout->addWidget( label, 0 );
layout->addWidget( browse, 2 ); layout->addLayout( textAndButton, 1 );
widget->setLayout( layout ); widget->setLayout( layout );
} }
else else
{ {
l->addWidget( label, line, 0 ); l->addWidget( text, line, 1 ); l->addWidget( label, line, 0 );
l->addWidget( browse, line, 2 ); l->addLayout( textAndButton, line, 1 );
} }
} }
...@@ -464,26 +469,30 @@ ModuleListConfigControl::ModuleListConfigControl( vlc_object_t *_p_this, ...@@ -464,26 +469,30 @@ ModuleListConfigControl::ModuleListConfigControl( vlc_object_t *_p_this,
QGridLayout *l, int &line) : QGridLayout *l, int &line) :
VStringConfigControl( _p_this, _p_item, _parent ) VStringConfigControl( _p_this, _p_item, _parent )
{ {
label = new QLabel( qfu(p_item->psz_text) ); groupBox = new QGroupBox ( qfu(p_item->psz_text) );
text = new QLineEdit(); text = new QLineEdit();
QGridLayout *layoutGroupBox = new QGridLayout( groupBox );
finish( bycat ); finish( bycat );
bool pom = false; int boxline = 0;
for( QVector<QCheckBox*>::iterator it = modules.begin();
it != modules.end(); it++ )
{
layoutGroupBox->addWidget( *it, boxline++, 0 );
}
layoutGroupBox->addWidget( text, boxline, 0 );
if( !l ) if( !l )
{ {
l = new QGridLayout(); QVBoxLayout *layout = new QVBoxLayout();
line = 0; layout->addWidget( groupBox, line, 0 );
pom = true; widget->setLayout( layout );
} }
for( QVector<QCheckBox*>::iterator it = modules.begin(); else
it != modules.end(); it++ )
{ {
l->addWidget( *it, line++, 1 ); l->addWidget( groupBox, line, 0, 1, -1 );
} }
l->addWidget( label, line, 0 );
l->addWidget( text, line, 1 );
if( pom )
widget->setLayout( l );
} }
#if 0 #if 0
ModuleConfigControl::ModuleConfigControl( vlc_object_t *_p_this, ModuleConfigControl::ModuleConfigControl( vlc_object_t *_p_this,
...@@ -503,7 +512,7 @@ ModuleListConfigControl::~ModuleListConfigControl() ...@@ -503,7 +512,7 @@ ModuleListConfigControl::~ModuleListConfigControl()
{ {
delete *it; delete *it;
} }
delete label; delete groupBox;
delete text; delete text;
} }
...@@ -546,8 +555,8 @@ void ModuleListConfigControl::finish( bool bycat ) ...@@ -546,8 +555,8 @@ void ModuleListConfigControl::finish( bool bycat )
} }
vlc_list_release( p_list ); vlc_list_release( p_list );
text->setToolTip( qfu(p_item->psz_longtext) ); text->setToolTip( qfu(p_item->psz_longtext) );
if( label ) if( groupBox )
label->setToolTip( qfu(p_item->psz_longtext) ); groupBox->setToolTip( qfu(p_item->psz_longtext) );
} }
QString ModuleListConfigControl::getValue() QString ModuleListConfigControl::getValue()
...@@ -562,8 +571,7 @@ void ModuleListConfigControl::hide() ...@@ -562,8 +571,7 @@ void ModuleListConfigControl::hide()
{ {
(*it)->hide(); (*it)->hide();
} }
text->hide(); groupBox->hide();
label->hide();
} }
void ModuleListConfigControl::show() void ModuleListConfigControl::show()
...@@ -573,8 +581,7 @@ void ModuleListConfigControl::show() ...@@ -573,8 +581,7 @@ void ModuleListConfigControl::show()
{ {
(*it)->show(); (*it)->show();
} }
text->show(); groupBox->show();
label->show();
} }
...@@ -600,6 +607,7 @@ IntegerConfigControl::IntegerConfigControl( vlc_object_t *_p_this, ...@@ -600,6 +607,7 @@ IntegerConfigControl::IntegerConfigControl( vlc_object_t *_p_this,
{ {
label = new QLabel( qfu(p_item->psz_text) ); label = new QLabel( qfu(p_item->psz_text) );
spin = new QSpinBox; spin->setMinimumWidth( 80 ); spin = new QSpinBox; spin->setMinimumWidth( 80 );
spin->setAlignment( Qt::AlignRight );
spin->setMaximumWidth( 90 ); spin->setMaximumWidth( 90 );
finish(); finish();
...@@ -795,6 +803,7 @@ FloatConfigControl::FloatConfigControl( vlc_object_t *_p_this, ...@@ -795,6 +803,7 @@ FloatConfigControl::FloatConfigControl( vlc_object_t *_p_this,
label = new QLabel( qfu(p_item->psz_text) ); label = new QLabel( qfu(p_item->psz_text) );
spin = new QDoubleSpinBox; spin->setMinimumWidth( 80 ); spin = new QDoubleSpinBox; spin->setMinimumWidth( 80 );
spin->setMaximumWidth( 90 ); spin->setMaximumWidth( 90 );
spin->setAlignment( Qt::AlignRight );
finish(); finish();
if( !l ) if( !l )
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <QLabel> #include <QLabel>
#include <QFile> #include <QFile>
#include <QPushButton> #include <QPushButton>
#include <QGroupBox>
#include "qt4.hpp" #include "qt4.hpp"
#include <assert.h> #include <assert.h>
...@@ -342,7 +343,7 @@ public slots: ...@@ -342,7 +343,7 @@ public slots:
private: private:
void finish( bool ); void finish( bool );
QVector<QCheckBox*> modules; QVector<QCheckBox*> modules;
QLabel *label; QGroupBox *groupBox;
QLineEdit *text; QLineEdit *text;
}; };
......
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