aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mageiaSync/mageiasync.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/mageiaSync/mageiasync.py b/mageiaSync/mageiasync.py
index 743cac8..1110607 100644
--- a/mageiaSync/mageiasync.py
+++ b/mageiaSync/mageiasync.py
@@ -3,7 +3,7 @@
from PyQt5.QtWidgets import ( QProgressDialog, QMainWindow,
QDialog, QFileDialog, QApplication)
from PyQt5.QtGui import ( QStandardItemModel,QStandardItem, QDesktopServices, QIcon, )
-from PyQt5.QtCore import ( QLibraryInfo, QUrl, QItemSelectionModel )
+from PyQt5.QtCore import ( QLibraryInfo, QUrl, QItemSelectionModel, QFileInfo )
from PyQt5 import QtCore # , Qt, QThread, QObject, pyqtSignal)
import sys
try:
@@ -402,7 +402,12 @@ class IsosViewer(QMainWindow, mageiaSyncUI.Ui_mainWindow):
self.password=params.value("password", type="QString")
self.destination=params.value("destination", type="QString")
self.bwl=params.value("bwl",type=int)
- self.localDirLabel.setText(self.tr("Local directory: ")+self.destination)
+ dest = QFileInfo(self.destination)
+ if dest.exists() and dest.isDir():
+ self.localDirLabel.setText(self.tr("Local directory: ")+self.destination)
+ else:
+ #; {} is the placeholder the directory anme
+ self.localDirLabel.setText(self.tr("/!\ Local directory {} doesn't exists or isn't accessible. Check mounts or settings.").format(self.destination))
if self.location !="":
self.remoteDirLabel.setText(self.tr("Remote directory: ")+self.location)
@@ -530,6 +535,10 @@ class IsosViewer(QMainWindow, mageiaSyncUI.Ui_mainWindow):
l = QDesktopServices.openUrl(QUrl('https://wiki.mageia.org/en/ISO_testing_rsync_tools'))
def launchSync(self):
+ dest = QFileInfo(self.destination)
+ if (not dest.exists()) or (not dest.isDir()):
+ self.lvMessage(self.tr("/!\ Local directory {} doesn't exists or isn't accessible. Check mounts or settings.").format(self.destination))
+ return
self.IprogressBar.setEnabled(True)
self.stop.setEnabled(True)
self.syncGo.setEnabled(False)