Add new "allowVersionCheck" setting

If true, users may control whether the version check is enabled
or disabled through the QGIS settings dialog. (The default
check behavior is determined by the existing 'checkVersion' setting).

If false, no version checking will be performed AND users will NOT
have an option to enable this check in the settings dialog.

This setting is intended for use in enterprise installs where QGIS version
management is handled centrally.
This commit is contained in:
Nyall Dawson 2018-11-27 09:26:39 +10:00
parent 59d2c5301f
commit 7c43bcda76
4 changed files with 43 additions and 19 deletions

View File

@ -1,4 +1,16 @@
[qgis]
# If true, QGIS will automatically check for new versions on startup and notify users if a new version is available.
# This setting controls the default value for that setting. Users may still manually enable or disable this check
# through the QGIS settings dialog.
checkVersion=true
# If true, users may control whether the version check is enabled or disabled through the QGIS settings dialog. (The default
# check behavior is determined by the 'checkVersion' setting). If false, no version checking will be performed and
# users will NOT have an option to enable this check in the settings dialog.
# This setting is intended for use in enterprise installs where QGIS version management is handled centrally.
allowVersionCheck=true
# If true, added layer names will be automatically capitalized and underscores replaced with spaces
formatLayerName=false

View File

@ -632,6 +632,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
cbxHideSplash->setChecked( mSettings->value( QStringLiteral( "/qgis/hideSplash" ), false ).toBool() );
mDataSourceManagerNonModal->setChecked( mSettings->value( QStringLiteral( "/qgis/dataSourceManagerNonModal" ), false ).toBool() );
cbxCheckVersion->setChecked( mSettings->value( QStringLiteral( "/qgis/checkVersion" ), true ).toBool() );
cbxCheckVersion->setVisible( mSettings->value( QStringLiteral( "/qgis/allowVersionCheck" ), true ).toBool() );
cbxAttributeTableDocked->setChecked( mSettings->value( QStringLiteral( "/qgis/dockAttributeTable" ), false ).toBool() );
cbxAddPostgisDC->setChecked( mSettings->value( QStringLiteral( "/qgis/addPostgisDC" ), false ).toBool() );
cbxAddOracleDC->setChecked( mSettings->value( QStringLiteral( "/qgis/addOracleDC" ), false ).toBool() );

View File

