]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/mediainfo.cpp
Qt4 - Cleanups on dialog and public=>private.
[vlc] / modules / gui / qt4 / dialogs / mediainfo.cpp
index 2e3258a92d7c54e64307f97e05b66316882d6588..b81ebaf87eac4674e8848aca0854f417f9b55354 100644 (file)
@@ -45,10 +45,10 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput,
 {
     i_runs = 0;
     p_input = NULL;
-    need_update = true;
+    b_need_update = true;
 
     setWindowTitle( qtr( "Media information" ) );
-    resize( 600 , 300 );
+    resize( 600 , 480 );
 
     /* TabWidgets and Tabs creation */
     IT = new QTabWidget;
@@ -90,8 +90,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput,
     CONNECT( MP, uriSet( QString ), uriLine, setText( QString ) );
     CONNECT( MP, editing(), this, editMeta() );
 
-    CONNECT( IT, currentChanged ( int ), this, updateButtons( int ) );
-
+    CONNECT( IT, currentChanged( int ), this, updateButtons( int ) );
 
     /* Create the main Update function with a time (150ms) */
     if( mainInput ) {
@@ -129,7 +128,7 @@ static int ItemChanged( vlc_object_t *p_this, const char *psz_var,
         vlc_value_t oldval, vlc_value_t newval, void *param )
 {
     MediaInfoDialog *p_d = (MediaInfoDialog *)param;
-    p_d->need_update = VLC_TRUE;
+    p_d->b_need_update = VLC_TRUE;
     return VLC_SUCCESS;
 }
 
@@ -142,8 +141,10 @@ void MediaInfoDialog::setInput( input_item_t *p_input )
      *
      * This really doesn't seem as clean solution as it could be
      */
-    in_edit = ( input_GetItem( MainInputManager::getInstance( p_intf )->getInput() ) != p_input );
-    MP->setEdit( in_edit );
+    input_thread_t *p_current =
+                     MainInputManager::getInstance( p_intf )->getInput();
+    MP->setEditMode( ( !p_current || p_current->b_dead ) ? 
+                            true: false );
 }
 
 void MediaInfoDialog::update()
@@ -163,14 +164,15 @@ void MediaInfoDialog::update()
 
     vlc_object_yield( p_input );
 
-    update( input_GetItem(p_input), need_update, need_update );
-    need_update = false;
+    update( input_GetItem(p_input), b_need_update, b_need_update );
+    b_need_update = false;
 
     vlc_object_release( p_input );
 }
 
-void MediaInfoDialog::update( input_item_t *p_item, bool update_info,
-                                                    bool update_meta )
+void MediaInfoDialog::update( input_item_t *p_item, 
+                                                 bool update_info,
+                                                 bool update_meta )
 {
     MP->setInput( p_item );
     if( update_info )
@@ -199,14 +201,12 @@ void MediaInfoDialog::close()
     if( mainInput == false ) {
         deleteLater();
     }
-    MP->setEdit( false );
+    MP->setEditMode( false );
 }
 
-void MediaInfoDialog::updateButtons( int i_tab )
+void MediaInfoDialog::( int i_tab )
 {
-    msg_Dbg( p_intf, "Coin Coin, Tab number: %i", i_tab );
-
-    if( in_edit and i_tab == 0 )
+    if( MP->isInEditMode() && i_tab == 0 )
         saveMetaButton->show();
     else
         saveMetaButton->hide();