X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fdialogs%2Fextended.cpp;h=f4fe68b467457bba95625765ef4e6a30b908d142;hb=4732f9dbb7b107bd87a15fe1250afe9c033b3a12;hp=c02dcc1181aa0e12c35f4b82085f8113e8c6663b;hpb=2aba5eebae25fda145279416af95ba92160e1718;p=vlc diff --git a/modules/gui/qt4/dialogs/extended.cpp b/modules/gui/qt4/dialogs/extended.cpp index c02dcc1181..f4fe68b467 100644 --- a/modules/gui/qt4/dialogs/extended.cpp +++ b/modules/gui/qt4/dialogs/extended.cpp @@ -1,7 +1,7 @@ /***************************************************************************** * extended.cpp : Extended controls - Undocked **************************************************************************** - * Copyright (C) 2006 the VideoLAN team + * Copyright (C) 2006-2008 the VideoLAN team * $Id$ * * Authors: Clément Stenac @@ -26,11 +26,10 @@ #endif #include "dialogs/extended.hpp" -#include "dialogs_provider.hpp" -#include "components/extended_panels.hpp" +#include "main_interface.hpp" /* Needed for external MI size */ +#include "input_manager.hpp" -#include "main_interface.hpp" #include #include @@ -41,19 +40,20 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) setWindowFlags( Qt::Tool ); setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) ); setWindowTitle( qtr( "Adjustments and Effects" ) ); + setWindowRole( "vlc-extended" ); QGridLayout *layout = new QGridLayout( this ); layout->setLayoutMargins( 0, 2, 0, 1, 1 ); layout->setSpacing( 3 ); - QTabWidget *mainTabW = new QTabWidget( this ); + mainTabW = new QTabWidget( this ); /* AUDIO effects */ QWidget *audioWidget = new QWidget; QHBoxLayout *audioLayout = new QHBoxLayout( audioWidget ); QTabWidget *audioTab = new QTabWidget( audioWidget ); - Equalizer *equal = new Equalizer( p_intf, audioTab ); + equal = new Equalizer( p_intf, audioTab ); audioTab->addTab( equal, qtr( "Graphic Equalizer" ) ); Spatializer *spatial = new Spatializer( p_intf, audioTab ); @@ -67,16 +67,16 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) QHBoxLayout *videoLayout = new QHBoxLayout( videoWidget ); QTabWidget *videoTab = new QTabWidget( videoWidget ); - ExtVideo *videoEffect = new ExtVideo( p_intf, videoTab ); + videoEffect = new ExtVideo( p_intf, videoTab ); videoLayout->addWidget( videoTab ); videoTab->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ); mainTabW->addTab( videoWidget, qtr( "Video Effects" ) ); - SyncControls *syncW = new SyncControls( p_intf, videoTab ); + syncW = new SyncControls( p_intf, videoTab ); mainTabW->addTab( syncW, qtr( "Synchronization" ) ); - if( module_Exists( p_intf, "v4l2" ) ) + if( module_exists( "v4l2" ) ) { ExtV4l2 *v4l2 = new ExtV4l2( p_intf, mainTabW ); mainTabW->addTab( v4l2, qtr( "v4l2 controls" ) ); @@ -88,14 +88,19 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) layout->addWidget( closeButton, 1, 4, 1, 1 ); CONNECT( closeButton, clicked(), this, close() ); - QPoint startPoint( 450, 0 ); - MainInterface *p_mi = p_intf->p_sys->p_mi; - if( p_mi ) + /* Restore geometry or move this dialog on the left pane of the MI */ + if( !restoreGeometry(getSettings()->value("EPanel/geometry").toByteArray())) { - startPoint.setX( p_mi->x() ); - startPoint.setY( p_mi->y() + p_mi->frameGeometry().height() ); + resize( QSize( 400, 280 ) ); + + MainInterface *p_mi = p_intf->p_sys->p_mi; + if( p_mi ) + move( ( p_mi->x() - frameGeometry().width() - 10 ), p_mi->y() ); + else + move ( 450 , 0 ); } - readSettings( "EPanel", QSize( 400, 280 ), startPoint ); + + CONNECT( THEMIM->getIM(), statusChanged( int ), this, changedItem( int ) ); } ExtendedDialog::~ExtendedDialog() @@ -103,3 +108,21 @@ ExtendedDialog::~ExtendedDialog() writeSettings( "EPanel" ); } +void ExtendedDialog::showTab( int i ) +{ + mainTabW->setCurrentIndex( i ); + show(); +} + +int ExtendedDialog::currentTab() +{ + return mainTabW->currentIndex(); +} + +void ExtendedDialog::changedItem( int i_status ) +{ + if( i_status != END_S ) return; + syncW->clean(); + videoEffect->clean(); + equal->clean(); +}