@@ -90,6 +90,7 @@ QgsGlobePluginDialog::QgsGlobePluginDialog( QWidget* parent, Qt::WFlags fl )
90
90
#endif
91
91
92
92
connect ( checkBoxSkyAutoAmbient, SIGNAL ( toggled ( bool ) ), horizontalSliderMinAmbient, SLOT ( setEnabled ( bool ) ) );
93
+ connect ( checkBoxDateTime, SIGNAL ( toggled ( bool ) ), dateTimeEditSky, SLOT ( setEnabled ( bool ) ) );
93
94
connect ( buttonBox->button ( QDialogButtonBox::Apply ), SIGNAL ( clicked ( bool ) ), this , SLOT ( apply () ) );
94
95
95
96
restoreSavedSettings ();
@@ -121,6 +122,9 @@ void QgsGlobePluginDialog::restoreSavedSettings()
121
122
groupBoxAntiAliasing->setChecked ( settings.value ( " /Plugin-Globe/anti-aliasing" , false ).toBool () );
122
123
lineEditAASamples->setText ( settings.value ( " /Plugin-Globe/anti-aliasing-level" , " " ).toString () );
123
124
125
+ horizontalSliderMinAmbient->setEnabled ( checkBoxSkyAutoAmbient->isChecked () );
126
+ dateTimeEditSky->setEnabled ( checkBoxDateTime->isChecked () );
127
+
124
128
// Advanced
125
129
sliderScrollSensitivity->setValue ( settings.value ( " /Plugin-Globe/scrollSensitivity" , 20 ).toInt () );
126
130
checkBoxInvertScroll->setChecked ( settings.value ( " /Plugin-Globe/invertScrollWheel" , 0 ).toInt () );
@@ -224,6 +228,7 @@ void QgsGlobePluginDialog::readProjectSettings()
224
228
225
229
// Map settings
226
230
groupBoxSky->setChecked ( QgsProject::instance ()->readBoolEntry ( " Globe-Plugin" , " /skyEnabled" , true ) );
231
+ checkBoxDateTime->setChecked ( QgsProject::instance ()->readBoolEntry ( " Globe-Plugin" , " /overrideDateTime" , false ) );
227
232
dateTimeEditSky->setDateTime ( QDateTime::fromString ( QgsProject::instance ()->readEntry ( " Globe-Plugin" , " /skyDateTime" , QDateTime::currentDateTime ().toString () ) ) );
228
233
checkBoxSkyAutoAmbient->setChecked ( QgsProject::instance ()->readBoolEntry ( " Globe-Plugin" , " /skyAutoAmbient" , true ) );
229
234
horizontalSliderMinAmbient->setValue ( QgsProject::instance ()->readDoubleEntry ( " Globe-Plugin" , " /skyMinAmbient" , 30 . ) );
@@ -257,6 +262,7 @@ void QgsGlobePluginDialog::writeProjectSettings()
257
262
258
263
// Map settings
259
264
QgsProject::instance ()->writeEntry ( " Globe-Plugin" , " /skyEnabled/" , groupBoxSky->isChecked () );
265
+ QgsProject::instance ()->writeEntry ( " Globe-Plugin" , " /overrideDateTime/" , checkBoxDateTime->isChecked () );
260
266
QgsProject::instance ()->writeEntry ( " Globe-Plugin" , " /skyDateTime/" , dateTimeEditSky->dateTime ().toString () );
261
267
QgsProject::instance ()->writeEntry ( " Globe-Plugin" , " /skyAutoAmbient/" , checkBoxSkyAutoAmbient->isChecked () );
262
268
QgsProject::instance ()->writeEntry ( " Globe-Plugin" , " /skyMinAmbient/" , horizontalSliderMinAmbient->value () );
@@ -460,7 +466,15 @@ bool QgsGlobePluginDialog::getSkyEnabled() const
460
466
461
467
QDateTime QgsGlobePluginDialog::getSkyDateTime () const
462
468
{
463
- return QDateTime::fromString ( QgsProject::instance ()->readEntry ( " Globe-Plugin" , " /skyDateTime" , QDateTime::currentDateTime ().toString () ) );
469
+ bool overrideDateTime = QgsProject::instance ()->readBoolEntry ( " Globe-Plugin" , " /overrideDateTime" , false );
470
+ if ( overrideDateTime )
471
+ {
472
+ return QDateTime::fromString ( QgsProject::instance ()->readEntry ( " Globe-Plugin" , " /skyDateTime" , QDateTime::currentDateTime ().toString () ) );
473
+ }
474
+ else
475
+ {
476
+ return QDateTime::currentDateTime ();
477
+ }
464
478
}
465
479
466
480
bool QgsGlobePluginDialog::getSkyAutoAmbience () const
0 commit comments