diff --git a/App/Setting/Index0/Global/GlobalSetting.cpp b/App/Setting/Index0/Global/GlobalSetting.cpp
index d5464c2..2bf4a88 100644
--- a/App/Setting/Index0/Global/GlobalSetting.cpp
+++ b/App/Setting/Index0/Global/GlobalSetting.cpp
@@ -12,6 +12,32 @@ GlobalSetting::GlobalSetting(QWidget *parent) :
bingmap.insert("混合地图","BingHybrid");
//bingmap.insert("中国地图","BingChina");
+ ui->label_mapcache_info->hide();
+ ui->progressBar_mapcache->hide();
+
+ for(int i = 1;i <= 20;i++)
+ {
+ ui->comboBox_map_level->addItem(tr("level %1").arg(i),i);
+ }
+
+ //地图缓存相关UI
+ ui->label_mapcache_info->hide();
+ ui->label_maplat->hide();
+ ui->label_maplevel->hide();
+ ui->label_maplng->hide();
+ ui->label_leftmap->hide();
+ ui->label_rightmap->hide();
+
+ ui->doubleSpinBox_left_lat->hide();
+ ui->doubleSpinBox_left_lng->hide();
+ ui->doubleSpinBox_right_lat->hide();
+ ui->doubleSpinBox_right_lng->hide();
+
+ ui->pushButton_map_cache->hide();
+ ui->comboBox_map_level->hide();
+
+
+
ui->comboBox_ID->addItem(tr("250"),250);
ui->comboBox_ID->addItem(tr("251"),251);
diff --git a/App/Setting/Index0/Global/GlobalSetting.ui b/App/Setting/Index0/Global/GlobalSetting.ui
index 38b87f9..231341c 100644
--- a/App/Setting/Index0/Global/GlobalSetting.ui
+++ b/App/Setting/Index0/Global/GlobalSetting.ui
@@ -6,8 +6,8 @@
0
0
- 443
- 419
+ 467
+ 544
@@ -390,13 +390,127 @@
地图设置
- -
+
-
+
+
+ 8
+
+
+ -90.000000000000000
+
+
+ 90.000000000000000
+
+
+
+ -
+
+
+ 右下坐标
+
+
+
+ -
+
+
+ 8
+
+
+ -90.000000000000000
+
+
+ 90.000000000000000
+
+
+
+ -
+
+
+ 8
+
+
+ -180.000000000000000
+
+
+ 180.000000000000000
+
+
+
+ -
+
+
+ 地图等级
+
+
+
+ -
+
+
+ -
+
+
+ 左上坐标
+
+
+
+ -
选择地图
+ -
+
+
+ 纬度
+
+
+
+ -
+
+
+ 开始缓存
+
+
+
+ -
+
+
+ 0
+
+
+ %v
+
+
+
+ -
+
+
+ 经度
+
+
+
+ -
+
+
+ 8
+
+
+ -180.000000000000000
+
+
+ 180.000000000000000
+
+
+
+ -
+
+
+ 地图缓存信息
+
+
+
diff --git a/opmap/mapwidget/opmapwidget.cpp b/opmap/mapwidget/opmapwidget.cpp
index a730c2f..9b5c443 100644
--- a/opmap/mapwidget/opmapwidget.cpp
+++ b/opmap/mapwidget/opmapwidget.cpp
@@ -47,6 +47,10 @@ OPMapWidget::OPMapWidget(QWidget *parent, Configuration *config) : QGraphicsView
QCoreApplication::installTranslator(translator);
*/
+ //this->setAcceptDrops(true);
+
+
+
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
core = new internals::Core;
@@ -59,6 +63,8 @@ OPMapWidget::OPMapWidget(QWidget *parent, Configuration *config) : QGraphicsView
map = new MapGraphicItem(core, config);
+ //map->setAcceptDrops(true);
+
mscene.addItem(map);//添加图层
this->setScene(&mscene);
@@ -106,6 +112,38 @@ OPMapWidget::OPMapWidget(QWidget *parent, Configuration *config) : QGraphicsView
NoOperationTimer->start(20000);//20s不操作
}
+
+void OPMapWidget::dragEnterEvent(QDragEnterEvent *event)
+{
+ QString suffix = event->mimeData()->urls()[0].fileName().right(5);
+
+ if(!suffix.compare(tr(".plan")))
+ {
+ event->acceptProposedAction();
+ }
+ else
+ {
+ event->ignore();
+ }
+}
+
+void OPMapWidget::dropEvent(QDropEvent *event)
+{
+ const QMimeData *qm = event->mimeData();
+
+ QString fileName = qm->urls()[0].toLocalFile();
+
+ if(fileName.right(5) == ".plan")
+ {
+ //setCommandFile(fileName);
+ //loadCommandJson(fileName);
+
+ WPLoad(fileName);
+
+ }
+}
+
+
void OPMapWidget::SetShowDiagnostics(bool const & value)
{
showDiag = value;
@@ -1183,6 +1221,20 @@ void OPMapWidget::setWPCreate(bool const & value)
{
isWPCreate = value;
+ if(map)
+ {
+ if(value)
+ {
+ map->setAcceptDrops(true);
+ }
+ else
+ {
+ map->setAcceptDrops(false);
+ }
+ }
+
+
+
if(altitudeitem)
{
if(value)
diff --git a/opmap/mapwidget/opmapwidget.h b/opmap/mapwidget/opmapwidget.h
index 7c41a21..911ea49 100644
--- a/opmap/mapwidget/opmapwidget.h
+++ b/opmap/mapwidget/opmapwidget.h
@@ -485,6 +485,10 @@ protected:
void mouseDoubleClickEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
+
+ void dragEnterEvent(QDragEnterEvent *event);
+ void dropEvent(QDropEvent *event);
+
// private slots:
signals:
void showMessage(const QString &message,int TimeOut = 0);