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
fa4c1e13
Commit
fa4c1e13
authored
Apr 30, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commented out old menu items, maybe useful later
parent
c00032ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
51 deletions
+22
-51
MainWindow.cc
src/ui/MainWindow.cc
+22
-25
MainWindow.ui
src/ui/MainWindow.ui
+0
-26
No files found.
src/ui/MainWindow.cc
View file @
fa4c1e13
...
...
@@ -136,10 +136,7 @@ MainWindow::MainWindow(QWidget *parent):
hide
();
// We only need this menu if we have more than one system
ui
.
menuConnected_Systems
->
setEnabled
(
false
);
// XXX This menu probably doesn't make sense and should go, not just hide
ui
.
menuUnmanned_System
->
setEnabled
(
false
);
// ui.menuConnected_Systems->setEnabled(false);
// Set dock options
setDockOptions
(
AnimatedDocks
|
AllowTabbedDocks
|
AllowNestedDocks
);
...
...
@@ -1257,8 +1254,8 @@ void MainWindow::addLink(LinkInterface *link)
void
MainWindow
::
setActiveUAS
(
UASInterface
*
uas
)
{
// Enable and rename menu
ui
.
menuUnmanned_System
->
setTitle
(
uas
->
getUASName
());
if
(
!
ui
.
menuUnmanned_System
->
isEnabled
())
ui
.
menuUnmanned_System
->
setEnabled
(
true
);
//
ui.menuUnmanned_System->setTitle(uas->getUASName());
//
if (!ui.menuUnmanned_System->isEnabled()) ui.menuUnmanned_System->setEnabled(true);
}
void
MainWindow
::
UASSpecsChanged
(
int
uas
)
...
...
@@ -1268,14 +1265,14 @@ void MainWindow::UASSpecsChanged(int uas)
{
if
(
activeUAS
->
getUASID
()
==
uas
)
{
ui
.
menuUnmanned_System
->
setTitle
(
activeUAS
->
getUASName
());
//
ui.menuUnmanned_System->setTitle(activeUAS->getUASName());
}
}
else
{
// Last system deleted
ui
.
menuUnmanned_System
->
setTitle
(
tr
(
"No System"
));
ui
.
menuUnmanned_System
->
setEnabled
(
false
);
//
ui.menuUnmanned_System->setTitle(tr("No System"));
//
ui.menuUnmanned_System->setEnabled(false);
}
}
...
...
@@ -1284,7 +1281,7 @@ void MainWindow::UASCreated(UASInterface* uas)
// Check if this is the 2nd system and we need a switch menu
if
(
UASManager
::
instance
()
->
getUASList
().
count
()
>
1
)
ui
.
menuConnected_Systems
->
setEnabled
(
true
);
//
ui.menuConnected_Systems->setEnabled(true);
// Connect the UAS to the full user interface
...
...
@@ -1364,12 +1361,12 @@ void MainWindow::UASCreated(UASInterface* uas)
break
;
}
QAction
*
uasAction
=
new
QAction
(
icon
,
tr
(
"Select %1 for control"
).
arg
(
uas
->
getUASName
()),
ui
.
menuConnected_Systems
);
connect
(
uas
,
SIGNAL
(
systemRemoved
()),
uasAction
,
SLOT
(
deleteLater
()));
connect
(
uasAction
,
SIGNAL
(
triggered
()),
uas
,
SLOT
(
setSelected
()));
//
QAction* uasAction = new QAction(icon, tr("Select %1 for control").arg(uas->getUASName()), ui.menuConnected_Systems);
//
connect(uas, SIGNAL(systemRemoved()), uasAction, SLOT(deleteLater()));
//
connect(uasAction, SIGNAL(triggered()), uas, SLOT(setSelected()));
connect
(
uas
,
SIGNAL
(
systemSpecsChanged
(
int
)),
this
,
SLOT
(
UASSpecsChanged
(
int
)));
ui
.
menuConnected_Systems
->
addAction
(
uasAction
);
//
ui.menuConnected_Systems->addAction(uasAction);
// FIXME Should be not inside the mainwindow
if
(
debugConsoleDockWidget
)
...
...
@@ -1482,8 +1479,8 @@ void MainWindow::UASCreated(UASInterface* uas)
//}
if
(
!
ui
.
menuConnected_Systems
->
isEnabled
())
ui
.
menuConnected_Systems
->
setEnabled
(
true
);
if
(
!
ui
.
menuUnmanned_System
->
isEnabled
())
ui
.
menuUnmanned_System
->
setEnabled
(
true
);
//
if (!ui.menuConnected_Systems->isEnabled()) ui.menuConnected_Systems->setEnabled(true);
//
if (!ui.menuUnmanned_System->isEnabled()) ui.menuUnmanned_System->setEnabled(true);
// Reload view state in case new widgets were added
loadViewState
();
...
...
@@ -1494,18 +1491,18 @@ void MainWindow::UASDeleted(UASInterface* uas)
if
(
UASManager
::
instance
()
->
getUASList
().
count
()
==
0
)
{
// Last system deleted
ui
.
menuUnmanned_System
->
setTitle
(
tr
(
"No System"
));
ui
.
menuUnmanned_System
->
setEnabled
(
false
);
//
ui.menuUnmanned_System->setTitle(tr("No System"));
//
ui.menuUnmanned_System->setEnabled(false);
}
QAction
*
act
;
QList
<
QAction
*>
actions
=
ui
.
menuConnected_Systems
->
actions
();
//
QAction* act;
//
QList<QAction*> actions = ui.menuConnected_Systems->actions();
foreach
(
act
,
actions
)
{
if
(
act
->
text
().
contains
(
uas
->
getUASName
()))
ui
.
menuConnected_Systems
->
removeAction
(
act
);
}
//
foreach (act, actions)
//
{
//
if (act->text().contains(uas->getUASName()))
//
ui.menuConnected_Systems->removeAction(act);
//
}
}
/**
...
...
src/ui/MainWindow.ui
View file @
fa4c1e13
...
...
@@ -82,30 +82,6 @@
<addaction
name=
"actionAdd_Link"
/>
<addaction
name=
"separator"
/>
</widget>
<widget
class=
"QMenu"
name=
"menuConnected_Systems"
>
<property
name=
"enabled"
>
<bool>
false
</bool>
</property>
<property
name=
"title"
>
<string>
Select System
</string>
</property>
</widget>
<widget
class=
"QMenu"
name=
"menuUnmanned_System"
>
<property
name=
"enabled"
>
<bool>
false
</bool>
</property>
<property
name=
"title"
>
<string>
System
</string>
</property>
<property
name=
"separatorsCollapsible"
>
<bool>
false
</bool>
</property>
<addaction
name=
"actionShutdownMAV"
/>
<addaction
name=
"actionLiftoff"
/>
<addaction
name=
"actionLand"
/>
<addaction
name=
"actionEmergency_Land"
/>
<addaction
name=
"actionEmergency_Kill"
/>
</widget>
<widget
class=
"QMenu"
name=
"menuTools"
>
<property
name=
"title"
>
<string>
Tool Widgets
</string>
...
...
@@ -143,8 +119,6 @@
</widget>
<addaction
name=
"menuMGround"
/>
<addaction
name=
"menuNetwork"
/>
<addaction
name=
"menuConnected_Systems"
/>
<addaction
name=
"menuUnmanned_System"
/>
<addaction
name=
"menuPerspectives"
/>
<addaction
name=
"menuMain"
/>
<addaction
name=
"menuTools"
/>
...
...
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