--- a/ProjectController.py Sat Jan 12 15:02:17 2019 +0300
+++ b/ProjectController.py Mon Jan 14 12:17:48 2019 +0300
@@ -549,10 +549,19 @@
- plc_file = os.path.join(new_project_path, "plc.xml")
- if os.path.isfile(plc_file):
- _("Selected directory already contains another project. Overwrite? \n"))
+ if not CheckPathPerm(new_project_path): + dialog = wx.MessageDialog( + _('No write permissions in selected directory! \n'), + _("Error"), wx.OK | wx.ICON_ERROR) + if not os.path.isdir(new_project_path) or len(os.listdir(new_project_path)) > 0: + plc_file = os.path.join(new_project_path, "plc.xml") + if os.path.isfile(plc_file): + message = _("Selected directory already contains another project. Overwrite? \n") + message = _("Selected directory isn't empty. Continue? \n") dialog = wx.MessageDialog(
self.AppFrame, message, _("Error"), wx.YES_NO | wx.ICON_ERROR)
answer = dialog.ShowModal()