Commit 5dbc0d5f authored by dogmaphobic's avatar dogmaphobic

Merge remote-tracking branch 'origin/master' into buildWork

* origin/master:
  Fix meta data warnings
  Reduce iOS default font size. Tweak toolbar height for mobile.
  Token change to force a rebuild.
  Adding TTS to iOS
  Better UAVCAN instructions, better param meta

Conflicts:
	QGCApplication.pro
	QGCCommon.pri
parents b1940863 ed55e5da
......@@ -84,10 +84,12 @@ MacBuild {
}
iOSBuild {
QMAKE_INFO_PLIST = $${BASEDIR}/ios/iOS-Info.plist
QMAKE_INFO_PLIST = $${BASEDIR}/ios/iOS-Info.plist
OTHER_FILES += $${BASEDIR}/ios/iOS-Info.plist
BUNDLE.files = $$files($$PWD/ios/AppIcon*.png) $$PWD/ios/LaunchScreen.xib
QMAKE_BUNDLE_DATA += BUNDLE
QMAKE_BUNDLE_DATA += BUNDLE
LIBS += -framework AVFoundation
OBJECTIVE_SOURCES += src/audio/QGCAudioWorker_iOS.mm
#-- TODO: Add iTunesArtwork
}
......
......@@ -53,6 +53,7 @@ linux {
macx-clang | macx-llvm {
message("Mac build")
CONFIG += MacBuild
DEFINES += __macos__
CONFIG += x86_64
CONFIG -= x86
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
......
......@@ -260,7 +260,7 @@ contains (DEFINES, DISABLE_SPEECH) {
}
}
# Mac support is built into OS 10.6+.
else:MacBuild {
else:MacBuild|iOSBuild {
message("Including support for speech output")
DEFINES += QGC_SPEECH_ENABLED
}
......
......@@ -281,7 +281,7 @@ QGCView {
fact: controller.getParameterFact(-1, "UAVCAN_ENABLE")
checkedValue: 3
uncheckedValue: 0
text: "Enable UAVCAN as the default MAIN output bus (requires restart)"
text: "Enable UAVCAN as the default MAIN output bus (requires autopilot restart)"
}
}
}
......
......@@ -140,8 +140,7 @@ static QObject* qgroundcontrolQmlGlobalSingletonFactory(QQmlEngine*, QJSEngine*)
}
#if defined(QGC_GST_STREAMING)
#ifdef Q_OS_MAC
#ifndef __ios__
#if defined(__macos__)
#ifdef QGC_INSTALL_RELEASE
static void qgcputenv(const QString& key, const QString& root, const QString& path)
{
......@@ -151,7 +150,6 @@ static void qgcputenv(const QString& key, const QString& root, const QString& pa
#endif
#endif
#endif
#endif
/**
* @brief Constructor for the main application.
......
......@@ -116,7 +116,7 @@ private:
#endif
#endif
{
#ifdef Q_OS_MAC
#ifdef __macos__
QString emptyTitle;
QMessageBox box(icon, emptyTitle, title, buttons, parent);
box.setDefaultButton(defaultButton);
......
......@@ -28,15 +28,18 @@
#include "MainWindow.h"
#ifdef Q_OS_WIN
const double ScreenToolsController::_defaultFontPixelSizeRatio = 1.0;
#elif __mobile__
const double ScreenToolsController::_defaultFontPixelSizeRatio = 1.0;
const double ScreenToolsController::_defaultFontPixelSizeRatio = 1.0;
#elif __android__
const double ScreenToolsController::_defaultFontPixelSizeRatio = 1.0;
#elif __ios__
const double ScreenToolsController::_defaultFontPixelSizeRatio = 0.8;
#else
const double ScreenToolsController::_defaultFontPixelSizeRatio = 0.8;
const double ScreenToolsController::_defaultFontPixelSizeRatio = 0.8;
#endif
const double ScreenToolsController::_smallFontPixelSizeRatio = 0.75;
const double ScreenToolsController::_mediumFontPixelSizeRatio = 1.22;
const double ScreenToolsController::_largeFontPixelSizeRatio = 1.66;
const double ScreenToolsController::_smallFontPixelSizeRatio = 0.75;
const double ScreenToolsController::_mediumFontPixelSizeRatio = 1.22;
const double ScreenToolsController::_largeFontPixelSizeRatio = 1.66;
ScreenToolsController::ScreenToolsController()
{
......
......@@ -39,7 +39,7 @@ Button {
verticalAlignment: TextEdit.AlignVCenter
horizontalAlignment: TextEdit.AlignHCenter
color: showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText
font.pixelSize: ScreenTools.isMobile ? ScreenTools.defaultFontPixelSize * 0.65 : ScreenTools.defaultFontPixelSize
font.pixelSize: ScreenTools.isMobile ? ScreenTools.defaultFontPixelSize * 0.75 : ScreenTools.defaultFontPixelSize
text: control.text
Rectangle {
......
......@@ -196,7 +196,7 @@ void UrlFactory::_tryCorrectGoogleVersions()
_network->setProxy(tProxy);
QString url = "http://maps.google.com/maps?output=classic";
qheader.setUrl(QUrl(url));
#if defined Q_OS_MACX
#if defined Q_OS_MAC
QByteArray userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0";
#elif defined Q_OS_WIN32
QByteArray userAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7";
......
......@@ -55,7 +55,7 @@
QGeoTileFetcherQGC::QGeoTileFetcherQGC(QGeoTiledMappingManagerEngine *parent)
: QGeoTileFetcher(parent)
, m_networkManager(new QNetworkAccessManager(this))
#if defined Q_OS_MACX
#if defined Q_OS_MAC
, m_userAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0")
#elif defined Q_OS_WIN32
, m_userAgent("Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7")
......
......@@ -75,8 +75,7 @@ void initializeVideoStreaming(int &argc, char* argv[])
GST_PLUGIN_STATIC_REGISTER(x264);
#endif
#ifdef Q_OS_MAC
#ifndef __ios__
#ifdef __macos__
#ifdef QGC_INSTALL_RELEASE
QString currentDir = QCoreApplication::applicationDirPath();
qgcputenv("GST_PLUGIN_SCANNER", currentDir, "/gst-plugin-scanner");
......@@ -92,7 +91,6 @@ void initializeVideoStreaming(int &argc, char* argv[])
// }
#endif
#endif
#endif
#else
Q_UNUSED(argc);
......
import QtQuick 2.2
import QtQuick 2.5
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
......@@ -6,78 +6,78 @@ import QGroundControl.Palette 1.0
import QGroundControl.Controllers 1.0
Rectangle {
property Component connectedComponent: __componentConnected
property Component disconnectedComponent: __componentDisconnected
property Component connectedComponent: __componentConnected
property Component disconnectedComponent: __componentDisconnected
QGCPalette { id: __qgcPal; colorGroupEnabled: enabled }
ViewWidgetController { id: __controller }
QGCPalette { id: __qgcPal; colorGroupEnabled: enabled }
ViewWidgetController { id: __controller }
color: __qgcPal.window
color: __qgcPal.window
Component.onCompleted: __controller.checkForVehicle()
Component.onCompleted: __controller.checkForVehicle()
Connections {
target: __controller
Connections {
target: __controller
onPluginConnected: {
pageLoader.autopilot = autopilot
pageLoader.sourceComponent = connectedComponent
}
onPluginConnected: {
pageLoader.autopilot = autopilot
pageLoader.sourceComponent = connectedComponent
}
onPluginDisconnected: {
onPluginDisconnected: {
pageLoader.sourceComponent = null
pageLoader.sourceComponent = disconnectedComponent
pageLoader.autopilot = null
}
}
pageLoader.sourceComponent = disconnectedComponent
pageLoader.autopilot = null
}
}
Loader {
id: pageLoader
Loader {
id: pageLoader
anchors.fill: parent
anchors.fill: parent
property var autopilot
property var autopilot
sourceComponent: __componentDisconnected
}
sourceComponent: __componentDisconnected
}
Component {
id: __componentConnected
Component {
id: __componentConnected
Rectangle {
QGCPalette { id: __qgcPal; colorGroupEnabled: enabled }
Rectangle {
QGCPalette { id: __qgcPal; colorGroupEnabled: enabled }
anchors.fill: parent
color: __qgcPal.window
anchors.fill: parent
color: __qgcPal.window
QGCLabel {
anchors.fill: parent
QGCLabel {
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: "missing connected implementation"
}
}
}
text: "missing connected implementation"
}
}
}
Component {
id: __componentDisconnected
Component {
id: __componentDisconnected
Rectangle {
QGCPalette { id: __qgcPal; colorGroupEnabled: enabled }
Rectangle {
QGCPalette { id: __qgcPal; colorGroupEnabled: enabled }
anchors.fill: parent
color: __qgcPal.window
anchors.fill: parent
color: __qgcPal.window
QGCLabel {
anchors.fill: parent
QGCLabel {
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: "no vehicle connected"
}
}
}
text: "no vehicle connected"
}
}
}
}
......@@ -8,7 +8,7 @@
#include "QGCAudioWorker.h"
#include "GAudioOutput.h"
#if defined Q_OS_MAC && defined QGC_SPEECH_ENABLED
#if (defined __macos__) && defined QGC_SPEECH_ENABLED
#include <ApplicationServices/ApplicationServices.h>
static SpeechChannel sc;
......@@ -53,6 +53,10 @@ MacSpeech macSpeech;
#endif
#if (defined __ios__) && defined QGC_SPEECH_ENABLED
extern void iOSSpeak(QString msg);
#endif
// Speech synthesis is only supported with MSVC compiler
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
// Documentation: http://msdn.microsoft.com/en-us/library/ee125082%28v=VS.85%29.aspx
......@@ -168,8 +172,10 @@ void QGCAudioWorker::say(QString inText, int severity)
unsigned int espeak_size = strlen(text.toStdString().c_str()) + 1;
espeak_Synth(text.toStdString().c_str(), espeak_size, 0, POS_CHARACTER, 0, espeakCHARS_AUTO, NULL, NULL);
#elif defined Q_OS_MAC && defined QGC_SPEECH_ENABLED
#elif (defined __macos__) && defined QGC_SPEECH_ENABLED
macSpeech.say(text.toStdString().c_str());
#elif (defined __ios__) && defined QGC_SPEECH_ENABLED
iOSSpeak(text);
#else
// Make sure there isn't an unused variable warning when speech output is disabled
Q_UNUSED(inText);
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief TTS for iOS
*
* @author Gus Grubba <mavlink@grubba.com>
*
*/
#include <QString>
#include "QGC.h"
#if (defined __ios__) && defined QGC_SPEECH_ENABLED
#import <AVFoundation/AVSpeechSynthesis.h>
class SpeakIOS
{
public:
SpeakIOS ();
~SpeakIOS ();
void speak (QString msg );
private:
AVSpeechSynthesizer *_synth;
};
SpeakIOS::SpeakIOS()
: _synth([[AVSpeechSynthesizer alloc] init])
{
}
SpeakIOS::~SpeakIOS()
{
[_synth release];
}
void SpeakIOS::speak(QString msg)
{
while ([_synth isSpeaking]) {
QGC::SLEEP::msleep(100);
}
NSString *msg_ns = [NSString stringWithCString:msg.toStdString().c_str() encoding:[NSString defaultCStringEncoding]];
AVSpeechUtterance *utterance = [[[AVSpeechUtterance alloc] initWithString: msg_ns] autorelease];
AVSpeechSynthesisVoice* currentVoice = [AVSpeechSynthesisVoice voiceWithLanguage:[AVSpeechSynthesisVoice currentLanguageCode]];
utterance.voice = currentVoice;
//utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];
utterance.rate = 0.5;
[_synth speakUtterance:utterance];
}
//-- The one and only static singleton
SpeakIOS kSpeakIOS;
void iOSSpeak(QString msg)
{
kSpeakIOS.speak(msg);
}
#endif
This diff is collapsed.
......@@ -265,7 +265,7 @@ MainWindow::MainWindow()
connect(_ui.actionStatusBar, &QAction::triggered, this, &MainWindow::showStatusBarCallback);
// Set OS dependent keyboard shortcuts for the main window, non OS dependent shortcuts are set in MainWindow.ui
#ifdef Q_OS_MACX
#ifdef __macos__
_ui.actionSetup->setShortcut(QApplication::translate("MainWindow", "Meta+1", 0));
_ui.actionPlan->setShortcut(QApplication::translate("MainWindow", "Meta+2", 0));
_ui.actionFlight->setShortcut(QApplication::translate("MainWindow", "Meta+3", 0));
......@@ -290,7 +290,7 @@ MainWindow::MainWindow()
menuBar()->hide();
#endif
show();
#ifdef Q_OS_MAC
#ifdef __macos__
// TODO HACK
// This is a really ugly hack. For whatever reason, by having a QQuickWidget inside a
// QDockWidget (MainToolBar above), the main menu is not shown when the app first
......
......@@ -40,7 +40,7 @@ Item {
QGCPalette { id: __qgcPal; colorGroupEnabled: true }
property real tbHeight: ScreenTools.isMobile ? (ScreenTools.isTinyScreen ? (mainWindow.width * 0.0666) : (mainWindow.width * 0.0444)) : ScreenTools.defaultFontPixelSize * 4
property real tbHeight: ScreenTools.isMobile ? (ScreenTools.isTinyScreen ? (mainWindow.width * 0.0666) : (mainWindow.width * 0.05)) : ScreenTools.defaultFontPixelSize * 4
property int tbCellHeight: tbHeight * 0.75
property real tbSpacing: ScreenTools.isMobile ? width * 0.00824 : 9.54
property real tbButtonWidth: tbCellHeight * 1.3
......
......@@ -421,7 +421,7 @@ Rectangle {
id: toolBarMessage
width: toolBarMessageArea.width - toolBarMessageCloseButton.width
wrapMode: Text.WordWrap
color: qgcPal.warningText
color: "#e4e428"
lineHeightMode: Text.ProportionalHeight
lineHeight: 1.15
anchors.margins: mainWindow.tbSpacing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment