Skip to content

Commit 9da6afc

Browse files
mbernasocchipka
authored andcommitted
initial readProject signal support
1 parent f918105 commit 9da6afc

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

src/plugins/globe/globe_plugin.cpp

+15-2
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,12 @@ void GlobePlugin::initGui()
106106
this, SLOT( extentsChanged() ) );
107107
//connect( mQGisIface->mapCanvas(), SIGNAL( layersChanged() ),
108108
// this, SLOT( layersChanged() ) );
109+
connect( mQGisIface->mainWindow(), SIGNAL( projectRead() ), this,
110+
SLOT( projectRead() ) );
111+
connect( mQGisIface->mainWindow(), SIGNAL( newProjectCreated() ), this,
112+
SLOT( newProject() ) );
109113
}
110114

111-
112115
void GlobePlugin::run()
113116
{
114117
#ifdef QGISDEBUG
@@ -159,7 +162,6 @@ void GlobePlugin::run()
159162

160163
void GlobePlugin::settings()
161164
{
162-
mSettingsDialog.readElevationDatasources();
163165
if( mSettingsDialog.exec() )
164166
{
165167
//viewer stereo settings set by mSettingsDialog and stored in QSettings
@@ -252,6 +254,17 @@ void GlobePlugin::setupMap()
252254
#endif
253255
}
254256

257+
void GlobePlugin::projectRead()
258+
{
259+
mSettingsDialog.readElevationDatasources();
260+
}
261+
262+
void GlobePlugin::blankProject()
263+
{//TODO
264+
mSettingsDialog.elevationDatasources()->clearContents();
265+
mSettingsDialog.elevationDatasources()->setRowCount(0);
266+
}
267+
255268
struct PanControlHandler : public NavigationControlHandler
256269
{
257270
PanControlHandler( osgEarthUtil::EarthManipulator* manip, double dx, double dy ) : _manip( manip ), _dx( dx ), _dy( dy ) { }

src/plugins/globe/globe_plugin.h

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class GlobePlugin : public QObject, public QgisPlugin
5757
//! show the help document
5858
void help();
5959

60+
6061
//! Called when the main canvas is about to be rendered
6162
void renderStarting();
6263
//! Called when the main canvas has rendered.
@@ -68,6 +69,9 @@ class GlobePlugin : public QObject, public QgisPlugin
6869
//! Sync globe extent to mapCanavas
6970
void syncExtent();
7071

72+
void projectRead();
73+
void blankProject();
74+
7175
//! Place an OSG model on the globe
7276
void placeNode( osg::Node* node, double lat, double lon, double alt = 0.0 );
7377

src/plugins/globe/globe_plugin_dialog.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ void QgsGlobePluginDialog::setRow(QTableWidget* widget, int row, const QList<QTa
269269

270270
void QgsGlobePluginDialog::readElevationDatasources()
271271
{
272+
//showMessageBox("reading");
272273
// clear the widget
273274
elevationDatasourcesWidget->clearContents();
274275
int keysCount = QgsProject::instance()->subkeyList("Globe-Plugin", "/elevationDatasources/").count();

0 commit comments

Comments
 (0)