提交 662aae57 编写于 作者: 丁劲犇's avatar 丁劲犇 😸

will remember autodownload options

上级 91e390a4
......@@ -316,6 +316,9 @@ namespace QTVOSM{
map_evt["status"] =m_bconnected?"CONNECTED":"CLOSED";
m_pViewer->post_event(map_evt);
}
QSettings settings(QCoreApplication::applicationFilePath()+".ini",QSettings::IniFormat);
settings.setValue(QString("settings/nAutoDownload_%1").arg(get_name()),bconnected?-1:0);
}
......
......@@ -18,6 +18,8 @@ namespace QTVOSM{
QString strServerURL = settings.value(QString("settings/ServerURL_%1").arg(layer->get_name()),"http://c.tile.openstreetmap.org/%1/%2/%3.png").toString();
QString strLocalCache = settings.value(QString("settings/LocalCache_%1").arg(layer->get_name()), QCoreApplication::applicationDirPath() +"/OSMCache").toString();
int nCacheExpireDays = settings.value(QString("settings/CacheExpireDays_%1").arg(layer->get_name()), 30).toInt();
int nAutoDownload = settings.value(QString("settings/nAutoDownload_%1").arg(layer->get_name()), 0).toInt();
ui->lineEdit_cacheFolder->setText(strLocalCache);
ui->lineEdit_addressUrl->setText(strServerURL);
ui->spinBox_cacheExpireDays->setValue(nCacheExpireDays);
......@@ -30,7 +32,10 @@ namespace QTVOSM{
connect (layer, &layer_tiles::svrurlChanged ,this->ui->lineEdit_addressUrl, &QLineEdit::setText);
connect (layer, &layer_tiles::cacheChanged ,this->ui->lineEdit_cacheFolder, &QLineEdit::setText);
connect (layer, &layer_tiles::cacheExpireChanged ,this->ui->spinBox_cacheExpireDays, &QSpinBox::setValue);
ui->checkBox_connect->setChecked(layer->isConnected());
//ui->checkBox_connect->setChecked(layer->isConnected());
if (nAutoDownload!=0)
layer->connectToTilesServer(true);
}
void layer_tiles_page::reTransUI()
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册