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
146f52ce
Commit
146f52ce
authored
Apr 05, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1420 from dogmaphobic/statusBar
Status bar
parents
8ffcd8b1
ccb8bf62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
7 deletions
+35
-7
MainWindow.cc
src/ui/MainWindow.cc
+17
-4
MainWindow.h
src/ui/MainWindow.h
+7
-2
MainWindow.ui
src/ui/MainWindow.ui
+11
-1
No files found.
src/ui/MainWindow.cc
View file @
146f52ce
...
...
@@ -126,6 +126,7 @@ void MainWindow::deleteInstance(void)
MainWindow
::
MainWindow
(
QSplashScreen
*
splashScreen
)
:
_autoReconnect
(
false
)
,
_lowPowerMode
(
false
)
,
_showStatusBar
(
false
)
,
_centerStackActionGroup
(
new
QActionGroup
(
this
))
,
_simulationLink
(
NULL
)
,
_centralLayout
(
NULL
)
...
...
@@ -255,8 +256,9 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
}
// And that they will stay checked properly after user input
QObject
::
connect
(
_ui
.
actionFullscreen
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
fullScreenActionItemCallback
()));
QObject
::
connect
(
_ui
.
actionNormal
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
normalActionItemCallback
()));
connect
(
_ui
.
actionFullscreen
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
fullScreenActionItemCallback
);
connect
(
_ui
.
actionNormal
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
normalActionItemCallback
);
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 Q_OS_MACX
...
...
@@ -284,6 +286,8 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
emit
initStatusChanged
(
tr
(
"Done"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
if
(
!
qgcApp
()
->
runningUnitTests
())
{
_ui
.
actionStatusBar
->
setChecked
(
_showStatusBar
);
showStatusBarCallback
(
_showStatusBar
);
show
();
#ifdef Q_OS_MAC
// TODO HACK
...
...
@@ -624,16 +628,23 @@ void MainWindow::_showHILConfigurationWidgets(void)
}
}
void
MainWindow
::
fullScreenActionItemCallback
()
void
MainWindow
::
fullScreenActionItemCallback
(
bool
)
{
_ui
.
actionNormal
->
setChecked
(
false
);
}
void
MainWindow
::
normalActionItemCallback
()
void
MainWindow
::
normalActionItemCallback
(
bool
)
{
_ui
.
actionFullscreen
->
setChecked
(
false
);
}
void
MainWindow
::
showStatusBarCallback
(
bool
checked
)
{
_showStatusBar
=
checked
;
checked
?
statusBar
()
->
show
()
:
statusBar
()
->
hide
();
_ui
.
actionStatusBar
->
setText
(
checked
?
"Hide Status Bar"
:
"Show Status Bar"
);
}
void
MainWindow
::
closeEvent
(
QCloseEvent
*
event
)
{
// Disallow window close if there are active connections
...
...
@@ -710,6 +721,7 @@ void MainWindow::loadSettings()
settings
.
beginGroup
(
MAIN_SETTINGS_GROUP
);
_autoReconnect
=
settings
.
value
(
"AUTO_RECONNECT"
,
_autoReconnect
).
toBool
();
_lowPowerMode
=
settings
.
value
(
"LOW_POWER_MODE"
,
_lowPowerMode
).
toBool
();
_showStatusBar
=
settings
.
value
(
"SHOW_STATUSBAR"
,
_showStatusBar
).
toBool
();
settings
.
endGroup
();
// Select the proper view. Default to the flight view or load the last one used if it's supported.
VIEW_SECTIONS
currentViewCandidate
=
(
VIEW_SECTIONS
)
settings
.
value
(
"CURRENT_VIEW"
,
_currentView
).
toInt
();
...
...
@@ -739,6 +751,7 @@ void MainWindow::storeSettings()
settings
.
beginGroup
(
MAIN_SETTINGS_GROUP
);
settings
.
setValue
(
"AUTO_RECONNECT"
,
_autoReconnect
);
settings
.
setValue
(
"LOW_POWER_MODE"
,
_lowPowerMode
);
settings
.
setValue
(
"SHOW_STATUSBAR"
,
_showStatusBar
);
settings
.
endGroup
();
settings
.
setValue
(
_getWindowGeometryKey
(),
saveGeometry
());
// Save the last current view in any case
...
...
src/ui/MainWindow.h
View file @
146f52ce
...
...
@@ -187,13 +187,17 @@ protected slots:
* Used as a triggered() callback by the fullScreenAction to make sure only one of it or the
* normalAction are checked at a time, as they're mutually exclusive.
*/
void
fullScreenActionItemCallback
();
void
fullScreenActionItemCallback
(
bool
);
/**
* @brief Unchecks the fullScreenActionItem.
* Used as a triggered() callback by the normalAction to make sure only one of it or the
* fullScreenAction are checked at a time, as they're mutually exclusive.
*/
void
normalActionItemCallback
();
void
normalActionItemCallback
(
bool
);
/**
* @brief Enable/Disable Status Bar
*/
void
showStatusBarCallback
(
bool
checked
);
signals:
void
initStatusChanged
(
const
QString
&
message
,
int
alignment
,
const
QColor
&
color
);
...
...
@@ -348,6 +352,7 @@ private:
bool
_autoReconnect
;
bool
_lowPowerMode
;
///< If enabled, QGC reduces the update rates of all widgets
bool
_showStatusBar
;
QActionGroup
*
_centerStackActionGroup
;
MAVLinkSimulationLink
*
_simulationLink
;
QList
<
QGCToolWidget
*>
_customWidgets
;
...
...
src/ui/MainWindow.ui
View file @
146f52ce
...
...
@@ -75,7 +75,7 @@
</widget>
<widget
class=
"QMenu"
name=
"menuPerspectives"
>
<property
name=
"title"
>
<string>
Perspectives
</string>
<string>
View
</string>
</property>
<addaction
name=
"actionSetup"
/>
<addaction
name=
"actionMissionView"
/>
...
...
@@ -84,6 +84,8 @@
<addaction
name=
"separator"
/>
<addaction
name=
"actionFullscreen"
/>
<addaction
name=
"actionNormal"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionStatusBar"
/>
</widget>
<widget
class=
"QMenu"
name=
"menuAdvanced"
>
<property
name=
"title"
>
...
...
@@ -335,6 +337,14 @@
<string>
Local 3D View
</string>
</property>
</action>
<action
name=
"actionStatusBar"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
Status Bar
</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