@ -72,7 +72,8 @@ QgsWelcomePage::QgsWelcomePage( bool skipVersionCheck, QWidget *parent )
mVersionInformation->setVisible( false );
mVersionInfo = new QgsVersionInfo();
if ( !QgsApplication::isRunningFromBuildDir() && settings.value( QStringLiteral( "qgis/checkVersion" ), true ).toBool() && !skipVersionCheck )
if ( !QgsApplication::isRunningFromBuildDir() && settings.value( QStringLiteral( "/qgis/allowVersionCheck" ), true ).toBool()
&& settings.value( QStringLiteral( "qgis/checkVersion" ), true ).toBool() && !skipVersionCheck )
{
connect( mVersionInfo, &QgsVersionInfo::versionInfoAvailable, this, &QgsWelcomePage::versionInfoReceived );
mVersionInfo->checkVersion();

View File

@ -332,7 +332,7 @@
<item>
<widget class="QStackedWidget" name="mOptionsStackedWidget">
<property name="currentIndex">
<number>13</number>
<number>0</number>
</property>
<widget class="QWidget" name="mOptionsPageGeneral">
<layout class="QVBoxLayout" name="verticalLayout_3">
@ -694,6 +694,20 @@
<property name="topMargin">
<number>0</number>
</property>
<item row="2" column="0">
<widget class="QCheckBox" name="cbxCheckVersion">
<property name="text">
<string>Check QGIS version at startup</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="mNativeColorDialogsChkBx">
<property name="text">
<string>Use native color chooser dialogs</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="mDataSourceManagerNonModal">
<property name="toolTip">
@ -711,13 +725,6 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="cbxCheckVersion">
<property name="text">
<string>Check QGIS version at startup</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="cbxHideSplash">
<property name="sizePolicy">
@ -731,13 +738,6 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="mNativeColorDialogsChkBx">
<property name="text">
<string>Use native color chooser dialogs</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@ -5544,6 +5544,8 @@ p, li { white-space: pre-wrap; }
<tabstop>mOptionsScrollArea_01</tabstop>
<tabstop>grpLocale</tabstop>
<tabstop>cboTranslation</tabstop>
<tabstop>cboGlobalLocale</tabstop>
<tabstop>cbShowGroupSeparator</tabstop>
<tabstop>cmbStyle</tabstop>
<tabstop>cmbUITheme</tabstop>
<tabstop>cmbIconSize</tabstop>
@ -5553,10 +5555,10 @@ p, li { white-space: pre-wrap; }
<tabstop>spinFontSize</tabstop>
<tabstop>mMessageTimeoutSpnBx</tabstop>
<tabstop>cbxHideSplash</tabstop>
<tabstop>cbxCheckVersion</tabstop>
<tabstop>mNativeColorDialogsChkBx</tabstop>
<tabstop>mDataSourceManagerNonModal</tabstop>
<tabstop>mCustomGroupBoxChkBx</tabstop>
<tabstop>mNativeColorDialogsChkBx</tabstop>
<tabstop>cbxCheckVersion</tabstop>
<tabstop>mProjectOnLaunchCmbBx</tabstop>
<tabstop>mProjectOnLaunchLineEdit</tabstop>
<tabstop>mProjectOnLaunchPushBtn</tabstop>
@ -5648,6 +5650,7 @@ p, li { white-space: pre-wrap; }
<tabstop>cmbLegendDoubleClickAction</tabstop>
<tabstop>cbxLegendClassifiers</tabstop>
<tabstop>mLegendGraphicResolutionSpinBox</tabstop>
<tabstop>mMapTipsDelaySpinBox</tabstop>
<tabstop>mOptionsScrollArea_05</tabstop>
<tabstop>spinBoxIdentifyValue</tabstop>
<tabstop>mIdentifyHighlightColorButton</tabstop>
@ -5667,13 +5670,15 @@ p, li { white-space: pre-wrap; }
<tabstop>pbnImportScales</tabstop>
<tabstop>pbnExportScales</tabstop>
<tabstop>scrollArea</tabstop>
<tabstop>mColorSchemesComboBox</tabstop>
<tabstop>mSchemeToolButton</tabstop>
<tabstop>mTreeCustomColors</tabstop>
<tabstop>mButtonAddColor</tabstop>
<tabstop>mButtonRemoveColor</tabstop>
<tabstop>mButtonCopyColors</tabstop>
<tabstop>mButtonPasteColors</tabstop>
<tabstop>mButtonImportColors</tabstop>
<tabstop>mButtonExportColors</tabstop>
<tabstop>mTreeCustomColors</tabstop>
<tabstop>mOptionsScrollArea_07</tabstop>
<tabstop>chkDisableAttributeValuesDlg</tabstop>
<tabstop>chkReuseLastValues</tabstop>
@ -5691,6 +5696,8 @@ p, li { white-space: pre-wrap; }
<tabstop>mSearchRadiusVertexEditComboBox</tabstop>
<tabstop>mSnappingMainDialogComboBox</tabstop>
<tabstop>mSnappingMarkerColorButton</tabstop>
<tabstop>mSnappingTooltipsCheckbox</tabstop>
<tabstop>mEnableSnappingOnInvisibleFeatureCheckbox</tabstop>
<tabstop>mMarkersOnlyForSelectedCheckBox</tabstop>
<tabstop>mMarkerStyleComboBox</tabstop>
<tabstop>mMarkerSizeSpinBox</tabstop>
@ -5736,6 +5743,9 @@ p, li { white-space: pre-wrap; }
<tabstop>mRemoveUrlPushButton</tabstop>
<tabstop>mExcludeUrlListWidget</tabstop>
<tabstop>mAdvancedSettingsEnableButton</tabstop>
<tabstop>mOpenClDevicesCombo</tabstop>
<tabstop>mGPUInfoTextBrowser</tabstop>
<tabstop>mGPUEnableCheckBox</tabstop>
</tabstops>
<resources>
<include location="../../images/images.qrc"/>