[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [marble/kitchen] src: Add enable/disable atmosphere menu entry to the KDE version too
From: Rene Kuettner <rene () bitkanal ! net>
Date: 2012-12-04 13:42:32
Message-ID: 20121204134232.9D1B3A6091 () git ! kde ! org
[Download RAW message or body]
Git commit cfce78f5f728b0ceec81a37ae33f632f756fe8b0 by Rene Kuettner.
Committed on 04/12/2012 at 14:40.
Pushed by renek into branch 'kitchen'.
Add enable/disable atmosphere menu entry to the KDE version too
M +12 -0 src/marble_part.cpp
M +1 -0 src/marble_part.h
http://commits.kde.org/marble/cfce78f5f728b0ceec81a37ae33f632f756fe8b0
diff --git a/src/marble_part.cpp b/src/marble_part.cpp
index 3769afb..5361c21 100644
--- a/src/marble_part.cpp
+++ b/src/marble_part.cpp
@@ -93,6 +93,7 @@
#include "PluginManager.h"
#include "SearchInputWidget.h"
#include "MarbleWidgetInputHandler.h"
+#include "Planet.h"
// Marble non-library classes
#include "ControlView.h"
@@ -304,6 +305,15 @@ void MarblePart::setShowAtmosphere( bool isChecked )
m_showAtmosphereAction->setChecked( isChecked ); // Sync state with the GUI
}
+void MarblePart::updateAtmosphereMenu()
+{
+ if( m_controlView->marbleModel()->planet()->hasAtmosphere() ) {
+ m_showAtmosphereAction->setEnabled( true );
+ } else {
+ m_showAtmosphereAction->setEnabled( false );
+ }
+}
+
void MarblePart::showPositionLabel( bool isChecked )
{
m_positionLabel->setVisible( isChecked );
@@ -848,6 +858,8 @@ void MarblePart::setupActions()
m_showAtmosphereAction, SLOT( setVisible( bool ) ) );
}
}
+ connect( m_controlView->marbleWidget(), SIGNAL( themeChanged( QString ) ),
+ this, SLOT( updateAtmosphereMenu() ) );
// Action: Show Crosshairs option
QList<RenderPlugin *> pluginList = m_controlView->marbleWidget()->renderPlugins();
diff --git a/src/marble_part.h b/src/marble_part.h
index 098d637..0961c02 100644
--- a/src/marble_part.h
+++ b/src/marble_part.h
@@ -82,6 +82,7 @@ class MarblePart: public KParts::ReadOnlyPart
void copyCoordinates();
void setShowClouds( bool );
void setShowAtmosphere( bool );
+ void updateAtmosphereMenu();
void setShowCurrentLocation( bool );
void setShowBookmarks( bool isChecked );
void showFullScreen( bool );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic