Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit 7c43bcd)
  • Loading branch information
nyalldawson committed Nov 29, 2018
1 parent 9e05356 commit 92407bc
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 19 deletions.
12 changes: 12 additions & 0 deletions resources/qgis_global_settings.ini
@@ -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

Expand Down
1 change: 1 addition & 0 deletions src/app/qgsoptions.cpp
Expand Up @@ -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() );
Expand Down
3 changes: 2 additions & 1 deletion src/app/qgswelcomepage.cpp
Expand Up @@ -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();
Expand Down
46 changes: 28 additions & 18 deletions src/ui/qgsoptionsbase.ui
Expand Up @@ -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">
Expand Down Expand Up @@ -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">
Expand All @@ -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">
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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"/>
Expand Down

0 comments on commit 92407bc

Please sign in to comment.