Commit 662b0388 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Moving function from one file to another...

parent 3e7d9284
......@@ -31,7 +31,8 @@
#include "components/open.hpp"
#include "dialogs/open.hpp"
#include "dialogs_provider.hpp"
#include "util/customwidgets.hpp"
#include "components/preferences_widgets.hpp"
#include <QFileDialog>
#include <QDialogButtonBox>
......
......@@ -434,6 +434,27 @@ QString StringListConfigControl::getValue()
return combo->itemData( combo->currentIndex() ).toString();
}
void setfillVLCConfigCombo( const char *configname, intf_thread_t *p_intf,
QComboBox *combo, QWidget *parent )
{
module_config_t *p_config =
config_FindConfig( VLC_OBJECT(p_intf), configname );
if( p_config )
{
for ( int i_index = 0; i_index < p_config->i_list; i_index++ )
{
combo->addItem( qfu( p_config->ppsz_list_text[i_index] ),
QVariant( p_config->pi_list[i_index] ) );
if( p_config->value.i == p_config->pi_list[i_index] )
{
combo->setCurrentIndex( i_index );
}
}
combo->setToolTip( qfu( p_config->psz_longtext ) );
}
}
/********* Module **********/
ModuleConfigControl::ModuleConfigControl( vlc_object_t *_p_this,
module_config_t *_p_item, QWidget *_parent, bool bycat,
......
......@@ -378,6 +378,11 @@ private slots:
void actionRequested( int );
};
void setfillVLCConfigCombo(const char *configname, intf_thread_t *p_intf,
QComboBox *combo, QWidget *parent = 0 );
#if 0
struct ModuleCheckBox {
QCheckBox *checkbox;
......
......@@ -196,26 +196,4 @@ QString VLCKeyToString( int val )
}
}
return r;
}
#include <QComboBox>
void setfillVLCConfigCombo( const char *configname, intf_thread_t *p_intf,
QComboBox *combo, QWidget *parent )
{
module_config_t *p_config =
config_FindConfig( VLC_OBJECT(p_intf), configname );
if( p_config )
{
for ( int i_index = 0; i_index < p_config->i_list; i_index++ )
{
combo->addItem( qfu( p_config->ppsz_list_text[i_index] ),
QVariant( p_config->pi_list[i_index] ) );
if( p_config->value.i == p_config->pi_list[i_index] )
{
combo->setCurrentIndex( i_index );
}
}
combo->setToolTip( qfu( p_config->psz_longtext ) );
}
}
}
\ No newline at end of file
......@@ -93,10 +93,4 @@ int qtEventToVLCKey( QKeyEvent *e );
int qtWheelEventToVLCKey( QWheelEvent *e );
QString VLCKeyToString( int val );
#include "qt4.hpp"
#include <vlc/vlc.h>
class QComboBox;
void setfillVLCConfigCombo(const char *configname, intf_thread_t *p_intf,
QComboBox *combo, QWidget *parent = 0 );
#endif
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