1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Disabled the waypointeditor dialog

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1018 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
pip 2010-07-04 09:28:52 +00:00 committed by pip
parent 455a99a3cf
commit 5079b1d348
14 changed files with 620 additions and 272 deletions

View File

@ -11,8 +11,10 @@ HEADERS += opmapplugin.h \
opmapgadget.h \
opmapgadgetwidget.h \
opmap_waypointeditor_dialog.h \
opmap_mapoverlaywidget.h \
opmap_edit_waypoint_dialog.h
opmap_edit_waypoint_dialog.h \
opmap_zoom_slider_widget.h \
opmap_statusbar_widget.h \
opmap_overlay_widget.h
SOURCES += opmapplugin.cpp \
opmapgadgetwidget.cpp \
opmapgadgetoptionspage.cpp \
@ -20,12 +22,16 @@ SOURCES += opmapplugin.cpp \
opmapgadgetconfiguration.cpp \
opmapgadget.cpp \
opmap_waypointeditor_dialog.cpp \
opmap_mapoverlaywidget.cpp \
opmap_edit_waypoint_dialog.cpp
opmap_edit_waypoint_dialog.cpp \
opmap_zoom_slider_widget.cpp \
opmap_statusbar_widget.cpp \
opmap_overlay_widget.cpp
OTHER_FILES += OPMapGadget.pluginspec
FORMS += opmapgadgetoptionspage.ui \
opmap_widget.ui \
opmap_waypointeditor_dialog.ui \
opmap_mapoverlaywidget.ui \
opmap_edit_waypoint_dialog.ui
opmap_edit_waypoint_dialog.ui \
opmap_zoom_slider_widget.ui \
opmap_statusbar_widget.ui \
opmap_overlay_widget.ui
RESOURCES += opmap.qrc

View File

