Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Plugin installer] Don't show wait cursor when fetching repositories
  • Loading branch information
borysiasty committed Apr 22, 2023
1 parent 699fa93 commit 43d1528
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
29 changes: 14 additions & 15 deletions python/pyplugin_installer/installer.py
Expand Up @@ -120,22 +120,21 @@ def fetchAvailablePlugins(self, reloadMode):
""" Fetch plugins from all enabled repositories."""
""" reloadMode = true: Fully refresh data from QgsSettings to mRepositories """
""" reloadMode = false: Fetch unready repositories only """
with OverrideCursor(Qt.WaitCursor):
if reloadMode:
repositories.load()
plugins.clearRepoCache()
plugins.getAllInstalled()
if reloadMode:
repositories.load()
plugins.clearRepoCache()
plugins.getAllInstalled()

for key in repositories.allEnabled():
if reloadMode or repositories.all()[key]["state"] == 3: # if state = 3 (error or not fetched yet), try to fetch once again
repositories.requestFetching(key, force_reload=reloadMode)

if repositories.fetchingInProgress():
fetchDlg = QgsPluginInstallerFetchingDialog(iface.mainWindow())
fetchDlg.exec_()
del fetchDlg
for key in repositories.all():
repositories.killConnection(key)
for key in repositories.allEnabled():
if reloadMode or repositories.all()[key]["state"] == 3: # if state = 3 (error or not fetched yet), try to fetch once again
repositories.requestFetching(key, force_reload=reloadMode)

if repositories.fetchingInProgress():
fetchDlg = QgsPluginInstallerFetchingDialog(iface.mainWindow())
fetchDlg.exec_()
del fetchDlg
for key in repositories.all():
repositories.killConnection(key)

# display error messages for every unavailable repository, unless Shift pressed nor all repositories are unavailable
keepQuiet = QgsApplication.keyboardModifiers() == Qt.KeyboardModifiers(Qt.ShiftModifier)
Expand Down
Expand Up @@ -24,7 +24,7 @@
***************************************************************************/
"""

from qgis.PyQt.QtCore import QCoreApplication
from qgis.PyQt.QtCore import Qt, QCoreApplication
from qgis.PyQt.QtWidgets import QDialog, QTreeWidgetItem

from .ui_qgsplugininstallerfetchingbase import Ui_QgsPluginInstallerFetchingDialogBase
Expand Down Expand Up @@ -54,6 +54,7 @@ def __init__(self, parent):
self.itemProgress[key] = 0
self.displayState(key, 2)
self.treeWidget.resizeColumnToContents(0)
self.treeWidget.setCursor(Qt.WaitCursor)
repositories.repositoryFetched.connect(self.repositoryFetched)
repositories.anythingChanged.connect(self.displayState)

Expand Down

0 comments on commit 43d1528

Please sign in to comment.