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

Dennis Nienhüser earthwings at gentoo.org
Sun Sep 12 22:39:59 CEST 2010


SVN commit 1174566 by nienhueser:

Small screen devices: Instead of having an action to toggle the side bar, use three actions for toggling the map view, legend and routing tab. The others are always hidden, saving some much needed pixels in the sidebar. The current location tab is not shown anymore as everything can be controlled from the routing plugin (float item).

 M  +58 -1     QtMainWindow.cpp  
 M  +10 -0     QtMainWindow.h  


--- trunk/KDE/kdeedu/marble/src/QtMainWindow.cpp #1174565:1174566
@@ -257,10 +257,31 @@
     // Do not create too many menu entries on a MID
     if( MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen ) {
         menuBar()->addAction( m_workOfflineAct );
-        menuBar()->addAction( m_sideBarAct );
+        //menuBar()->addAction( m_sideBarAct );
         /** @todo: Full screen cannot be left on Maemo currently (shortcuts not working) */
         //menuBar()->addAction( m_fullScreenAct );
         menuBar()->addAction( m_downloadRegionAction );
+
+        m_toggleMapViewTabAction = menuBar()->addAction( tr( "Map View" ) );
+        m_toggleMapViewTabAction->setCheckable( true );
+        connect( m_toggleMapViewTabAction, SIGNAL( triggered( bool ) ),
+                 this, SLOT( showMapViewTab( bool ) ) );
+        m_toggleLegendTabAction = menuBar()->addAction( tr( "Legend" ) );
+        m_toggleLegendTabAction->setCheckable( true );
+        connect( m_toggleLegendTabAction, SIGNAL( triggered( bool ) ),
+                 this, SLOT( showLegendTab( bool ) ) );
+        m_toggleRoutingTabAction = menuBar()->addAction( tr( "Routing" ) );
+        m_toggleRoutingTabAction->setCheckable( true );
+        connect( m_toggleRoutingTabAction, SIGNAL( triggered( bool ) ),
+                 this, SLOT( showRoutingTab( bool) ) );
+
+        m_controlView->marbleControl()->setNavigationTabShown( false );
+        m_controlView->marbleControl()->setLegendTabShown( false );
+        m_controlView->marbleControl()->setMapViewTabShown( false );
+        m_controlView->marbleControl()->setCurrentLocationTabShown( false );
+        m_controlView->marbleControl()->setRoutingTabShown( true );
+        m_toggleRoutingTabAction->setChecked( true );
+
         menuBar()->addAction( m_aboutMarbleAct );
         return;
     }
@@ -1060,4 +1081,40 @@
 #endif
 }
 
+void MainWindow::showMapViewTab( bool enabled )
+{
+    m_toggleLegendTabAction->setChecked( false );
+    m_toggleRoutingTabAction->setChecked( false );
+    m_controlView->marbleControl()->setNavigationTabShown( false );
+    m_controlView->marbleControl()->setLegendTabShown( false );
+    m_controlView->marbleControl()->setMapViewTabShown( true );
+    m_controlView->marbleControl()->setCurrentLocationTabShown( false );
+    m_controlView->marbleControl()->setRoutingTabShown( false );
+    m_controlView->setSideBarShown( enabled );
+}
+
+void MainWindow::showLegendTab( bool enabled )
+{
+    m_toggleMapViewTabAction->setChecked( false );
+    m_toggleRoutingTabAction->setChecked( false );
+    m_controlView->marbleControl()->setNavigationTabShown( false );
+    m_controlView->marbleControl()->setLegendTabShown( true );
+    m_controlView->marbleControl()->setMapViewTabShown( false );
+    m_controlView->marbleControl()->setCurrentLocationTabShown( false );
+    m_controlView->marbleControl()->setRoutingTabShown( false );
+    m_controlView->setSideBarShown( enabled );
+}
+
+void MainWindow::showRoutingTab( bool enabled )
+{
+    m_toggleMapViewTabAction->setChecked( false );
+    m_toggleLegendTabAction->setChecked( false );
+    m_controlView->marbleControl()->setNavigationTabShown( false );
+    m_controlView->marbleControl()->setLegendTabShown( false );
+    m_controlView->marbleControl()->setMapViewTabShown( false );
+    m_controlView->marbleControl()->setCurrentLocationTabShown( false );
+    m_controlView->marbleControl()->setRoutingTabShown( true );
+    m_controlView->setSideBarShown( enabled );
+}
+
 #include "QtMainWindow.moc"
--- trunk/KDE/kdeedu/marble/src/QtMainWindow.h #1174565:1174566
@@ -114,6 +114,11 @@
     void  disconnectDownloadRegionDialog();
     void  downloadRegion();
 
+    // Small screen devices specific slots
+    void showMapViewTab( bool enabled );
+    void showLegendTab( bool enabled );
+    void showRoutingTab( bool enabled );
+
  private:
     ControlView *m_controlView;
     SunControlWidget* m_sunControlDialog;
@@ -179,6 +184,11 @@
     QAction *m_addBookmarkAct;
     QAction *m_removeAllBookmarksAct;
     QAction *m_addBookmarkFolderAct;
+
+    // Small screen devices
+    QAction *m_toggleMapViewTabAction;
+    QAction *m_toggleLegendTabAction;
+    QAction *m_toggleRoutingTabAction;
 };
 
 } // namespace Marble


More information about the Marble-commits mailing list