mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
Added functionality to some user control buttons on the new map plug-in
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@867 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
76e522f15a
commit
bd56e4476e
@ -102,7 +102,8 @@
|
||||
<string>Show/Hide Flight Controls</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgba(255, 255, 255, 0);</string>
|
||||
<string notr="true">background-color: rgba(255, 255, 255, 0);
|
||||
color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
@ -247,7 +248,8 @@ color: rgb(255, 255, 255);</string>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);
|
||||
<string notr="true">background-color: rgba(128, 128, 128, 0);
|
||||
color: rgb(255, 255, 255);
|
||||
</string>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
@ -609,15 +611,8 @@ color: rgb(255, 255, 255);</string>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton {
|
||||
background-color: rgba(255, 255, 255, 0);
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
QToolButton:hover {
|
||||
|
||||
}
|
||||
QToolButton:pressed {
|
||||
}</string>
|
||||
<string notr="true">background-color: rgba(255, 255, 255, 0);
|
||||
color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
|
@ -378,8 +378,10 @@ void OPMapGadgetWidget::zoomChanged(double zoom)
|
||||
|
||||
void OPMapGadgetWidget::OnMapDrag()
|
||||
{
|
||||
if (followUAVAct->isChecked())
|
||||
followUAVAct->setChecked(false); // disable follow UAV mode when the user starts to manually drag the map
|
||||
if (followUAVAct)
|
||||
{ // disable follow UAV mode when the user starts to manually drag the map
|
||||
if (followUAVAct->isChecked()) followUAVAct->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::OnCurrentPositionChanged(internals::PointLatLng point)
|
||||
@ -538,6 +540,28 @@ void OPMapGadgetWidget::on_toolButtonFlightControlsShowHide_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::on_toolButtonMapHome_clicked()
|
||||
{
|
||||
followUAVAct->setChecked(false);
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::on_toolButtonMapUAV_clicked()
|
||||
{
|
||||
followUAVAct->toggle();
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::on_toolButtonHome_clicked()
|
||||
{
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::on_toolButtonHoldPosition_clicked()
|
||||
{
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::on_toolButtonGo_clicked()
|
||||
{
|
||||
}
|
||||
|
||||
// *************************************************************************************
|
||||
// public functions
|
||||
|
||||
@ -696,7 +720,7 @@ void OPMapGadgetWidget::createMapOverlayUserControls()
|
||||
void OPMapGadgetWidget::createActions()
|
||||
{
|
||||
// ***********************
|
||||
// create the menu actions
|
||||
// create menu actions
|
||||
|
||||
closeAct = new QAction(tr("&Close menu"), this);
|
||||
// closeAct->setShortcuts(QKeySequence::New);
|
||||
@ -741,7 +765,7 @@ void OPMapGadgetWidget::createActions()
|
||||
followUAVAct->setStatusTip(tr("Keep the map centered onto the UAV"));
|
||||
followUAVAct->setCheckable(true);
|
||||
followUAVAct->setChecked(false);
|
||||
connect(followUAVAct, SIGNAL(triggered()), this, SLOT(followUAV()));
|
||||
connect(followUAVAct, SIGNAL(toggled(bool)), this, SLOT(on_followUAVAct_toggled(bool)));
|
||||
|
||||
wayPointEditorAct = new QAction(tr("&Way point editor"), this);
|
||||
wayPointEditorAct->setShortcut(tr("Ctrl+W"));
|
||||
@ -911,8 +935,11 @@ void OPMapGadgetWidget::goUAV()
|
||||
}
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::followUAV()
|
||||
void OPMapGadgetWidget::on_followUAVAct_toggled(bool checked)
|
||||
{
|
||||
if (m_widget)
|
||||
if (m_widget->toolButtonMapUAV->isChecked() != followUAVAct->isChecked())
|
||||
m_widget->toolButtonMapUAV->setChecked(followUAVAct->isChecked());
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::openWayPointEditor()
|
||||
|
@ -80,7 +80,12 @@ private slots:
|
||||
void on_pushButtonGeoFenceP_clicked();
|
||||
void on_comboBoxZoom_currentIndexChanged(int index);
|
||||
void on_toolButtonFlightControlsShowHide_clicked();
|
||||
void on_toolButtonMapHome_clicked();
|
||||
void on_toolButtonMapUAV_clicked();
|
||||
|
||||
void on_toolButtonHome_clicked();
|
||||
void on_toolButtonHoldPosition_clicked();
|
||||
void on_toolButtonGo_clicked();
|
||||
|
||||
// map signals
|
||||
void zoomChanged(double zoom);
|
||||
@ -101,7 +106,7 @@ private slots:
|
||||
void goMouseClick();
|
||||
void goHome();
|
||||
void goUAV();
|
||||
void followUAV();
|
||||
void on_followUAVAct_toggled(bool checked);
|
||||
void openWayPointEditor();
|
||||
void addWayPoint();
|
||||
void deleteWayPoint();
|
||||
|
Loading…
Reference in New Issue
Block a user