@@ -2973,6 +2973,7 @@ void QgisApp::fileNew( bool thePromptToSaveFlag, bool forceBlank )
29732973 mMapCanvas ->freeze ( false );
29742974 mMapCanvas ->refresh ();
29752975 mMapCanvas ->clearExtentHistory ();
2976+ mScaleEdit ->updateScales ();
29762977
29772978 // set project CRS
29782979 QgsMapRenderer* myRenderer = mMapCanvas ->mapRenderer ();
@@ -3107,6 +3108,13 @@ void QgisApp::fileOpen()
31073108 }
31083109
31093110 setTitleBarText_ ( *this );
3111+
3112+ bool projectScales = QgsProject::instance ()->readBoolEntry ( " Scales" , " /useProjectScales" );
3113+ if ( projectScales )
3114+ {
3115+ mScaleEdit ->updateScales ( QgsProject::instance ()->readListEntry ( " Scales" , " /ScalesList" ) );
3116+ }
3117+
31103118 emit projectRead (); // let plug-ins know that we've read in a new
31113119 // project so that they can check any project
31123120 // specific plug-in state
@@ -3117,7 +3125,6 @@ void QgisApp::fileOpen()
31173125 mMapCanvas ->freeze ( false );
31183126 mMapCanvas ->refresh ();
31193127 }
3120-
31213128} // QgisApp::fileOpen
31223129
31233130
@@ -3170,6 +3177,13 @@ bool QgisApp::addProject( QString projectFile )
31703177 int myAlpha = QgsProject::instance ()->readNumEntry ( " Gui" , " /SelectionColorAlphaPart" , defaultAlpha );
31713178 QgsRenderer::setSelectionColor ( QColor ( myRed, myGreen, myBlue, myAlpha ) );
31723179
3180+ // load project scales
3181+ bool projectScales = QgsProject::instance ()->readBoolEntry ( " Scales" , " /useProjectScales" );
3182+ if ( projectScales )
3183+ {
3184+ mScaleEdit ->updateScales ( QgsProject::instance ()->readListEntry ( " Scales" , " /ScalesList" ) );
3185+ }
3186+
31733187 mMapCanvas ->updateScale ();
31743188 QgsDebugMsg ( " Scale restored..." );
31753189
@@ -3302,12 +3316,10 @@ void QgisApp::fileSaveAs()
33023316 }
33033317} // QgisApp::fileSaveAs
33043318
3305-
33063319// Open the project file corresponding to the
33073320// path at the given index in mRecentProjectPaths
33083321void QgisApp::openProject ( QAction *action )
33093322{
3310-
33113323 // possibly save any pending work before opening a different project
33123324 QString debugme;
33133325 assert ( action != NULL );
@@ -3323,7 +3335,6 @@ void QgisApp::openProject( QAction *action )
33233335 int myProjectionEnabledFlag =
33243336 QgsProject::instance ()->readNumEntry ( " SpatialRefSys" , " /ProjectionsEnabled" , 0 );
33253337 mMapCanvas ->mapRenderer ()->setProjectionsEnabled ( myProjectionEnabledFlag );
3326-
33273338} // QgisApp::openProject
33283339
33293340
@@ -3342,7 +3353,6 @@ void QgisApp::openProject( const QString & fileName )
33423353 return ;
33433354}
33443355
3345-
33463356/* *
33473357 Open a raster or vector file; ignore other files.
33483358 Used to process a commandline argument or OpenDocument AppleEvent.
@@ -6499,6 +6509,9 @@ void QgisApp::projectProperties()
64996509 // changing things in the project properties dialog box
65006510 connect ( pp, SIGNAL ( displayPrecisionChanged () ), this ,
65016511 SLOT ( updateMouseCoordinatePrecision () ) );
6512+
6513+ connect ( pp, SIGNAL ( scalesChanged ( const QStringList & ) ), mScaleEdit ,
6514+ SLOT ( updateScales ( const QStringList & ) ) );
65026515 QApplication::restoreOverrideCursor ();
65036516
65046517 // pass any refresh signals off to canvases
0 commit comments