diff --git a/RsyncUI_fr_FR.ts b/RsyncUI_fr_FR.ts index 722a54d..20b3414 100644 --- a/RsyncUI_fr_FR.ts +++ b/RsyncUI_fr_FR.ts @@ -248,62 +248,67 @@ Voulez-vous vraiment sortir ? - + File Doc - + File is already downloaded. Do you want to reload it ? The old file will be deleted Le document est déjà téléchargé. Voulez-vous le télécharger à nouveau ? L'ancien fichier sera effacé - + + File is already downloading + Le document est déjà en téléchargement + + + Rsync process crashed Le processus rsync à planté - + Version Version - + Licence License - + Author Auteur - + EMail Courriel - + Source code Code source - + Since the save path is linked to service, you need to select a service before you can select a folder Vous devez sélectionnez un service pour pouvoir sélectionnez un dossier par défaut - + Choose folder where to save file Choisissez un dossier où enregistrer le document - + Do you want to stop downloading and delete this file from download queue ? Voulez-vous arrêter le téléchargement et enlever ce fichier de la file de téléchargement ? - + Do you want to delete this file from download queue ? Voulez-vous enlever ce fichier de la file de téléchargement ? diff --git a/languages/fr_FR/RsyncUI_fr_FR.qm b/languages/fr_FR/RsyncUI_fr_FR.qm index 829bc00..66e5449 100644 Binary files a/languages/fr_FR/RsyncUI_fr_FR.qm and b/languages/fr_FR/RsyncUI_fr_FR.qm differ diff --git a/mainwindow.cpp b/mainwindow.cpp index e5a1d8b..bfde7f3 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -524,25 +524,12 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadD cout << "no directory selectioned, ignoring download request"; return; } - } - - if (QFile::exists(this->downloading.savePath + "/" + path)) + }else { - reply = QMessageBox::question( - this, - "RsyncUI", - tr("File is already downloaded. Do you want to reload it ? The old file will be deleted"), - QMessageBox::Yes|QMessageBox::No, - QMessageBox::No); - - if (reply == QMessageBox::No) - { - return; - }else - { - QFile::remove(this->downloading.savePath + "/" + path); - } + this->downloading.savePath = this->settings.value(str).toString(); } + + while(itemR->parent() != NULL) { itemR = itemR->parent(); @@ -553,6 +540,25 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadD if (item->text(1) == tr("File") or downloadDir == true) { // Item is a file + // searching if file exists in savepath + if (QFile::exists(this->downloading.savePath + "/" + path)) + { + reply = QMessageBox::question( + this, + "RsyncUI", + tr("File is already downloaded. Do you want to reload it ? The old file will be deleted"), + QMessageBox::Yes|QMessageBox::No, + QMessageBox::No); + + if (reply == QMessageBox::No) + { + return; + }else + { + QFile::remove(this->downloading.savePath + "/" + path); + } + } + if(ui->listDownload->findItems(path, Qt::MatchStartsWith).empty()) { // is there a downloading process ? @@ -570,6 +576,13 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadD // Adding download in download list str = path + " => " + this->connexion.server + "/" + this->connexion.service; ui->listDownload->addItem(str); + }else + { + QMessageBox::warning( + this, + "RsyncUI", + tr("File is already downloading" ) + ); } }else { @@ -628,7 +641,7 @@ void MainWindow::downloadFinished(int exitCode, QProcess::ExitStatus exitStatus) disconnect(this->downloading.process, 0, 0, 0); // reset variables and window - this->downloading.process= nullptr; + this->downloading.process = nullptr; ui->progressBar->hide(); delete ui->listDownload->takeItem(0); this->downloading.clear(); @@ -653,7 +666,7 @@ void MainWindow::downloadFinished(int exitCode, QProcess::ExitStatus exitStatus) path.resize(pos); this->downloading.path = path; - // save path exists in settings ? + // savepath exists in settings ? str = "Folder/" + this->downloading.server + "/" + this->downloading.service; if (this->settings.contains(str)) { @@ -671,6 +684,7 @@ void MainWindow::downloadFinished(int exitCode, QProcess::ExitStatus exitStatus) } } } + saveDownloadList(); }