Skip to content
Permalink
Browse files

Provide the enhancement in ticket #207 (option of whether to

ask the user to save a project when exiting, etc).


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6381 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m
g_j_m committed Jan 2, 2007
1 parent 6185a19 commit 3339af508e0146272bc033f163de55a0aad4b535
Showing with 60 additions and 6 deletions.
  1. +5 −2 src/gui/qgisapp.cpp
  2. +3 −0 src/gui/qgsoptions.cpp
  3. +52 −4 src/ui/qgsoptionsbase.ui
@@ -4391,7 +4391,7 @@ void QgisApp::setExtent(QgsRect theRect)

int QgisApp::saveDirty()
{
int answer = 0;
int answer(QMessageBox::No);
mMapCanvas->freeze(true);

#ifdef QGISDEBUG
@@ -4418,7 +4418,10 @@ int QgisApp::saveDirty()
}
#endif

if ((QgsProject::instance()->dirty() || (mMapCanvas->isDirty()) && mMapCanvas->layerCount() > 0))
QSettings settings;
bool askThem = settings.value("qgis/askToSaveProjectChanges", true).toBool();

if (askThem && (QgsProject::instance()->dirty() || (mMapCanvas->isDirty()) && mMapCanvas->layerCount() > 0))
{
// flag project as dirty since dirty state of canvas is reset if "dirty"
// is based on a zoom or pan
@@ -130,6 +130,8 @@ QgsOptions::QgsOptions(QWidget *parent, Qt::WFlags fl) :
pbnMeasureColour->setColor( QColor(myRed,myGreen,myBlue) );

capitaliseCheckBox->setChecked(settings.value("qgis/capitaliseLayerName", QVariant(false)).toBool());

chbAskToSaveProjectChanges->setChecked(settings.value("qgis/askToSaveProjectChanges", QVariant(true)).toBool());

cmbWheelAction->setCurrentIndex(settings.value("/qgis/wheel_action", 0).toInt());
spinZoomFactor->setValue(settings.value("/qgis/zoom_factor", 2).toDouble());
@@ -189,6 +191,7 @@ void QgsOptions::saveOptions()
settings.writeEntry("/qgis/enable_anti_aliasing",chkAntiAliasing->isChecked());
settings.writeEntry("/qgis/use_qimage_to_render", !(chkUseQPixmap->isChecked()));
settings.setValue("qgis/capitaliseLayerName", capitaliseCheckBox->isChecked());
settings.setValue("qgis/askToSaveProjectChanges", chbAskToSaveProjectChanges->isChecked());

if(cmbTheme->currentText().length() == 0)
{
@@ -6,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>590</width>
<height>454</height>
<height>463</height>
</rect>
</property>
<property name="windowTitle" >
@@ -31,8 +31,56 @@
<item row="0" column="0" >
<widget class="QTabWidget" name="tabWidget" >
<property name="currentIndex" >
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="tabGeneral" >
<attribute name="title" >
<string>&amp;General</string>
</attribute>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox_11" >
<property name="title" >
<string>General</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="chbAskToSaveProjectChanges" >
<property name="text" >
<string>Ask to save project changes when required</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabAppearance" >
<attribute name="title" >
<string>&amp;Appearance</string>
@@ -258,7 +306,7 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="TabPage" >
<widget class="QWidget" name="tabRendering" >
<attribute name="title" >
<string>&amp;Rendering</string>
</attribute>
@@ -603,7 +651,7 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<widget class="QWidget" name="TabPage" >
<widget class="QWidget" name="tabProjection" >
<attribute name="title" >
<string>Pro&amp;jection</string>
</attribute>

0 comments on commit 3339af5

Please sign in to comment.
You can’t perform that action at this time.