Skip to content
Permalink
Browse files

gui stable, added cache checkboxes

  • Loading branch information
mbernasocchi authored and pka committed Dec 9, 2010
1 parent 9564033 commit 1667fb813a063138e8d0ad855b8d728095007892
@@ -3,7 +3,7 @@
<loading_policy mode="sequential"/>

<cache type="tilecache">
<path>/home/pi/devel/gis/qgis/.qgis/cache/globe</path>
<path>/home/marco/.qgis/cache/globe</path>
</cache>

<image name="world" driver="gdal">
@@ -25,21 +25,27 @@
<url>http://demo.pelicanmapping.com/rmweb/data/srtm30_plus_tms/tms.xml</url>
</heightfield>
-->
<<<<<<< Updated upstream

=======
>>>>>>> Stashed changes
<!--
<heightfield name="WorldWind bil" driver="worldwind">
<worldwind_cache>/home/pi/devel/gis/qgis/.qgis/cache/globe/worldwind_srtm</worldwind_cache>
<worldwind_cache>/home/marco/.qgis/cache/globe/worldwind_srtm</worldwind_cache>
<cache_enabled>false</cache_enabled>
</heightfield>
-->
<<<<<<< Updated upstream

<!--
=======

>>>>>>> Stashed changes
<heightfield name="aster_dem" driver="gdal">
<url>/home/pi/data/geodata/Lech/ASTGTM_N47E010/ASTGTM_N47E010_dem.tif</url>
<url>/home/marco/data/geodata/Lech/ASTGTM_N47E010/ASTGTM_N47E010_dem.tif</url>
<cache_enabled>false</cache_enabled>
</heightfield>
-->


<!--
<vertical_scale>2</vertical_scale>
<sample_ratio>0.25</sample_ratio>
@@ -606,7 +606,7 @@ void GlobePlugin::layersChanged()
for(int i = 0; i < table->rowCount(); ++i)
{
QString type = table->item(i, 0)->text();
QString uri = table->item(i, 1)->text();
QString uri = table->item(i, 2)->text();
MapLayer* layer = 0;

if( "Raster" == type)
@@ -633,6 +633,8 @@ void GlobePlugin::layersChanged()
//map->addElevationLayer( new osgEarth::ElevationLayer( "SRTM", tms ) );
}
map->addMapLayer( layer );

bool cache = table->item(i, 1)->checkState();
layer->setCache( 0 ); //TODO: from dialog
}

@@ -201,9 +201,12 @@ void QgsGlobePluginDialog::on_elevationAdd_clicked()
int i = elevationDatasourcesWidget->rowCount();
QTableWidgetItem *type = new QTableWidgetItem(elevationCombo->currentText());
QTableWidgetItem *uri = new QTableWidgetItem(elevationPath->text());
QTableWidgetItem* cache = new QTableWidgetItem();
cache->setCheckState(Qt::Unchecked);
elevationDatasourcesWidget->setRowCount(1+i);
elevationDatasourcesWidget->setItem(i, 0, type);
elevationDatasourcesWidget->setItem(i, 1, uri);
elevationDatasourcesWidget->setItem(i, 1, cache);
elevationDatasourcesWidget->setItem(i, 2, uri);
elevationDatasourcesWidget->setCurrentItem(type, QItemSelectionModel::Clear);
}
}
@@ -280,13 +283,10 @@ void QgsGlobePluginDialog::readElevationDatasources()

elevationDatasourcesWidget->setRowCount(1+i);
elevationDatasourcesWidget->setItem(i, 0, type);
elevationDatasourcesWidget->setItem(i, 1, uri);
QCheckBox *cacheCheckbox= new QCheckBox();
elevationDatasourcesWidget->setCellWidget(i, 2, cacheCheckbox);
if(cache)
{
cacheCheckbox->setChecked(true);
}
QTableWidgetItem* chkBoxItem = new QTableWidgetItem();
(cache) ? chkBoxItem->setCheckState(Qt::Checked) : chkBoxItem->setCheckState(Qt::Unchecked);
elevationDatasourcesWidget->setItem(i, 1, chkBoxItem);
elevationDatasourcesWidget->setItem(i, 2, uri);
}
}

@@ -296,10 +296,8 @@ void QgsGlobePluginDialog::saveElevationDatasources()
for(int i = 0; i < elevationDatasourcesWidget->rowCount(); ++i)
{
QString type = elevationDatasourcesWidget->item(i, 0)->text();
QString uri = elevationDatasourcesWidget->item(i, 1)->text();
//TODO
QCheckBox *cacheCheckbox = qobject_cast<QCheckBox*>(elevationDatasourcesWidget->cellWidget(i, 2));
bool cache = cacheCheckbox->isChecked();
bool cache = elevationDatasourcesWidget->item(i, 1)->checkState();
QString uri = elevationDatasourcesWidget->item(i, 2)->text();

QString iNum;
iNum.setNum(i);
@@ -36,7 +36,6 @@ class QgsGlobePluginDialog:public QDialog, private Ui::QgsGlobePluginDialogGuiBa

private:
QSettings settings;
QCheckBox cacheCheckbox;
QString openFile();
void updateStereoDialog();
void restartGlobe();
@@ -271,7 +271,7 @@
</column>
<column>
<property name="text">
<string>Path</string>
<string>Cache</string>
</property>
<property name="font">
<font>
@@ -282,7 +282,7 @@
</column>
<column>
<property name="text">
<string>Cache</string>
<string>Path</string>
</property>
<property name="font">
<font>

0 comments on commit 1667fb8

Please sign in to comment.
You can’t perform that action at this time.