X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fdialogs%2Fmediainfo.cpp;h=cf7ebbba3772229931ba9556390ff7b9ae4ea0db;hb=62fae3a7cab589b5c87ea6de3e65b5f698a87c9b;hp=40dcc28111d57610cf207427a7fdd3dc10e24d6e;hpb=ba836c7e4b857a0a7e0f1c7ccaaeb0368a496f85;p=vlc diff --git a/modules/gui/qt4/dialogs/mediainfo.cpp b/modules/gui/qt4/dialogs/mediainfo.cpp index 40dcc28111..cf7ebbba37 100644 --- a/modules/gui/qt4/dialogs/mediainfo.cpp +++ b/modules/gui/qt4/dialogs/mediainfo.cpp @@ -21,6 +21,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. ******************************************************************************/ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include "dialogs/mediainfo.hpp" #include "input_manager.hpp" @@ -33,6 +36,11 @@ MediaInfoDialog *MediaInfoDialog::instance = NULL; +/* This Dialog has two main modes: + - General Mode that shows the current Played item, and the stats + - Single mode that shows the info on ONE SINGLE Item on the playlist + Please be Careful of not breaking one the modes behaviour... */ + MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, input_item_t *_p_item, bool _mainInput, @@ -44,7 +52,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, b_cleaned = true; i_runs = 0; - setWindowTitle( qtr( "Media information" ) ); + setWindowTitle( qtr( "Media Information" ) ); resize( 600 , 480 ); /* TabWidgets and Tabs creation */ @@ -70,7 +78,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, closeButton->setDefault( true ); uriLine = new QLineEdit; - QLabel *uriLabel = new QLabel( qtr( "Location :" ) ); + QLabel *uriLabel = new QLabel( qtr( "Location:" ) ); layout->addWidget( IT, 0, 0, 1, 8 ); layout->addWidget( uriLabel, 1, 0, 1, 1 ); @@ -89,11 +97,21 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, CONNECT( IT, currentChanged( int ), this, updateButtons( int ) ); - CONNECT( THEMIM, inputChanged( input_thread_t * ), this, update( input_thread_t * ) ); + /* If using the General Mode */ + if( !p_item ) + { + msg_Dbg( p_intf, "Using a general windows" ); + CONNECT( THEMIM, inputChanged( input_thread_t * ), + this, update( input_thread_t * ) ); + + if( THEMIM->getInput() ) + p_item = input_GetItem( THEMIM->getInput() ); + } /* Call update by hand, so info is shown from current item too */ - if( THEMIM->getInput() ) - update( input_GetItem(THEMIM->getInput() ), true, true ); + if( p_item ) + update( p_item, true, true ); + if( stats ) ON_TIMEOUT( updateOnTimeOut() ); } @@ -141,14 +159,14 @@ void MediaInfoDialog::update( input_thread_t *p_input ) vlc_object_release( p_input ); } -void MediaInfoDialog::updateOnTimeOut() +void MediaInfoDialog::updateOnTimeOut() { - /* Timer runs at 150 ms, dont' update more than 2 times per second */ - i_runs++; - if( i_runs % 4 != 0 ) return; + /* Timer runs at 150 ms, dont' update more than 2 times per second */ + i_runs++; + if( i_runs % 4 != 0 ) return; - /* Get Input and clear if non-existant */ - input_thread_t *p_input = THEMIM->getInput(); + /* Get Input and clear if non-existant */ + input_thread_t *p_input = THEMIM->getInput(); if( p_input && !p_input->b_dead ) { @@ -184,7 +202,7 @@ void MediaInfoDialog::clear() void MediaInfoDialog::close() { - this->toggleVisible(); + toggleVisible(); /* if dialog is closed, revert editing if not saved */ if( MP->isInEditMode() )