diff --git a/RsyncUI.pro.user b/RsyncUI.pro.user index 0b6d4e2..0b24d62 100644 --- a/RsyncUI.pro.user +++ b/RsyncUI.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/RsyncUI_fr_FR.ts b/RsyncUI_fr_FR.ts index bd9db74..b73e946 100644 --- a/RsyncUI_fr_FR.ts +++ b/RsyncUI_fr_FR.ts @@ -165,48 +165,55 @@ Barre d'outils - + Download Télécharger - + Click on menu button to download the entire folder Cliquer sur le bouton droit de la souris pour télécharger le dossier entier - + Exit Quitter - + Terminate the program Terminer le programme - + Ctrl+Q Ctrl+Q - - + + hidden service + entre + +Service caché + + + + Change save folder Changer le dossier de destination - + About À propos - + About Qt À propos de Qt - + Settings Paramètres @@ -317,69 +324,80 @@ Voulez-vous vraiment sortir ? 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. - + The processus does'nt respond: Le processus ne répond pas: - + server does not exists Le serveur n'existe pas - - + + Dir dossier - + + File 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 - + Download Téléchargement + + + RsyncUI Request + Requête RsyncUI + + + + Hidden service name + Nom du servcice caché + Version @@ -411,22 +429,22 @@ Voulez-vous vraiment sortir ? 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/LC_MESSAGES/RsyncUI_fr_FR.qm b/languages/fr_FR/LC_MESSAGES/RsyncUI_fr_FR.qm index 406a673..e9af2ed 100644 Binary files a/languages/fr_FR/LC_MESSAGES/RsyncUI_fr_FR.qm and b/languages/fr_FR/LC_MESSAGES/RsyncUI_fr_FR.qm differ diff --git a/mainwindow.cpp b/mainwindow.cpp index f281359..aad7db3 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -290,7 +290,7 @@ void MainWindow::populateTree(QTreeWidgetItem * parent) if (validateServer(this->connexion.server)) { // server is validated, scanning directory - path = ui->listWidget->currentItem()->text().section('\n', 0, 0) + "/"; + path = this->connexion.service + "/"; scanDir(this->connexion.server, this->connexion.port, parent, path); } // Restoring cursor @@ -302,7 +302,9 @@ void MainWindow::populateTree(QTreeWidgetItem * parent) void MainWindow::populateList() { QString server; + QStringList hidden; int port; + int i; server = ui->khistorycombobox->currentText(); port = ui->portEdit->text().toUInt(); @@ -350,7 +352,14 @@ void MainWindow::populateList() } } this->settings.endGroup(); + this->settings.beginGroup("Hidden/"); + hidden = this->settings.allKeys(); + for (i = 0; i < hidden.size(); i++) + { + ui->listWidget->addItem(this->settings.value(hidden.at(i)).toString() + "\n\t"); + } QGuiApplication::restoreOverrideCursor(); //setting cursor to default + this->settings.endGroup(); } } @@ -637,15 +646,21 @@ QTreeWidgetItem * MainWindow::addTreeChild(QTreeWidgetItem *parent, QString name return treeItem; } -// Slot acivated when a service in the list is clicked +// Slot activated when a service in the list is clicked void MainWindow::on_listWidget_clicked() +{ + this->connexion.service = ui->listWidget->currentItem()->text().section("\n", 0 ,0); + preparePopulateTree(); +} + +void MainWindow::preparePopulateTree() { QString str; QStringList logins; this->rescan = true; this->connexion.user = nullptr; - this->connexion.password = nullptr; this->connexion.service = ui->listWidget->currentItem()->text().section("\n", 0 ,0); + this->connexion.password = nullptr; str = "Folder/" + this->connexion.server + "/" + this->connexion.service; // if service exists in settings for this server if (this->settings.contains(str)) @@ -714,36 +729,37 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadD path = item->text(0); sizeFromRsync = item->text(2).remove(',').toUInt(); - // exists saving path in settings ? - str = "Folder/" + this->connexion.server + "/" + this->connexion.service; - if(!this->settings.contains(str)) - { - // saving path do not exists, asking for it - if(!on_DefaultSaveFolder_triggered()) - { - cout << "no directory selectioned, ignoring download request"; - return; - } - }else - { - this->downloading.savePath = this->settings.value(str).toString(); - } - - while(itemR->parent() != NULL) { itemR = itemR->parent(); // concatening parent to path path.prepend(itemR->text(0) + "/"); }; - QFileInfo info(this->downloading.savePath + "/" + path); + cout << item->text(1).toStdString() <text(1) == tr("File") or downloadDir == true) { + // exists saving path in settings ? + str = "Folder/" + this->connexion.server + "/" + this->connexion.service; + if(!this->settings.contains(str)) + { + // saving path do not exists, asking for it + if(!on_DefaultSaveFolder_triggered()) + { + cout << "no directory selectioned, ignoring download request"; + return; + } + }else + { + this->downloading.savePath = this->settings.value(str).toString(); + } + // Item is a file // searching if file exists in savepath if (QFile::exists(this->downloading.savePath + "/" + path)) { + + QFileInfo info(this->downloading.savePath + "/" + path); if (info.size() < sizeFromRsync) { reply = QMessageBox::question( @@ -1213,3 +1229,18 @@ void MainWindow::setDlSpeed(QString speed) speed.squeeze(); } +void MainWindow::on_actionHiddenService_triggered() +{ + QInputDialog hiddenFolderDialog; + + bool ok; + QString text = QInputDialog::getText(this, tr("RsyncUI Request"), + tr("Hidden service name"), QLineEdit::Normal, + "test", &ok); + if (ok && !text.isEmpty()) + { + this->connexion.service = text; + this->settings.setValue("Hidden/" + this->connexion.server, text); + preparePopulateTree(); + } +} diff --git a/mainwindow.h b/mainwindow.h index a86c086..eda2f3e 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -163,6 +163,7 @@ class MainWindow : public QMainWindow void showWindow(); void init(); bool getUserPassword(bool); + void preparePopulateTree(); private slots: @@ -214,6 +215,8 @@ class MainWindow : public QMainWindow void on_loginBox_accepted(); + void on_actionHiddenService_triggered(); + signals: void stopDownloading(QProcess *); void progressSignal(int); diff --git a/mainwindow.ui b/mainwindow.ui index cdfd5a2..dbeed37 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -399,6 +399,7 @@ false + @@ -466,6 +467,14 @@ Ctrl+Q + + + + + + hidden service + +