Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SkywardHub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
SkywardHub
Commits
5ce8765f
Commit
5ce8765f
authored
2 years ago
by
Riccardo Musso
Browse files
Options
Downloads
Patches
Plain Diff
CommandPad now saves selected message type on the xml configuration
parent
64a8ac54
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Modules/CommandPad/commandpad.cpp
+9
-3
9 additions, 3 deletions
Modules/CommandPad/commandpad.cpp
Modules/CommandPad/commandpad.h
+2
-0
2 additions, 0 deletions
Modules/CommandPad/commandpad.h
with
11 additions
and
3 deletions
Modules/CommandPad/commandpad.cpp
+
9
−
3
View file @
5ce8765f
...
@@ -72,11 +72,17 @@ QWidget* CommandPad::toWidget() {
...
@@ -72,11 +72,17 @@ QWidget* CommandPad::toWidget() {
}
}
XmlObject
CommandPad
::
toXmlObject
()
{
XmlObject
CommandPad
::
toXmlObject
()
{
return
XmlObject
(
getName
(
ModuleId
::
COMMANDPAD
));
XmlObject
obj
(
getName
(
ModuleId
::
COMMANDPAD
));
obj
.
addAttribute
(
"selected"
,
commandComboBox
->
currentText
());
return
obj
;
}
}
void
CommandPad
::
fromXmlObject
(
const
XmlObject
&
xmlObject
)
{
void
CommandPad
::
fromXmlObject
(
const
XmlObject
&
xmlObject
)
{
Q_UNUSED
(
xmlObject
);
QString
curr
=
xmlObject
.
getAttribute
(
"selected"
);
int
idx
=
commandComboBox
->
findText
(
curr
);
if
(
idx
!=
-
1
)
{
commandComboBox
->
setCurrentIndex
(
idx
);
}
}
}
#define _CMD(id, strName) \
#define _CMD(id, strName) \
...
@@ -128,7 +134,7 @@ void CommandPad::fromXmlObject(const XmlObject& xmlObject) {
...
@@ -128,7 +134,7 @@ void CommandPad::fromXmlObject(const XmlObject& xmlObject) {
void
CommandPad
::
setupUi
()
{
void
CommandPad
::
setupUi
()
{
QStackedWidget
*
stacked
=
new
QStackedWidget
;
QStackedWidget
*
stacked
=
new
QStackedWidget
;
QComboBox
*
commandComboBox
=
new
QComboBox
;
commandComboBox
=
new
QComboBox
;
commandComboBox
->
setSizePolicy
(
QSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Fixed
));
commandComboBox
->
setSizePolicy
(
QSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Fixed
));
connect
(
commandComboBox
,
QOverload
<
int
>::
of
(
&
QComboBox
::
currentIndexChanged
),
this
,
connect
(
commandComboBox
,
QOverload
<
int
>::
of
(
&
QComboBox
::
currentIndexChanged
),
this
,
[
=
](
int
idx
)
{
[
=
](
int
idx
)
{
...
...
This diff is collapsed.
Click to expand it.
Modules/CommandPad/commandpad.h
+
2
−
0
View file @
5ce8765f
...
@@ -22,6 +22,8 @@ class CommandPad : public DefaultModule {
...
@@ -22,6 +22,8 @@ class CommandPad : public DefaultModule {
private:
private:
void
setupUi
();
void
setupUi
();
QComboBox
*
commandComboBox
;
};
};
#endif // COMMANDPAD_H
#endif // COMMANDPAD_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment