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
c990e079
Commit
c990e079
authored
Dec 06, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2363 from DonLakeFlyer/MoreMessage
More message box removal
parents
4105a169
549000eb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
36 deletions
+37
-36
RadioComponentController.cc
src/AutoPilotPlugins/Common/RadioComponentController.cc
+1
-1
ParameterLoader.cc
src/FactSystem/ParameterLoader.cc
+2
-11
QGCApplication.cc
src/QGCApplication.cc
+3
-8
QGCQuickWidget.cc
src/QGCQuickWidget.cc
+1
-1
MainWindow.cc
src/ui/MainWindow.cc
+10
-14
MainWindow.h
src/ui/MainWindow.h
+5
-0
MainWindow.qml
src/ui/MainWindow.qml
+15
-1
No files found.
src/AutoPilotPlugins/Common/RadioComponentController.cc
View file @
c990e079
...
...
@@ -26,8 +26,8 @@
/// @author Don Gagne <don@thegagnes.com
#include "RadioComponentController.h"
#include "QGCMessageBox.h"
#include "AutoPilotPluginManager.h"
#include "QGCApplication.h"
#include <QSettings>
...
...
src/FactSystem/ParameterLoader.cc
View file @
c990e079
...
...
@@ -657,7 +657,6 @@ void ParameterLoader::_saveToEEPROM(void)
QString
ParameterLoader
::
readParametersFromStream
(
QTextStream
&
stream
)
{
QString
errors
;
bool
userWarned
=
false
;
while
(
!
stream
.
atEnd
())
{
QString
line
=
stream
.
readLine
();
...
...
@@ -665,16 +664,8 @@ QString ParameterLoader::readParametersFromStream(QTextStream& stream)
QStringList
wpParams
=
line
.
split
(
"
\t
"
);
int
lineMavId
=
wpParams
.
at
(
0
).
toInt
();
if
(
wpParams
.
size
()
==
5
)
{
if
(
!
userWarned
&&
(
_vehicle
->
id
()
!=
lineMavId
))
{
userWarned
=
true
;
QString
msg
(
"The parameters in the stream have been saved from System Id %1, but the current vehicle has the System Id %2."
);
QGCMessageBox
::
StandardButton
button
=
QGCMessageBox
::
warning
(
"Parameter Load"
,
msg
.
arg
(
lineMavId
).
arg
(
_vehicle
->
id
()),
QGCMessageBox
::
Ok
|
QGCMessageBox
::
Cancel
,
QGCMessageBox
::
Cancel
);
if
(
button
==
QGCMessageBox
::
Cancel
)
{
return
QString
();
}
if
(
_vehicle
->
id
()
!=
lineMavId
)
{
return
QString
(
"The parameters in the stream have been saved from System Id %1, but the current vehicle has the System Id %2."
).
arg
(
lineMavId
).
arg
(
_vehicle
->
id
());
}
int
componentId
=
wpParams
.
at
(
1
).
toInt
();
...
...
src/QGCApplication.cc
View file @
c990e079
...
...
@@ -455,9 +455,7 @@ bool QGCApplication::_initForNormalAppBoot(void)
/// settings.
QString
savedFilesLocation
=
settings
.
value
(
_savedFilesLocationKey
).
toString
();
if
(
savedFilesLocation
.
isEmpty
())
{
QGCMessageBox
::
warning
(
tr
(
"Bad save location"
),
tr
(
"The location to save files to is invalid, or cannot be written to. Please provide a new one."
));
showMessage
(
"The location to save files to is invalid, or cannot be written to. Please provide a new one."
);
mainWindow
->
showSettings
();
}
...
...
@@ -705,10 +703,7 @@ void QGCApplication::_missingParamsDisplay(void)
}
_missingParams
.
clear
();
QGCMessageBox
::
critical
(
"Missing Parameters"
,
QString
(
"Parameters missing from firmware: %1.
\n\n
"
"You should quit QGroundControl immediately and update your firmware."
).
arg
(
params
));
showMessage
(
QString
(
"Parameters missing from firmware: %1.
\n\n
You should quit QGroundControl immediately and update your firmware."
).
arg
(
params
));
}
void
QGCApplication
::
showMessage
(
const
QString
&
message
)
...
...
@@ -717,6 +712,6 @@ void QGCApplication::showMessage(const QString& message)
if
(
mainWindow
)
{
mainWindow
->
showToolbarMessage
(
message
);
}
else
{
QGCMessageBox
::
information
(
""
,
message
)
;
qWarning
()
<<
"showMessage with no mainWindow"
<<
message
;
}
}
src/QGCQuickWidget.cc
View file @
c990e079
...
...
@@ -60,7 +60,7 @@ bool QGCQuickWidget::setSource(const QUrl& qmlUrl)
errorList
+=
error
.
toString
();
errorList
+=
"
\n
"
;
}
QGCMessageBox
::
warning
(
tr
(
"Qml Error"
),
tr
(
"Source not ready: Status(%1)
\n
Errors:
\n
%2"
).
arg
(
status
()).
arg
(
errorList
));
qgcApp
()
->
showMessage
(
QString
(
"Source not ready: Status(%1)
\n
Errors:
\n
%2"
).
arg
(
status
()).
arg
(
errorList
));
return
false
;
}
...
...
src/ui/MainWindow.cc
View file @
c990e079
...
...
@@ -425,24 +425,20 @@ void MainWindow::showStatusBarCallback(bool checked)
checked
?
statusBar
()
->
show
()
:
statusBar
()
->
hide
();
}
void
MainWindow
::
acceptWindowClose
(
void
)
{
qgcApp
()
->
toolbox
()
->
linkManager
()
->
shutdown
();
// The above shutdown causes a flurry of activity as the vehicle components are removed. This in turn
// causes the Windows Version of Qt to crash if you allow the close event to be accepted. In order to prevent
// the crash, we ignore the close event and setup a delayed timer to close the window after things settle down.
QTimer
::
singleShot
(
1500
,
this
,
&
MainWindow
::
_closeWindow
);
}
void
MainWindow
::
closeEvent
(
QCloseEvent
*
event
)
{
// Disallow window close if there are active connections
if
(
qgcApp
()
->
toolbox
()
->
multiVehicleManager
()
->
vehicles
()
->
count
())
{
QGCMessageBox
::
StandardButton
button
=
QGCMessageBox
::
warning
(
tr
(
"QGroundControl close"
),
tr
(
"There are still active connections to vehicles. Do you want to disconnect these before closing?"
),
QMessageBox
::
Yes
|
QMessageBox
::
Cancel
,
QMessageBox
::
Cancel
);
if
(
button
==
QMessageBox
::
Yes
)
{
qgcApp
()
->
toolbox
()
->
linkManager
()
->
shutdown
();
// The above disconnect causes a flurry of activity as the vehicle components are removed. This in turn
// causes the Windows Version of Qt to crash if you allow the close event to be accepted. In order to prevent
// the crash, we ignore the close event and setup a delayed timer to close the window after things settle down.
QTimer
::
singleShot
(
1500
,
this
,
&
MainWindow
::
_closeWindow
);
}
emit
showWindowCloseMessage
();
event
->
ignore
();
return
;
}
...
...
src/ui/MainWindow.h
View file @
c990e079
...
...
@@ -91,6 +91,9 @@ public:
/// @brief Saves the last used connection
void
saveLastUsedConnection
(
const
QString
connection
);
// Called from MainWindow.qml when the user accepts the window close dialog
Q_INVOKABLE
void
acceptWindowClose
(
void
);
public
slots
:
/** @brief Show the application settings */
void
showSettings
();
...
...
@@ -132,6 +135,7 @@ protected slots:
* this incoherent.
*/
void
handleActiveViewActionState
(
bool
triggered
);
signals:
// Signals the Qml to show the specified view
void
showFlyView
(
void
);
...
...
@@ -139,6 +143,7 @@ signals:
void
showSetupView
(
void
);
void
showToolbarMessage
(
const
QString
&
message
);
void
showWindowCloseMessage
(
void
);
// These are used for unit testing
void
showSetupFirmware
(
void
);
...
...
src/ui/MainWindow.qml
View file @
c990e079
...
...
@@ -23,6 +23,7 @@ along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
import
QtQuick
2.5
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Dialogs
1.2
import
QtPositioning
5.2
import
QGroundControl
1.0
...
...
@@ -95,6 +96,8 @@ Item {
onShowToolbarMessage
:
toolBar
.
showToolbarMessage
(
message
)
onShowWindowCloseMessage
:
windowCloseDialog
.
open
()
// The following are use for unit testing only
onShowSetupFirmware
:
setupViewLoader
.
item
.
showFirmwarePanel
()
...
...
@@ -173,13 +176,24 @@ Item {
function
showPopUp
(
dropItem
,
centerX
)
{
if
(
currentPopUp
)
{
currentPopUp
.
close
()
}
}
indicatorDropdown
.
centerX
=
centerX
indicatorDropdown
.
sourceComponent
=
dropItem
indicatorDropdown
.
visible
=
true
currentPopUp
=
indicatorDropdown
}
MessageDialog
{
id
:
windowCloseDialog
title
:
"
QGroundControl close
"
text
:
"
There are still active connections to vehicles. Do you want to disconnect these before closing?
"
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
Cancel
modality
:
Qt
.
ApplicationModal
visible
:
false
onYes
:
controller
.
acceptWindowClose
()
}
//-- Left Settings Menu
Loader
{
id
:
leftPanel
...
...
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