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
355fb0b5
Commit
355fb0b5
authored
May 03, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Search from Tools menu
parent
9f5ffd93
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
106 additions
and
101 deletions
+106
-101
ParameterEditor.qml
src/QmlControls/ParameterEditor.qml
+105
-100
ParameterEditorController.h
src/QmlControls/ParameterEditorController.h
+1
-1
No files found.
src/QmlControls/ParameterEditor.qml
View file @
355fb0b5
...
@@ -53,6 +53,7 @@ QGCView {
...
@@ -53,6 +53,7 @@ QGCView {
ParameterEditorController
{
ParameterEditorController
{
id
:
controller
;
id
:
controller
;
factPanel
:
panel
factPanel
:
panel
onShowErrorMessage
:
{
onShowErrorMessage
:
{
showMessage
(
qsTr
(
"
Parameter Load Errors
"
),
errorMsg
,
StandardButton
.
Ok
)
showMessage
(
qsTr
(
"
Parameter Load Errors
"
),
errorMsg
,
StandardButton
.
Ok
)
}
}
...
@@ -61,55 +62,52 @@ QGCView {
...
@@ -61,55 +62,52 @@ QGCView {
QGCViewPanel
{
QGCViewPanel
{
id
:
panel
id
:
panel
anchors.fill
:
parent
anchors.fill
:
parent
Column
{
anchors.fill
:
parent
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.25
//---------------------------------------------
//---------------------------------------------
//-- Header
//-- Header
Item
{
Row
{
id
:
header
id
:
header
width
:
parent
.
width
anchors.left
:
parent
.
left
height
:
ScreenTools
.
defaultFontPixelHeight
*
1.75
anchors.right
:
parent
.
right
QGCLabel
{
height
:
searchText
.
height
+
ScreenTools
.
defaultFontPixelHeight
/
3
text
:
qsTr
(
"
Search Results
"
)
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_searchFilter
font.weight
:
Font
.
DemiBold
QGCButton
{
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.top
:
searchText
.
top
}
anchors.bottom
:
searchText
.
bottom
Item
{
text
:
qsTr
(
"
Filter by:
"
)
id
:
groupTitle
visible
:
!
_searchFilter
onClicked
:
{
width
:
ScreenTools
.
defaultFontPixelWidth
*
25
_searchResults
=
controller
.
searchParametersForComponent
(
-
1
,
searchText
.
text
)
anchors.verticalCenter
:
parent
.
verticalCenter
_searchFilter
=
true
QGCLabel
{
text
:
qsTr
(
"
GROUPS
"
)
font.weight
:
Font
.
DemiBold
anchors.centerIn
:
parent
}
}
}
}
QGCLabel
{
text
:
qsTr
(
"
%1 Parameters
"
).
arg
(
_currentGroup
)
QGCTextField
{
visible
:
!
_searchFilter
id
:
searchText
font.weight
:
Font
.
DemiBold
anchors.left
:
groupTitle
.
right
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
QGCButton
{
QGCButton
{
text
:
qsTr
(
"
Back
"
)
anchors.top
:
searchText
.
top
anchors.bottom
:
searchText
.
bottom
text
:
qsTr
(
"
Clear
"
)
visible
:
_searchFilter
visible
:
_searchFilter
anchors.right
:
parent
.
right
height
:
ScreenTools
.
defaultFontPixelHeight
*
1.75
onClicked
:
{
onClicked
:
{
searchText
.
text
=
""
_searchFilter
=
false
_searchFilter
=
false
hideDialog
()
hideDialog
()
}
}
}
}
}
// Row - Header
QGCButton
{
QGCButton
{
anchors.top
:
header
.
top
anchors.bottom
:
header
.
bottom
anchors.right
:
parent
.
right
text
:
qsTr
(
"
Tools
"
)
text
:
qsTr
(
"
Tools
"
)
visible
:
!
_searchFilter
visible
:
!
_searchFilter
anchors.right
:
parent
.
right
height
:
ScreenTools
.
defaultFontPixelHeight
*
1.75
menu
:
Menu
{
menu
:
Menu
{
MenuItem
{
MenuItem
{
text
:
qsTr
(
"
Refresh
"
)
text
:
qsTr
(
"
Refresh
"
)
...
@@ -117,11 +115,7 @@ QGCView {
...
@@ -117,11 +115,7 @@ QGCView {
}
}
MenuItem
{
MenuItem
{
text
:
qsTr
(
"
Reset all to defaults
"
)
text
:
qsTr
(
"
Reset all to defaults
"
)
onTriggered
:
controller
.
resetAllToDefaults
()
onTriggered
:
showDialog
(
resetToDefaultConfirmComponent
,
qsTr
(
"
Reset All
"
),
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Cancel
|
StandardButton
.
Reset
)
}
MenuItem
{
text
:
qsTr
(
"
Search...
"
)
onTriggered
:
showDialog
(
searchDialogComponent
,
qsTr
(
"
Parameter Search
"
),
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Reset
|
StandardButton
.
Apply
)
}
}
MenuSeparator
{
}
MenuSeparator
{
}
MenuItem
{
MenuItem
{
...
@@ -152,23 +146,17 @@ QGCView {
...
@@ -152,23 +146,17 @@ QGCView {
}
}
}
}
}
}
}
Rectangle
{
color
:
__qgcPal
.
text
width
:
parent
.
width
height
:
1
opacity
:
0.1
anchors.topMargin
:
-
1
}
//---------------------------------------------
//---------------------------------------------
//-- Contents
//-- Contents
Loader
{
Loader
{
width
:
parent
.
width
anchors.left
:
parent
.
left
height
:
parent
.
height
-
header
.
height
anchors.right
:
parent
.
right
anchors.top
:
header
.
bottom
anchors.bottom
:
parent
.
bottom
sourceComponent
:
_searchFilter
?
searchResultsViewComponent
:
groupedViewComponent
sourceComponent
:
_searchFilter
?
searchResultsViewComponent
:
groupedViewComponent
}
}
}
}
}
//-- Parameter Groups
//-- Parameter Groups
Component
{
Component
{
...
@@ -403,4 +391,21 @@ QGCView {
...
@@ -403,4 +391,21 @@ QGCView {
onFilenameReturned
:
controller
.
saveToFile
(
filename
)
onFilenameReturned
:
controller
.
saveToFile
(
filename
)
}
}
}
}
Component
{
id
:
resetToDefaultConfirmComponent
QGCViewDialog
{
function
accept
()
{
controller
.
resetAllToDefaults
()
hideDialog
()
}
QGCLabel
{
width
:
parent
.
width
wrapMode
:
Text
.
WordWrap
text
:
qsTr
(
"
Select Reset to reset all parameters to their defaults.
"
)
}
}
}
}
// QGCView
}
// QGCView
src/QmlControls/ParameterEditorController.h
View file @
355fb0b5
...
@@ -46,7 +46,7 @@ public:
...
@@ -46,7 +46,7 @@ public:
Q_INVOKABLE
QStringList
getGroupsForComponent
(
int
componentId
);
Q_INVOKABLE
QStringList
getGroupsForComponent
(
int
componentId
);
Q_INVOKABLE
QStringList
getParametersForGroup
(
int
componentId
,
QString
group
);
Q_INVOKABLE
QStringList
getParametersForGroup
(
int
componentId
,
QString
group
);
Q_INVOKABLE
QStringList
searchParametersForComponent
(
int
componentId
,
const
QString
&
searchText
,
bool
searchInName
,
bool
searchInDescriptions
);
Q_INVOKABLE
QStringList
searchParametersForComponent
(
int
componentId
,
const
QString
&
searchText
,
bool
searchInName
=
true
,
bool
searchInDescriptions
=
true
);
Q_INVOKABLE
void
clearRCToParam
(
void
);
Q_INVOKABLE
void
clearRCToParam
(
void
);
Q_INVOKABLE
void
saveToFilePicker
(
void
);
Q_INVOKABLE
void
saveToFilePicker
(
void
);
...
...
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