Skip to content

Commit

Permalink
Merge pull request #257 from opengisch/pyqtslots
Browse files Browse the repository at this point in the history
Kill pyqt slots for QGIS 3.20
  • Loading branch information
suricactus authored Jun 23, 2021
2 parents b917bee + 781e20e commit cc1d72e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
4 changes: 0 additions & 4 deletions qfieldsync/core/offline_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
Qt,
QObject,
pyqtSignal,
pyqtSlot,
QCoreApplication
)
from qgis.PyQt.QtWidgets import (
Expand Down Expand Up @@ -378,16 +377,13 @@ def createBaseMapLayer(self, map_theme, layer, tile_size, map_units_per_pixel):
layer_tree = QgsProject.instance().layerTreeRoot()
layer_tree.insertLayer(len(layer_tree.children()), new_layer)

@pyqtSlot(int, int)
def on_offline_editing_next_layer(self, layer_index, layer_count):
msg = self.trUtf8('Packaging layer {layer_name}…').format(layer_name=self.__offline_layer_names[layer_index - 1])
self.total_progress_updated.emit(layer_index, layer_count, msg)

@pyqtSlot('QgsOfflineEditing::ProgressMode', int)
def on_offline_editing_max_changed(self, _, mode_count):
self.__max_task_progress = mode_count

@pyqtSlot(int)
def offline_editing_task_progress(self, progress):
self.task_progress_updated.emit(progress, self.__max_task_progress)

Expand Down
5 changes: 0 additions & 5 deletions qfieldsync/gui/package_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
)
from qfieldsync.gui.project_configuration_dialog import ProjectConfigurationDialog
from qgis.PyQt.QtCore import (
pyqtSlot,
Qt
)
from qgis.PyQt.QtGui import (
Expand Down Expand Up @@ -185,26 +184,22 @@ def show_settings(self):
dlg.exec_()
self.update_info_visibility()

@pyqtSlot(int, int, str)
def update_total(self, current, layer_count, message):
self.totalProgressBar.setMaximum(layer_count)
self.totalProgressBar.setValue(current)
self.statusLabel.setText(message)

@pyqtSlot(int, int)
def update_task(self, progress, max_progress):
self.layerProgressBar.setMaximum(max_progress)
self.layerProgressBar.setValue(progress)

@pyqtSlot()
def extent_changed(self):
extent = self.iface.mapCanvas().extent()
self.xMinLabel.setText(str(extent.xMinimum()))
self.xMaxLabel.setText(str(extent.xMaximum()))
self.yMinLabel.setText(str(extent.yMinimum()))
self.yMaxLabel.setText(str(extent.yMaximum()))

@pyqtSlot(str, str)
def show_warning(self, _, message):
# Most messages from the offline editing plugin are not important enough to show in the message bar.
# In case we find important ones in the future, we need to filter them.
Expand Down
5 changes: 0 additions & 5 deletions qfieldsync/gui/synchronize_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
***************************************************************************/
"""
import os
from qgis.PyQt.QtCore import pyqtSlot
from qgis.PyQt.QtWidgets import (
QDialog,
QDialogButtonBox,
Expand Down Expand Up @@ -98,21 +97,17 @@ def start_synchronization(self):
except NoProjectFoundError as e:
self.iface.messageBar().pushWarning('QFieldSync', str(e))

@pyqtSlot(int, int)
def update_total(self, current, layer_count):
self.totalProgressBar.setMaximum(layer_count)
self.totalProgressBar.setValue(current)

@pyqtSlot(int)
def update_value(self, progress):
self.layerProgressBar.setValue(progress)

@pyqtSlot('QgsOfflineEditing::ProgressMode', int)
def update_mode(self, _, mode_count):
self.layerProgressBar.setMaximum(mode_count)
self.layerProgressBar.setValue(0)

@pyqtSlot()
def update_done(self):
self.offline_editing.progressStopped.disconnect(self.update_done)
self.offline_editing.layerProgressUpdated.disconnect(self.update_total)
Expand Down

0 comments on commit cc1d72e

Please sign in to comment.