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
2e4d3888
Commit
2e4d3888
authored
Feb 19, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of View menu
parent
760255d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
94 deletions
+2
-94
MainWindow.cc
src/ui/MainWindow.cc
+0
-30
MainWindow.h
src/ui/MainWindow.h
+0
-10
MainWindow.ui
src/ui/MainWindow.ui
+2
-54
No files found.
src/ui/MainWindow.cc
View file @
2e4d3888
...
...
@@ -245,19 +245,6 @@ MainWindow::MainWindow()
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
#ifdef __macos__
_ui
.
actionSetup
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+1"
,
0
));
_ui
.
actionPlan
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+2"
,
0
));
_ui
.
actionFlight
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+3"
,
0
));
#else
_ui
.
actionSetup
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+1"
,
0
));
_ui
.
actionPlan
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+2"
,
0
));
_ui
.
actionFlight
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+3"
,
0
));
#endif
_ui
.
actionFlight
->
setChecked
(
true
);
connect
(
&
windowNameUpdateTimer
,
&
QTimer
::
timeout
,
this
,
&
MainWindow
::
configureWindowName
);
windowNameUpdateTimer
.
start
(
15000
);
emit
initStatusChanged
(
tr
(
"Done"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
...
...
@@ -503,27 +490,10 @@ void MainWindow::connectCommonActions()
// Application Settings
connect
(
_ui
.
actionSettings
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
showSettings
);
// Views actions
connect
(
_ui
.
actionFlight
,
&
QAction
::
triggered
,
qgcApp
(),
&
QGCApplication
::
showFlyView
);
connect
(
_ui
.
actionPlan
,
&
QAction
::
triggered
,
qgcApp
(),
&
QGCApplication
::
showPlanView
);
connect
(
_ui
.
actionSetup
,
&
QAction
::
triggered
,
qgcApp
(),
&
QGCApplication
::
showSetupView
);
connect
(
_ui
.
actionFlight
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
handleActiveViewActionState
);
connect
(
_ui
.
actionPlan
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
handleActiveViewActionState
);
connect
(
_ui
.
actionSetup
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
handleActiveViewActionState
);
// Connect internal actions
connect
(
qgcApp
()
->
toolbox
()
->
multiVehicleManager
(),
&
MultiVehicleManager
::
vehicleAdded
,
this
,
&
MainWindow
::
_vehicleAdded
);
}
void
MainWindow
::
handleActiveViewActionState
(
bool
triggered
)
{
Q_UNUSED
(
triggered
);
QAction
*
triggeredAction
=
qobject_cast
<
QAction
*>
(
sender
());
_ui
.
actionFlight
->
setChecked
(
triggeredAction
==
_ui
.
actionFlight
);
_ui
.
actionPlan
->
setChecked
(
triggeredAction
==
_ui
.
actionPlan
);
_ui
.
actionSetup
->
setChecked
(
triggeredAction
==
_ui
.
actionSetup
);
}
void
MainWindow
::
_openUrl
(
const
QString
&
url
,
const
QString
&
errorMessage
)
{
if
(
!
QDesktopServices
::
openUrl
(
QUrl
(
url
)))
{
...
...
src/ui/MainWindow.h
View file @
2e4d3888
...
...
@@ -120,16 +120,6 @@ protected slots:
*/
void
showStatusBarCallback
(
bool
checked
);
/**
* @brief Disable the other QActions that trigger view mode changes
*
* When a user hits Ctrl+1, Ctrl+2, Ctrl+3 - only one view is set to active
* (and in the QML file for the MainWindow the others are set to have
* visibility = false), but on the Menu all of them would be selected making
* this incoherent.
*/
void
handleActiveViewActionState
(
bool
triggered
);
signals:
void
initStatusChanged
(
const
QString
&
message
,
int
alignment
,
const
QColor
&
color
);
/** Emitted when any value changes from any source */
...
...
src/ui/MainWindow.ui
View file @
2e4d3888
...
...
@@ -51,7 +51,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
1024
</width>
<height>
2
1
</height>
<height>
2
2
</height>
</rect>
</property>
<widget
class=
"QMenu"
name=
"menuMGround"
>
...
...
@@ -60,6 +60,7 @@
</property>
<addaction
name=
"separator"
/>
<addaction
name=
"actionMuteAudioOutput"
/>
<addaction
name=
"actionStatusBar"
/>
<addaction
name=
"actionSettings"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionExit"
/>
...
...
@@ -72,24 +73,12 @@
<addaction
name=
"actionProject_Roadmap"
/>
<addaction
name=
"actionDeveloper_Credits"
/>
</widget>
<widget
class=
"QMenu"
name=
"menuPerspectives"
>
<property
name=
"title"
>
<string>
View
</string>
</property>
<addaction
name=
"actionSetup"
/>
<addaction
name=
"actionPlan"
/>
<addaction
name=
"actionFlight"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionStatusBar"
/>
</widget>
<widget
class=
"QMenu"
name=
"menuWidgets"
>
<property
name=
"title"
>
<string>
Widgets
</string>
</property>
</widget>
<addaction
name=
"menuMGround"
/>
<addaction
name=
"menuPerspectives"
/>
<addaction
name=
"menuWidgets"
/>
<addaction
name=
"menuHelp"
/>
</widget>
...
...
@@ -122,22 +111,6 @@
<string>
Developer Credits
</string>
</property>
</action>
<action
name=
"actionPlan"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
Plan
</string>
</property>
</action>
<action
name=
"actionFlight"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
Fly
</string>
</property>
</action>
<action
name=
"actionMuteAudioOutput"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
...
...
@@ -157,20 +130,6 @@
<enum>
QAction::PreferencesRole
</enum>
</property>
</action>
<action
name=
"actionSetup"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
Setup
</string>
</property>
<property
name=
"toolTip"
>
<string>
Setup of the vehicle
</string>
</property>
<property
name=
"menuRole"
>
<enum>
QAction::NoRole
</enum>
</property>
</action>
<action
name=
"actionAdvanced_Mode"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
...
...
@@ -187,17 +146,6 @@
<string>
Show Status Bar
</string>
</property>
</action>
<action
name=
"actionMissionEditor"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
New Mission Editor
</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