Skip to content

Commit

Permalink
Fix issue where gps tracker was not being restored properly on subseq…
Browse files Browse the repository at this point in the history
…uent qgis launches. Also wrapped some more conditional qwt bits

git-svn-id: http://svn.osgeo.org/qgis/trunk@12711 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jan 8, 2010
1 parent 502ca0a commit 8b1e064
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
40 changes: 18 additions & 22 deletions src/app/qgisapp.cpp
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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();

Expand All @@ -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();
}

Expand Down Expand Up @@ -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 ///////////////

Expand Down
7 changes: 6 additions & 1 deletion src/app/qgisapp.h
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 & );
};
Expand Down

0 comments on commit 8b1e064

Please sign in to comment.