def createView(self): name, ok = QInputDialog.getText(None, "View name", "View name") if ok: try: self.db.connector.createSpatialView(name, self._getSqlQuery()) except BaseError as e: DlgDbError.showError(e, self)
def createView(self): name, ok = QInputDialog.getText(None, "View name", "View name") if ok: try: self.db.connector.createSpatialView(name, self._getSqlQuery()) except BaseError as e: DlgDbError.showError(e, self)
def createSchemaActionSlot(self, item, action, parent): QApplication.restoreOverrideCursor() try: if not isinstance(item, (DBPlugin, Schema, Table)) or item.database() is None: parent.infoBar.pushMessage( QApplication.translate("DBManagerPlugin", "No database selected or you are not connected to it."), QgsMessageBar.INFO, parent.iface.messageTimeout()) return (schema, ok) = QInputDialog.getText(parent, QApplication.translate("DBManagerPlugin", "New schema"), QApplication.translate("DBManagerPlugin", "Enter new schema name")) if not ok: return finally: QApplication.setOverrideCursor(Qt.WaitCursor) self.createSchema(schema)
def createSchemaActionSlot(self, item, action, parent): QApplication.restoreOverrideCursor() try: if not isinstance(item, (DBPlugin, Schema, Table)) or item.database() is None: parent.infoBar.pushMessage( QApplication.translate("DBManagerPlugin", "No database selected or you are not connected to it."), QgsMessageBar.INFO, parent.iface.messageTimeout()) return (schema, ok) = QInputDialog.getText(parent, QApplication.translate("DBManagerPlugin", "New schema"), QApplication.translate("DBManagerPlugin", "Enter new schema name")) if not ok: return finally: QApplication.setOverrideCursor(Qt.WaitCursor) self.createSchema(schema)