def run(self): appdef = None projFile = QgsProject.instance().fileName() if projFile: appdefFile = projFile + ".appdef" if os.path.exists(appdefFile): if pluginSetting("askreload") == "Ask": ret = QMessageBox.question( self.iface.mainWindow(), "Web app builder", "This project has been already published as a web app.\n" "Do you want to reload app configuration?", QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes) if ret == QMessageBox.Yes: appdef = loadAppdef(appdefFile) elif pluginSetting("askreload") == "Open last configuration": appdef = loadAppdef(appdefFile) initialize() # reset credential token in case related credentials are changed utils.resetCachedToken() try: dlg = MainDialog(appdef) dlg.exec_() except: dlg.progressBar.setMaximum(100) dlg.progressBar.setValue(0) dlg.progressBar.setVisible(False) dlg.progressLabel.setVisible(False) QApplication.restoreOverrideCursor() QgsMessageLog.logMessage(traceback.format_exc(), "WebAppBuilder", level=QgsMessageLog.CRITICAL) QMessageBox.critical( self.iface.mainWindow(), "Unmanaged error. See QGIS log for more details.")
def run(self): appdef = None projFile = QgsProject.instance().fileName() if projFile: appdefFile = projFile + ".appdef" if os.path.exists(appdefFile): ret = QMessageBox.question(self.iface.mainWindow(), "Web app builder", "This project has been already published as a web app.\n" "Do you want to reload app configuration?", QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes) if ret == QMessageBox.Yes: appdef = loadAppdef(appdefFile) initialize() dlg = MainDialog(appdef) dlg.exec_()
def openWAB(appdef = None): initialize() dlg = MainDialog(appdef) dlg.open()
def openWAB(appdef=None): initialize() dlg = MainDialog(appdef, parent=iface.mainWindow()) dlg.open() dlg.setWindowModality(Qt.NonModal)
def openWAB(appdef = None): initialize() dlg = MainDialog(appdef) dlg.open()