Showing with 12 additions and 6 deletions.
  1. +2 −1 python/plugins/processing/modeler/ModelerDialog.py
  2. +9 −5 src/plugins/globe/globe_plugin.cpp
  3. +1 −0 src/plugins/globe/globe_plugin.h
3 changes: 2 additions & 1 deletion python/plugins/processing/modeler/ModelerDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ def openModel(self):
self.textGroup.setText(alg.group)
self.textName.setText(alg.name)
self.repaintModel()
self.view.ensureVisible(self.scene.getLastAlgorithmItem())
if self.scene.getLastAlgorithmItem():
self.view.ensureVisible(self.scene.getLastAlgorithmItem())
self.view.centerOn(0,0)
except WrongModelException, e:
QMessageBox.critical(self,
Expand Down
14 changes: 9 additions & 5 deletions src/plugins/globe/globe_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,25 +194,25 @@ void GlobePlugin::initGui()
// Create the action for tool
mQActionPointer = new QAction( QIcon( ":/globe/globe.png" ), tr( "Launch Globe" ), this );
mQActionSettingsPointer = new QAction( QIcon( ":/globe/globe.png" ), tr( "Globe Settings" ), this );
QAction* actionUnload = new QAction( tr( "Unload Globe" ), this );
mQActionUnload = new QAction( tr( "Unload Globe" ), this );

// Set the what's this text
mQActionPointer->setWhatsThis( tr( "Overlay data on a 3D globe" ) );
mQActionSettingsPointer->setWhatsThis( tr( "Settings for 3D globe" ) );
actionUnload->setWhatsThis( tr( "Unload globe" ) );
mQActionUnload->setWhatsThis( tr( "Unload globe" ) );

// Connect actions
connect( mQActionPointer, SIGNAL( triggered() ), this, SLOT( run() ) );
connect( mQActionSettingsPointer, SIGNAL( triggered() ), this, SLOT( settings() ) );
connect( actionUnload, SIGNAL( triggered() ), this, SLOT( reset() ) );
connect( mQActionUnload, SIGNAL( triggered() ), this, SLOT( reset() ) );

// Add the icon to the toolbar
mQGisIface->addToolBarIcon( mQActionPointer );

//Add menu
mQGisIface->addPluginToMenu( tr( "&Globe" ), mQActionPointer );
mQGisIface->addPluginToMenu( tr( "&Globe" ), mQActionSettingsPointer );
mQGisIface->addPluginToMenu( tr( "&Globe" ), actionUnload );
mQGisIface->addPluginToMenu( tr( "&Globe" ), mQActionUnload );

connect( mQGisIface->mapCanvas() , SIGNAL( extentsChanged() ),
this, SLOT( extentsChanged() ) );
Expand Down Expand Up @@ -778,8 +778,12 @@ void GlobePlugin::unload()
{
reset();
// remove the GUI
mQGisIface->removePluginMenu( "&Globe", mQActionPointer );
mQGisIface->removePluginMenu( tr( "&Globe" ), mQActionPointer );
mQGisIface->removePluginMenu( tr( "&Globe" ), mQActionSettingsPointer );
mQGisIface->removePluginMenu( tr( "&Globe" ), mQActionUnload );

mQGisIface->removeToolBarIcon( mQActionPointer );

delete mQActionPointer;
}

Expand Down
1 change: 1 addition & 0 deletions src/plugins/globe/globe_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class GlobePlugin : public QObject, public QgisPlugin
QAction * mQActionPointer;
//!pointer to the qaction for this plugin
QAction * mQActionSettingsPointer;
QAction * mQActionUnload;
//! OSG Viewer
osgViewer::Viewer* mOsgViewer;
//! QT viewer widget
Expand Down