From 3d2866df48c34bea5af8ddc032b4530794bf1072 Mon Sep 17 00:00:00 2001 From: pixhawk Date: Sun, 11 Apr 2010 18:27:30 +0200 Subject: [PATCH] Finally fixed the Mac OS 32bit/64bit chaos --- mavground.pri | 24 +++++++++++++++++------- src/Core.cc | 21 +++++++++++---------- src/ui/MainWindow.cc | 13 +++++++++---- 3 files changed, 37 insertions(+), 21 deletions(-) diff --git a/mavground.pri b/mavground.pri index f9d0ec2..fa151f4 100644 --- a/mavground.pri +++ b/mavground.pri @@ -37,8 +37,8 @@ LANGUAGE = C++ #CONFIG += static debug #CONFIG += static release console CONFIG += static debug_and_release console -QMAKE_CFLAGS += -j8 -QMAKE_CXXFLAGS += -j8 +#QMAKE_CFLAGS += -j8 +#QMAKE_CXXFLAGS += -j8 OBJECTS_DIR = $$BUILDDIR/obj MOC_DIR = $$BUILDDIR/moc @@ -60,10 +60,20 @@ message(Qt version $$[QT_VERSION]) # MAC OS X macx { - message(Building for Mac OS X 64bit) + CONFIG += x86 #x86_64 + CONFIG -= static phonon - CONFIG += x86_64 - CONFIG -= x86 static phonon + HARDWARE_PLATFORM = $$system(uname -a) + contains( HARDWARE_PLATFORM, x86_64 ) { + # x64 Mac OS X Snow Leopard 10.6 and later + CONFIG += x86_64 + CONFIG -= x86 static phonon + message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later) + } else { + # x86 Mac OS X Leopard 10.5 and earlier + CONFIG += x86 static phonon + message(Building for Mac OS X 32bit/Leopard 10.5 and earlier) + } QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5 @@ -88,8 +98,6 @@ macx { # GNU/Linux linux-g++ { - - message(Building for GNU/Linux) debug { DESTDIR = $$BASEDIR @@ -105,10 +113,12 @@ linux-g++ { # 64-bit Linux LIBS += \ -L$$BASEDIR/lib/flite/linux64 + message(Building for GNU/Linux 64bit/x64) } else { # 32-bit Linux LIBS += \ -L$$BASEDIR/lib/flite/linux32 + message(Building for GNU/Linux 32bit/i386) } LIBS += -lm \ -lflite_cmu_us_awb \ diff --git a/src/Core.cc b/src/Core.cc index a705a71..c078b24 100644 --- a/src/Core.cc +++ b/src/Core.cc @@ -61,6 +61,14 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv) this->setApplicationName("OpenMAV Ground Control Station"); this->setApplicationVersion("v. 0.0.5"); this->setOrganizationName(QLatin1String("OpenMAV Association")); + this->setOrganizationDomain("http://qgroundcontrol.org"); + + // Show splash screen + QPixmap splashImage(":images/splash.png"); + QSplashScreen* splashScreen = new QSplashScreen(splashImage, Qt::WindowStaysOnTopHint); + splashScreen->show(); + splashScreen->showMessage(tr("Loading application fonts"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); + QSettings::setDefaultFormat(QSettings::IniFormat); // Exit main application when last window is closed connect(this, SIGNAL(lastWindowClosed()), this, SLOT(quit())); @@ -73,17 +81,12 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv) fontDatabase.addApplicationFont(fontFileName); setFont(fontDatabase.font(fontFamilyName, "Roman", 12)); - // Show splash screen - QPixmap splashImage(":images/splash.png"); - QSplashScreen* splashScreen = new QSplashScreen(splashImage, Qt::WindowStaysOnTopHint); - splashScreen->show(); - // Start the comm link manager - splashScreen->showMessage(tr("Starting Communication Links")); + splashScreen->showMessage(tr("Starting Communication Links"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); startLinkManager(); // Start the UAS Manager - splashScreen->showMessage(tr("Starting UAS Manager")); + splashScreen->showMessage(tr("Starting UAS Manager"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); startUASManager(); // Start audio output @@ -93,7 +96,7 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv) //tarsus->start(); // Start the user interface - splashScreen->showMessage(tr("Starting User Interface")); + splashScreen->showMessage(tr("Starting User Interface"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); startUI(); // Remove splash screen @@ -140,7 +143,5 @@ void Core::startUI() { // Start UI mainWindow = new MainWindow(); - // Make UI visible - mainWindow->show(); } diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 4da7172..8c7e67e 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -60,6 +60,9 @@ This file is part of the PIXHAWK project MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { + this->hide(); + this->setVisible(false); + // Quick hack //comp = new LogCompressor("/home/pixhawk/Desktop/test.txt"); @@ -142,10 +145,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) // Add status bar setStatusBar(createStatusBar()); - // Load widgets - loadWidgets(); - // Adjust the size - adjustSize(); // Create actions connectActions(); @@ -173,6 +172,12 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) //CommConfigurationWindow* simulationWidget = new CommConfigurationWindow(simulationLink, mavlink, this); //ui.menuNetwork->addAction(commWidget->getAction()); simulationLink->connect(); + + // Load widgets and show application window + loadWidgets(); + + // Adjust the size + adjustSize(); } MainWindow::~MainWindow()