@ -1,63 +0,0 @@
/**
******************************************************************************
*
* @file opmap_mapoverlaywidget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief
* @see The GNU Public License (GPL) Version 3
* @defgroup opmap
* @{
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "opmap_mapoverlaywidget.h"
#include "ui_opmap_mapoverlaywidget.h"
OPMap_MapOverlayWidget::OPMap_MapOverlayWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::OPMap_MapOverlayWidget)
{
ui->setupUi(this);
}
OPMap_MapOverlayWidget::~OPMap_MapOverlayWidget()
{
delete ui;
}
void OPMap_MapOverlayWidget::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
void OPMap_MapOverlayWidget::on_verticalSlider_sliderMoved(int position)
{
}
void OPMap_MapOverlayWidget::on_dial_sliderMoved(int position)
{
}

View File

@ -1,54 +0,0 @@
/**
******************************************************************************
*
* @file opmap_mapoverlaywidget.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief
* @see The GNU Public License (GPL) Version 3
* @defgroup opmap
* @{
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef OPMAP_MAPOVERLAYWIDGET_H
#define OPMAP_MAPOVERLAYWIDGET_H
#include <QWidget>
namespace Ui {
class OPMap_MapOverlayWidget;
}
class OPMap_MapOverlayWidget : public QWidget {
Q_OBJECT
public:
OPMap_MapOverlayWidget(QWidget *parent = 0);
~OPMap_MapOverlayWidget();
protected:
void changeEvent(QEvent *e);
private:
Ui::OPMap_MapOverlayWidget *ui;
private slots:
void on_dial_sliderMoved(int position);
void on_verticalSlider_sliderMoved(int position);
};
#endif // OPMAP_MAPOVERLAYWIDGET_H

View File

@ -0,0 +1,14 @@
#include "opmap_overlay_widget.h"
#include "ui_opmap_overlay_widget.h"
opmap_overlay_widget::opmap_overlay_widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::opmap_overlay_widget)
{
ui->setupUi(this);
}
opmap_overlay_widget::~opmap_overlay_widget()
{
delete ui;
}

View File

@ -0,0 +1,22 @@
#ifndef OPMAP_OVERLAY_WIDGET_H
#define OPMAP_OVERLAY_WIDGET_H
#include <QWidget>
namespace Ui {
class opmap_overlay_widget;
}
class opmap_overlay_widget : public QWidget
{
Q_OBJECT
public:
explicit opmap_overlay_widget(QWidget *parent = 0);
~opmap_overlay_widget();
private:
Ui::opmap_overlay_widget *ui;
};
#endif // OPMAP_OVERLAY_WIDGET_H

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OPMap_MapOverlayWidget</class>
<widget class="QWidget" name="OPMap_MapOverlayWidget">
<class>opmap_overlay_widget</class>
<widget class="QWidget" name="opmap_overlay_widget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>476</width>
<height>289</height>
<width>336</width>
<height>300</height>
</rect>
</property>
<property name="sizePolicy">
@ -16,97 +16,23 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string/>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="autoFillBackground">
<bool>false</bool>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="styleSheet">
<string notr="true">/*background-color: rgba(0, 0, 0, 0);*/
background-color: transparent;
QFrame {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(110, 110, 110, 255), stop:1 rgba(71, 71, 71, 255));
color: rgba(255, 255, 255, 70);
}
QLabel { /* all label types */
/* background-color: rgba(255, 255, 255, 0); */
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(64, 64, 64, 255), stop:1 rgba(128, 128, 128, 255));
color: rgb(255, 255, 255);
}
QToolButton { /* all types of tool button */
background-color: rgba(255, 255, 255, 0);
color: rgb(255, 255, 255);
/*border-style: none;*/
border: 0px;
}
QToolButton:hover {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 160, 0, 255), stop:1 rgba(160, 100, 0, 255));
color: rgb(255, 255, 255);
}
QToolButton:pressed {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QToolButton:checked {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QSlider::groove:horizontal {
border: none;
height: 4px;
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(80, 80, 80, 255));
margin: 2px 0;
}
QSlider::handle:horizontal {
border: 1px solid #5c5c5c;
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 255, 255, 255), stop:1 rgba(128, 128, 128, 255));
width: 24px;
margin: -2px 0;
border-radius: 3px;
}
QComboBox {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QComboBox:hover {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
background-color: rgb(197, 138, 0);
}
QComboBox::down-arrow {
image: url(:/opmap/images/combobox_down_arrow.png);
}
QComboBox:drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
border-left-style: none;
border-top-right-radius: 1px;
border-bottom-right-radius: 1px;
}
QToolTip {
background-color: white;
color: black;
border: 1px solid black;
padding: 5px;
border-radius: 5px;
/* opacity: 170; */
}
</string>
<string notr="true">background-color: transparent;
border: none;</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>20</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
@ -131,35 +57,23 @@ border-radius: 5px;
<item>
<widget class="QFrame" name="frame_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>27</width>
<height>170</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>27</width>
<height>170</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 100);
border: none;
border-radius: 12px;</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>3</number>
</property>
@ -175,13 +89,32 @@ border-radius: 12px;</string>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255, 0);</string>
<string notr="true">QToolButton { /* all types of tool button */
background-color: rgba(255, 255, 255, 0);
color: rgb(255, 255, 255);
/*border-style: none;*/
border: 0px;
}
QToolButton:hover {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 160, 0, 255), stop:1 rgba(160, 100, 0, 255));
color: rgb(255, 255, 255);
}
QToolButton:pressed {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QToolButton:checked {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<iconset resource="opmap.qrc">
<normaloff>:/opmap/images/plus.png</normaloff>:/opmap/images/plus.png</iconset>
</property>
<property name="autoRaise">
@ -192,36 +125,30 @@ border-radius: 12px;</string>
<item>
<widget class="QSlider" name="verticalSlider">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>120</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>120</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QSlider {
background-color: rgba(0, 0, 0, 0);
}
background-color: rgba(255, 255, 255, 0);
QSlider::handle:vertical {
QSlider::groove:horizontal {
border: none;
height: 4px;
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(80, 80, 80, 255));
margin: 2px 0;
}
QSlider::handle:horizontal {
border: 1px solid #5c5c5c;
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(128, 128, 128, 255), stop:1 rgba(255, 255, 255, 255));
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 255, 255, 255), stop:1 rgba(128, 128, 128, 255));
width: 24px;
height: 20px;
margin: -2px 0;
border-radius: 3px;
}
</string>
</property>
<property name="minimum">
@ -233,18 +160,9 @@ border-radius: 3px;
<property name="pageStep">
<number>1</number>
</property>
<property name="tracking">
<bool>true</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="invertedControls">
<bool>false</bool>
</property>
</widget>
</item>
<item>
@ -256,13 +174,32 @@ border-radius: 3px;
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255, 0);</string>
<string notr="true">QToolButton { /* all types of tool button */
background-color: rgba(255, 255, 255, 0);
color: rgb(255, 255, 255);
/*border-style: none;*/
border: 0px;
}
QToolButton:hover {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 160, 0, 255), stop:1 rgba(160, 100, 0, 255));
color: rgb(255, 255, 255);
}
QToolButton:pressed {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QToolButton:checked {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<iconset resource="opmap.qrc">
<normaloff>:/opmap/images/minus.png</normaloff>:/opmap/images/minus.png</iconset>
</property>
<property name="autoRaise">
@ -274,7 +211,7 @@ border-radius: 3px;
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -307,7 +244,7 @@ border-radius: 3px;
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_4">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -324,6 +261,12 @@ border-radius: 3px;
</item>
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 100);
border: none;
@ -398,7 +341,7 @@ border-radius: 10px;
<property name="maximumSize">
<size>
<width>100</width>
<height>14</height>
<height>16</height>
</size>
</property>
<property name="styleSheet">
@ -431,7 +374,7 @@ border-radius: 3px;
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -450,6 +393,8 @@ border-radius: 3px;
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="opmap.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -0,0 +1,14 @@
#include "opmap_statusbar_widget.h"
#include "ui_opmap_statusbar_widget.h"
opmap_statusbar_widget::opmap_statusbar_widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::opmap_statusbar_widget)
{
ui->setupUi(this);
}
opmap_statusbar_widget::~opmap_statusbar_widget()
{
delete ui;
}

