def __stopConnection(self): """ Disconnect from plugins. """ if self.__pluginsConnected: Logger().info("Stopping connection. Please wait...") self.setStatusbarMessage(self.tr("Stopping connection. Please wait...")) self._view.connectLabel.setPixmap(QtGui.QPixmap(":/icons/connect_creating.png").scaled(22, 22)) if config.platform != 'darwin': while QtGui.QApplication.hasPendingEvents(): QtGui.QApplication.processEvents() #QtCore.QEventLoop.ExcludeUserInputEvents) Spy().suspend() self._view.setCursor(QtGui.QCursor(QtCore.Qt.WaitCursor)) if self.__pluginsStatus is not None: pluginsConnector = PluginsConnector() pluginsConnector.stop(self.__pluginsStatus) if self.__pluginsConnected: Logger().info("Connection stopped") self.setStatusbarMessage(self.tr("Connection stopped"), 10) self._view.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) self._view.connectLabel.setPixmap(QtGui.QPixmap(":/icons/connect_no.png").scaled(22, 22)) self.__SetDisconnectedWidgetState() self.__pluginsConnected = False