QWidget( _parent ), p_intf( _p_intf )
{
module_config_t *p_item;
+
+ /* Find our module */
module_t *p_module = NULL;
- vlc_list_t *p_list = NULL;
- global_layout = new QVBoxLayout();
if( data->i_type == TYPE_CATEGORY )
- {
- /* TODO */
- return;
- }
+ return;
else if( data->i_type == TYPE_MODULE )
- {
p_module = (module_t *) vlc_object_get( p_intf, data->i_object_id );
- }
else
{
/* List the plugins */
int i_index;
vlc_bool_t b_found = VLC_FALSE;
- p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
+ vlc_list_t *p_list = vlc_list_find( p_intf,
+ VLC_OBJECT_MODULE, FIND_ANYWHERE );
if( !p_list ) return;
for( i_index = 0; i_index < p_list->i_count; i_index++ )
p_item->i_value == data->i_object_id ) ||
( data->i_type == TYPE_CATSUBCAT &&
p_item->i_value == data->i_subcat_id ) )
- {
break;
- }
if( p_item->i_type == CONFIG_HINT_END ) break;
} while( p_item++ );
}
+ global_layout = new QVBoxLayout();
QString head;
if( data->i_type == TYPE_SUBCATEGORY || data->i_type == TYPE_CATSUBCAT )
{
box = new QGroupBox( qfu(p_item->psz_text) );
boxlayout = new QGridLayout();
}
+
ConfigControl *control;
if( ! box )
- {
control = ConfigControl::createControl( VLC_OBJECT( p_intf ),
p_item, NULL, layout, i_line );
- }
else
- {
control = ConfigControl::createControl( VLC_OBJECT( p_intf ),
p_item, NULL, boxlayout, i_boxline );
- }
if( !control )
{
continue;
scroller->setWidgetResizable( true );
global_layout->addWidget( scroller );
setLayout( global_layout );
-#if 0
- some_hidden_text = new QLabel( qfu( I_HIDDEN_ADV ) );
- some_hidden_text->setWordWrap( true );
- setAdvanced( currently_advanced, true );
-#endif
}
void PrefsPanel::apply()
for( i = controls.begin() ; i != controls.end() ; i++ )
{
ConfigControl *c = qobject_cast<ConfigControl *>(*i);
- fprintf( stderr, "Get a control %s\n", c->getName() );
switch( c->getType() )
{
case 1:
{
VIntConfigControl *vicc = qobject_cast<VIntConfigControl *>(*i);
- fprintf( stderr, "Put %s = %i\n", vicc->getName(),vicc->getValue() );
config_PutInt( p_intf, vicc->getName(), vicc->getValue() );
break;
}
case 2:
{
VFloatConfigControl *vfcc = qobject_cast<VFloatConfigControl *>(*i);
- fprintf( stderr, "Put %s = %f\n", vfcc->getName(),vfcc->getValue() );
config_PutFloat( p_intf, vfcc->getName(), vfcc->getValue() );
break;
}
{
VStringConfigControl *vscc =
qobject_cast<VStringConfigControl *>(*i);
- fprintf( stderr, "Put %s = %s\n", vscc->getName(),vscc->getValue().toAscii().data() );
- config_PutPsz( p_intf, vscc->getName(),
- vscc->getValue().toAscii().data() );
+ config_PutPsz( p_intf, vscc->getName(), qta( vscc->getValue() ) );
}
}
}
void PrefsPanel::clean()
{}
-#if 0
-void PrefsPanel::setAdvanced( bool adv, bool force )
-{
- bool some_hidden = false;
- if( !force && adv == advanced ) return;
-
- advanced = adv;
- QList<ConfigControl *>::Iterator i;
- for( i = controls.begin() ; i != controls.end() ; i++ )
- {
- if( (*i)->isAdvanced() )
- {
- if( !advanced )
- {
- some_hidden = true;
- (*i)->hide();
- }
- else
- (*i)->show();
- }
- }
- if( some_hidden_text )
- {
- global_layout->removeWidget( some_hidden_text );
- some_hidden_text->hide();
- }
- if( some_hidden )
- {
- global_layout->addWidget( some_hidden_text );
- some_hidden_text->show();
- }
-}
-#endif
all = new QRadioButton( "All", types ); tl->addWidget( all );
types->setLayout(tl);
small->setChecked( true );
-#if 0
- adv_chk = new QCheckBox("Advanced options");
-#endif
+
advanced_tree = NULL;
simple_tree = NULL;
simple_panel = NULL;
main_layout->addWidget( types, 0,0,1,1 );
main_layout->addWidget( tree_panel, 1,0,1,1 );
-#if 0
- main_layout->addWidget( adv_chk , 2,0,1,1 );
-#endif
main_layout->addWidget( main_panel, 0, 1, 2, 1 );
main_layout->setColumnMinimumWidth( 0, 200 );
main_layout->setColumnStretch( 1,3 );
setSmall();
-#if 0
- connect( adv_chk, SIGNAL( toggled(bool) ),
- this, SLOT( setAdvanced( bool ) ) );
-#endif
QPushButton *save, *cancel;
QHBoxLayout *buttonsLayout =
connect( small, SIGNAL( clicked() ), this, SLOT( setSmall()) );
connect( all, SIGNAL( clicked() ), this, SLOT( setAll()) );
}
-#if 0
-void PrefsDialog::setAdvanced( bool advanced )
-{
- if( advanced_panel )
- advanced_panel->setAdvanced( advanced );
-}
-#endif
+
void PrefsDialog::setAll()
{
if( simple_tree )
advanced_panel = new PrefsPanel( main_panel );
main_panel_l->addWidget( advanced_panel );
advanced_panel->show();
-#if 0
- adv_chk->show();
-#endif
}
void PrefsDialog::setSmall()
simple_panel = new SPrefsPanel( p_intf, main_panel, SPrefsDefaultCat );
main_panel_l->addWidget( simple_panel );
simple_panel->show();
-#if 0
- adv_chk->hide();
-#endif
}
PrefsDialog::~PrefsDialog()
advanced_panel->hide();
}
if( !data->panel )
- {
data->panel = new PrefsPanel( p_intf, main_panel , data, true );
-#if 0
- adv_chk->isChecked() );
-#endif
- }
+
advanced_panel = data->panel;
main_panel_l->addWidget( advanced_panel );
advanced_panel->show();
-#if 0
- setAdvanced( adv_chk->isChecked() );
-#endif
}
void PrefsDialog::save()
QString file;
foreach( file, files )
{
- const char * psz_utf8 = file.toUtf8().data();
+ const char * psz_utf8 = qtu( file );
playlist_PlaylistAdd( THEPL, psz_utf8, psz_utf8,
PLAYLIST_APPEND | PLAYLIST_PREPARSE, PLAYLIST_END );
}
QString file;
foreach( file, files )
{
- const char * psz_utf8 = file.toUtf8().data();
+ const char * psz_utf8 = qtu( file );
playlist_MLAdd( THEPL, psz_utf8, psz_utf8,
PLAYLIST_APPEND | PLAYLIST_PREPARSE, PLAYLIST_END );
}
QString file;
for( size_t i = 0 ; i< files.size(); i++ )
{
- const char * psz_utf8 = files[i].toUtf8().data();
+ const char * psz_utf8 = qtu( files[i] );
/* Play the first one, parse and enqueue the other ones */
playlist_PlaylistAdd( THEPL, psz_utf8, psz_utf8,
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) |
QString file;
for( size_t i = 0 ; i< files.size(); i++ )
{
- const char * psz_utf8 = files[i].toUtf8().data();
+ const char * psz_utf8 = qtu( files[i] );
/* Play the first one, parse and enqueue the other ones */
playlist_Import( THEPL, psz_utf8, THEPL->p_root_category, VLC_FALSE );
}
{
QString dir = QFileDialog::getExistingDirectory ( 0,
_("Open directory") );
- const char *psz_utf8 = dir.toUtf8().data();
+ const char *psz_utf8 = qtu( dir );
input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, psz_utf8,
0, NULL, -1 );
playlist_PlaylistAddInput( THEPL, p_input,
{
QString dir = QFileDialog::getExistingDirectory ( 0,
_("Open directory") );
- const char *psz_utf8 = dir.toUtf8().data();
- fprintf( stderr, "%s\n", psz_utf8 );
+ const char *psz_utf8 = qtu( dir );
input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, psz_utf8,
0, NULL, -1 );
playlist_MLAddInput( THEPL, p_input, PLAYLIST_APPEND, PLAYLIST_END );
* Module descriptor
*****************************************************************************/
vlc_module_begin();
- set_shortname( (char*)"QT" );
- set_description( (char*)_("QT interface") );
+ set_shortname( (char *)"Qt" );
+ set_description( (char*)_("Qt interface") );
set_category( CAT_INTERFACE) ;
set_subcategory( SUBCAT_INTERFACE_MAIN );
set_capability( "interface", 100 );
p_intf->p_sys->p_playlist = (playlist_t *)vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( !p_intf->p_sys->p_playlist )
+ {
+ free( p_intf->p_sys );
return VLC_EGENERIC;
+ }
p_intf->p_sys->p_sub = msg_Subscribe( p_intf, MSG_QUEUE_NORMAL );
{
if( p_intf->pf_show_dialog )
{
- if( vlc_thread_create( p_intf, "QT dialogs", Init, 0, VLC_TRUE ) )
- {
- msg_Err( p_intf, "failed to create QT dialogs thread" );
- }
+ if( vlc_thread_create( p_intf, "Qt dialogs", Init, 0, VLC_TRUE ) )
+ msg_Err( p_intf, "failed to create Qt dialogs thread" );
}
else
- {
Init( p_intf );
- }
}
static void Init( intf_thread_t *p_intf )
// Initialize timers
DialogsProvider::getInstance( p_intf );
- /* Normal interface */
+ // Normal interface
if( !p_intf->pf_show_dialog )
{
MainInterface *p_mi = new MainInterface( p_intf );
#define qfu( i ) QString::fromUtf8( i )
#define qtr( i ) QString::fromUtf8( _(i) )
+#define qtu( i ) i.toUtf8().data()
+#define qta( i ) i.toAscii().data()
static int DialogEvent_Type = QEvent::User + 1;