View File

@ -0,0 +1,22 @@
#ifndef OPMAP_STATUSBAR_WIDGET_H
#define OPMAP_STATUSBAR_WIDGET_H
#include <QWidget>
namespace Ui {
class opmap_statusbar_widget;
}
class opmap_statusbar_widget : public QWidget
{
Q_OBJECT
public:
explicit opmap_statusbar_widget(QWidget *parent = 0);
~opmap_statusbar_widget();
private:
Ui::opmap_statusbar_widget *ui;
};
#endif // OPMAP_STATUSBAR_WIDGET_H

View File

@ -0,0 +1,184 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>opmap_statusbar_widget</class>
<widget class="QWidget" name="opmap_statusbar_widget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>501</width>
<height>20</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);
border: none;
</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 100);
border: none;
border-radius: 8px;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px; </string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="labelStatus">
<property name="styleSheet">
<string notr="true">QLabel { /* all label types */
color: rgb(255, 255, 255);
background-color: rgba(255, 255, 255, 0);
border: none;
border-radius: 10px;
}</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
<string>labelStatus</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="margin">
<number>1</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QProgressBar" name="progressBarTiles">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>14</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QProgressBar {
border: nonei;
border-radius: 5px;
padding: 3px;
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QProgressBar::chunk {
background-color: rgb(85, 85, 255);
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(160, 160, 255, 255), stop:1 rgba(80, 80, 160, 255));
border: none;
border-radius: 3px;
}</string>
</property>
<property name="value">
<number>24</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="format">
<string>%v</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,14 @@
#include "opmap_zoom_slider_widget.h"
#include "ui_opmap_zoom_slider_widget.h"
opmap_zoom_slider_widget::opmap_zoom_slider_widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::opmap_zoom_slider_widget)
{
ui->setupUi(this);
}
opmap_zoom_slider_widget::~opmap_zoom_slider_widget()
{
delete ui;
}

View File

@ -0,0 +1,22 @@
#ifndef OPMAP_ZOOM_SLIDER_WIDGET_H
#define OPMAP_ZOOM_SLIDER_WIDGET_H
#include <QWidget>
namespace Ui {
class opmap_zoom_slider_widget;
}
class opmap_zoom_slider_widget : public QWidget
{
Q_OBJECT
public:
explicit opmap_zoom_slider_widget(QWidget *parent = 0);
~opmap_zoom_slider_widget();
private:
Ui::opmap_zoom_slider_widget *ui;
};
#endif // OPMAP_ZOOM_SLIDER_WIDGET_H

View File

