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
ca13be59
Commit
ca13be59
authored
Jul 15, 2011
by
Bryan Godbolt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/dev-lin' into dev-lin
parents
f31c086b
0f28dcbf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
XMLCommProtocolWidget.cc
src/ui/XMLCommProtocolWidget.cc
+8
-4
QGCMAVLinkTextEdit.cc
src/ui/mavlink/QGCMAVLinkTextEdit.cc
+6
-6
No files found.
src/ui/XMLCommProtocolWidget.cc
View file @
ca13be59
...
...
@@ -18,13 +18,13 @@ XMLCommProtocolWidget::XMLCommProtocolWidget(QWidget *parent) :
{
m_ui
->
setupUi
(
this
);
// Now set syntax highlighter
//highlighter = new MAVLinkSyntaxHighlighter(m_ui->xmlTextView->document());
connect
(
m_ui
->
selectFileButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
selectXMLFile
()));
connect
(
m_ui
->
selectOutputButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
selectOutputDirectory
()));
connect
(
m_ui
->
generateButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
generate
()));
connect
(
m_ui
->
saveButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
save
()));
// Make sure text background is white
m_ui
->
xmlTextView
->
setStyleSheet
(
"QGCMAVLinkTextEdit { background-color: #FFFFFF; }"
);
}
void
XMLCommProtocolWidget
::
selectXMLFile
()
...
...
@@ -128,7 +128,11 @@ void XMLCommProtocolWidget::generate()
m_ui
->
compileLog
->
clear
();
// Check XML validity
if
(
!
m_ui
->
xmlTextView
->
syntaxcheck
())
return
;
if
(
!
m_ui
->
xmlTextView
->
syntaxcheck
())
{
// Syntax check already gives output
return
;
}
MAVLinkXMLParser
*
parser
=
new
MAVLinkXMLParser
(
m_ui
->
fileNameLabel
->
text
().
trimmed
(),
m_ui
->
outputDirNameLabel
->
text
().
trimmed
());
connect
(
parser
,
SIGNAL
(
parseState
(
QString
)),
m_ui
->
compileLog
,
SLOT
(
appendHtml
(
QString
)));
...
...
src/ui/mavlink/QGCMAVLinkTextEdit.cc
View file @
ca13be59
...
...
@@ -50,32 +50,32 @@ void QGCMAVLinkTextEdit::setPlainText( const QString txt )
bool
QGCMAVLinkTextEdit
::
syntaxcheck
()
{
bool
error
=
fals
e
;
bool
noError
=
tru
e
;
if
(
text
().
size
()
>
0
)
{
QString
errorStr
;
int
errorLine
,
errorColumn
;
QDomDocument
doc
;
if
(
!
doc
.
setContent
(
text
(),
false
,
&
errorStr
,
&
errorLine
,
&
errorColumn
))
{
//////return doc.toString(5);
QMessageBox
::
information
(
0
,
tr
(
"Found xml error"
),
tr
(
"Check line %1 column %2 on string
\"
%3
\"
!"
)
QMessageBox
::
critical
(
0
,
tr
(
"Found xml error"
),
tr
(
"Check line %1 column %2 on string
\"
%3
\"
!"
)
.
arg
(
errorLine
-
1
)
.
arg
(
errorColumn
-
1
)
.
arg
(
errorStr
));
error
=
tru
e
;
noError
=
fals
e
;
// FIXME Mark line
if
(
errorLine
>=
0
)
{
}
}
else
{
QMessageBox
::
information
(
0
,
tr
(
"XML valid."
),
tr
(
"All tag
are valid size %1
."
).
arg
(
text
().
size
()));
QMessageBox
::
information
(
0
,
tr
(
"XML valid."
),
tr
(
"All tag
s are valid. Document size is %1 characters
."
).
arg
(
text
().
size
()));
setPlainText
(
doc
.
toString
(
5
));
}
}
else
{
QMessageBox
::
information
(
0
,
tr
(
"XML not found!"
),
tr
(
"Null size xml document!"
));
error
=
tru
e
;
noError
=
fals
e
;
}
return
e
rror
;
return
noE
rror
;
}
void
QGCMAVLinkTextEdit
::
contextMenuEvent
(
QContextMenuEvent
*
e
)
...
...
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