Skip to content

Commit

Permalink
Windows Google Earth support works! Also cleaned up some unwanted pro…
Browse files Browse the repository at this point in the history
…ject files.
  • Loading branch information
pixhawk committed Dec 21, 2010
1 parent e4089c2 commit 0da55f2
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 242 deletions.
148 changes: 0 additions & 148 deletions .cproject

This file was deleted.

11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,13 @@ user_config.pri

*.ncb
*.vcproj
*.sln
*.sln
*.sln
*.vcproj
*.user
*.ncb
*.idb
*.project
*.cproject
*.sln
*.suo
88 changes: 0 additions & 88 deletions .project

This file was deleted.

8 changes: 4 additions & 4 deletions qgroundcontrol.pri
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,10 @@ exists($$BASEDIR/lib/osgEarth123) {
TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")

debug {
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\debug\\SDL.dll\"
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\audio\" \"$$TARGETDIR_WIN\\debug\\audio\" /S /E /Y
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\models\" \"$$TARGETDIR_WIN\\debug\\models\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR\\images\\earth.html $$TARGETDIR_WIN\\debug\"
QMAKE_POST_LINK += ; copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\debug\\SDL.dll\"
QMAKE_POST_LINK += ; xcopy \"$$BASEDIR_WIN\\audio\" \"$$TARGETDIR_WIN\\debug\\audio\" /S /E /Y
QMAKE_POST_LINK += ; xcopy \"$$BASEDIR_WIN\\models\" \"$$TARGETDIR_WIN\\debug\\models\" /S /E /Y
QMAKE_POST_LINK += ; copy /Y \"$$BASEDIR\\images\\earth.html $$TARGETDIR_WIN\\debug\"
}

release {
Expand Down
14 changes: 13 additions & 1 deletion src/ui/map3D/QGCGoogleEarthView.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <QWebFrame>
#include <QWebPage>
#include <QApplication>
#include <QDir>

#include <QDebug>

Expand Down Expand Up @@ -42,6 +44,10 @@ QGCGoogleEarthView::QGCGoogleEarthView(QWidget *parent) :
ui->webViewLayout->addWidget(webViewMac);
#endif

#ifdef _MSC_VER
ui->webViewLayout->addWidget(webViewWin);
#endif

#if ((defined Q_OS_MAC) | (defined _MSC_VER))
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*)));
connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateState()));
Expand All @@ -59,6 +65,11 @@ QGCGoogleEarthView::QGCGoogleEarthView(QWidget *parent) :
// Get list of available 3D models

// Load HTML file
#ifdef _MSC_VER
webViewWin->dynamicCall("GoHome()");
webViewWin->dynamicCall("Navigate(const QString&)", QApplication::applicationDirPath() + "/earth.html");
qDebug() << QDir::cleanPath(QApplication::applicationDirPath() + "/earth.html").replace('/', "\\");
#endif

// Parse for model links

Expand Down Expand Up @@ -107,7 +118,8 @@ void QGCGoogleEarthView::show()
#endif

#ifdef _MSC_VER
//webViewWin->load(QUrl("earth.html"));
webViewWin->dynamicCall("GoHome()");
webViewWin->dynamicCall("Navigate(const QString&)", "http://pixhawk.ethz.ch");
#endif
webViewInitialized = true;
}
Expand Down
2 changes: 2 additions & 0 deletions src/ui/map3D/QGCGoogleEarthView.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class QGCWebAxWidget : public QAxWidget
QGCWebAxWidget(QWidget* parent = 0, Qt::WindowFlags f = 0)
: QAxWidget(parent, f)
{
// Set web browser control
setControl("{8856F961-340A-11D0-A96B-00C04FD705A2}");
}
protected:
virtual bool translateKeyEvent(int message, int keycode) const
Expand Down

0 comments on commit 0da55f2

Please sign in to comment.