corrected regression: resuming downloadlist download did not start\n added downloading speed in progress bar
This commit is contained in:
parent
e8743ff802
commit
f3c361f155
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE QtCreatorProject>
|
<!DOCTYPE QtCreatorProject>
|
||||||
<!-- Written by QtCreator 4.14.2, 2023-02-16T21:27:43. -->
|
<!-- Written by QtCreator 4.14.2, 2023-02-22T00:23:04. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>EnvironmentId</variable>
|
<variable>EnvironmentId</variable>
|
||||||
|
@ -183,27 +183,27 @@
|
|||||||
<translation>Paramètres</translation>
|
<translation>Paramètres</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="100"/>
|
<location filename="mainwindow.cpp" line="102"/>
|
||||||
<source>KB</source>
|
<source>KB</source>
|
||||||
<translation>Ko</translation>
|
<translation>Ko</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="100"/>
|
<location filename="mainwindow.cpp" line="102"/>
|
||||||
<source>MB</source>
|
<source>MB</source>
|
||||||
<translation>Mo</translation>
|
<translation>Mo</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="100"/>
|
<location filename="mainwindow.cpp" line="102"/>
|
||||||
<source>GB</source>
|
<source>GB</source>
|
||||||
<translation>Go</translation>
|
<translation>Go</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="100"/>
|
<location filename="mainwindow.cpp" line="102"/>
|
||||||
<source>TB</source>
|
<source>TB</source>
|
||||||
<translation>To</translation>
|
<translation>To</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="100"/>
|
<location filename="mainwindow.cpp" line="102"/>
|
||||||
<source>PB</source>
|
<source>PB</source>
|
||||||
<translation>Po</translation>
|
<translation>Po</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -245,17 +245,17 @@ Cliquez sur un fichier pour le supprimer de la file et une fenêtre de confirmat
|
|||||||
<translation type="vanished"><h2>Client pour serveur rsync<2><br><br>éaa</translation>
|
<translation type="vanished"><h2>Client pour serveur rsync<2><br><br>éaa</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="72"/>
|
<location filename="mainwindow.cpp" line="73"/>
|
||||||
<source>Path</source>
|
<source>Path</source>
|
||||||
<translation>Chemin</translation>
|
<translation>Chemin</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="72"/>
|
<location filename="mainwindow.cpp" line="73"/>
|
||||||
<source>Size</source>
|
<source>Size</source>
|
||||||
<translation>Taille</translation>
|
<translation>Taille</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="72"/>
|
<location filename="mainwindow.cpp" line="73"/>
|
||||||
<source>Type</source>
|
<source>Type</source>
|
||||||
<translation>Type</translation>
|
<translation>Type</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -265,85 +265,85 @@ Cliquez sur un fichier pour le supprimer de la file et une fenêtre de confirmat
|
|||||||
<translation>Une liste de téléchargement existe, voulez-vous utiliser cette liste ? si non, elle sera effacée</translation>
|
<translation>Une liste de téléchargement existe, voulez-vous utiliser cette liste ? si non, elle sera effacée</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="144"/>
|
<location filename="mainwindow.cpp" line="146"/>
|
||||||
<source>&Quit</source>
|
<source>&Quit</source>
|
||||||
<translation>&Quitter</translation>
|
<translation>&Quitter</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="201"/>
|
<location filename="mainwindow.cpp" line="203"/>
|
||||||
<source>Clicking Save button, You can save the list of downloads
|
<source>Clicking Save button, You can save the list of downloads
|
||||||
</source>
|
</source>
|
||||||
<translation>Vous pouvez enregistrer la liste des téléchargements en cliquant sur "enregister"
|
<translation>Vous pouvez enregistrer la liste des téléchargements en cliquant sur "enregister"
|
||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="207"/>
|
<location filename="mainwindow.cpp" line="209"/>
|
||||||
<source>Exiting will stop downloading, and will clear the download queue.
|
<source>Exiting will stop downloading, and will clear the download queue.
|
||||||
Do you want to exit ?</source>
|
Do you want to exit ?</source>
|
||||||
<translation>Si vous sortez, les téléchargements seront arrêter.
|
<translation>Si vous sortez, les téléchargements seront arrêter.
|
||||||
Voulez-vous vraiment sortir ?</translation>
|
Voulez-vous vraiment sortir ?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="245"/>
|
<location filename="mainwindow.cpp" line="247"/>
|
||||||
<source>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.</source>
|
<source>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.</source>
|
||||||
<translation>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.</translation>
|
<translation>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.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="538"/>
|
<location filename="mainwindow.cpp" line="540"/>
|
||||||
<source>server does not exists</source>
|
<source>server does not exists</source>
|
||||||
<translation>Le serveur n'existe pas</translation>
|
<translation>Le serveur n'existe pas</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="565"/>
|
<location filename="mainwindow.cpp" line="567"/>
|
||||||
<location filename="mainwindow.cpp" line="585"/>
|
<location filename="mainwindow.cpp" line="587"/>
|
||||||
<source>Dir</source>
|
<source>Dir</source>
|
||||||
<translation>dossier</translation>
|
<translation>dossier</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="569"/>
|
<location filename="mainwindow.cpp" line="571"/>
|
||||||
<location filename="mainwindow.cpp" line="655"/>
|
<location filename="mainwindow.cpp" line="657"/>
|
||||||
<source>File</source>
|
<source>File</source>
|
||||||
<translation>Doc</translation>
|
<translation>Doc</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="666"/>
|
<location filename="mainwindow.cpp" line="668"/>
|
||||||
<source>File is partially downloaded. Do you want to resume download ? if no, the file will be deleted from destination directory</source>
|
<source>File is partially downloaded. Do you want to resume download ? if no, the file will be deleted from destination directory</source>
|
||||||
<translation>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</translation>
|
<translation>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</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="683"/>
|
<location filename="mainwindow.cpp" line="685"/>
|
||||||
<source>File is already downloaded. Do you want to reload it ? The old file will be deleted</source>
|
<source>File is already downloaded. Do you want to reload it ? The old file will be deleted</source>
|
||||||
<translation>Le document est déjà téléchargé. Voulez-vous le télécharger à nouveau ? L'ancien fichier sera effacé</translation>
|
<translation>Le document est déjà téléchargé. Voulez-vous le télécharger à nouveau ? L'ancien fichier sera effacé</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="719"/>
|
<location filename="mainwindow.cpp" line="722"/>
|
||||||
<source>File is already downloading</source>
|
<source>File is already downloading</source>
|
||||||
<translation>Le document est déjà en téléchargement</translation>
|
<translation>Le document est déjà en téléchargement</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="742"/>
|
<location filename="mainwindow.cpp" line="745"/>
|
||||||
<source>Starting downloading
|
<source>Starting downloading
|
||||||
</source>
|
</source>
|
||||||
<translation>Démarrage du téléchargement
|
<translation>Démarrage du téléchargement
|
||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="757"/>
|
<location filename="mainwindow.cpp" line="760"/>
|
||||||
<source>finished</source>
|
<source>finished</source>
|
||||||
<translation>Terminé</translation>
|
<translation>Terminé</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="765"/>
|
<location filename="mainwindow.cpp" line="768"/>
|
||||||
<source>Rsync process crashed</source>
|
<source>Rsync process crashed</source>
|
||||||
<translation>Le processus rsync à planté</translation>
|
<translation>Le processus rsync à planté</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="777"/>
|
<location filename="mainwindow.cpp" line="780"/>
|
||||||
<source>stopped by user</source>
|
<source>stopped by user</source>
|
||||||
<translation>stoppé par l'utilisateur</translation>
|
<translation>stoppé par l'utilisateur</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="781"/>
|
<location filename="mainwindow.cpp" line="784"/>
|
||||||
<source>Download </source>
|
<source>Download </source>
|
||||||
<translation>Téléchargement </translation>
|
<translation>Téléchargement </translation>
|
||||||
</message>
|
</message>
|
||||||
@ -378,52 +378,52 @@ Voulez-vous vraiment sortir ?</translation>
|
|||||||
<translation>Code source</translation>
|
<translation>Code source</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="952"/>
|
<location filename="mainwindow.cpp" line="955"/>
|
||||||
<source>Since the save path is linked to service, you need to select a service before you can select a folder</source>
|
<source>Since the save path is linked to service, you need to select a service before you can select a folder</source>
|
||||||
<translation>Vous devez sélectionnez un service pour pouvoir sélectionnez un dossier par défaut</translation>
|
<translation>Vous devez sélectionnez un service pour pouvoir sélectionnez un dossier par défaut</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="957"/>
|
<location filename="mainwindow.cpp" line="960"/>
|
||||||
<source>Choose folder where to save file</source>
|
<source>Choose folder where to save file</source>
|
||||||
<translation>Choisissez un dossier où enregistrer le document</translation>
|
<translation>Choisissez un dossier où enregistrer le document</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="848"/>
|
<location filename="mainwindow.cpp" line="851"/>
|
||||||
<source>Do you want to stop downloading and delete this file from download queue ?</source>
|
<source>Do you want to stop downloading and delete this file from download queue ?</source>
|
||||||
<translation>Voulez-vous arrêter le téléchargement et enlever ce fichier de la file de téléchargement ?</translation>
|
<translation>Voulez-vous arrêter le téléchargement et enlever ce fichier de la file de téléchargement ?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="862"/>
|
<location filename="mainwindow.cpp" line="865"/>
|
||||||
<source>Do you want to delete this file from download queue ?</source>
|
<source>Do you want to delete this file from download queue ?</source>
|
||||||
<translation>Voulez-vous enlever ce fichier de la file de téléchargement ?</translation>
|
<translation>Voulez-vous enlever ce fichier de la file de téléchargement ?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.h" line="125"/>
|
<location filename="mainwindow.h" line="128"/>
|
||||||
<source>The process failed to start. Either the invoked program is missing, or you may have insufficient permissions or resources to invoke the program.</source>
|
<source>The process failed to start. Either the invoked program is missing, or you may have insufficient permissions or resources to invoke the program.</source>
|
||||||
<translation>Le processus échoué, soit le programme est manquant, soit vous n'avez pas l'autorisation de l'exécuter.</translation>
|
<translation>Le processus échoué, soit le programme est manquant, soit vous n'avez pas l'autorisation de l'exécuter.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.h" line="126"/>
|
<location filename="mainwindow.h" line="129"/>
|
||||||
<source>The process crashed some time after starting successfully.</source>
|
<source>The process crashed some time after starting successfully.</source>
|
||||||
<translation>Le processus à planté après avoir démarré avec succès.</translation>
|
<translation>Le processus à planté après avoir démarré avec succès.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.h" line="127"/>
|
<location filename="mainwindow.h" line="130"/>
|
||||||
<source>The last waitFor...() function timed out. The state of QProcess is unchanged, and you can try calling waitFor...() again.</source>
|
<source>The last waitFor...() function timed out. The state of QProcess is unchanged, and you can try calling waitFor...() again.</source>
|
||||||
<translation>La fonction waitFor...() a dépassé la limite de temps, you pouvez essayer de la relancer.</translation>
|
<translation>La fonction waitFor...() a dépassé la limite de temps, you pouvez essayer de la relancer.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.h" line="128"/>
|
<location filename="mainwindow.h" line="131"/>
|
||||||
<source>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.</source>
|
<source>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.</source>
|
||||||
<translation>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.</translation>
|
<translation>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.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.h" line="129"/>
|
<location filename="mainwindow.h" line="132"/>
|
||||||
<source>An error occurred when attempting to read from the process. For example, the process may not be running.</source>
|
<source>An error occurred when attempting to read from the process. For example, the process may not be running.</source>
|
||||||
<translation>Une erreur est survenue lors de la lecturee de données, le processus est probablement arrêté.</translation>
|
<translation>Une erreur est survenue lors de la lecturee de données, le processus est probablement arrêté.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.h" line="130"/>
|
<location filename="mainwindow.h" line="133"/>
|
||||||
<source>An unknown error occurred. This is the default return value of error().</source>
|
<source>An unknown error occurred. This is the default return value of error().</source>
|
||||||
<translation>Une erreur inconnue est survenue. C'est la valeur de retour par défaut de error().</translation>
|
<translation>Une erreur inconnue est survenue. C'est la valeur de retour par défaut de error().</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -49,7 +49,7 @@ void MainWindow::download()
|
|||||||
{
|
{
|
||||||
param << "--bwlimit=" + QString::number(this->connexion.bandwidthLimit) + bwUnitChar[this->connexion.bandwidthLimitUnit];
|
param << "--bwlimit=" + QString::number(this->connexion.bandwidthLimit) + bwUnitChar[this->connexion.bandwidthLimitUnit];
|
||||||
}
|
}
|
||||||
param << "--port=" + QString::number(this->connexion.port);
|
param << "--port=" + QString::number(this->downloading.port);
|
||||||
param << "-aXP";
|
param << "-aXP";
|
||||||
param << this->downloading.server + "::" + this->downloading.service + "/" + this->downloading.path << this->downloading.savePath + "/";
|
param << this->downloading.server + "::" + this->downloading.service + "/" + this->downloading.path << this->downloading.savePath + "/";
|
||||||
|
|
||||||
@ -69,32 +69,50 @@ void MainWindow::readRsyncOutput()
|
|||||||
bool flag = false;
|
bool flag = false;
|
||||||
int value;
|
int value;
|
||||||
int pos;
|
int pos;
|
||||||
|
static QString dlSpeed;
|
||||||
|
QStringList list;
|
||||||
|
static QString filename;
|
||||||
|
int i;
|
||||||
|
int listSize;
|
||||||
|
|
||||||
while(!flag)
|
while(!flag)
|
||||||
{
|
{
|
||||||
|
list.clear();
|
||||||
line = QString::fromUtf8(this->downloading.process->readLine());
|
line = QString::fromUtf8(this->downloading.process->readLine());
|
||||||
if (line.isEmpty())
|
if (line.isEmpty())
|
||||||
{
|
{
|
||||||
flag = true;
|
flag = true;
|
||||||
break;
|
break;
|
||||||
}
|
}else
|
||||||
|
{
|
||||||
pos = line.indexOf("%");
|
pos = line.indexOf("%");
|
||||||
if (pos != -1)
|
if (pos != -1)
|
||||||
{
|
{
|
||||||
line.resize(pos);
|
line = line.simplified();
|
||||||
|
list = line.split(" ");
|
||||||
|
listSize = list.count() / 4;
|
||||||
|
for (i = 0; i < listSize; i++)
|
||||||
|
{
|
||||||
|
value = list.at(i *4 + 1).chopped(1).toInt();
|
||||||
|
dlSpeed = list.at(i * 4 + 2);
|
||||||
|
|
||||||
|
/*line.resize(pos);
|
||||||
pos = line.lastIndexOf(' ');
|
pos = line.lastIndexOf(' ');
|
||||||
if (pos != -1)
|
if (pos != -1)
|
||||||
{
|
{
|
||||||
line.remove(0, pos);
|
line.remove(0, pos);
|
||||||
value = line.toInt();
|
value = line.toInt();*/
|
||||||
// sending progress to Main window
|
// sending progress to Main window
|
||||||
emit progressSignal(value);
|
emit progressSignal(value);
|
||||||
|
emit fileName(filename + " %p%" + "\t " + dlSpeed);
|
||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
if (!line.contains("receiving"))
|
if (!line.contains("receiving"))
|
||||||
{
|
{
|
||||||
emit fileName(line.remove(QChar('\n'), Qt::CaseInsensitive) + " %p%");
|
filename = line.remove(QChar('\n'), Qt::CaseInsensitive);
|
||||||
|
emit fileName(filename + " %p%\t " + dlSpeed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <QTreeWidgetItem>
|
#include <QTreeWidgetItem>
|
||||||
|
#include <QList>
|
||||||
#include <QListWidgetItem>
|
#include <QListWidgetItem>
|
||||||
#include <QProgressDialog>
|
#include <QProgressDialog>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
@ -68,6 +69,7 @@ class Downloading
|
|||||||
QString service;
|
QString service;
|
||||||
QString path;
|
QString path;
|
||||||
QString savePath;
|
QString savePath;
|
||||||
|
int port;
|
||||||
QProcess * process = nullptr;
|
QProcess * process = nullptr;
|
||||||
bool quit = false;
|
bool quit = false;
|
||||||
void clear();
|
void clear();
|
||||||
@ -198,9 +200,12 @@ class MainWindow : public QMainWindow
|
|||||||
|
|
||||||
void on_actionExit_triggered();
|
void on_actionExit_triggered();
|
||||||
|
|
||||||
|
void setDlSpeed(QString speed);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void stopDownloading(QProcess *);
|
void stopDownloading(QProcess *);
|
||||||
void progressSignal(int);
|
void progressSignal(int);
|
||||||
|
void speed(QString);
|
||||||
void finishedSignal(bool = true);
|
void finishedSignal(bool = true);
|
||||||
void fileName(QString);
|
void fileName(QString);
|
||||||
//void errorSignal(QString);
|
//void errorSignal(QString);
|
||||||
|
Loading…
Reference in New Issue
Block a user