|
@@ -845,6 +845,7 @@ class Atlas:
|
|
|
self.dlg.treeWidget.addTopLevelItem(item)
|
|
self.dlg.treeWidget.addTopLevelItem(item)
|
|
|
def checkIfMapExist(self, name):
|
|
def checkIfMapExist(self, name):
|
|
|
url = "http://layman.lesprojekt.cz/rest/"+self.laymanUsername+"/maps/"+str(name)+"/file"
|
|
url = "http://layman.lesprojekt.cz/rest/"+self.laymanUsername+"/maps/"+str(name)+"/file"
|
|
|
|
|
+ print(url)
|
|
|
r = requests.get(url)
|
|
r = requests.get(url)
|
|
|
print(r.content)
|
|
print(r.content)
|
|
|
if (r.status_code == 404):
|
|
if (r.status_code == 404):
|
|
@@ -1700,7 +1701,8 @@ class Atlas:
|
|
|
if (operation == "add"):
|
|
if (operation == "add"):
|
|
|
msgbox = QMessageBox(QMessageBox.Question, "Import Map", "Chcete přidat do kompozice "+str(successful)+" vrstev?")
|
|
msgbox = QMessageBox(QMessageBox.Question, "Import Map", "Chcete přidat do kompozice "+str(successful)+" vrstev?")
|
|
|
if (operation == "mod"):
|
|
if (operation == "mod"):
|
|
|
- msgbox = QMessageBox(QMessageBox.Question, "Import Map", "Chcete opravdu provést změny v této kompozici?")
|
|
|
|
|
|
|
+ msgbox = QMessageBox(QMessageBox.Question, "Import Map", "Do you want save changes?")
|
|
|
|
|
+
|
|
|
self.dlg.close()
|
|
self.dlg.close()
|
|
|
self.afterCloseEditMapDialog()
|
|
self.afterCloseEditMapDialog()
|
|
|
print(self.URI+'/rest/'+self.laymanUsername+'/maps/'+self.compositeList[x]['name'])
|
|
print(self.URI+'/rest/'+self.laymanUsername+'/maps/'+self.compositeList[x]['name'])
|
|
@@ -1710,12 +1712,17 @@ class Atlas:
|
|
|
self.dlg.show()
|
|
self.dlg.show()
|
|
|
if (operation == "del"):
|
|
if (operation == "del"):
|
|
|
msgbox = QMessageBox(QMessageBox.Question, "Import Map", "Chcete smazat vybranou vrstvu?")
|
|
msgbox = QMessageBox(QMessageBox.Question, "Import Map", "Chcete smazat vybranou vrstvu?")
|
|
|
- msgbox.addButton(QMessageBox.Yes)
|
|
|
|
|
- msgbox.addButton(QMessageBox.No)
|
|
|
|
|
- msgbox.setDefaultButton(QMessageBox.No)
|
|
|
|
|
- reply = msgbox.exec()
|
|
|
|
|
|
|
+
|
|
|
|
|
+ try: # jedná se o mod pokud je except
|
|
|
|
|
+ msgbox.addButton(QMessageBox.Yes)
|
|
|
|
|
+ msgbox.addButton(QMessageBox.No)
|
|
|
|
|
+ msgbox.setDefaultButton(QMessageBox.No)
|
|
|
|
|
+ reply = msgbox.exec()
|
|
|
|
|
+ except:
|
|
|
|
|
+ pass
|
|
|
|
|
+
|
|
|
if (reply == QMessageBox.Yes):
|
|
if (reply == QMessageBox.Yes):
|
|
|
- response = requests.post(self.URI+'/rest/'+self.laymanUsername+'/maps', files=files, data = data, headers = self.authHeader, verify=False)
|
|
|
|
|
|
|
+ response = requests.post(self.URI+'/rest/'+self.laymanUsername+'/maps', files=files, data = data, headers = self.authHeader)
|
|
|
print(response.content)
|
|
print(response.content)
|
|
|
data = response.content
|
|
data = response.content
|
|
|
self.dlg.progressBar.hide()
|
|
self.dlg.progressBar.hide()
|
|
@@ -1857,6 +1864,7 @@ class Atlas:
|
|
|
return False
|
|
return False
|
|
|
|
|
|
|
|
def removeUnacceptableChars(self, input):
|
|
def removeUnacceptableChars(self, input):
|
|
|
|
|
+ input = input.lower()
|
|
|
input = input.replace("ř","r")
|
|
input = input.replace("ř","r")
|
|
|
input = input.replace("š","s")
|
|
input = input.replace("š","s")
|
|
|
input = input.replace("ž","z")
|
|
input = input.replace("ž","z")
|
|
@@ -1872,7 +1880,7 @@ class Atlas:
|
|
|
input = input.replace("ě","e")
|
|
input = input.replace("ě","e")
|
|
|
input = input.replace("ť","t")
|
|
input = input.replace("ť","t")
|
|
|
input = re.sub(r'[?|$|.|!]',r'',input)
|
|
input = re.sub(r'[?|$|.|!]',r'',input)
|
|
|
- input = input.lower()
|
|
|
|
|
|
|
+
|
|
|
# iface.messageBar().pushWidget(iface.messageBar().createMessage("Layman:", "Diacritics in name of layer was replaced."), Qgis.Success, duration=3)
|
|
# iface.messageBar().pushWidget(iface.messageBar().createMessage("Layman:", "Diacritics in name of layer was replaced."), Qgis.Success, duration=3)
|
|
|
return input
|
|
return input
|
|
|
|
|
|