Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
ed55e5da
Commit
ed55e5da
authored
Nov 12, 2015
by
Gus Grubba
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2199 from dogmaphobic/iosWork
Adding TTS to iOS
parents
f8bb6c6d
8226db0f
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
311 additions
and
218 deletions
+311
-218
QGCApplication.pro
QGCApplication.pro
+5
-3
QGCCommon.pri
QGCCommon.pri
+2
-0
QGCExternalLibs.pri
QGCExternalLibs.pri
+1
-1
QGCApplication.cc
src/QGCApplication.cc
+1
-3
QGCMessageBox.h
src/QGCMessageBox.h
+1
-1
ScreenToolsController.cc
src/QmlControls/ScreenToolsController.cc
+10
-7
SubMenuButton.qml
src/QmlControls/SubMenuButton.qml
+1
-1
OpenPilotMaps.cc
src/QtLocationPlugin/OpenPilotMaps.cc
+1
-1
qgeotilefetcherqgc.cpp
src/QtLocationPlugin/qgeotilefetcherqgc.cpp
+1
-1
VideoStreaming.cc
src/VideoStreaming/VideoStreaming.cc
+1
-3
ViewWidget.qml
src/ViewWidgets/ViewWidget.qml
+52
-52
QGCAudioWorker.cpp
src/audio/QGCAudioWorker.cpp
+8
-2
QGCAudioWorker_iOS.mm
src/audio/QGCAudioWorker_iOS.mm
+84
-0
QGCFlightGearLink.cc
src/comm/QGCFlightGearLink.cc
+139
-139
MainWindow.cc
src/ui/MainWindow.cc
+2
-2
MainWindow.qml
src/ui/MainWindow.qml
+1
-1
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+1
-1
No files found.
QGCApplication.pro
View file @
ed55e5da
...
@@ -87,9 +87,11 @@ MacBuild {
...
@@ -87,9 +87,11 @@ MacBuild {
}
}
iOSBuild
{
iOSBuild
{
QMAKE_INFO_PLIST
=
$$
{
BASEDIR
}
/
ios
/
iOS
-
Info
.
plist
QMAKE_INFO_PLIST
=
$$
{
BASEDIR
}
/
ios
/
iOS
-
Info
.
plist
ICON
=
$$
{
BASEDIR
}
/
resources
/
icons
/
macx
.
icns
ICON
=
$$
{
BASEDIR
}
/
resources
/
icons
/
macx
.
icns
OTHER_FILES
+=
$$
{
BASEDIR
}
/
iOS
-
Info
.
plist
OTHER_FILES
+=
$$
{
BASEDIR
}
/
iOS
-
Info
.
plist
LIBS
+=
-
framework
AVFoundation
OBJECTIVE_SOURCES
+=
src
/
audio
/
QGCAudioWorker_iOS
.
mm
}
}
LinuxBuild
{
LinuxBuild
{
...
...
QGCCommon.pri
View file @
ed55e5da
...
@@ -49,6 +49,7 @@ linux {
...
@@ -49,6 +49,7 @@ linux {
macx-clang | macx-llvm {
macx-clang | macx-llvm {
message("Mac build")
message("Mac build")
CONFIG += MacBuild
CONFIG += MacBuild
DEFINES += __macos__
QMAKE_CXXFLAGS += -fvisibility=hidden
QMAKE_CXXFLAGS += -fvisibility=hidden
} else {
} else {
error("Unsupported Mac toolchain, only 64-bit LLVM+clang is supported")
error("Unsupported Mac toolchain, only 64-bit LLVM+clang is supported")
...
@@ -60,6 +61,7 @@ linux {
...
@@ -60,6 +61,7 @@ linux {
message("iOS build")
message("iOS build")
CONFIG += iOSBuild MobileBuild app_bundle
CONFIG += iOSBuild MobileBuild app_bundle
DEFINES += __ios__
DEFINES += __ios__
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
warning("iOS build is experimental and not yet fully functional")
warning("iOS build is experimental and not yet fully functional")
} else {
} else {
error("Unsupported build platform, only Linux, Windows, Android and Mac (Mac OS and iOS) are supported")
error("Unsupported build platform, only Linux, Windows, Android and Mac (Mac OS and iOS) are supported")
...
...
QGCExternalLibs.pri
View file @
ed55e5da
...
@@ -260,7 +260,7 @@ contains (DEFINES, DISABLE_SPEECH) {
...
@@ -260,7 +260,7 @@ contains (DEFINES, DISABLE_SPEECH) {
}
}
}
}
# Mac support is built into OS 10.6+.
# Mac support is built into OS 10.6+.
else:MacBuild {
else:MacBuild
|iOSBuild
{
message("Including support for speech output")
message("Including support for speech output")
DEFINES += QGC_SPEECH_ENABLED
DEFINES += QGC_SPEECH_ENABLED
}
}
...
...
src/QGCApplication.cc
View file @
ed55e5da
...
@@ -140,8 +140,7 @@ static QObject* qgroundcontrolQmlGlobalSingletonFactory(QQmlEngine*, QJSEngine*)
...
@@ -140,8 +140,7 @@ static QObject* qgroundcontrolQmlGlobalSingletonFactory(QQmlEngine*, QJSEngine*)
}
}
#if defined(QGC_GST_STREAMING)
#if defined(QGC_GST_STREAMING)
#ifdef Q_OS_MAC
#if defined(__macos__)
#ifndef __ios__
#ifdef QGC_INSTALL_RELEASE
#ifdef QGC_INSTALL_RELEASE
static
void
qgcputenv
(
const
QString
&
key
,
const
QString
&
root
,
const
QString
&
path
)
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
...
@@ -151,7 +150,6 @@ static void qgcputenv(const QString& key, const QString& root, const QString& pa
#endif
#endif
#endif
#endif
#endif
#endif
#endif
/**
/**
* @brief Constructor for the main application.
* @brief Constructor for the main application.
...
...
src/QGCMessageBox.h
View file @
ed55e5da
...
@@ -116,7 +116,7 @@ private:
...
@@ -116,7 +116,7 @@ private:
#endif
#endif
#endif
#endif
{
{
#ifdef
Q_OS_MAC
#ifdef
__macos__
QString
emptyTitle
;
QString
emptyTitle
;
QMessageBox
box
(
icon
,
emptyTitle
,
title
,
buttons
,
parent
);
QMessageBox
box
(
icon
,
emptyTitle
,
title
,
buttons
,
parent
);
box
.
setDefaultButton
(
defaultButton
);
box
.
setDefaultButton
(
defaultButton
);
...
...
src/QmlControls/ScreenToolsController.cc
View file @
ed55e5da
...
@@ -28,15 +28,18 @@
...
@@ -28,15 +28,18 @@
#include "MainWindow.h"
#include "MainWindow.h"
#ifdef Q_OS_WIN
#ifdef Q_OS_WIN
const
double
ScreenToolsController
::
_defaultFontPixelSizeRatio
=
1.0
;
const
double
ScreenToolsController
::
_defaultFontPixelSizeRatio
=
1.0
;
#elif __mobile__
#elif __android__
const
double
ScreenToolsController
::
_defaultFontPixelSizeRatio
=
1.0
;
const
double
ScreenToolsController
::
_defaultFontPixelSizeRatio
=
1.0
;
#elif __ios__
const
double
ScreenToolsController
::
_defaultFontPixelSizeRatio
=
0.8
;
#else
#else
const
double
ScreenToolsController
::
_defaultFontPixelSizeRatio
=
0.8
;
const
double
ScreenToolsController
::
_defaultFontPixelSizeRatio
=
0.8
;
#endif
#endif
const
double
ScreenToolsController
::
_smallFontPixelSizeRatio
=
0.75
;
const
double
ScreenToolsController
::
_mediumFontPixelSizeRatio
=
1.22
;
const
double
ScreenToolsController
::
_smallFontPixelSizeRatio
=
0.75
;
const
double
ScreenToolsController
::
_largeFontPixelSizeRatio
=
1.66
;
const
double
ScreenToolsController
::
_mediumFontPixelSizeRatio
=
1.22
;
const
double
ScreenToolsController
::
_largeFontPixelSizeRatio
=
1.66
;
ScreenToolsController
::
ScreenToolsController
()
ScreenToolsController
::
ScreenToolsController
()
{
{
...
...
src/QmlControls/SubMenuButton.qml
View file @
ed55e5da
...
@@ -39,7 +39,7 @@ Button {
...
@@ -39,7 +39,7 @@ Button {
verticalAlignment
:
TextEdit
.
AlignVCenter
verticalAlignment
:
TextEdit
.
AlignVCenter
horizontalAlignment
:
TextEdit
.
AlignHCenter
horizontalAlignment
:
TextEdit
.
AlignHCenter
color
:
showHighlight
?
qgcPal
.
buttonHighlightText
:
qgcPal
.
buttonText
color
:
showHighlight
?
qgcPal
.
buttonHighlightText
:
qgcPal
.
buttonText
font.pixelSize
:
ScreenTools
.
isMobile
?
ScreenTools
.
defaultFontPixelSize
*
0.
6
5
:
ScreenTools
.
defaultFontPixelSize
font.pixelSize
:
ScreenTools
.
isMobile
?
ScreenTools
.
defaultFontPixelSize
*
0.
7
5
:
ScreenTools
.
defaultFontPixelSize
text
:
control
.
text
text
:
control
.
text
Rectangle
{
Rectangle
{
...
...
src/QtLocationPlugin/OpenPilotMaps.cc
View file @
ed55e5da
...
@@ -196,7 +196,7 @@ void UrlFactory::_tryCorrectGoogleVersions()
...
@@ -196,7 +196,7 @@ void UrlFactory::_tryCorrectGoogleVersions()
_network
->
setProxy
(
tProxy
);
_network
->
setProxy
(
tProxy
);
QString
url
=
"http://maps.google.com/maps?output=classic"
;
QString
url
=
"http://maps.google.com/maps?output=classic"
;
qheader
.
setUrl
(
QUrl
(
url
));
qheader
.
setUrl
(
QUrl
(
url
));
#if defined Q_OS_MAC
X
#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"
;
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
#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"
;
QByteArray
userAgent
=
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7"
;
...
...
src/QtLocationPlugin/qgeotilefetcherqgc.cpp
View file @
ed55e5da
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
QGeoTileFetcherQGC
::
QGeoTileFetcherQGC
(
QGeoTiledMappingManagerEngine
*
parent
)
QGeoTileFetcherQGC
::
QGeoTileFetcherQGC
(
QGeoTiledMappingManagerEngine
*
parent
)
:
QGeoTileFetcher
(
parent
)
:
QGeoTileFetcher
(
parent
)
,
m_networkManager
(
new
QNetworkAccessManager
(
this
))
,
m_networkManager
(
new
QNetworkAccessManager
(
this
))
#if defined Q_OS_MAC
X
#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"
)
,
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
#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"
)
,
m_userAgent
(
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7"
)
...
...
src/VideoStreaming/VideoStreaming.cc
View file @
ed55e5da
...
@@ -75,8 +75,7 @@ void initializeVideoStreaming(int &argc, char* argv[])
...
@@ -75,8 +75,7 @@ void initializeVideoStreaming(int &argc, char* argv[])
GST_PLUGIN_STATIC_REGISTER
(
x264
);
GST_PLUGIN_STATIC_REGISTER
(
x264
);
#endif
#endif
#ifdef Q_OS_MAC
#ifdef __macos__
#ifndef __ios__
#ifdef QGC_INSTALL_RELEASE
#ifdef QGC_INSTALL_RELEASE
QString
currentDir
=
QCoreApplication
::
applicationDirPath
();
QString
currentDir
=
QCoreApplication
::
applicationDirPath
();
qgcputenv
(
"GST_PLUGIN_SCANNER"
,
currentDir
,
"/gst-plugin-scanner"
);
qgcputenv
(
"GST_PLUGIN_SCANNER"
,
currentDir
,
"/gst-plugin-scanner"
);
...
@@ -92,7 +91,6 @@ void initializeVideoStreaming(int &argc, char* argv[])
...
@@ -92,7 +91,6 @@ void initializeVideoStreaming(int &argc, char* argv[])
// }
// }
#endif
#endif
#endif
#endif
#endif
#else
#else
Q_UNUSED
(
argc
);
Q_UNUSED
(
argc
);
...
...
src/ViewWidgets/ViewWidget.qml
View file @
ed55e5da
import
QtQuick
2.
2
import
QtQuick
2.
5
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QtQuick
.
Controls
.
Styles
1.2
...
@@ -6,78 +6,78 @@ import QGroundControl.Palette 1.0
...
@@ -6,78 +6,78 @@ import QGroundControl.Palette 1.0
import
QGroundControl
.
Controllers
1.0
import
QGroundControl
.
Controllers
1.0
Rectangle
{
Rectangle
{
property
Component
connectedComponent
:
__componentConnected
property
Component
connectedComponent
:
__componentConnected
property
Component
disconnectedComponent
:
__componentDisconnected
property
Component
disconnectedComponent
:
__componentDisconnected
QGCPalette
{
id
:
__qgcPal
;
colorGroupEnabled
:
enabled
}
QGCPalette
{
id
:
__qgcPal
;
colorGroupEnabled
:
enabled
}
ViewWidgetController
{
id
:
__controller
}
ViewWidgetController
{
id
:
__controller
}
color
:
__qgcPal
.
window
color
:
__qgcPal
.
window
Component.onCompleted
:
__controller
.
checkForVehicle
()
Component.onCompleted
:
__controller
.
checkForVehicle
()
Connections
{
Connections
{
target
:
__controller
target
:
__controller
onPluginConnected
:
{
onPluginConnected
:
{
pageLoader
.
autopilot
=
autopilot
pageLoader
.
autopilot
=
autopilot
pageLoader
.
sourceComponent
=
connectedComponent
pageLoader
.
sourceComponent
=
connectedComponent
}
}
onPluginDisconnected
:
{
onPluginDisconnected
:
{
pageLoader
.
sourceComponent
=
null
pageLoader
.
sourceComponent
=
null
pageLoader
.
sourceComponent
=
disconnectedComponent
pageLoader
.
sourceComponent
=
disconnectedComponent
pageLoader
.
autopilot
=
null
pageLoader
.
autopilot
=
null
}
}
}
}
Loader
{
Loader
{
id
:
pageLoader
id
:
pageLoader
anchors.fill
:
parent
anchors.fill
:
parent
property
var
autopilot
property
var
autopilot
sourceComponent
:
__componentDisconnected
sourceComponent
:
__componentDisconnected
}
}
Component
{
Component
{
id
:
__componentConnected
id
:
__componentConnected
Rectangle
{
Rectangle
{
QGCPalette
{
id
:
__qgcPal
;
colorGroupEnabled
:
enabled
}
QGCPalette
{
id
:
__qgcPal
;
colorGroupEnabled
:
enabled
}
anchors.fill
:
parent
anchors.fill
:
parent
color
:
__qgcPal
.
window
color
:
__qgcPal
.
window
QGCLabel
{
QGCLabel
{
anchors.fill
:
parent
anchors.fill
:
parent
horizontalAlignment
:
Text
.
AlignHCenter
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
verticalAlignment
:
Text
.
AlignVCenter
text
:
"
missing connected implementation
"
text
:
"
missing connected implementation
"
}
}
}
}
}
}
Component
{
Component
{
id
:
__componentDisconnected
id
:
__componentDisconnected
Rectangle
{
Rectangle
{
QGCPalette
{
id
:
__qgcPal
;
colorGroupEnabled
:
enabled
}
QGCPalette
{
id
:
__qgcPal
;
colorGroupEnabled
:
enabled
}
anchors.fill
:
parent
anchors.fill
:
parent
color
:
__qgcPal
.
window
color
:
__qgcPal
.
window
QGCLabel
{
QGCLabel
{
anchors.fill
:
parent
anchors.fill
:
parent
horizontalAlignment
:
Text
.
AlignHCenter
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
verticalAlignment
:
Text
.
AlignVCenter
text
:
"
no vehicle connected
"
text
:
"
no vehicle connected
"
}
}
}
}
}
}
}
}
src/audio/QGCAudioWorker.cpp
View file @
ed55e5da
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include "QGCAudioWorker.h"
#include "QGCAudioWorker.h"
#include "GAudioOutput.h"
#include "GAudioOutput.h"
#if
defined Q_OS_MAC
&& defined QGC_SPEECH_ENABLED
#if
(defined __macos__)
&& defined QGC_SPEECH_ENABLED
#include <ApplicationServices/ApplicationServices.h>
#include <ApplicationServices/ApplicationServices.h>
static
SpeechChannel
sc
;
static
SpeechChannel
sc
;
...
@@ -53,6 +53,10 @@ MacSpeech macSpeech;
...
@@ -53,6 +53,10 @@ MacSpeech macSpeech;
#endif
#endif
#if (defined __ios__) && defined QGC_SPEECH_ENABLED
extern
void
iOSSpeak
(
QString
msg
);
#endif
// Speech synthesis is only supported with MSVC compiler
// Speech synthesis is only supported with MSVC compiler
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
// Documentation: http://msdn.microsoft.com/en-us/library/ee125082%28v=VS.85%29.aspx
// 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)
...
@@ -168,8 +172,10 @@ void QGCAudioWorker::say(QString inText, int severity)
unsigned
int
espeak_size
=
strlen
(
text
.
toStdString
().
c_str
())
+
1
;
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
);
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
());
macSpeech
.
say
(
text
.
toStdString
().
c_str
());
#elif (defined __ios__) && defined QGC_SPEECH_ENABLED
iOSSpeak
(
text
);
#else
#else
// Make sure there isn't an unused variable warning when speech output is disabled
// Make sure there isn't an unused variable warning when speech output is disabled
Q_UNUSED
(
inText
);
Q_UNUSED
(
inText
);
...
...
src/audio/QGCAudioWorker_iOS.mm
0 → 100644
View file @
ed55e5da
/*=====================================================================
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
src/comm/QGCFlightGearLink.cc
View file @
ed55e5da
This diff is collapsed.
Click to expand it.
src/ui/MainWindow.cc
View file @
ed55e5da
...
@@ -265,7 +265,7 @@ MainWindow::MainWindow()
...
@@ -265,7 +265,7 @@ MainWindow::MainWindow()
connect
(
_ui
.
actionStatusBar
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
showStatusBarCallback
);
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
// 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
.
actionSetup
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+1"
,
0
));
_ui
.
actionPlan
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+2"
,
0
));
_ui
.
actionPlan
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+2"
,
0
));
_ui
.
actionFlight
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+3"
,
0
));
_ui
.
actionFlight
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+3"
,
0
));
...
@@ -290,7 +290,7 @@ MainWindow::MainWindow()
...
@@ -290,7 +290,7 @@ MainWindow::MainWindow()
menuBar
()
->
hide
();
menuBar
()
->
hide
();
#endif
#endif
show
();
show
();
#ifdef
Q_OS_MAC
#ifdef
__macos__
// TODO HACK
// TODO HACK
// This is a really ugly hack. For whatever reason, by having a QQuickWidget inside a
// 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
// QDockWidget (MainToolBar above), the main menu is not shown when the app first
...
...
src/ui/MainWindow.qml
View file @
ed55e5da
...
@@ -40,7 +40,7 @@ Item {
...
@@ -40,7 +40,7 @@ Item {
QGCPalette
{
id
:
__qgcPal
;
colorGroupEnabled
:
true
}
QGCPalette
{
id
:
__qgcPal
;
colorGroupEnabled
:
true
}
property
real
tbHeight
:
ScreenTools
.
isMobile
?
(
ScreenTools
.
isTinyScreen
?
(
mainWindow
.
width
*
0.0666
)
:
(
mainWindow
.
width
*
0.0
444
))
:
ScreenTools
.
defaultFontPixelSize
*
4
property
real
tbHeight
:
ScreenTools
.
isMobile
?
(
ScreenTools
.
isTinyScreen
?
(
mainWindow
.
width
*
0.0666
)
:
(
mainWindow
.
width
*
0.0
5
))
:
ScreenTools
.
defaultFontPixelSize
*
4
property
int
tbCellHeight
:
tbHeight
*
0.75
property
int
tbCellHeight
:
tbHeight
*
0.75
property
real
tbSpacing
:
ScreenTools
.
isMobile
?
width
*
0.00824
:
9.54
property
real
tbSpacing
:
ScreenTools
.
isMobile
?
width
*
0.00824
:
9.54
property
real
tbButtonWidth
:
tbCellHeight
*
1.3
property
real
tbButtonWidth
:
tbCellHeight
*
1.3
...
...
src/ui/toolbar/MainToolBar.qml
View file @
ed55e5da
...
@@ -421,7 +421,7 @@ Rectangle {
...
@@ -421,7 +421,7 @@ Rectangle {
id
:
toolBarMessage
id
:
toolBarMessage
width
:
toolBarMessageArea
.
width
-
toolBarMessageCloseButton
.
width
width
:
toolBarMessageArea
.
width
-
toolBarMessageCloseButton
.
width
wrapMode
:
Text
.
WordWrap
wrapMode
:
Text
.
WordWrap
color
:
qgcPal
.
warningText
color
:
"
#e4e428
"
lineHeightMode
:
Text
.
ProportionalHeight
lineHeightMode
:
Text
.
ProportionalHeight
lineHeight
:
1.15
lineHeight
:
1.15
anchors.margins
:
mainWindow
.
tbSpacing
anchors.margins
:
mainWindow
.
tbSpacing
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment