亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fetchmap.cpp

?? 給予QT的qps開源最新源碼
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
/*
  qpegps is a program for displaying a map centered at the current longitude/
  latitude as read from a gps receiver.

  Copyright (C) 2002 Ralf Haselmeier <Ralf.Haselmeier@gmx.de>

  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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA.

*/

#include "fetchmap.h"
#include "mapdisp.h"

MapSource::MapSource(QString *sourceInfo)
{
    QTextIStream *sourceIStream;
    sourceIStream = new QTextIStream (sourceInfo);
    *sourceIStream >> name >> pixelWidth >> pixelHeight >> url;
}

MapSource::MapSource(QString lname, int pWidth, int pHeight, QString lurl)
{
    name = lname;
    pixelWidth = pWidth;
    pixelHeight = pHeight;
    url = lurl;
}

MapSource::~MapSource(){};

int MapSource::operator<(MapSource& source)
{
    return (this->name < source.name);
}

int MapSource::operator==(MapSource& source)
{
    return (this->name == source.name);
}

int MapSource::operator>(MapSource& source)
{
    return (this->name > source.name);
}

QString MapSource::makeURLString(DownloadSpecification *spec)
{
    QString urlstr = url;
    QString string;
    const QString lon = "<LON>";
    const QString lat = "<LAT>";
    const QString sca = "<SCA>";

    const QString lonVal = string.setNum(spec->longitude * spec->lonHem);
    const QString latVal = string.setNum(spec->latitude * spec->latHem);
    const QString scaVal = string.setNum(spec->scale);

    urlstr.replace(lon, lonVal);
    urlstr.replace(lat, latVal);
    urlstr.replace(sca, scaVal);

    return urlstr;
}

MapSourceFile::MapSourceFile(QString mapSourceFilename)
{
    filename = mapSourceFilename;
}

MapSourceFile::~MapSourceFile(){};

MapSourceList* MapSourceFile::makeMapSourceList()
{
    MapSourceList *mapSourceList;
    mapSourceList = new MapSourceList();
    QFile sourceFile(filename);
    int ok = sourceFile.open(IO_ReadOnly);
    if ( ok )
    {
        MapSource *ms;
        QString line;
        QTextStream t( &sourceFile );
        mapSourceList->setAutoDelete(TRUE);
        while ( !t.eof() )
        {
            line = t.readLine().stripWhiteSpace();
            if (line.length() > 0) {
                if (line[0] != '#') {
                    ms = new MapSource(&line);
                    mapSourceList->append(ms);
                }
            }
        }
    }
    return mapSourceList;
}

void MapSourceFile::write(MapSourceList *)
{
    //write the sources to the file
}

MapSourceWidget::MapSourceWidget(QWidget *parent, const char *name)
        : QVBox(parent,name)
{
    sourceGB = new QVGroupBox(tr("Map Source"), this);
    sourceCB = new QComboBox(sourceGB);
    urlL = new QLabel(tr("URL:"),sourceGB);
    urlMLE = new QMultiLineEdit(sourceGB);
    urlMLE->setWordWrap(QMultiLineEdit::WidgetWidth);
    urlMLE->setWrapPolicy(QMultiLineEdit::Anywhere);
    urlMLE->setReadOnly(TRUE);

    //QHBox *hBox;
    //hBox = new QHBox(sourceGB);
    //sourceDeletePB = new QPushButton("delete",hBox);
    //sourceEditPB = new QPushButton("edit...",hBox);
    //sourceAddPB = new QPushButton("add...",hBox);

    connect(sourceCB,SIGNAL(highlighted(int)),SLOT(sourceChanged(int)));
    //connect(sourceDeletePB,SIGNAL(clicked()),SLOT(remove()));
    //connect(sourceEditPB,SIGNAL(clicked()),SLOT(edit()));
    //connect(sourceAddPB,SIGNAL(clicked()),SLOT(add()));
}

MapSourceWidget::~MapSourceWidget(){};

void MapSourceWidget::setMapSourceList(MapSourceList *mapSourceList)
{
    _mapSourceList = mapSourceList;

    for (MapSource *source=_mapSourceList->first(); source!=0; source=_mapSourceList->next()) {
        sourceCB->insertItem(source->name);
    }
    if (_mapSourceList->count() > 0)
        urlMLE->setText(_mapSourceList->first()->url);
}

int MapSourceWidget::getSourceIndex()
{
    return sourceCB->currentItem();
}

void MapSourceWidget::sourceChanged(int index)
{
    urlMLE->setText(_mapSourceList->at(index)->url);
}

void MapSourceWidget::remove()
{
    qDebug(tr("delete clicked"));
}

void MapSourceWidget::edit()
{
    MapSourceEditorDialog msDialog(this, "edit map source", TRUE, 0);
    msDialog.setCaption(tr("Edit"));
    msDialog.exec();
    if(msDialog.result()==QDialog::Accepted)
    {

    }
}

void MapSourceWidget::add()
{
    MapSourceEditorDialog msDialog(this, "add map source", TRUE, 0);
    msDialog.setCaption(tr("Add"));
    msDialog.exec();
    if(msDialog.result()==QDialog::Accepted)
    {

    }
}

MapSourceEditorDialog::MapSourceEditorDialog(QWidget *parent, const char *name,
        bool modal,WFlags f) :
        QDialog(parent,name,modal,f)
{
    resize(parent->geometry().size());
    mapSrcEditW = new MapSourceEditorWidget(this);
}

MapSourceEditorDialog::~MapSourceEditorDialog(){};

MapSourceEditorWidget::MapSourceEditorWidget( QWidget *parent, const char *name )
        : QVBox(parent,name)
{
    QHBox *hBox;
    QVBox *vBox;

    resize(parent->geometry().size());

    vBox = new QVBox(this);
    sourceGB = new QVGroupBox(tr("Download Source Information"),vBox);
    hBox = new QHBox(sourceGB);
    nameL = new QLabel(tr("name:"),hBox);
    nameLE = new QLineEdit(hBox);
    urlL = new QLabel(tr("URL:"),sourceGB);
    urlMLE = new QMultiLineEdit(sourceGB);
    urlMLE->setWordWrap(QMultiLineEdit::WidgetWidth);
    urlMLE->setWrapPolicy(QMultiLineEdit::Anywhere);
    hBox = new QHBox(sourceGB);
    mapLatLonL = new QLabel(tr("<LAT>,<LON> specify map:"),hBox);
    mapLatLonCB = new QComboBox(hBox);
    mapLatLonCB->insertItem(tr("Center"));
    mapLatLonCB->insertItem(tr("Lower Left"));
    mapLatLonCB->insertItem(tr("Upper Left"));
    mapLatLonCB->insertItem(tr("Lower Right"));
    mapLatLonCB->insertItem(tr("Upper Right"));
    gifGB = new QVGroupBox(tr("GIF Conversion"),this);
    gifL = new QLabel(tr("GIF maps must be converted to PNG"),gifGB);
    gifCB = new QCheckBox(tr("Downloaded maps are in GIF format"),gifGB);
    optimizeCB = new QCheckBox(tr("Optimize converted PNGs"),gifGB);
}

MapSourceEditorWidget::MapSourceEditorWidget( MapSource *, QWidget *parent,
        const char *name ) : QVBox(parent,name)
{
    MapSourceEditorWidget();
}

MapSourceEditorWidget::~MapSourceEditorWidget(){};

DownloadSpecification::DownloadSpecification(Position &pos, MapSelector *maps)
{
    mapSelector = maps;

    longitude = pos.lon;
    latitude = pos.lat;
    // default to current position from map info page
/*    longitude = mapInfo->mapPos.lon;
    latitude = mapInfo->mapPos.lat;

    if ((longitude == 0) && (latitude == 0)) {
        // use current location from GPS
        longitude = gpsData->gpsdData.fix.position.lon;
        latitude  = gpsData->gpsdData.fix.position.lat;
    }*/

    scale = 100000;
}

DownloadSpecification::~DownloadSpecification(){};

void DownloadSpecification::download(MapSource *mapSource)
{
    QString fullPath = mapSelector->mapPathStr() + "/" + name;
    QString urlStr = mapSource->makeURLString(this);  

    // --quick and dirty implemtation with wget for now - this will be replaced with a fully Qt solution
    //   with a progress bar and everything
#if 0 // PROXY
    if(!gpsData->proxyUrl.isEmpty())
	system("export http_proxy=" + gpsData->proxyUrl + "; wget -O " + fullPath + ".gif \"" + urlStr + "\"");
    else
#endif
   system("wget -O " + fullPath + ".gif \"" + urlStr + "\"");

    // not in Qtopia 1.5 :-(
    //ServiceRequest srv("WebAccess", "getURL(QString,QString)");
    //srv << urlStr << fullPath;
    //if(!srv.send())
    //qWarning("service getURL not available");



    // we're assuming we're downloading a gif for now.  this should be configurable in the MapSource
    // Qt/E comes compiled w/o gif support by default for licensing reasons - i think allowing users
    // to install a gif2png ipk if they want to use this feature might be a good option
    system("gif2png -O -d " + fullPath + ".gif");

    QString str = name +".png "+ str.setNum(scale) +" "+
          str.setNum(mapSource->pixelWidth) +" "+ str.setNum(mapSource->pixelHeight) +" "+
          str.setNum(latitude*latHem) +" "+ str.setNum(longitude*lonHem);
    QString nosub = "";
    MapFritz * mapFritz = new MapFritz(str, nosub);
    mapSelector->addMap(mapFritz);
}

DownloadSpecificationWidget::DownloadSpecificationWidget(DownloadSpecification *spec, QWidget *parent, const char *name)
        : QVBox(parent,name)
{
    QHBox *hBox;
    detailsGB = new QVGroupBox(tr("Download"), this);
    hBox = new QHBox(detailsGB);
    nameL = new QLabel(tr("map name:"),hBox);
    nameLE = new QLineEdit(hBox);
    hBox = new QHBox(detailsGB);
    latitudeL = new QLabel(tr("latitude:"),hBox);
    latitudeLE = new QLineEdit(hBox);
    latitudeLE->setValidator(new QDoubleValidator(-1000,1000,10,latitudeLE));
    latitudeCB = new QComboBox(hBox);
    latitudeCB->insertItem(tr("North"));
    latitudeCB->insertItem(tr("South"));
    hBox = new QHBox(detailsGB);
    longitudeL = new QLabel(tr("longitude:"),hBox);
    longitudeLE = new QLineEdit(hBox);
    longitudeLE->setValidator(new QDoubleValidator(-1000,1000,10,longitudeLE));
    longitudeCB = new QComboBox(hBox);
    longitudeCB->insertItem(tr("East"));
    longitudeCB->insertItem(tr("West"));
    hBox = new QHBox(detailsGB);
    scaleL = new QLabel(tr("scale 1:"),hBox);
    scaleCB = new QComboBox(TRUE,hBox);
    scaleCB->setValidator(new QIntValidator(1,100000000,scaleCB));
    scaleCB->insertItem("002500");
    scaleCB->insertItem("005000");
    scaleCB->insertItem("007500");
    scaleCB->insertItem("010000");
    scaleCB->insertItem("015000");
    scaleCB->insertItem("025000");
    scaleCB->insertItem("050000");
    scaleCB->insertItem("075000");
    scaleCB->insertItem("100000");
    scaleCB->insertItem("250000");
    scaleCB->insertItem("500000");
    //scalePB = new QPushButton( "...",hBox,"edit scales");

    setDownloadSpecification(spec);
}

DownloadSpecificationWidget::~DownloadSpecificationWidget(){};

bool DownloadSpecificationWidget::validate()
{
    bool valid=TRUE;

    if (longitudeLE->text().stripWhiteSpace().isEmpty()) {
        QMessageBox mb( tr("Map Download"),
                        tr("Longitude not specified.\n\nYou must specify a longitude."),
                        QMessageBox::Warning,
                        QMessageBox::Ok | QMessageBox::Default,
                        QMessageBox::NoButton,
                        QMessageBox::NoButton );
        mb.exec();
        mb.hide();
        valid = FALSE;
    } else if (latitudeLE->text().stripWhiteSpace().isEmpty()) {
        QMessageBox mb( tr("Map Download"),

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品毛片久久久久久| 狠狠色丁香婷婷综合久久片| 精品免费日韩av| 日韩vs国产vs欧美| 午夜久久电影网| 国产酒店精品激情| 裸体歌舞表演一区二区| 99视频精品在线| 99re成人在线| 日韩视频免费观看高清完整版| 午夜亚洲福利老司机| 久久99精品国产麻豆不卡| 青青草原综合久久大伊人精品 | 亚洲一区二区不卡免费| 美国毛片一区二区三区| 日韩va亚洲va欧美va久久| 成人夜色视频网站在线观看| 国产精品伦理一区二区| 亚洲va国产va欧美va观看| 欧美男女性生活在线直播观看| 久久网站热最新地址| 日韩欧美一级在线播放| 亚洲免费av观看| 国产精品少妇自拍| 麻豆精品一二三| 亚洲天堂精品在线观看| 日韩成人免费电影| 久久看人人爽人人| 精品国产一区二区在线观看| 亚洲高清免费观看| 不卡区在线中文字幕| 99久久99久久精品国产片果冻| 51精品视频一区二区三区| 欧美电影免费提供在线观看| 亚洲精品一二三| 天堂精品中文字幕在线| www.欧美精品一二区| 欧美亚一区二区| 国产精品色哟哟| 亚洲精品欧美专区| 成人午夜免费电影| 在线看一区二区| 自拍偷拍欧美精品| 国产精品传媒入口麻豆| 亚洲欧美偷拍另类a∨色屁股| 午夜精品久久久久久不卡8050| 天堂蜜桃91精品| 国产成人一级电影| 欧洲视频一区二区| 欧美一区二区三区视频免费| 亚洲免费观看高清完整版在线观看熊| 日日夜夜免费精品| 不卡av在线网| 粉嫩蜜臀av国产精品网站| 日韩一区二区麻豆国产| 91精品一区二区三区在线观看| 一区二区三区日韩| 日本午夜一本久久久综合| 在线观看中文字幕不卡| 欧美日韩中文另类| 亚洲视频在线一区观看| 高清不卡在线观看av| 日本国产一区二区| 国产欧美日韩不卡免费| 欧美三级在线看| 一区二区三区产品免费精品久久75| 香港成人在线视频| 99免费精品在线| 久久综合久久综合久久综合| 精品久久久久久最新网址| 精品久久久久久久久久久久久久久 | 国产欧美一区视频| 麻豆91在线观看| 色婷婷精品久久二区二区蜜臂av| 91香蕉视频黄| 中文字幕亚洲在| 狠狠色综合播放一区二区| 精品福利一区二区三区免费视频| 一区二区三区四区高清精品免费观看 | 六月婷婷色综合| 91精品国产综合久久福利软件| 亚洲欧洲无码一区二区三区| 国产欧美日韩精品a在线观看| 国产999精品久久久久久绿帽| 欧美高清激情brazzers| 亚洲午夜在线电影| 91丨国产丨九色丨pron| 国产精品天干天干在线综合| 久久精品二区亚洲w码| 国产一区啦啦啦在线观看| 91精品国产综合久久蜜臀| 国产精品美女一区二区三区| 99免费精品视频| 中文字幕国产一区| 色天天综合久久久久综合片| 3d动漫精品啪啪| 久久精品国内一区二区三区| 欧美精品黑人性xxxx| 五月天视频一区| 欧美日韩视频一区二区| 中文字幕一区二区三区蜜月| 色香色香欲天天天影视综合网| 国产日韩欧美一区二区三区乱码| 99久久99久久精品免费观看 | 日本不卡1234视频| 欧洲激情一区二区| 亚洲一区二区精品视频| 欧美吻胸吃奶大尺度电影| 日韩欧美一级片| 不卡的av在线| 日本一区二区不卡视频| 欧美日韩三级一区| 亚洲成人动漫在线免费观看| 精品播放一区二区| 国产suv一区二区三区88区| 亚洲激情网站免费观看| 在线免费av一区| 日韩伦理电影网| 国产精品灌醉下药二区| 国产精品一区免费视频| 亚洲激情图片小说视频| 91麻豆视频网站| 天天综合色天天| 91精品国产麻豆| 国产精品一区二区久激情瑜伽 | 欧美午夜精品一区二区蜜桃| 亚洲在线一区二区三区| 欧美岛国在线观看| 91天堂素人约啪| 久草精品在线观看| 亚洲男人电影天堂| 久久综合色综合88| 91官网在线免费观看| 国产一区二区三区四区五区入口| 亚洲永久精品国产| 亚洲国产精品传媒在线观看| 欧美福利视频导航| aa级大片欧美| 激情深爱一区二区| 亚洲成a天堂v人片| 欧美国产精品一区二区| 日韩欧美色综合网站| 欧美在线视频日韩| 粉嫩av一区二区三区在线播放| 三级在线观看一区二区| 中文字幕色av一区二区三区| 精品国产sm最大网站| 欧美日韩国产一级| 99久久99久久精品国产片果冻 | 久久久精品国产免大香伊| 欧美视频在线一区二区三区| 成人av综合一区| 国内精品视频666| 蜜桃av噜噜一区| 视频一区二区三区入口| 一区二区三区精品| 中文字幕综合网| 中文字幕va一区二区三区| 精品乱码亚洲一区二区不卡| 欧美剧情电影在线观看完整版免费励志电影 | 欧美绝品在线观看成人午夜影视| 一本到高清视频免费精品| 成人国产精品免费观看视频| 国产精品99久久久久| 国产一区三区三区| 日韩精品成人一区二区在线| 亚洲精品国产第一综合99久久| 欧美极品美女视频| 国产三级精品三级| 久久久久久久久久电影| 久久综合久久99| 精品免费一区二区三区| 日韩欧美一区在线观看| 在线成人高清不卡| 欧美精品一卡两卡| 欧美日韩国产乱码电影| 欧美亚洲动漫另类| 欧美日韩国产不卡| 欧美日韩国产高清一区二区| 欧美精品色综合| 欧美老年两性高潮| 91精品国产麻豆国产自产在线 | 日韩国产精品91| 亚洲制服丝袜一区| 亚洲国产一区视频| 亚洲一区二区视频在线观看| 一区二区三区免费观看| 一区二区三区丝袜| 亚洲综合成人网| 亚洲aaa精品| 日韩 欧美一区二区三区| 蜜臀av一区二区在线观看| 久久99精品久久只有精品| 蜜桃传媒麻豆第一区在线观看| 亚洲色图欧洲色图婷婷| 中文字幕在线视频一区| 久久久久一区二区三区四区| 久久天天做天天爱综合色| 国产清纯白嫩初高生在线观看91 | 国产午夜精品福利|