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
9ceca7fe
Commit
9ceca7fe
authored
Apr 05, 2016
by
Nate Weibley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move messages into preferences panel and refactor into AppMessages control
parent
e0a68ab0
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
35 additions
and
33 deletions
+35
-33
qgroundcontrol.pro
qgroundcontrol.pro
+5
-5
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-1
QGCApplication.cc
src/QGCApplication.cc
+2
-0
AppMessages.cc
src/QmlControls/AppMessages.cc
+5
-11
AppMessages.h
src/QmlControls/AppMessages.h
+2
-6
AppMessages.qml
src/QmlControls/AppMessages.qml
+0
-0
QGroundControl.Controls.qmldir
src/QmlControls/QGroundControl.Controls.qmldir
+1
-0
main.cc
src/main.cc
+2
-2
MainWindow.cc
src/ui/MainWindow.cc
+4
-8
MainWindowLeftPanel.qml
src/ui/MainWindowLeftPanel.qml
+13
-0
No files found.
qgroundcontrol.pro
View file @
9ceca7fe
...
...
@@ -282,6 +282,7 @@ HEADERS += \
src
/
QGCQuickWidget
.
h
\
src
/
QGCTemporaryFile
.
h
\
src
/
QGCToolbox
.
h
\
src
/
QmlControls
/
AppMessages
.
h
\
src
/
QmlControls
/
CoordinateVector
.
h
\
src
/
QmlControls
/
MavlinkQmlSingleton
.
h
\
src
/
QmlControls
/
ParameterEditorController
.
h
\
...
...
@@ -297,7 +298,7 @@ HEADERS += \
src
/
AutoPilotPlugins
/
APM
/
APMAirframeLoader
.
h
\
src
/
QmlControls
/
QGCImageProvider
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMRemoteParamsDownloader
.
h
\
src
/
QtLocationPlugin
/
QMLControl
/
QGCMapEngineManager
.
h
src
/
QtLocationPlugin
/
QMLControl
/
QGCMapEngineManager
.
h
\
DebugBuild
{
HEADERS
+=
\
...
...
@@ -370,7 +371,6 @@ HEADERS += \
src
/
ViewWidgets
/
LogDownload
.
h
\
src
/
ViewWidgets
/
LogDownloadController
.
h
\
src
/
ViewWidgets
/
ViewWidgetController
.
h
\
src
/
ViewWidgets
/
AppMessagesDialog
.
h
}
iOSBuild
{
...
...
@@ -424,6 +424,7 @@ SOURCES += \
src
/
QGCTemporaryFile
.
cc
\
src
/
QGCToolbox
.
cc
\
src
/
QGCGeo
.
cc
\
src
/
QmlControls
/
AppMessages
.
cc
\
src
/
QmlControls
/
CoordinateVector
.
cc
\
src
/
QmlControls
/
ParameterEditorController
.
cc
\
src
/
QmlControls
/
ScreenToolsController
.
cc
\
...
...
@@ -437,7 +438,7 @@ SOURCES += \
src
/
AutoPilotPlugins
/
APM
/
APMAirframeLoader
.
cc
\
src
/
QmlControls
/
QGCImageProvider
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMRemoteParamsDownloader
.
cc
\
src
/
QtLocationPlugin
/
QMLControl
/
QGCMapEngineManager
.
cc
src
/
QtLocationPlugin
/
QMLControl
/
QGCMapEngineManager
.
cc
\
DebugBuild
{
SOURCES
+=
\
...
...
@@ -502,8 +503,7 @@ SOURCES += \
src
/
ViewWidgets
/
CustomCommandWidgetController
.
cc
\
src
/
ViewWidgets
/
LogDownload
.
cc
\
src
/
ViewWidgets
/
LogDownloadController
.
cc
\
src
/
ViewWidgets
/
ViewWidgetController
.
cc
\
src
/
ViewWidgets
/
AppMessagesDialog
.
cc
src
/
ViewWidgets
/
ViewWidgetController
.
cc
}
#
...
...
qgroundcontrol.qrc
View file @
9ceca7fe
...
...
@@ -12,7 +12,6 @@
<file alias="APMAirframeComponentSummary.qml">src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml</file>
<file alias="CustomCommandWidget.qml">src/ViewWidgets/CustomCommandWidget.qml</file>
<file alias="LogDownload.qml">src/ViewWidgets/LogDownload.qml</file>
<file alias="AppMessagesDialog.qml">src/ViewWidgets/AppMessagesDialog.qml</file>
<file alias="FirmwareUpgrade.qml">src/VehicleSetup/FirmwareUpgrade.qml</file>
<file alias="FlightDisplayView.qml">src/FlightDisplay/FlightDisplayView.qml</file>
<file alias="PX4FlightModes.qml">src/AutoPilotPlugins/PX4/PX4FlightModes.qml</file>
...
...
@@ -86,6 +85,7 @@
<file alias="QGroundControl/Controls/SubMenuButton.qml">src/QmlControls/SubMenuButton.qml</file>
<file alias="QGroundControl/Controls/VehicleRotationCal.qml">src/QmlControls/VehicleRotationCal.qml</file>
<file alias="QGroundControl/Controls/VehicleSummaryRow.qml">src/QmlControls/VehicleSummaryRow.qml</file>
<file alias="QGroundControl/Controls/AppMessages.qml">src/QmlControls/AppMessages.qml</file>
<file alias="QGroundControl/Controls/ViewWidget.qml">src/ViewWidgets/ViewWidget.qml</file>
<file alias="SimpleItemEditor.qml">src/MissionEditor/SimpleItemEditor.qml</file>
...
...
src/QGCApplication.cc
View file @
9ceca7fe
...
...
@@ -100,6 +100,7 @@
#include "LogDownloadController.h"
#include "PX4AirframeLoader.h"
#include "ValuesWidgetController.h"
#include "AppMessages.h"
#ifndef __ios__
#include "SerialLink.h"
...
...
@@ -484,6 +485,7 @@ bool QGCApplication::_initForNormalAppBoot(void)
_qmlAppEngine
=
new
QQmlApplicationEngine
(
this
);
_qmlAppEngine
->
addImportPath
(
"qrc:/qml"
);
_qmlAppEngine
->
rootContext
()
->
setContextProperty
(
"joystickManager"
,
toolbox
()
->
joystickManager
());
_qmlAppEngine
->
rootContext
()
->
setContextProperty
(
"debugMessageModel"
,
&
AppMessages
::
getModel
());
_qmlAppEngine
->
load
(
QUrl
(
QStringLiteral
(
"qrc:/qml/MainWindowNative.qml"
)));
#else
// Start the user interface
...
...
src/
ViewWidgets/AppMessagesDialog
.cc
→
src/
QmlControls/AppMessages
.cc
View file @
9ceca7fe
...
...
@@ -21,7 +21,7 @@ This file is part of the QGROUNDCONTROL project
======================================================================*/
#include "AppMessages
Dialog
.h"
#include "AppMessages.h"
#include <QStringListModel>
#include <iostream>
...
...
@@ -46,18 +46,12 @@ static void msgHandler(QtMsgType type, const QMessageLogContext &context, const
if
(
type
==
QtFatalMsg
)
abort
();
}
AppMessagesDialog
::
AppMessagesDialog
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
)
:
QGCQmlWidgetHolder
(
title
,
action
,
parent
)
void
AppMessages
::
installHandler
()
{
resize
(
800
,
600
);
setContextPropertyObject
(
"debugMessageModel"
,
&
debug_strings
);
setSource
(
QUrl
::
fromUserInput
(
"qrc:/qml/AppMessagesDialog.qml"
));
loadSettings
();
old_handler
=
qInstallMessageHandler
(
msgHandler
);
}
void
AppMessagesDialog
::
installHandler
()
QStringListModel
&
AppMessages
::
getModel
()
{
old_handler
=
qInstallMessageHandler
(
msgHandler
)
;
return
debug_strings
;
}
src/
ViewWidgets/AppMessagesDialog
.h
→
src/
QmlControls/AppMessages
.h
View file @
9ceca7fe
...
...
@@ -23,15 +23,11 @@ This file is part of the QGROUNDCONTROL project
#pragma once
#include "QGCQmlWidgetHolder.h"
class
QStringListModel
;
class
AppMessages
Dialog
:
public
QGCQmlWidgetHolder
class
AppMessages
{
Q_OBJECT
public:
AppMessagesDialog
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
=
0
);
static
void
installHandler
();
static
QStringListModel
&
getModel
();
};
src/
ViewWidgets/AppMessagesDialog
.qml
→
src/
QmlControls/AppMessages
.qml
View file @
9ceca7fe
File moved
src/QmlControls/QGroundControl.Controls.qmldir
View file @
9ceca7fe
Module QGroundControl.Controls
AppMessages 1.0 AppMessages.qml
ClickableColor 1.0 ClickableColor.qml
DropButton 1.0 DropButton.qml
ExclusiveGroupItem 1.0 ExclusiveGroupItem.qml
...
...
src/main.cc
View file @
9ceca7fe
...
...
@@ -42,7 +42,7 @@ This file is part of the QGROUNDCONTROL project
#ifndef __mobile__
#include "QGCSerialPortInfo.h"
#include "AppMessages
Dialog
.h"
#include "AppMessages.h"
#endif
#ifdef QT_DEBUG
...
...
@@ -117,7 +117,7 @@ int main(int argc, char *argv[])
#ifndef __mobile__
// install the message handler
AppMessages
Dialog
::
installHandler
();
AppMessages
::
installHandler
();
//-- Test for another instance already running. If that's the case, we simply exit.
QHostAddress
host
(
"127.0.0.1"
);
...
...
src/ui/MainWindow.cc
View file @
9ceca7fe
...
...
@@ -66,7 +66,7 @@ This file is part of the QGROUNDCONTROL project
#include "UASInfoWidget.h"
#include "HILDockWidget.h"
#include "LogDownload.h"
#include "AppMessages
Dialog
.h"
#include "AppMessages.h"
#endif
#ifndef __ios__
...
...
@@ -89,8 +89,7 @@ enum DockWidgetTypes {
INFO_VIEW
,
HIL_CONFIG
,
ANALYZE
,
LOG_DOWNLOAD
,
DEBUG_MESSAGES
LOG_DOWNLOAD
};
static
const
char
*
rgDockWidgetNames
[]
=
{
...
...
@@ -101,8 +100,7 @@ static const char *rgDockWidgetNames[] = {
"Info View"
,
"HIL Config"
,
"Analyze"
,
"Log Download"
,
"Debug Messages"
"Log Download"
};
#define ARRAY_SIZE(ARRAY) (sizeof(ARRAY) / sizeof(ARRAY[0]))
...
...
@@ -167,6 +165,7 @@ MainWindow::MainWindow()
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
_mainQmlWidgetHolder
->
setContextPropertyObject
(
"controller"
,
this
);
_mainQmlWidgetHolder
->
setContextPropertyObject
(
"debugMessageModel"
,
&
AppMessages
::
getModel
());
_mainQmlWidgetHolder
->
setSource
(
QUrl
::
fromUserInput
(
"qrc:qml/MainWindowHybrid.qml"
));
// Image provider
...
...
@@ -355,9 +354,6 @@ bool MainWindow::_createInnerDockWidget(const QString& widgetName)
case
LOG_DOWNLOAD
:
widget
=
new
LogDownload
(
widgetName
,
action
,
this
);
break
;
case
DEBUG_MESSAGES
:
widget
=
new
AppMessagesDialog
(
widgetName
,
action
,
this
);
break
;
case
STATUS_DETAILS
:
widget
=
new
UASInfoWidget
(
widgetName
,
action
,
this
);
break
;
...
...
src/ui/MainWindowLeftPanel.qml
View file @
9ceca7fe
...
...
@@ -213,6 +213,19 @@ Item {
}
}
QGCButton
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
text
:
"
Console
"
exclusiveGroup
:
panelActionGroup
onClicked
:
{
if
(
__rightPanel
.
source
!=
"
QGroundControl/Controls/AppMessages.qml
"
)
{
__rightPanel
.
source
=
"
QGroundControl/Controls/AppMessages.qml
"
}
checked
=
true
}
}
QGCButton
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
...
...
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