[Marble-commits] branches/KDE/4.5/kdeedu/marble/src

Torsten Rahn tackat at kde.org
Wed Aug 25 07:10:33 CEST 2010


SVN commit 1167627 by rahn:


- Show map title in title bar.



 M  +21 -1     QtMainWindow.cpp  
 M  +2 -0      QtMainWindow.h  


--- branches/KDE/4.5/kdeedu/marble/src/QtMainWindow.cpp #1167626:1167627
@@ -39,6 +39,10 @@
 
 #include <QtNetwork/QNetworkProxy>
 
+// GeoData
+#include <GeoSceneDocument.h>
+#include <GeoSceneHead.h>
+
 #include "MarbleDirs.h"
 #include "MarbleAboutDialog.h"
 #include "QtMarbleConfigDialog.h"
@@ -75,7 +79,7 @@
 
     m_controlView = new ControlView( this );
 
-    setWindowTitle( tr("Marble - Desktop Globe") );
+    setMapTitle();
     setWindowIcon( QIcon(":/icons/marble.png") );
     setCentralWidget( m_controlView );
     
@@ -98,6 +102,10 @@
     m_distance = marbleWidget()->distanceString();
 
     QTimer::singleShot( 0, this, SLOT( initObject() ) );
+
+    
+    connect( marbleWidget(), SIGNAL( themeChanged( QString ) ), 
+         this, SLOT( setMapTitle() ) );
 }
 
 void MainWindow::initObject()
@@ -930,4 +938,16 @@
     m_controlView->marbleWidget()->map()->model()->downloadRegion( sourceDir, pyramid );
 }
 
+void MainWindow::setMapTitle()
+{
+    QString documentTitle;
+    
+    GeoSceneDocument *mapTheme = marbleWidget()->mapTheme();
+    if ( mapTheme ) {
+        documentTitle = tr( mapTheme->head()->name().toLatin1() );
+    }
+    
+    setWindowTitle( documentTitle + "  -  " + tr("Marble - Desktop Globe") );
+}
+
 #include "QtMainWindow.moc"
--- branches/KDE/4.5/kdeedu/marble/src/QtMainWindow.h #1167626:1167627
@@ -105,6 +105,8 @@
     void  disconnectDownloadRegionDialog();
     void  downloadRegion();
 
+    void  setMapTitle();
+
  private:
     ControlView *m_controlView;
     SunControlWidget* m_sunControlDialog;


More information about the Marble-commits mailing list