#include <vlc_keys.h>
+
+QString formatTooltip(const QString & tooltip)
+{
+ QString formatted =
+ "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">"
+ " p, li { white-space: pre-wrap; } </style></head><body style=\" font-family:'Sans Serif';"
+ " font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;\">"
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; "
+ "-qt-block-indent:0; text-indent:0px;\">" +
+ tooltip +
+ "</p></body></html>";
+ return formatted;
+}
+
ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
module_config_t *p_item,
QWidget *parent )
void StringConfigControl::finish()
{
text->setText( qfu(p_item->value.psz) );
- text->setToolTip( qfu(p_item->psz_longtext) );
+ text->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
if( label )
- label->setToolTip( qfu(p_item->psz_longtext) );
+ label->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
}
/*********** File **************/
void FileConfigControl::finish()
{
text->setText( qfu(p_item->value.psz) );
- text->setToolTip( qfu(p_item->psz_longtext) );
+ text->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
if( label )
- label->setToolTip( qfu(p_item->psz_longtext) );
+ label->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
}
/********* String / Directory **********/
p_item->ppsz_list[i_index] ) )
combo->setCurrentIndex( combo->count() - 1 );
}
- combo->setToolTip( qfu(p_item->psz_longtext) );
+ combo->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
if( label )
- label->setToolTip( qfu(p_item->psz_longtext) );
+ label->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
}
QString StringListConfigControl::getValue()
}
}
vlc_list_release( p_list );
- combo->setToolTip( qfu(p_item->psz_longtext) );
+ combo->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
if( label )
- label->setToolTip( qfu(p_item->psz_longtext) );
+ label->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
}
QString ModuleConfigControl::getValue()
{
QCheckBox *cb =
new QCheckBox( qfu( p_parser->psz_object_name ) );
- cb->setToolTip( qfu(p_parser->psz_longname) );
+ CONNECT( cb, stateChanged( int ), this, onUpdate( int ) );
+ cb->setToolTip(
+ formatTooltip( qfu(p_parser->psz_longname)) );
modules.push_back( cb );
}
}
{
QCheckBox *cb =
new QCheckBox( qfu( p_parser->psz_object_name ) );
- cb->setToolTip( qfu(p_parser->psz_longname) );
+ CONNECT( cb, stateChanged( int ), this, onUpdate( int ) );
+ cb->setToolTip( formatTooltip(qfu(p_parser->psz_longname)) );
modules.push_back( cb );
}
}
vlc_list_release( p_list );
- text->setToolTip( qfu(p_item->psz_longtext) );
+ text->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
if( groupBox )
- groupBox->setToolTip( qfu(p_item->psz_longtext) );
+ groupBox->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
}
QString ModuleListConfigControl::getValue()
}
-void ModuleListConfigControl::wakeUp_TheUserJustClickedOnSomething( int value )
+void ModuleListConfigControl::onUpdate( int value )
{
text->clear();
+ bool first = true;
+
for( QVector<QCheckBox*>::iterator it = modules.begin();
it != modules.end(); it++ )
{
+ if( (*it)->isChecked() )
+ {
+ if( first )
+ {
+ text->setText( text->text() + (*it)->text() );
+ first = false;
+ }
+ else
+ {
+ text->setText( text->text() + ":" + (*it)->text() );
+ }
+ }
}
}
spin->setMaximum( 2000000000 );
spin->setMinimum( -2000000000 );
spin->setValue( p_item->value.i );
- spin->setToolTip( qfu(p_item->psz_longtext) );
+ spin->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
if( label )
- label->setToolTip( qfu(p_item->psz_longtext) );
+ label->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
}
int IntegerConfigControl::getValue()
slider->setMaximum( p_item->max.i );
slider->setMinimum( p_item->min.i );
slider->setValue( p_item->value.i );
- slider->setToolTip( qfu(p_item->psz_longtext) );
+ slider->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
if( label )
- label->setToolTip( qfu(p_item->psz_longtext) );
+ label->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
}
int IntegerRangeSliderConfigControl::getValue()
if( p_item->value.i == p_item->pi_list[i_index] )
combo->setCurrentIndex( combo->count() - 1 );
}
- combo->setToolTip( qfu(p_item->psz_longtext) );
+ combo->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
if( label )
- label->setToolTip( qfu(p_item->psz_longtext) );
+ label->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
}
int IntegerListConfigControl::getValue()
{
checkbox->setCheckState( p_item->value.i == VLC_TRUE ? Qt::Checked
: Qt::Unchecked );
- checkbox->setToolTip( qfu(p_item->psz_longtext) );
+ checkbox->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
}
int BoolConfigControl::getValue()
spin->setMinimum( -2000000000. );
spin->setSingleStep( 0.1 );
spin->setValue( (double)p_item->value.f );
- spin->setToolTip( qfu(p_item->psz_longtext) );
+ spin->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
if( label )
- label->setToolTip( qfu(p_item->psz_longtext) );
+ label->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
}
float FloatConfigControl::getValue()
void KeySelectorControl::finish()
{
if( label )
- label->setToolTip( qfu(p_item->psz_longtext) );
+ label->setToolTip( formatTooltip(qfu(p_item->psz_longtext)) );
/* Fill the table */
table->setColumnCount( 2 );