]> git.sesse.net Git - vlc/commitdiff
Qt4 - Main Windows: Rename the interface to $MEDIANAME - VLC media player.
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 30 Apr 2007 19:12:15 +0000 (19:12 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 30 Apr 2007 19:12:15 +0000 (19:12 +0000)
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp

index 154e11cc08d094bb8b63df32e95c888d12a48853..a1977c255530b463a2fb0a84d749fee1b3bef69c 100644 (file)
@@ -105,7 +105,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     visualSelectorEnabled= settings->value( "visual-selector", false ).toBool();
 
     /* UI */
-    setWindowTitle( qtr( "VLC media player" ) );
+    setVLCWindowsTitle();
     handleMainUi( settings );
     QVLCMenu::createMenuBar( this, p_intf, playlistEmbeddedFlag,
                              advControlsEnabled, visualSelectorEnabled );
@@ -181,6 +181,18 @@ MainInterface::~MainInterface()
     p_intf->pf_control_window = NULL;
 }
 
+void MainInterface::setVLCWindowsTitle( QString aTitle )
+{
+    if( aTitle.isEmpty() )
+    {
+        this->setWindowTitle( qtr( "VLC media player" ) );
+    }
+    else
+    {
+        this->setWindowTitle( aTitle + " - " + qtr( "VLC media player" ) );
+    }
+}
+
 void MainInterface::handleMainUi( QSettings *settings )
 {
     QWidget *main = new QWidget( this );
@@ -658,6 +670,7 @@ void MainInterface::setDisplay( float pos, int time, int length )
 void MainInterface::setName( QString name )
 {
     nameLabel->setText( " " + name+" " );
+    setVLCWindowsTitle( name );
 }
 
 void MainInterface::setStatus( int status )
index c6d9f9d0cfad6c5f155f15fc3d0375a117b1d3d8..6d2bab5004928e0c7500f934215e758f412f3f7e 100644 (file)
@@ -56,6 +56,7 @@ public:
                         unsigned int *pi_height );
     void releaseVideo( void *);
     int controlVideo( void *p_window, int i_query, va_list args );
+    void setVLCWindowsTitle( QString title = "" );
 protected:
     void resizeEvent( QResizeEvent * );
     void dropEvent( QDropEvent *);