Skip to content
Permalink
Browse files

cleaned code, gui set to no drag and drop and single selection mode

  • Loading branch information
mbernasocchi authored and pka committed Dec 8, 2010
1 parent e1510a8 commit d4526de1282f7900cf07726e3bfc7d1eaafe10da
@@ -37,8 +37,6 @@

#include <osg/DisplaySettings>

QList<DataSource> elevationsDatasources;

//constructor
QgsGlobePluginDialog::QgsGlobePluginDialog( QWidget* parent, Qt::WFlags fl )
: QDialog( parent, fl )
@@ -206,6 +204,7 @@
elevationDatasourcesWidget->setRowCount(1+i);
elevationDatasourcesWidget->setItem(i, 0, type);
elevationDatasourcesWidget->setItem(i, 1, uri);
elevationDatasourcesWidget->setCurrentItem(type, QItemSelectionModel::Clear);
}
}

@@ -236,27 +235,20 @@

void QgsGlobePluginDialog::saveElevationDatasources()
{
elevationsDatasources.clear();
settings.beginGroup("Plugin-Globe");
settings.remove("ElevationsDatasources");
settings.beginWriteArray("ElevationsDatasources");

for(int i = 0; i < elevationDatasourcesWidget->rowCount(); ++i)
{
QTableWidgetItem* type = elevationDatasourcesWidget->item(i, 0);
QTableWidgetItem* uri = elevationDatasourcesWidget->item(i, 1);
DataSource ds;
ds.uri = uri->text();
ds.type = type->text();
elevationsDatasources.append(ds);
}
QString type = elevationDatasourcesWidget->item(i, 0)->text();
QString uri = elevationDatasourcesWidget->item(i, 1)->text();

settings.beginGroup("Plugin-Globe");
settings.remove("");
settings.beginWriteArray("ElevationsDatasources");
for (int i = 0; i < elevationsDatasources.size(); ++i)
{
settings.setArrayIndex(i);
settings.setValue("type", elevationsDatasources.at(i).type);
settings.setValue("uri", elevationsDatasources.at(i).uri);
settings.setValue("type", type);
settings.setValue("uri", uri);
}

settings.endArray();
settings.endGroup();
}
@@ -73,9 +73,4 @@ class QgsGlobePluginDialog:public QDialog, private Ui::QgsGlobePluginDialogGuiBa
void on_elevationRemove_clicked();
};

struct DataSource {
QString type;
QString uri;
};

#endif // QGIS_GLOBE_PLUGIN_DIALOG_H
@@ -199,6 +199,9 @@
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>

0 comments on commit d4526de

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