Skip to content
Permalink
Browse files
Fix issue where gps tracker was not being restored properly on subseq…
…uent qgis launches. Also wrapped some more conditional qwt bits

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12711 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jan 8, 2010
1 parent 3b89436 commit 9e2652e2c7d903d7f074e1050e36f8f78bc514d5
Showing with 24 additions and 23 deletions.
  1. +18 −22 src/app/qgisapp.cpp
  2. +6 −1 src/app/qgisapp.h
@@ -330,8 +330,11 @@ QgisApp::QgisApp( QSplashScreen *splash, QWidget * parent, Qt::WFlags fl )
: QMainWindow( parent, fl ),
mSplash( splash ),
mPythonConsole( NULL ),
mPythonUtils( NULL ),
mPythonUtils( NULL )
#ifdef HAVE_QWT
,
mpGpsWidget( NULL )
#endif
{
if ( smInstance )
{
@@ -2080,15 +2083,7 @@ void QgisApp::saveRecentProjectPath( QString projectPath, QSettings & settings )
// Persist the list
settings.setValue( "/UI/recentProjectsList", mRecentProjectPaths );

// Persist state of GPS Tracker
if ( mpGpsWidget )
{
settings.setValue( "/gps/widgetEnabled", true );
}
else
{
settings.setValue( "/gps/widgetEnabled", false );
}

// Update menu list of paths
updateRecentProjectPaths();

@@ -2104,6 +2099,19 @@ void QgisApp::saveWindowState()
// store window geometry
settings.setValue( "/UI/geometry", saveGeometry() );

#if HAVE_QWT
// Persist state of GPS Tracker
if ( mpGpsWidget )
{
settings.setValue( "/gps/widgetEnabled", true );
delete mpGpsWidget;
}
else
{
settings.setValue( "/gps/widgetEnabled", false );
}
#endif

QgsPluginRegistry::instance()->unloadAll();
}

@@ -2134,18 +2142,6 @@ void QgisApp::restoreWindowState()
QgsDebugMsg( "restore of UI geometry failed" );
}

#ifdef HAVE_QWT
// Persist state of GPS Tracker
if ( mpGpsWidget )
{
settings.setValue( "/gps/widgetEnabled", true );
delete mpGpsWidget;
}
else
{
settings.setValue( "/gps/widgetEnabled", false );
}
#endif
}
///////////// END OF GUI SETUP ROUTINES ///////////////

@@ -70,7 +70,9 @@ class QDomDocument;
#include "qgsconfig.h"
#include "qgsfeature.h"
#include "qgspoint.h"
#ifdef HAVE_QWT
class QgsGPSInformationWidget;
#endif

/*! \class QgisApp
* \brief Main window for the Qgis application
@@ -902,7 +904,9 @@ class QgisApp : public QMainWindow
// docks ------------------------------------------
QDockWidget *mLegendDock;
QDockWidget *mOverviewDock;
#ifdef HAVE_QWT
QDockWidget *mpGpsDock;
#endif

#ifdef Q_WS_MAC
//! Window menu action to select this window
@@ -1050,9 +1054,10 @@ class QgisApp : public QMainWindow

int mLastComposerId;

#ifdef HAVE_QWT
//! Persistent GPS toolbox
QgsGPSInformationWidget * mpGpsWidget;

#endif
//! project changed
void projectChanged( const QDomDocument & );
};

0 comments on commit 9e2652e

Please sign in to comment.