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
c67c91a7
Commit
c67c91a7
authored
Apr 15, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
silenced settings load
parent
e0534e82
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
20 deletions
+20
-20
QGCCommandButton.cc
src/ui/designer/QGCCommandButton.cc
+2
-2
QGCToolWidget.cc
src/ui/designer/QGCToolWidget.cc
+18
-18
No files found.
src/ui/designer/QGCCommandButton.cc
View file @
c67c91a7
...
@@ -118,7 +118,7 @@ void QGCCommandButton::sendCommand()
...
@@ -118,7 +118,7 @@ void QGCCommandButton::sendCommand()
int
component
=
ui
->
editComponentSpinBox
->
value
();
int
component
=
ui
->
editComponentSpinBox
->
value
();
QGCToolWidgetItem
::
uas
->
executeCommand
(
command
,
confirm
,
param1
,
param2
,
param3
,
param4
,
param5
,
param6
,
param7
,
component
);
QGCToolWidgetItem
::
uas
->
executeCommand
(
command
,
confirm
,
param1
,
param2
,
param3
,
param4
,
param5
,
param6
,
param7
,
component
);
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"SENDING COMMAND"
<<
index
;
//
qDebug() << __FILE__ << __LINE__ << "SENDING COMMAND" << index;
}
}
}
}
}
}
...
@@ -226,7 +226,7 @@ void QGCCommandButton::endEditMode()
...
@@ -226,7 +226,7 @@ void QGCCommandButton::endEditMode()
void
QGCCommandButton
::
writeSettings
(
QSettings
&
settings
)
void
QGCCommandButton
::
writeSettings
(
QSettings
&
settings
)
{
{
qDebug
()
<<
"COMMAND BUTTON WRITING SETTINGS"
;
//
qDebug() << "COMMAND BUTTON WRITING SETTINGS";
settings
.
setValue
(
"TYPE"
,
"COMMANDBUTTON"
);
settings
.
setValue
(
"TYPE"
,
"COMMANDBUTTON"
);
settings
.
setValue
(
"QGC_COMMAND_BUTTON_DESCRIPTION"
,
ui
->
nameLabel
->
text
());
settings
.
setValue
(
"QGC_COMMAND_BUTTON_DESCRIPTION"
,
ui
->
nameLabel
->
text
());
settings
.
setValue
(
"QGC_COMMAND_BUTTON_BUTTONTEXT"
,
ui
->
commandButton
->
text
());
settings
.
setValue
(
"QGC_COMMAND_BUTTON_BUTTONTEXT"
,
ui
->
commandButton
->
text
());
...
...
src/ui/designer/QGCToolWidget.cc
View file @
c67c91a7
...
@@ -28,7 +28,7 @@ QGCToolWidget::QGCToolWidget(const QString& title, QWidget *parent, QSettings* s
...
@@ -28,7 +28,7 @@ QGCToolWidget::QGCToolWidget(const QString& title, QWidget *parent, QSettings* s
{
{
widgetTitle
=
QString
(
"%1 %2"
).
arg
(
title
).
arg
(
QGCToolWidget
::
instances
()
->
count
());
widgetTitle
=
QString
(
"%1 %2"
).
arg
(
title
).
arg
(
QGCToolWidget
::
instances
()
->
count
());
}
}
qDebug
()
<<
"WidgetTitle"
<<
widgetTitle
;
//
qDebug() << "WidgetTitle" << widgetTitle;
setObjectName
(
widgetTitle
);
setObjectName
(
widgetTitle
);
createActions
();
createActions
();
...
@@ -99,12 +99,12 @@ QList<QGCToolWidget*> QGCToolWidget::createWidgetsFromSettings(QWidget* parent,
...
@@ -99,12 +99,12 @@ QList<QGCToolWidget*> QGCToolWidget::createWidgetsFromSettings(QWidget* parent,
if
(
!
settingsFile
.
isEmpty
())
if
(
!
settingsFile
.
isEmpty
())
{
{
settings
=
new
QSettings
(
settingsFile
,
QSettings
::
IniFormat
);
settings
=
new
QSettings
(
settingsFile
,
QSettings
::
IniFormat
);
qDebug
()
<<
"LOADING SETTINGS FROM"
<<
settingsFile
;
//
qDebug() << "LOADING SETTINGS FROM" << settingsFile;
}
}
else
else
{
{
settings
=
new
QSettings
();
settings
=
new
QSettings
();
qDebug
()
<<
"LOADING SETTINGS FROM DEFAULT"
<<
settings
->
fileName
();
//
qDebug() << "LOADING SETTINGS FROM DEFAULT" << settings->fileName();
}
}
QList
<
QGCToolWidget
*>
newWidgets
;
QList
<
QGCToolWidget
*>
newWidgets
;
...
@@ -116,7 +116,7 @@ QList<QGCToolWidget*> QGCToolWidget::createWidgetsFromSettings(QWidget* parent,
...
@@ -116,7 +116,7 @@ QList<QGCToolWidget*> QGCToolWidget::createWidgetsFromSettings(QWidget* parent,
if
(
!
instances
()
->
contains
(
name
)
&&
name
.
length
()
!=
0
)
if
(
!
instances
()
->
contains
(
name
)
&&
name
.
length
()
!=
0
)
{
{
qDebug
()
<<
"CREATED WIDGET:"
<<
name
;
//
qDebug() << "CREATED WIDGET:" << name;
QGCToolWidget
*
tool
=
new
QGCToolWidget
(
name
,
parent
,
settings
);
QGCToolWidget
*
tool
=
new
QGCToolWidget
(
name
,
parent
,
settings
);
newWidgets
.
append
(
tool
);
newWidgets
.
append
(
tool
);
}
}
...
@@ -127,12 +127,12 @@ QList<QGCToolWidget*> QGCToolWidget::createWidgetsFromSettings(QWidget* parent,
...
@@ -127,12 +127,12 @@ QList<QGCToolWidget*> QGCToolWidget::createWidgetsFromSettings(QWidget* parent,
}
}
else
else
{
{
qDebug
()
<<
"WIDGET"
<<
name
<<
"DID ALREADY EXIST, REJECTING"
;
//
qDebug() << "WIDGET" << name << "DID ALREADY EXIST, REJECTING";
}
}
}
}
settings
->
endArray
();
settings
->
endArray
();
qDebug
()
<<
"NEW WIDGETS: "
<<
newWidgets
.
size
();
//
qDebug() << "NEW WIDGETS: " << newWidgets.size();
// Load individual widget items
// Load individual widget items
for
(
int
i
=
0
;
i
<
newWidgets
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
newWidgets
.
size
();
i
++
)
...
@@ -158,7 +158,7 @@ bool QGCToolWidget::loadSettings(const QString& settings, bool singleinstance)
...
@@ -158,7 +158,7 @@ bool QGCToolWidget::loadSettings(const QString& settings, bool singleinstance)
// Do not use setTitle() here,
// Do not use setTitle() here,
// interferes with loading settings
// interferes with loading settings
widgetTitle
=
widgetName
;
widgetTitle
=
widgetName
;
qDebug
()
<<
"WIDGET TITLE LOADED: "
<<
widgetName
;
//
qDebug() << "WIDGET TITLE LOADED: " << widgetName;
loadSettings
(
set
);
loadSettings
(
set
);
return
true
;
return
true
;
}
}
...
@@ -172,9 +172,9 @@ void QGCToolWidget::loadSettings(QSettings& settings)
...
@@ -172,9 +172,9 @@ void QGCToolWidget::loadSettings(QSettings& settings)
{
{
QString
widgetName
=
getTitle
();
QString
widgetName
=
getTitle
();
settings
.
beginGroup
(
widgetName
);
settings
.
beginGroup
(
widgetName
);
qDebug
()
<<
"LOADING FOR"
<<
widgetName
;
//
qDebug() << "LOADING FOR" << widgetName;
int
size
=
settings
.
beginReadArray
(
"QGC_TOOL_WIDGET_ITEMS"
);
int
size
=
settings
.
beginReadArray
(
"QGC_TOOL_WIDGET_ITEMS"
);
qDebug
()
<<
"CHILDREN SIZE:"
<<
size
;
//
qDebug() << "CHILDREN SIZE:" << size;
for
(
int
j
=
0
;
j
<
size
;
j
++
)
for
(
int
j
=
0
;
j
<
size
;
j
++
)
{
{
settings
.
setArrayIndex
(
j
);
settings
.
setArrayIndex
(
j
);
...
@@ -185,12 +185,12 @@ void QGCToolWidget::loadSettings(QSettings& settings)
...
@@ -185,12 +185,12 @@ void QGCToolWidget::loadSettings(QSettings& settings)
if
(
type
==
"COMMANDBUTTON"
)
if
(
type
==
"COMMANDBUTTON"
)
{
{
item
=
new
QGCCommandButton
(
this
);
item
=
new
QGCCommandButton
(
this
);
qDebug
()
<<
"CREATED COMMANDBUTTON"
;
//
qDebug() << "CREATED COMMANDBUTTON";
}
}
else
if
(
type
==
"SLIDER"
)
else
if
(
type
==
"SLIDER"
)
{
{
item
=
new
QGCParamSlider
(
this
);
item
=
new
QGCParamSlider
(
this
);
qDebug
()
<<
"CREATED PARAM SLIDER"
;
//
qDebug() << "CREATED PARAM SLIDER";
}
}
if
(
item
)
if
(
item
)
...
@@ -199,12 +199,12 @@ void QGCToolWidget::loadSettings(QSettings& settings)
...
@@ -199,12 +199,12 @@ void QGCToolWidget::loadSettings(QSettings& settings)
addToolWidget
(
item
);
addToolWidget
(
item
);
item
->
readSettings
(
settings
);
item
->
readSettings
(
settings
);
qDebug
()
<<
"Created tool widget"
;
//
qDebug() << "Created tool widget";
}
}
}
}
else
else
{
{
qDebug
()
<<
"UNKNOWN TOOL WIDGET TYPE"
;
//
qDebug() << "UNKNOWN TOOL WIDGET TYPE";
}
}
}
}
settings
.
endArray
();
settings
.
endArray
();
...
@@ -218,12 +218,12 @@ void QGCToolWidget::storeWidgetsToSettings(QString settingsFile)
...
@@ -218,12 +218,12 @@ void QGCToolWidget::storeWidgetsToSettings(QString settingsFile)
if
(
!
settingsFile
.
isEmpty
())
if
(
!
settingsFile
.
isEmpty
())
{
{
settings
=
new
QSettings
(
settingsFile
,
QSettings
::
IniFormat
);
settings
=
new
QSettings
(
settingsFile
,
QSettings
::
IniFormat
);
qDebug
()
<<
"STORING SETTINGS TO"
<<
settings
->
fileName
();
//
qDebug() << "STORING SETTINGS TO" << settings->fileName();
}
}
else
else
{
{
settings
=
new
QSettings
();
settings
=
new
QSettings
();
qDebug
()
<<
"STORING SETTINGS TO DEFAULT"
<<
settings
->
fileName
();
//
qDebug() << "STORING SETTINGS TO DEFAULT" << settings->fileName();
}
}
int
preArraySize
=
settings
->
beginReadArray
(
"QGC_TOOL_WIDGET_NAMES"
);
int
preArraySize
=
settings
->
beginReadArray
(
"QGC_TOOL_WIDGET_NAMES"
);
...
@@ -237,7 +237,7 @@ void QGCToolWidget::storeWidgetsToSettings(QString settingsFile)
...
@@ -237,7 +237,7 @@ void QGCToolWidget::storeWidgetsToSettings(QString settingsFile)
{
{
// Updating value
// Updating value
settings
->
setValue
(
"TITLE"
,
instances
()
->
values
().
at
(
i
)
->
getTitle
());
settings
->
setValue
(
"TITLE"
,
instances
()
->
values
().
at
(
i
)
->
getTitle
());
qDebug
()
<<
"WRITING TITLE"
<<
instances
()
->
values
().
at
(
i
)
->
getTitle
();
//
qDebug() << "WRITING TITLE" << instances()->values().at(i)->getTitle();
}
}
else
else
{
{
...
@@ -269,7 +269,7 @@ void QGCToolWidget::storeSettings(const QString& settingsFile)
...
@@ -269,7 +269,7 @@ void QGCToolWidget::storeSettings(const QString& settingsFile)
void
QGCToolWidget
::
storeSettings
(
QSettings
&
settings
)
void
QGCToolWidget
::
storeSettings
(
QSettings
&
settings
)
{
{
qDebug
()
<<
"WRITING WIDGET"
<<
widgetTitle
<<
"TO SETTINGS"
;
//
qDebug() << "WRITING WIDGET" << widgetTitle << "TO SETTINGS";
settings
.
beginGroup
(
widgetTitle
);
settings
.
beginGroup
(
widgetTitle
);
settings
.
beginWriteArray
(
"QGC_TOOL_WIDGET_ITEMS"
);
settings
.
beginWriteArray
(
"QGC_TOOL_WIDGET_ITEMS"
);
int
k
=
0
;
// QGCToolItem counter
int
k
=
0
;
// QGCToolItem counter
...
@@ -285,7 +285,7 @@ void QGCToolWidget::storeSettings(QSettings& settings)
...
@@ -285,7 +285,7 @@ void QGCToolWidget::storeSettings(QSettings& settings)
item
->
writeSettings
(
settings
);
item
->
writeSettings
(
settings
);
}
}
}
}
qDebug
()
<<
"WROTE"
<<
k
<<
"SUB-WIDGETS TO SETTINGS"
;
//
qDebug() << "WROTE" << k << "SUB-WIDGETS TO SETTINGS";
settings
.
endArray
();
settings
.
endArray
();
settings
.
endGroup
();
settings
.
endGroup
();
}
}
...
...
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