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
7a25f8f6
Commit
7a25f8f6
authored
Sep 08, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add switch for using old/new mission editor
parent
748f1dd9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
27 deletions
+56
-27
QGCApplication.cc
src/QGCApplication.cc
+12
-0
QGCApplication.h
src/QGCApplication.h
+5
-0
MainWindow.cc
src/ui/MainWindow.cc
+25
-25
MainWindow.h
src/ui/MainWindow.h
+2
-1
MainWindow.ui
src/ui/MainWindow.ui
+12
-1
No files found.
src/QGCApplication.cc
View file @
7a25f8f6
...
...
@@ -158,6 +158,7 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
,
_runningUnitTests
(
unitTesting
)
,
_styleIsDark
(
true
)
,
_fakeMobile
(
false
)
,
_useNewMissionEditor
(
false
)
{
Q_ASSERT
(
_app
==
NULL
);
_app
=
this
;
...
...
@@ -419,6 +420,9 @@ bool QGCApplication::_initForNormalAppBoot(void)
_styleIsDark
=
settings
.
value
(
_styleKey
,
_styleIsDark
).
toBool
();
_loadCurrentStyle
();
// Temp hack for new mission editor
_useNewMissionEditor
=
settings
.
value
(
"UseNewMissionEditor"
,
false
).
toBool
();
// Show splash screen
QPixmap
splashImage
(
":/res/SplashScreen"
);
QSplashScreen
*
splashScreen
=
new
QSplashScreen
(
splashImage
);
...
...
@@ -801,3 +805,11 @@ void QGCApplication::showToolBarMessage(const QString& message)
QGCMessageBox
::
information
(
""
,
message
);
}
}
void
QGCApplication
::
setUseNewMissionEditor
(
bool
use
)
{
// Temp hack for new mission editor
QSettings
settings
;
settings
.
setValue
(
"UseNewMissionEditor"
,
use
);
}
src/QGCApplication.h
View file @
7a25f8f6
...
...
@@ -106,6 +106,9 @@ public:
/// @return true: Fake ui into showing mobile interface
bool
fakeMobile
(
void
)
{
return
_fakeMobile
;
}
bool
useNewMissionEditor
(
void
)
{
return
_useNewMissionEditor
;
}
void
setUseNewMissionEditor
(
bool
use
);
public
slots
:
/// You can connect to this slot to show an information message box from a different thread.
void
informationMessageBoxOnMainThread
(
const
QString
&
title
,
const
QString
&
msg
);
...
...
@@ -175,6 +178,8 @@ private:
bool
_fakeMobile
;
///< true: Fake ui into displaying mobile interface
bool
_useNewMissionEditor
;
///< true: Use new Mission Editor
/// Unit Test have access to creating and destroying singletons
friend
class
UnitTest
;
};
...
...
src/ui/MainWindow.cc
View file @
7a25f8f6
...
...
@@ -709,7 +709,6 @@ void MainWindow::connectCommonActions()
perspectives
->
addAction
(
_ui
.
actionFlight
);
perspectives
->
addAction
(
_ui
.
actionSimulationView
);
perspectives
->
addAction
(
_ui
.
actionPlan
);
perspectives
->
addAction
(
_ui
.
actionMissionEditor
);
perspectives
->
addAction
(
_ui
.
actionSetup
);
perspectives
->
setExclusive
(
true
);
...
...
@@ -729,16 +728,11 @@ void MainWindow::connectCommonActions()
_ui
.
actionSimulationView
->
setChecked
(
true
);
_ui
.
actionSimulationView
->
activate
(
QAction
::
Trigger
);
}
if
(
_currentView
==
VIEW_PLAN
)
if
(
_currentView
==
VIEW_PLAN
||
_currentView
==
VIEW_MISSIONEDITOR
)
{
_ui
.
actionPlan
->
setChecked
(
true
);
_ui
.
actionPlan
->
activate
(
QAction
::
Trigger
);
}
if
(
_currentView
==
VIEW_MISSIONEDITOR
)
{
_ui
.
actionMissionEditor
->
setChecked
(
true
);
_ui
.
actionMissionEditor
->
activate
(
QAction
::
Trigger
);
}
if
(
_currentView
==
VIEW_SETUP
)
{
_ui
.
actionSetup
->
setChecked
(
true
);
...
...
@@ -757,7 +751,9 @@ void MainWindow::connectCommonActions()
connect
(
_ui
.
actionSimulationView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSimulationView
()));
connect
(
_ui
.
actionAnalyze
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadAnalyzeView
()));
connect
(
_ui
.
actionPlan
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadPlanView
()));
connect
(
_ui
.
actionMissionEditor
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadMissionEditorView
()));
_ui
.
actionUseMissionEditor
->
setChecked
(
qgcApp
()
->
useNewMissionEditor
());
connect
(
_ui
.
actionUseMissionEditor
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
_setUseMissionEditor
);
// Help Actions
connect
(
_ui
.
actionOnline_Documentation
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
showHelp
()));
...
...
@@ -1005,23 +1001,22 @@ void MainWindow::loadAnalyzeView()
void
MainWindow
::
loadPlanView
()
{
if
(
_currentView
!=
VIEW_PLAN
)
{
_storeCurrentViewState
();
_currentView
=
VIEW_PLAN
;
_ui
.
actionPlan
->
setChecked
(
true
);
_loadCurrentViewState
();
}
}
void
MainWindow
::
loadMissionEditorView
()
{
if
(
_currentView
!=
VIEW_MISSIONEDITOR
)
{
_storeCurrentViewState
();
_currentView
=
VIEW_MISSIONEDITOR
;
_ui
.
actionMissionEditor
->
setChecked
(
true
);
_loadCurrentViewState
();
if
(
qgcApp
()
->
useNewMissionEditor
())
{
if
(
_currentView
!=
VIEW_MISSIONEDITOR
)
{
_storeCurrentViewState
();
_currentView
=
VIEW_MISSIONEDITOR
;
_ui
.
actionPlan
->
setChecked
(
true
);
_loadCurrentViewState
();
}
}
else
{
if
(
_currentView
!=
VIEW_PLAN
)
{
_storeCurrentViewState
();
_currentView
=
VIEW_PLAN
;
_ui
.
actionPlan
->
setChecked
(
true
);
_loadCurrentViewState
();
}
}
}
...
...
@@ -1118,3 +1113,8 @@ void MainWindow::_showQmlTestWidget(void)
new
QmlTestWidget
();
}
#endif
void
MainWindow
::
_setUseMissionEditor
(
bool
checked
)
{
qgcApp
()
->
setUseNewMissionEditor
(
checked
);
}
src/ui/MainWindow.h
View file @
7a25f8f6
...
...
@@ -135,7 +135,6 @@ public slots:
void
loadSimulationView
();
void
loadAnalyzeView
();
void
loadPlanView
();
void
loadMissionEditorView
();
void
manageLinks
();
...
...
@@ -176,6 +175,8 @@ protected slots:
* @brief Enable/Disable Status Bar
*/
void
showStatusBarCallback
(
bool
checked
);
void
_setUseMissionEditor
(
bool
checked
);
signals:
void
initStatusChanged
(
const
QString
&
message
,
int
alignment
,
const
QColor
&
color
);
...
...
src/ui/MainWindow.ui
View file @
7a25f8f6
...
...
@@ -62,6 +62,7 @@
<addaction
name=
"actionMuteAudioOutput"
/>
<addaction
name=
"actionAdd_Link"
/>
<addaction
name=
"actionSettings"
/>
<addaction
name=
"actionUseMissionEditor"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionExit"
/>
</widget>
...
...
@@ -79,7 +80,6 @@
</property>
<addaction
name=
"actionSetup"
/>
<addaction
name=
"actionPlan"
/>
<addaction
name=
"actionMissionEditor"
/>
<addaction
name=
"actionFlight"
/>
<addaction
name=
"actionAnalyze"
/>
<addaction
name=
"separator"
/>
...
...
@@ -254,6 +254,17 @@
<string>
Mission Editor
</string>
</property>
</action>
<action
name=
"actionUseMissionEditor"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
Use new mission editor (reboot required)
</string>
</property>
<property
name=
"toolTip"
>
<string>
Mission Editor
</string>
</property>
</action>
</widget>
<layoutdefault
spacing=
"6"
margin=
"11"
/>
<resources>
...
...
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