Skip to content

Commit

Permalink
initial readProject signal support
Browse files Browse the repository at this point in the history
  • Loading branch information
mbernasocchi authored and pka committed Jul 5, 2011
1 parent f918105 commit 9da6afc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/plugins/globe/globe_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,12 @@ void GlobePlugin::initGui()
this, SLOT( extentsChanged() ) );
//connect( mQGisIface->mapCanvas(), SIGNAL( layersChanged() ),
// this, SLOT( layersChanged() ) );
connect( mQGisIface->mainWindow(), SIGNAL( projectRead() ), this,
SLOT( projectRead() ) );
connect( mQGisIface->mainWindow(), SIGNAL( newProjectCreated() ), this,
SLOT( newProject() ) );
}


void GlobePlugin::run()
{
#ifdef QGISDEBUG
Expand Down Expand Up @@ -159,7 +162,6 @@ void GlobePlugin::run()

void GlobePlugin::settings()
{
mSettingsDialog.readElevationDatasources();
if( mSettingsDialog.exec() )
{
//viewer stereo settings set by mSettingsDialog and stored in QSettings
Expand Down Expand Up @@ -252,6 +254,17 @@ void GlobePlugin::setupMap()
#endif
}

void GlobePlugin::projectRead()
{
mSettingsDialog.readElevationDatasources();
}

void GlobePlugin::blankProject()
{//TODO
mSettingsDialog.elevationDatasources()->clearContents();
mSettingsDialog.elevationDatasources()->setRowCount(0);
}

struct PanControlHandler : public NavigationControlHandler
{
PanControlHandler( osgEarthUtil::EarthManipulator* manip, double dx, double dy ) : _manip( manip ), _dx( dx ), _dy( dy ) { }
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/globe/globe_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class GlobePlugin : public QObject, public QgisPlugin
//! show the help document
void help();


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

void projectRead();
void blankProject();

//! Place an OSG model on the globe
void placeNode( osg::Node* node, double lat, double lon, double alt = 0.0 );

Expand Down
1 change: 1 addition & 0 deletions src/plugins/globe/globe_plugin_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ void QgsGlobePluginDialog::setRow(QTableWidget* widget, int row, const QList<QTa

void QgsGlobePluginDialog::readElevationDatasources()
{
//showMessageBox("reading");
// clear the widget
elevationDatasourcesWidget->clearContents();
int keysCount = QgsProject::instance()->subkeyList("Globe-Plugin", "/elevationDatasources/").count();
Expand Down

0 comments on commit 9da6afc

Please sign in to comment.