@ -0,0 +1,196 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>opmap_zoom_slider_widget</class>
<widget class="QWidget" name="opmap_zoom_slider_widget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>27</width>
<height>187</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);
border: none;
</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 100);
border: none;
border-radius: 12px;</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>3</number>
</property>
<property name="margin">
<number>3</number>
</property>
<item>
<widget class="QToolButton" name="toolButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">QToolButton { /* all types of tool button */
background-color: rgba(255, 255, 255, 0);
color: rgb(255, 255, 255);
/*border-style: none;*/
border: 0px;
}
QToolButton:hover {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 160, 0, 255), stop:1 rgba(160, 100, 0, 255));
color: rgb(255, 255, 255);
}
QToolButton:pressed {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QToolButton:checked {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="opmap.qrc">
<normaloff>:/opmap/images/plus.png</normaloff>:/opmap/images/plus.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="verticalSlider">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">QSlider {
background-color: rgba(0, 0, 0, 0);
}
QSlider::groove:horizontal {
border: none;
height: 4px;
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(80, 80, 80, 255));
margin: 2px 0;
}
QSlider::handle:horizontal {
border: 1px solid #5c5c5c;
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 255, 255, 255), stop:1 rgba(128, 128, 128, 255));
width: 24px;
margin: -2px 0;
border-radius: 3px;
}
</string>
</property>
<property name="minimum">
<number>2</number>
</property>
<property name="maximum">
<number>19</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">QToolButton { /* all types of tool button */
background-color: rgba(255, 255, 255, 0);
color: rgb(255, 255, 255);
/*border-style: none;*/
border: 0px;
}
QToolButton:hover {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 160, 0, 255), stop:1 rgba(160, 100, 0, 255));
color: rgb(255, 255, 255);
}
QToolButton:pressed {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QToolButton:checked {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="opmap.qrc">
<normaloff>:/opmap/images/minus.png</normaloff>:/opmap/images/minus.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="opmap.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -47,9 +47,13 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent)
m_widget = NULL;
m_map = NULL;
findPlaceCompleter = NULL;
m_overlay_widget = NULL;
m_map_graphics_scene = NULL;
m_map_scene_proxy = NULL;
m_map_overlay_widget = NULL;
m_zoom_slider_widget = NULL;
m_statusbar_widget = NULL;
m_plugin_manager = NULL;
m_objManager = NULL;
@ -100,18 +104,32 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent)
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_map);
// layout->addChildWidget();
m_widget->mapWidget->setLayout(layout);
// **************
// create the user controls overlayed onto the map
// doing this makes the map VERY slow :(
/*
m_map_overlay_widget = new OPMap_MapOverlayWidget();
m_zoom_slider_widget = new opmap_zoom_slider_widget();
m_statusbar_widget = new opmap_statusbar_widget();
m_map_graphics_scene = m_map->scene();
m_map_scene_proxy = m_map_graphics_scene->addWidget(m_map_overlay_widget);
m_map_overlay_widget->setGeometry(m_widget->mapWidget->geometry());
m_map_scene_proxy = m_map_graphics_scene->addWidget(m_zoom_slider_widget);
m_map_scene_proxy = m_map_graphics_scene->addWidget(m_statusbar_widget);
m_zoom_slider_widget->move(m_map->width() - 20 - m_zoom_slider_widget->width(), 20);
m_statusbar_widget->move(0, m_map->height() - m_statusbar_widget->height());
*/
/*
m_overlay_widget = new opmap_overlay_widget(m_map);
QVBoxLayout *layout2 = new QVBoxLayout;
layout2->setSpacing(0);
layout2->setContentsMargins(0, 0, 0, 0);
layout2->addWidget(m_overlay_widget);
m_map->setLayout(layout2);
*/
// **************
// set the user control options
@ -294,7 +312,8 @@ OPMapGadgetWidget::~OPMapGadgetWidget()
onClearWayPointsAct_triggered();
if (m_map_overlay_widget) delete m_map_overlay_widget;
if (m_zoom_slider_widget) delete m_zoom_slider_widget;
if (m_statusbar_widget) delete m_statusbar_widget;
if (m_map) delete m_map;
if (m_widget) delete m_widget;
}
@ -767,7 +786,8 @@ void OPMapGadgetWidget::on_toolButtonAddWaypoint_clicked()
void OPMapGadgetWidget::on_toolButtonWaypointEditor_clicked()
{
wayPointEditorAct->trigger();
if (wayPointEditorAct->isEnabled())
wayPointEditorAct->trigger();
}
void OPMapGadgetWidget::on_treeViewWaypoints_clicked(QModelIndex index)
@ -949,6 +969,7 @@ void OPMapGadgetWidget::createActions()
wayPointEditorAct = new QAction(tr("&Waypoint editor"), this);
wayPointEditorAct->setShortcut(tr("Ctrl+W"));
wayPointEditorAct->setStatusTip(tr("Open the waypoint editor"));
wayPointEditorAct->setEnabled(false); // temporary
connect(wayPointEditorAct, SIGNAL(triggered()), this, SLOT(onOpenWayPointEditorAct_triggered()));
addWayPointAct = new QAction(tr("&Add waypoint"), this);
@ -1102,7 +1123,7 @@ void OPMapGadgetWidget::onFollowUAVpositionAct_toggled(bool checked)
if (m_map)
{
m_map->SetCanDragMap(!checked); // allow/disallow manual map dragging
// m_map->SetCanDragMap(!checked); // allow/disallow manual map dragging
if (!checked) m_map->SetRotate(0); // reset map rotation to 0deg
}
}

View File

@ -41,7 +41,9 @@
#include "uavobjects/positionactual.h"
#include "extensionsystem/pluginmanager.h"
#include "opmap_mapoverlaywidget.h"
#include "opmap_overlay_widget.h"
#include "opmap_zoom_slider_widget.h"
#include "opmap_statusbar_widget.h"
#include "opmap_waypointeditor_dialog.h"
#include "opmap_edit_waypoint_dialog.h"
@ -195,9 +197,12 @@ private:
opmap_edit_waypoint_dialog waypoint_edit_dialog;
opmap_overlay_widget *m_overlay_widget;
QGraphicsScene *m_map_graphics_scene;
QGraphicsProxyWidget *m_map_scene_proxy;
OPMap_MapOverlayWidget *m_map_overlay_widget;
opmap_zoom_slider_widget *m_zoom_slider_widget;
opmap_statusbar_widget *m_statusbar_widget;
QStandardItemModel wayPoint_treeView_model;