From e1bc02f624e3b481059443e64f4b97020a848db5 Mon Sep 17 00:00:00 2001 From: Bryant Date: Wed, 5 Feb 2014 11:40:23 -0800 Subject: [PATCH] Added the QGC_GOOGLE_EARTH_ENABLED macro when that support exists. --- QGCExternalLibs.pri | 6 ++++-- src/ui/MainWindow.cc | 14 +++++++------- src/ui/MainWindow.h | 26 +++++++++++++------------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/QGCExternalLibs.pri b/QGCExternalLibs.pri index a8033a388..a690060e4 100644 --- a/QGCExternalLibs.pri +++ b/QGCExternalLibs.pri @@ -267,14 +267,16 @@ OSGDependency { # Only supported on Mac and Windows where Google Earth can be installed. # contains(DEFINES, DISABLE_GOOGLE_EARTH) { - message("Skipping support for Google Earth view (manual override)") + message("Skipping support for Google Earth view (manual override)") + DEFINES -= DISABLE_GOOGLE_EARTH } else:MacBuild { message("Including support for Google Earth view") + DEFINES += QGC_GOOGLE_EARTH_ENABLED HEADERS += src/ui/map3D/QGCGoogleEarthView.h SOURCES += src/ui/map3D/QGCGoogleEarthView.cc } else:WindowsBuild { message("Including support for Google Earth view") - + DEFINES += QGC_GOOGLE_EARTH_ENABLED HEADERS += src/ui/map3D/QGCGoogleEarthView.h SOURCES += src/ui/map3D/QGCGoogleEarthView.cc CONFIG += qaxcontainer diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 51a0ea6f2..cac2bbc90 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -676,13 +676,13 @@ void MainWindow::buildCommonWidgets() q3DWidget->setObjectName("VIEW_3DWIDGET"); addToCentralStackedWidget(q3DWidget, VIEW_3DWIDGET, tr("Local 3D")); - } -#endif - -#ifndef DISABLE_GOOGLE_EARTH - if (!earthWidget) - { - earthWidget = new QGCGoogleEarthView(this); + } +#endif + +#ifdef QGC_GOOGLE_EARTH_ENABLED + if (!earthWidget) + { + earthWidget = new QGCGoogleEarthView(this); addToCentralStackedWidget(earthWidget, VIEW_GOOGLEEARTH, tr("Google Earth")); } #endif diff --git a/src/ui/MainWindow.h b/src/ui/MainWindow.h index 966b6ae22..8d6d4dfe0 100644 --- a/src/ui/MainWindow.h +++ b/src/ui/MainWindow.h @@ -58,13 +58,13 @@ This file is part of the QGROUNDCONTROL project #include "ParameterInterface.h" #include "HDDisplay.h" #include "WatchdogControl.h" -#include "HSIDisplay.h" -#include "QGCRemoteControlView.h" -#include "opmapcontrol.h" -#ifndef DISABLE_GOOGLE_EARTH -#include "QGCGoogleEarthView.h" -#endif -#include "QGCToolBar.h" +#include "HSIDisplay.h" +#include "QGCRemoteControlView.h" +#include "opmapcontrol.h" +#ifdef QGC_GOOGLE_EARTH_ENABLED +#include "QGCGoogleEarthView.h" +#endif +#include "QGCToolBar.h" #include "SlugsDataSensorView.h" #include "LogCompressor.h" @@ -413,13 +413,13 @@ protected: //QPointer mapWidget; //QPointer protocolWidget; //QPointer dataplotWidget; -#ifdef QGC_OSG_ENABLED - QPointer q3DWidget; -#endif -#ifndef DISABLE_GOOGLE_EARTH +#ifdef QGC_OSG_ENABLED + QPointer q3DWidget; +#endif +#ifdef QGC_GOOGLE_EARTH_ENABLED QPointer earthWidget; -#endif - QPointer firmwareUpdateWidget; +#endif + QPointer firmwareUpdateWidget; // Dock widgets QPointer controlDockWidget; -- 2.22.0