diff --git a/RsyncUI.pro b/RsyncUI.pro index fdc1433..9096888 100644 --- a/RsyncUI.pro +++ b/RsyncUI.pro @@ -1,4 +1,4 @@ -QT += core gui concurrent +QT += core gui QT += KItemViews QT += KCompletion QT += widgets diff --git a/RsyncUI_fr_FR.ts b/RsyncUI_fr_FR.ts index bffdbc0..15385e9 100644 --- a/RsyncUI_fr_FR.ts +++ b/RsyncUI_fr_FR.ts @@ -69,29 +69,24 @@ LoginDialog - RsyncUI request - Requête RsyncUI + Requête RsyncUI - Login name - Identifiant + Identifiant - Enter login - Entrez votre identifiant + Entrez votre identifiant - Password - Mot de passe + Mot de passe - Enter password - Entrez votre mot de passe + Entrez votre mot de passe @@ -221,32 +216,32 @@ Paramètres - + KB Ko - + MB Mo - + GB Go - + TB To - + PB Po - + You click on file to enqueue it, and RyncUI Download one file a time Client for rsync server<br><br>You click on file to enqueue it, and RyncUI Download one file a time <h3>Utilisation</h3> @@ -279,92 +274,97 @@ Cliquez sur un fichier pour le supprimer de la file et une fenêtre de confirmat Permet de quitter le programme - + Path Chemin - + Size Taille - + Type Type - + Date Date - + KB/s Ko/s - + MB/s Mo/s - + GB/s Go/s - + TB/s To/s - + PB/s Po/s - + A list of interrupted downloads exists, do you want to continue downloading ? if not the list will be cleared Une liste de téléchargement existe, voulez-vous utiliser cette liste ? si non, elle sera effacée - + &Quit &Quitter - + Clicking Save button, You can save the list of downloads Vous pouvez enregistrer la liste des téléchargements en cliquant sur "enregister" - + Exiting will stop downloading, and will clear the download queue. Do you want to exit ? Si vous sortez, les téléchargements seront arrêter. Voulez-vous vraiment sortir ? - + The program will keep running in the system tray. To terminate the program, choose <b>Quit</b> in the context menu of the system tray entry. Le programme continue dans la boîte à miniatures. Pour quitter le programme cliquez sur l'icône <b>Quitter</b> ou dans les menu contextuel. - + + Authentication failed + Mauvais mot de passe ou utilisateur + + + The processus does'nt respond: Le processus ne répond pas: - + server does not exists Le serveur n'existe pas - - + + Dir dossier @@ -373,146 +373,161 @@ Voulez-vous vraiment sortir ? Doc - + File is partially downloaded. Do you want to resume download ? if no, the file will be deleted from destination directory Le document est déjà partiellement téléchargé. Voulez vous continuer le téléchargemnt ? Si non, il sera supprimer du dossier de destination - + 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 - + Starting downloading Démarrage du téléchargement - + finished Terminé - + Rsync process crashed Le processus rsync à planté - + stopped by user stoppé par l'utilisateur - + Do you want to retry? Voulez-vous ré-essayer? - + Download Téléchargement - RsyncUI Request - Requête RsyncUI + Requête RsyncUI - + Hidden service name Nom du servcice caché - + Version Version - + <h2>Client for rsync server</h2> <h2>Client pour serveur rsync</h2> - + Licence License - + Author Auteur - + EMail Courriel - + Source code Code source - + + Select the user you want to connect with or enter a new one + Choisissez l'utilisateur avec lequel vous voulez vous connecter ou entrez en un nouveau + + + + + Request + Requête de mot de passe + + + + Enter password + Entrez votre mot de passe + + + 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 ? - + B o - + The process failed to start. Either the invoked program is missing, or you may have insufficient permissions or resources to invoke the program. Le processus échoué, soit le programme est manquant, soit vous n'avez pas l'autorisation de l'exécuter. - + The process crashed some time after starting successfully. Le processus à planté après avoir démarré avec succès. - + The last waitFor...() function timed out. The state of QProcess is unchanged, and you can try calling waitFor...() again. La fonction waitFor...() a dépassé la limite de temps, you pouvez essayer de la relancer. - + An error occurred when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel. Une erreur est survenue lors de l'envoi des données vers le processus. Le processus est peut être arrté ou il a fermé son canal d'entrée. - + An error occurred when attempting to read from the process. For example, the process may not be running. Une erreur est survenue lors de la lecturee de données, le processus est probablement arrêté. - + An unknown error occurred. This is the default return value of error(). Une erreur inconnue est survenue. C'est la valeur de retour par défaut de error(). @@ -520,87 +535,87 @@ Voulez-vous ré-essayer? QTranslator - + Success. The rsync command completed successfully without any errors. Succès. La command rsync s'est terminée sans erreurs. - + Syntax or usage error. There was a problem with the syntax of the rsync command or with the options specified. Erreur de syntaxe ou d'usage. il y a un problème avec la synaxe de rsync ou avec les paramètres spécifiés. - + Protocol incompatibility. There was a problem with the protocol version or negotiation between the rsync client and server. Incompatibilité de protocole. Il y a eu un problème avec la version du protocole ou la négotiation avec le serveur rsync. - + Errors selecting input/output files, dirs. There was a problem with the source or destination file or directory specified in the rsync command. Erreurs dans la sélection des fichiers ou dossiers. il y a eu une problème avec le fichier/dossier source ou destination spécifié. - + Requested action not supported: An attempt was made to use an unsupported action or option. Action non suportée. Une tentative d'utiliser une action, ou une option, non supportée à été faite. - + Error starting client-server protocol. There was an error starting the client-server protocol. Erreur de démarrage du protocole client-seveur. Il ya eu une erreur en démarrant le protocole slient-serveur. - + Daemon unable to append to log-file. The rsync daemon was unable to write to its log file. Le démon rsyncd n'arrive pas écrire dans son fichier de log. - + Error in socket I/O. There was an error with the socket input/output. Erreur d'entrée/sortie socket. Il y a eu une erreur d'entrée/sortie sur le socket. - + Error in file I/O. There was an error reading or writing to a file. Erreur de 'entrée/sortie. Il y a eu une erreur de lecture/écriture sur un fichier. - + Error in rsync protocol data stream. There was an error in the rsync protocol data stream. Erreur dans le protocole de flux de données de rsync. - + Errors with program diagnostics. There was an error generating program diagnostics. Erreur avec les diagnostiques du programme. - + Error in IPC code. There was an error in the inter-process communication (IPC) code. Erreur dans le code IPC. IL y a eu une erreur dans la communication inter-processus. - + Received SIGUSR1 or SIGINT. The rsync process was interrupted by a signal. Reçu les signaux SIGUSR1 ou SIGINT. Le processus rsync a été interrompu par un signal. - + Some error returned by waitpid(). An error occurred while waiting for a child process to complete. Erreurs retournées par waitpid().Une erreur est survenue pendant l'attente de la complétion du processus fils. - + Error allocating core memory buffers. There was an error allocating memory buffers. Erreur d'allocation des buffers mémoire. - + Partial transfer due to error. The rsync command completed with an error, but some files may have been transferred successfully. Transfert partiel due à une erreur. La command rsync s'est terminée avec une erreur, mais des fichiers on été transférés avec succès. - + Partial transfer due to vanished source files. Some source files disappeared before they could be transferred. Transfert partiel dû à la disparition des fichiers source. Des fichiers source ont disparu avec d'avoir été transférés. diff --git a/mainwindow.cpp b/mainwindow.cpp index e6a81da..10bcb42 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -383,7 +383,8 @@ bool MainWindow::testServicePresence(QString service, bool askPassword) QStringList v; QProcess *myProcess; bool returnValue = false; - QEventLoop loop; + int loop =0; + bool r = false; cmd = "/usr/bin/rsync"; param << "--contimeout=10" << "-nq" << "--port=" + QString::number(this->connexion.port) << this->connexion.server + "::" + service; @@ -405,9 +406,10 @@ bool MainWindow::testServicePresence(QString service, bool askPassword) } if (line.contains("auth failed")) { - if (askPassword) + if (askPassword == true and loop >=2 and r == true) { - getUserPassword(&this->connexion); + r = getUserPassword(&this->connexion); + loop++; } returnValue = true; } @@ -487,6 +489,8 @@ bool MainWindow::scanDir(QString server, int portN, QTreeWidgetItem *parent, QSt bool readOk = false; bool passwdOk = false; int nChild = 0; + bool r; + static uint looping; myProcess = new QProcess(this); myProcess->setProcessChannelMode(QProcess::MergedChannels); @@ -531,9 +535,23 @@ bool MainWindow::scanDir(QString server, int portN, QTreeWidgetItem *parent, QSt } if (line.contains("auth failed")) { - myProcess->readAllStandardOutput(); - getUserPassword(&this->connexion); - return 0; + myProcess->readAllStandardOutput(); + r = getUserPassword(&this->connexion); + if (looping <= 1) + { + this->rescan = true; + looping++; + }else + { + this->rescan = false; + looping = 0; + QMessageBox::warning( + this, + a.applicationName(), + tr("Authentication failed" ) + ); + } + return false; } // extracting name, size and if is dir/file @@ -593,7 +611,7 @@ bool MainWindow::scanDir(QString server, int portN, QTreeWidgetItem *parent, QSt testRsyncReturn(this, myProcess); myProcess->close(); } - return 0; + return false; } // Verify if server address is IP address @@ -609,7 +627,7 @@ bool MainWindow::isIpAddress(QString server) for (auto element : r) { elementN = element.toInt(&ok); - if (elementN < 0 or elementN > 255 or ok == false) + if ((elementN < 0) or (elementN > 255) or ok == false) { return false; } @@ -777,8 +795,8 @@ void MainWindow::preparePopulateTree() bool MainWindow::getUserPassword(Connexion * object) { QStringList logins; - QString login; - QString password; + QString login = ""; + QString password = ""; QString server; QString service; int c; @@ -820,10 +838,12 @@ bool MainWindow::getUserPassword(Connexion * object) if (!ok or password.isEmpty()) { password = ""; + returnValue = false; } }else { password = getPassword(login); + returnValue = true; } object->user = login; object->password = password; @@ -955,6 +975,7 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadD { scanDir(this->connexion.server, this->connexion.port, item, this->connexion.service + "/" + path +"/"); item->setExpanded(true); + } }