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

Andrew Manson g.real.ate at gmail.com
Mon Jul 20 19:49:24 CEST 2009


SVN commit 1000013 by mansona:

Setting up the Toolbar in the KDE version


 M  +28 -0     marble_part.cpp  
 M  +1 -0      marble_part.h  
 M  +5 -0      marble_part.rc  


--- trunk/KDE/kdeedu/marble/src/marble_part.cpp #1000012:1000013
@@ -687,6 +687,13 @@
 
     KStandardAction::preferences( this, SLOT( editSettings() ),
 				  actionCollection() );
+
+    //    FIXME: Discuss if this is the best place to put this
+    QList<RenderPlugin *>::const_iterator it = pluginList.constBegin();
+    for (; it != pluginList.constEnd(); ++it) {
+        connect( (*it), SIGNAL( actionGroupsChanged() ),
+                 this, SLOT( createPluginMenus() ) );
+    }
 }
 
 void MarblePart::createInfoBoxesMenu()
@@ -751,6 +758,27 @@
     updateStatusBar();
 }
 
+void MarblePart::createPluginMenus()
+{
+    unplugActionList("plugins_actionlist");
+    QList<QActionGroup*> *tmp_toolbarActionGroups;
+    QList<RenderPlugin *> renderPluginList = m_controlView->marbleWidget()->renderPlugins();
+    QList<RenderPlugin *>::const_iterator i;
+
+    //Load the toolbars
+    for( i = renderPluginList.constBegin(); i != renderPluginList.constEnd(); ++i ) {
+        tmp_toolbarActionGroups = (*i)->toolbarActionGroups();
+
+        if ( tmp_toolbarActionGroups ) {
+
+            foreach( QActionGroup* ag, *tmp_toolbarActionGroups ) {
+                plugActionList( "plugins_actionlist", ag->actions() );
+            }
+        }
+    }
+
+}
+
 void MarblePart::updateTileZoomLevel()
 {
     const int tileZoomLevel =
--- trunk/KDE/kdeedu/marble/src/marble_part.h #1000012:1000013
@@ -57,6 +57,7 @@
     void  showDistance( const QString& position);
     void  showZoomLevel( int zoomLevel );
     void  mapThemeChanged( const QString& newMapTheme );
+    void  createPluginMenus();
 
   private Q_SLOTS:
     void  initObject();
--- trunk/KDE/kdeedu/marble/src/marble_part.rc #1000012:1000013
@@ -53,4 +53,9 @@
   <Action name="edit_copy"/>
 </ToolBar>
 
+<ToolBar position="Top" hidden="false" name="pluginToolBar">
+    <text>Plugin ToolBar</text>
+     <ActionList name="plugins_actionlist" />
+</ToolBar>
+
 </kpartgui>


More information about the Marble-commits mailing list