@@ -489,16 +489,17 @@ def evt_btnConnectToDb_clicked(self) -> None:
489
489
490
490
###########################################################
491
491
# Only for testing purposes
492
- # qgis_pkg_curr_version_txt : str = "0.7.3"
493
- # qgis_pkg_curr_version_major : int = 0
494
- # qgis_pkg_curr_version_minor : int = 7
495
- # qgis_pkg_curr_version_minor_rev: int = 3
492
+ # qgis_pkg_curr_version_major: int = 0
493
+ # qgis_pkg_curr_version_minor: int = 9
494
+ # qgis_pkg_curr_version_minor_rev : int = 5
495
+ # qgis_pkg_curr_version_txt: str = ".".join([str(qgis_pkg_curr_version_major), str(qgis_pkg_curr_version_minor), str(qgis_pkg_curr_version_minor_rev)])
496
496
###########################################################
497
497
498
498
# Check that the QGIS Package version is >= than the minimum required for this version of the plugin (see cdb4_constants.py)
499
499
if all ((qgis_pkg_curr_version_major == c .QGIS_PKG_MIN_VERSION_MAJOR ,
500
500
qgis_pkg_curr_version_minor == c .QGIS_PKG_MIN_VERSION_MINOR ,
501
- qgis_pkg_curr_version_minor_rev >= c .QGIS_PKG_MIN_VERSION_MINOR_REV )):
501
+ qgis_pkg_curr_version_minor_rev >= c .QGIS_PKG_MIN_VERSION_MINOR_REV ,
502
+ )):
502
503
503
504
# Set/update the status check variable
504
505
self .checks .is_qgis_pkg_supported = True
@@ -524,7 +525,30 @@ def evt_btnConnectToDb_clicked(self) -> None:
524
525
# Finish setting up the GUI
525
526
ti_wf .setup_post_qgis_pkg_installation (dlg = self )
526
527
527
- else : # Wrong (outdated?) version of QGIS Package
528
+ elif any ((qgis_pkg_curr_version_major > c .QGIS_PKG_MIN_VERSION_MAJOR ,
529
+ all ((qgis_pkg_curr_version_major == c .QGIS_PKG_MIN_VERSION_MAJOR , qgis_pkg_curr_version_minor > c .QGIS_PKG_MIN_VERSION_MINOR ))
530
+ )):
531
+ # This is a future, most likely incompatible version of the QGIS Package.
532
+ # For example: 1.x.x or 0.11.x, if the current is 0.10.x)
533
+
534
+ # Set/update the status check variable
535
+ self .checks .is_qgis_pkg_supported = False
536
+
537
+ # Update the Connection Status label
538
+ self .lblMainInst_out .setText (c .warning_html .format (text = c .INST_FAIL_VERSION_MSG ))
539
+
540
+ # Deactivate the Main Installation Group box
541
+ self .gbxMainInst .setDisabled (True )
542
+ # Deactivate the User Installation Group box
543
+ self .gbxUserInstCont .setDisabled (False )
544
+
545
+ # Inform the user
546
+ msg = f"The QGIS Package (v. { qgis_pkg_curr_version_txt } ) installed in the database you are connecting to is more recent than the one supported by this plug-in (v. { c .QGIS_PKG_MIN_VERSION_MAJOR } .{ c .QGIS_PKG_MIN_VERSION_MINOR } .x).<br><br>Please upgrade your plug-in to a more recent version or contact the database administrator."
547
+ QMessageBox .warning (self , "Unsupported QGIS Package version" , msg )
548
+
549
+ return None # Exit
550
+
551
+ else : # Wrong (outdated) version of QGIS Package
528
552
# Set/update the status check variable
529
553
self .checks .is_qgis_pkg_supported = False
530
554
0 commit comments