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