Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
42a7376f58 | |||
83ef43fab1 | |||
9d305b0b3b | |||
711ca7d1cd | |||
927c4a932a | |||
8227c76a88 | |||
d326e63a2f | |||
85dc65fc9e | |||
04b46b1b86 | |||
6bfbfe1c78 | |||
7e736b524e |
@ -19,11 +19,13 @@ SOURCES += \
|
|||||||
downloadfile.cpp \
|
downloadfile.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
mainwindow.cpp \
|
mainwindow.cpp \
|
||||||
|
password.cpp \
|
||||||
tools.cpp
|
tools.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
downloadfile.h \
|
downloadfile.h \
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
|
password.h \
|
||||||
tools.h
|
tools.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
|
@ -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-03-01T13:05:08. -->
|
<!-- Written by QtCreator 4.14.2, 2023-03-05T10:17:18. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>EnvironmentId</variable>
|
<variable>EnvironmentId</variable>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: rsyncui
|
Name: rsyncui
|
||||||
Summary: Client for rsync server
|
Summary: Client for rsync server
|
||||||
Version: 2.6
|
Version: 2.9
|
||||||
Release: %mkrel 1
|
Release: %mkrel 1
|
||||||
License: GPLv3
|
License: GPLv3
|
||||||
Group: Networking/Remote access
|
Group: Networking/Remote access
|
||||||
|
160
RsyncUI_fr_FR.ts
160
RsyncUI_fr_FR.ts
@ -149,89 +149,99 @@
|
|||||||
<translation>Cliquez pour ajouter à la file de téléchargement</translation>
|
<translation>Cliquez pour ajouter à la file de téléchargement</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="338"/>
|
<location filename="mainwindow.ui" line="329"/>
|
||||||
|
<source>Filter...</source>
|
||||||
|
<translation>Filtrer...</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.ui" line="341"/>
|
||||||
<source>Click on file to stop downloading</source>
|
<source>Click on file to stop downloading</source>
|
||||||
<translation>Cliquez sur le document pour arrêter le téléchargement et l'enlever de la file</translation>
|
<translation>Cliquez sur le document pour arrêter le téléchargement et l'enlever de la file</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="364"/>
|
<location filename="mainwindow.ui" line="367"/>
|
||||||
<source>%p%</source>
|
<source>%p%</source>
|
||||||
<extracomment>Downloading</extracomment>
|
<extracomment>Downloading</extracomment>
|
||||||
<translation>Téléchargement</translation>
|
<translation>Téléchargement</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="375"/>
|
<location filename="mainwindow.ui" line="378"/>
|
||||||
<source>toolBar</source>
|
<source>toolBar</source>
|
||||||
<translation>Barre d'outils</translation>
|
<translation>Barre d'outils</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="448"/>
|
<location filename="mainwindow.ui" line="452"/>
|
||||||
<source>Download</source>
|
<source>Download</source>
|
||||||
<translation>Télécharger</translation>
|
<translation>Télécharger</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="451"/>
|
<location filename="mainwindow.ui" line="455"/>
|
||||||
<source>Click on menu button to download the entire folder</source>
|
<source>Click on menu button to download the entire folder</source>
|
||||||
<translation>Cliquer sur le bouton droit de la souris pour télécharger le dossier entier</translation>
|
<translation>Cliquer sur le bouton droit de la souris pour télécharger le dossier entier</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="460"/>
|
<location filename="mainwindow.ui" line="464"/>
|
||||||
<source>Exit</source>
|
<source>Exit</source>
|
||||||
<translation>Quitter</translation>
|
<translation>Quitter</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="463"/>
|
<location filename="mainwindow.ui" line="467"/>
|
||||||
<source>Terminate the program</source>
|
<source>Terminate the program</source>
|
||||||
<translation>Terminer le programme</translation>
|
<translation>Terminer le programme</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="466"/>
|
<location filename="mainwindow.ui" line="470"/>
|
||||||
<source>Ctrl+Q</source>
|
<source>Ctrl+Q</source>
|
||||||
<translation>Ctrl+Q</translation>
|
<translation>Ctrl+Q</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="413"/>
|
<location filename="mainwindow.ui" line="479"/>
|
||||||
<location filename="mainwindow.ui" line="416"/>
|
<source>hidden service</source>
|
||||||
|
<translation>Service caché</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.ui" line="417"/>
|
||||||
|
<location filename="mainwindow.ui" line="420"/>
|
||||||
<source>Change save folder</source>
|
<source>Change save folder</source>
|
||||||
<translation>Changer le dossier de destination</translation>
|
<translation>Changer le dossier de destination</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="425"/>
|
<location filename="mainwindow.ui" line="429"/>
|
||||||
<source>About</source>
|
<source>About</source>
|
||||||
<translation>À propos</translation>
|
<translation>À propos</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="434"/>
|
<location filename="mainwindow.ui" line="438"/>
|
||||||
<source>About Qt</source>
|
<source>About Qt</source>
|
||||||
<translation>À propos de Qt</translation>
|
<translation>À propos de Qt</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="443"/>
|
<location filename="mainwindow.ui" line="447"/>
|
||||||
<source>Settings</source>
|
<source>Settings</source>
|
||||||
<translation>Paramètres</translation>
|
<translation>Paramètres</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="107"/>
|
<location filename="mainwindow.h" line="123"/>
|
||||||
<source>KB</source>
|
<source>KB</source>
|
||||||
<translation>Ko</translation>
|
<translation>Ko</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="107"/>
|
<location filename="mainwindow.h" line="124"/>
|
||||||
<source>MB</source>
|
<source>MB</source>
|
||||||
<translation>Mo</translation>
|
<translation>Mo</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="107"/>
|
<location filename="mainwindow.h" line="125"/>
|
||||||
<source>GB</source>
|
<source>GB</source>
|
||||||
<translation>Go</translation>
|
<translation>Go</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="107"/>
|
<location filename="mainwindow.h" line="126"/>
|
||||||
<source>TB</source>
|
<source>TB</source>
|
||||||
<translation>To</translation>
|
<translation>To</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="107"/>
|
<location filename="mainwindow.h" line="127"/>
|
||||||
<source>PB</source>
|
<source>PB</source>
|
||||||
<translation>Po</translation>
|
<translation>Po</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -268,10 +278,6 @@ Cliquez sur un fichier pour le supprimer de la file et une fenêtre de confirmat
|
|||||||
<b>5ème icône: Quitter</b><br>
|
<b>5ème icône: Quitter</b><br>
|
||||||
Permet de quitter le programme</translation>
|
Permet de quitter le programme</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source><h2>Client for rsync server<2><br><br></source>
|
|
||||||
<translation type="vanished"><h2>Client pour serveur rsync<2><br><br>éaa</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="78"/>
|
<location filename="mainwindow.cpp" line="78"/>
|
||||||
<source>Path</source>
|
<source>Path</source>
|
||||||
@ -288,98 +294,143 @@ Cliquez sur un fichier pour le supprimer de la file et une fenêtre de confirmat
|
|||||||
<translation>Type</translation>
|
<translation>Type</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="122"/>
|
<location filename="mainwindow.cpp" line="78"/>
|
||||||
|
<source>Date</source>
|
||||||
|
<translation>Date</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="105"/>
|
||||||
|
<source>KB/s</source>
|
||||||
|
<translation>Ko/s</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="105"/>
|
||||||
|
<source>MB/s</source>
|
||||||
|
<translation>Mo/s</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="105"/>
|
||||||
|
<source>GB/s</source>
|
||||||
|
<translation>Go/s</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="105"/>
|
||||||
|
<source>TB/s</source>
|
||||||
|
<translation>To/s</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="105"/>
|
||||||
|
<source>PB/s</source>
|
||||||
|
<translation>Po/s</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="123"/>
|
||||||
<source>A list of interrupted downloads exists, do you want to continue downloading ? if not the list will be cleared</source>
|
<source>A list of interrupted downloads exists, do you want to continue downloading ? if not the list will be cleared</source>
|
||||||
<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="151"/>
|
<location filename="mainwindow.cpp" line="152"/>
|
||||||
<source>&Quit</source>
|
<source>&Quit</source>
|
||||||
<translation>&Quitter</translation>
|
<translation>&Quitter</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="208"/>
|
<location filename="mainwindow.cpp" line="209"/>
|
||||||
<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="214"/>
|
<location filename="mainwindow.cpp" line="215"/>
|
||||||
<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="252"/>
|
<location filename="mainwindow.cpp" line="253"/>
|
||||||
<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="492"/>
|
<location filename="mainwindow.cpp" line="513"/>
|
||||||
<source>The processus does'nt respond: </source>
|
<source>The processus does'nt respond: </source>
|
||||||
<translation>Le processus ne répond pas: </translation>
|
<translation>Le processus ne répond pas: </translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="578"/>
|
<location filename="mainwindow.cpp" line="599"/>
|
||||||
<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="606"/>
|
<location filename="mainwindow.cpp" line="633"/>
|
||||||
<location filename="mainwindow.cpp" line="626"/>
|
<location filename="mainwindow.cpp" line="745"/>
|
||||||
<source>Dir</source>
|
<source>Dir</source>
|
||||||
<translation>dossier</translation>
|
<translation>dossier</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="610"/>
|
|
||||||
<location filename="mainwindow.cpp" line="740"/>
|
|
||||||
<source>File</source>
|
<source>File</source>
|
||||||
<translation>Doc</translation>
|
<translation type="vanished">Doc</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="751"/>
|
<location filename="mainwindow.cpp" line="773"/>
|
||||||
<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="768"/>
|
<location filename="mainwindow.cpp" line="790"/>
|
||||||
<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="805"/>
|
<location filename="mainwindow.cpp" line="827"/>
|
||||||
<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="830"/>
|
<location filename="mainwindow.cpp" line="852"/>
|
||||||
<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="845"/>
|
<location filename="mainwindow.cpp" line="867"/>
|
||||||
<source>finished</source>
|
<source>finished</source>
|
||||||
<translation>Terminé</translation>
|
<translation>Terminé</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="853"/>
|
<location filename="mainwindow.cpp" line="877"/>
|
||||||
<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="865"/>
|
<location filename="mainwindow.cpp" line="884"/>
|
||||||
<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="871"/>
|
<location filename="mainwindow.cpp" line="895"/>
|
||||||
|
<source>
|
||||||
|
Do you want to retry?</source>
|
||||||
|
<translation>
|
||||||
|
Voulez-vous ré-essayer?</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="904"/>
|
||||||
<source>Download </source>
|
<source>Download </source>
|
||||||
<translation>Téléchargement </translation>
|
<translation>Téléchargement </translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="1257"/>
|
||||||
|
<source>RsyncUI Request</source>
|
||||||
|
<translation>Requête RsyncUI</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="1258"/>
|
||||||
|
<source>Hidden service name</source>
|
||||||
|
<translation>Nom du servcice caché</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="56"/>
|
<location filename="mainwindow.cpp" line="56"/>
|
||||||
<source>Version</source>
|
<source>Version</source>
|
||||||
@ -411,52 +462,57 @@ Voulez-vous vraiment sortir ?</translation>
|
|||||||
<translation>Code source</translation>
|
<translation>Code source</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1036"/>
|
<location filename="mainwindow.cpp" line="1073"/>
|
||||||
<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="1041"/>
|
<location filename="mainwindow.cpp" line="1078"/>
|
||||||
<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="932"/>
|
<location filename="mainwindow.cpp" line="969"/>
|
||||||
<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="946"/>
|
<location filename="mainwindow.cpp" line="983"/>
|
||||||
<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="137"/>
|
<location filename="mainwindow.h" line="122"/>
|
||||||
|
<source>B</source>
|
||||||
|
<translation>o</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.h" line="139"/>
|
||||||
<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="138"/>
|
<location filename="mainwindow.h" line="140"/>
|
||||||
<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="139"/>
|
<location filename="mainwindow.h" line="141"/>
|
||||||
<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="140"/>
|
<location filename="mainwindow.h" line="142"/>
|
||||||
<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="141"/>
|
<location filename="mainwindow.h" line="143"/>
|
||||||
<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="142"/>
|
<location filename="mainwindow.h" line="144"/>
|
||||||
<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>
|
||||||
|
Binary file not shown.
216
mainwindow.cpp
216
mainwindow.cpp
@ -65,19 +65,18 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
// connectors
|
// connectors
|
||||||
connect(this, &MainWindow::fileName, ui->progressBar, &QProgressBar::setFormat);
|
connect(this, &MainWindow::fileName, ui->progressBar, &QProgressBar::setFormat);
|
||||||
connect(this, &MainWindow::progressSignal, ui->progressBar, &QProgressBar::setValue);
|
connect(this, &MainWindow::progressSignal, ui->progressBar, &QProgressBar::setValue);
|
||||||
//connect(this, &MainWindow::speed, ui->progressBar, &MainWindow::setDlSpeed);
|
|
||||||
//connect(this, &MainWindow::errorSignal, this, &MainWindow::downloadingErrorSlot);
|
|
||||||
connect(this, &MainWindow::stopDownloading, this, &MainWindow::cancelled);
|
connect(this, &MainWindow::stopDownloading, this, &MainWindow::cancelled);
|
||||||
connect(config.buttonBox, SIGNAL(accepted()), this, SLOT(on_buttonBox_accepted()));
|
connect(config.buttonBox, SIGNAL(accepted()), this, SLOT(on_buttonBox_accepted()));
|
||||||
connect(config.comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &MainWindow::on_comboBox_currentIndexChanged);
|
connect(config.comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &MainWindow::on_comboBox_currentIndexChanged);
|
||||||
connect(loginD.loginBox, SIGNAL(accepted()), this, SLOT(on_loginBox_accepted()));
|
connect(loginD.loginBox, SIGNAL(accepted()), this, SLOT(on_loginBox_accepted()));
|
||||||
|
|
||||||
|
loadSettings();
|
||||||
|
|
||||||
// init of widgets
|
// init of widgets
|
||||||
ui->ktreewidgetsearchline->setTreeWidget(ui->treeWidget); // attach search widget to treewidget
|
ui->ktreewidgetsearchline->setTreeWidget(ui->treeWidget); // attach search widget to treewidget
|
||||||
ui->ktreewidgetsearchline->setCaseSensitivity(Qt::CaseInsensitive); // and set it case insensitive
|
ui->ktreewidgetsearchline->setCaseSensitivity(Qt::CaseInsensitive); // and set it case insensitive
|
||||||
ui->treeWidget->setHeaderLabels({tr("Path"), tr("Type"), tr("Size")} ); // set header of columns of tree widget
|
ui->treeWidget->setHeaderLabels({tr("Path"), tr("Type"), tr("Size"), tr("Date"), "fullSize"} ); // set header of columns of tree widget
|
||||||
|
//ui->treeWidget->header()->setContextMenuPolicy();
|
||||||
|
|
||||||
// setting arrowcursor for treeWidget, listWidget and listDownload to arrow
|
// setting arrowcursor for treeWidget, listWidget and listDownload to arrow
|
||||||
ui->treeWidget->setCursor(Qt::ArrowCursor);
|
ui->treeWidget->setCursor(Qt::ArrowCursor);
|
||||||
ui->listWidget->setCursor(Qt::ArrowCursor);
|
ui->listWidget->setCursor(Qt::ArrowCursor);
|
||||||
@ -86,7 +85,6 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
// Hiding progress bar
|
// Hiding progress bar
|
||||||
ui->progressBar->hide();
|
ui->progressBar->hide();
|
||||||
|
|
||||||
loadSettings();
|
|
||||||
|
|
||||||
// if last server exists in settings
|
// if last server exists in settings
|
||||||
if (this->settings.contains("connexion/lastServer"))
|
if (this->settings.contains("connexion/lastServer"))
|
||||||
@ -104,7 +102,10 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
config.comboBox->setCurrentIndex(ui->toolBar->toolButtonStyle()); // setting combobox to saved settings
|
config.comboBox->setCurrentIndex(ui->toolBar->toolButtonStyle()); // setting combobox to saved settings
|
||||||
|
|
||||||
//setting unit of bandwidth limit
|
//setting unit of bandwidth limit
|
||||||
config.UnitCombobox->addItems({tr("KB"), tr("MB"), tr("GB"), tr("TB"), tr("PB")});
|
config.UnitCombobox->addItems({tr("KB/s"), tr("MB/s"), tr("GB/s"), tr("TB/s"), tr("PB/s")});
|
||||||
|
|
||||||
|
// hide fullsize column of treeview
|
||||||
|
ui->treeWidget->setColumnHidden(4, true);
|
||||||
|
|
||||||
initSystemTrayIcon();
|
initSystemTrayIcon();
|
||||||
}
|
}
|
||||||
@ -275,7 +276,7 @@ void MainWindow::closeEvent (QCloseEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Populate treeview with list of files
|
// Populate treeview with list of files
|
||||||
void MainWindow::populateTree(QTreeWidgetItem * parent)
|
void MainWindow::populateTree()
|
||||||
{
|
{
|
||||||
QString path;
|
QString path;
|
||||||
|
|
||||||
@ -290,8 +291,8 @@ void MainWindow::populateTree(QTreeWidgetItem * parent)
|
|||||||
if (validateServer(this->connexion.server))
|
if (validateServer(this->connexion.server))
|
||||||
{
|
{
|
||||||
// server is validated, scanning directory
|
// 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);
|
scanDir(this->connexion.server, this->connexion.port, nullptr, path);
|
||||||
}
|
}
|
||||||
// Restoring cursor
|
// Restoring cursor
|
||||||
QGuiApplication::restoreOverrideCursor();
|
QGuiApplication::restoreOverrideCursor();
|
||||||
@ -302,7 +303,9 @@ void MainWindow::populateTree(QTreeWidgetItem * parent)
|
|||||||
void MainWindow::populateList()
|
void MainWindow::populateList()
|
||||||
{
|
{
|
||||||
QString server;
|
QString server;
|
||||||
|
QStringList hidden;
|
||||||
int port;
|
int port;
|
||||||
|
int i;
|
||||||
|
|
||||||
server = ui->khistorycombobox->currentText();
|
server = ui->khistorycombobox->currentText();
|
||||||
port = ui->portEdit->text().toUInt();
|
port = ui->portEdit->text().toUInt();
|
||||||
@ -350,7 +353,15 @@ void MainWindow::populateList()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->settings.endGroup();
|
this->settings.endGroup();
|
||||||
|
this->settings.beginGroup("Hidden/");
|
||||||
|
hidden = this->settings.allKeys();
|
||||||
|
for (i = 0; i < hidden.size(); i++)
|
||||||
|
{
|
||||||
|
//TODO detect if service is already present
|
||||||
|
ui->listWidget->addItem(this->settings.value(hidden.at(i)).toString() + "\n\t");
|
||||||
|
}
|
||||||
QGuiApplication::restoreOverrideCursor(); //setting cursor to default
|
QGuiApplication::restoreOverrideCursor(); //setting cursor to default
|
||||||
|
this->settings.endGroup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,7 +378,7 @@ void MainWindow::listServices()
|
|||||||
bool flag = false;
|
bool flag = false;
|
||||||
|
|
||||||
cmd = "/usr/bin/rsync";
|
cmd = "/usr/bin/rsync";
|
||||||
param << "--contimeout=10" << "--port=" + QString::number(this->connexion.port) << this->connexion.server + "::";
|
param << "--contimeout=20" << "--port=" + QString::number(this->connexion.port) << this->connexion.server + "::";
|
||||||
myProcess = new QProcess(this);
|
myProcess = new QProcess(this);
|
||||||
myProcess->start(cmd, param);
|
myProcess->start(cmd, param);
|
||||||
|
|
||||||
@ -406,9 +417,13 @@ bool MainWindow::scanDir(QString server, int portN, QTreeWidgetItem *parent, QSt
|
|||||||
{
|
{
|
||||||
QString cmd;
|
QString cmd;
|
||||||
QStringList param;
|
QStringList param;
|
||||||
|
QStringList sizeA;
|
||||||
QString line;
|
QString line;
|
||||||
QString size;
|
QString size;
|
||||||
|
QString fullsize;
|
||||||
QString filename;
|
QString filename;
|
||||||
|
QString fileType;
|
||||||
|
QString date;
|
||||||
QProcess * myProcess;
|
QProcess * myProcess;
|
||||||
bool isDir = false;
|
bool isDir = false;
|
||||||
bool flag = false;
|
bool flag = false;
|
||||||
@ -435,7 +450,7 @@ bool MainWindow::scanDir(QString server, int portN, QTreeWidgetItem *parent, QSt
|
|||||||
}
|
}
|
||||||
myProcess->setProcessEnvironment(env);
|
myProcess->setProcessEnvironment(env);
|
||||||
cmd = "rsync";
|
cmd = "rsync";
|
||||||
param << "--contimeout=10" << "--port=" + QString::number(portN) << server + "::" + path;
|
param << "--contimeout=20" << "--port=" + QString::number(portN) << server + "::" + path;
|
||||||
|
|
||||||
|
|
||||||
myProcess->start(cmd, param);
|
myProcess->start(cmd, param);
|
||||||
@ -455,12 +470,24 @@ bool MainWindow::scanDir(QString server, int portN, QTreeWidgetItem *parent, QSt
|
|||||||
flag = true;
|
flag = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// extracting name, size and is dir/file
|
// extracting name, size and if is dir/file
|
||||||
line = line.simplified();
|
line = line.simplified();
|
||||||
size = line.section(" ", 1, 1);
|
|
||||||
filename = line.section(" ", 4);
|
filename = line.section(" ", 4);
|
||||||
if (filename != '.')
|
if (filename != '.')
|
||||||
{
|
{
|
||||||
|
|
||||||
|
size = line.section(" ", 1, 1);
|
||||||
|
fullsize = size;
|
||||||
|
fullsize.remove(",");
|
||||||
|
sizeA = size.split(',');
|
||||||
|
if (sizeA.count() <= 1)
|
||||||
|
{
|
||||||
|
size = sizeA.at(0) + " " + UnitText[0] + " ";
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
size = sizeA.at(0) + "," + sizeA.at(1).left(2) + " " + UnitText[sizeA.count()-1] + " ";
|
||||||
|
}
|
||||||
|
|
||||||
if (line[0] == "d")
|
if (line[0] == "d")
|
||||||
{
|
{
|
||||||
isDir = true;
|
isDir = true;
|
||||||
@ -468,15 +495,9 @@ bool MainWindow::scanDir(QString server, int portN, QTreeWidgetItem *parent, QSt
|
|||||||
{
|
{
|
||||||
isDir = false;
|
isDir = false;
|
||||||
}
|
}
|
||||||
if (parent != NULL)
|
date = line.section(' ', 2, 2);
|
||||||
{
|
fileType = getFileType(filename);
|
||||||
//adding item to tree
|
addTreeItem(filename, size, fullsize, fileType, date, isDir, parent);
|
||||||
addTreeChild(parent, filename, size, isDir);
|
|
||||||
}else
|
|
||||||
{
|
|
||||||
//adding item to tree (as directory)
|
|
||||||
addTreeRoot(filename, size, isDir);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
flag = false;
|
flag = false;
|
||||||
@ -595,57 +616,56 @@ void MainWindow::on_connectButton_clicked()
|
|||||||
populateList();
|
populateList();
|
||||||
}
|
}
|
||||||
|
|
||||||
// add a dir in treeview
|
// add parent in treeview
|
||||||
QTreeWidgetItem * MainWindow::addTreeRoot(QString name, QString fileSize, bool isDir)
|
void MainWindow::addTreeItem(QString name, QString fileSize, QString fullsize, QString type, QString date, bool isDir=false, QTreeWidgetItem *parent=nullptr)
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *treeItem = new QTreeWidgetItem(ui->treeWidget);
|
QTreeWidgetItem *treeItem;
|
||||||
|
if (parent != nullptr)
|
||||||
|
{
|
||||||
|
treeItem = new QTreeWidgetItem();
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
treeItem = new QTreeWidgetItem(ui->treeWidget);
|
||||||
|
}
|
||||||
if (isDir == true)
|
if (isDir == true)
|
||||||
{
|
{
|
||||||
// item is a dir
|
// item is a dir
|
||||||
treeItem->setText(1, tr("Dir"));
|
treeItem->setText(1, tr("Dir"));
|
||||||
|
treeItem->setIcon(0, QIcon::fromTheme("folder"));
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
// item is a file
|
// item is a file
|
||||||
treeItem->setText(1,tr("File"));
|
treeItem->setText(1,type);
|
||||||
}
|
}
|
||||||
treeItem->setText(0, name);
|
treeItem->setText(0, name);
|
||||||
treeItem->setText(2, fileSize);
|
treeItem->setText(2, fileSize);
|
||||||
|
treeItem->setText(3, date);
|
||||||
|
treeItem->setText(4, fullsize);
|
||||||
|
|
||||||
return treeItem;
|
treeItem->setTextAlignment(2, Qt::AlignRight);
|
||||||
}
|
|
||||||
|
|
||||||
// add a file in treeview
|
if (parent != nullptr)
|
||||||
QTreeWidgetItem * MainWindow::addTreeChild(QTreeWidgetItem *parent, QString name, QString fileSize, bool isDir)
|
|
||||||
{
|
|
||||||
QTreeWidgetItem *treeItem = new QTreeWidgetItem();
|
|
||||||
|
|
||||||
if (isDir == true)
|
|
||||||
{
|
{
|
||||||
// item is a dir
|
// QTreeWidgetItem::addChild(QTreeWidgetItem * child)
|
||||||
treeItem->setText(1, tr("Dir"));
|
parent->addChild(treeItem);
|
||||||
}else
|
|
||||||
{
|
|
||||||
// item is a file
|
|
||||||
treeItem->setText(1,("File"));
|
|
||||||
}
|
}
|
||||||
treeItem->setText(0, name);
|
|
||||||
treeItem->setText(2, fileSize);
|
|
||||||
|
|
||||||
// QTreeWidgetItem::addChild(QTreeWidgetItem * child)
|
|
||||||
parent->addChild(treeItem);
|
|
||||||
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()
|
void MainWindow::on_listWidget_clicked()
|
||||||
|
{
|
||||||
|
this->connexion.service = ui->listWidget->currentItem()->text().section("\n", 0 ,0);
|
||||||
|
preparePopulateTree();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::preparePopulateTree()
|
||||||
{
|
{
|
||||||
QString str;
|
QString str;
|
||||||
QStringList logins;
|
QStringList logins;
|
||||||
|
|
||||||
this->rescan = true;
|
this->rescan = true;
|
||||||
this->connexion.user = nullptr;
|
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;
|
str = "Folder/" + this->connexion.server + "/" + this->connexion.service;
|
||||||
// if service exists in settings for this server
|
// if service exists in settings for this server
|
||||||
if (this->settings.contains(str))
|
if (this->settings.contains(str))
|
||||||
@ -662,7 +682,7 @@ void MainWindow::on_listWidget_clicked()
|
|||||||
this->connexion.password = this->settings.value(logins[0]).toString();
|
this->connexion.password = this->settings.value(logins[0]).toString();
|
||||||
}
|
}
|
||||||
this->settings.endGroup();
|
this->settings.endGroup();
|
||||||
populateTree(NULL);
|
populateTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
// get password and user login
|
// get password and user login
|
||||||
@ -712,23 +732,7 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadD
|
|||||||
|
|
||||||
// assembling path from treewidget
|
// assembling path from treewidget
|
||||||
path = item->text(0);
|
path = item->text(0);
|
||||||
sizeFromRsync = item->text(2).remove(',').toUInt();
|
sizeFromRsync = item->text(4).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)
|
while(itemR->parent() != NULL)
|
||||||
{
|
{
|
||||||
@ -736,13 +740,31 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadD
|
|||||||
// concatening parent to path
|
// concatening parent to path
|
||||||
path.prepend(itemR->text(0) + "/");
|
path.prepend(itemR->text(0) + "/");
|
||||||
};
|
};
|
||||||
QFileInfo info(this->downloading.savePath + "/" + path);
|
|
||||||
if (item->text(1) == tr("File") or downloadDir == true)
|
cout << item->text(1).toStdString() <<endl;
|
||||||
|
if (item->text(1) != tr("Dir") 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
|
// Item is a file
|
||||||
// searching if file exists in savepath
|
// searching if file exists in savepath
|
||||||
if (QFile::exists(this->downloading.savePath + "/" + path))
|
if (QFile::exists(this->downloading.savePath + "/" + path))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
QFileInfo info(this->downloading.savePath + "/" + path);
|
||||||
if (info.size() < sizeFromRsync)
|
if (info.size() < sizeFromRsync)
|
||||||
{
|
{
|
||||||
reply = QMessageBox::question(
|
reply = QMessageBox::question(
|
||||||
@ -843,6 +865,8 @@ void MainWindow::downloadFinished(int exitCode, QProcess::ExitStatus exitStatus)
|
|||||||
QString str;
|
QString str;
|
||||||
int pos;
|
int pos;
|
||||||
QString aborted = tr("finished");
|
QString aborted = tr("finished");
|
||||||
|
QMessageBox::StandardButton reply;
|
||||||
|
bool retry = false;
|
||||||
|
|
||||||
// test if process crashed
|
// test if process crashed
|
||||||
if (exitStatus == QProcess::CrashExit)
|
if (exitStatus == QProcess::CrashExit)
|
||||||
@ -853,19 +877,28 @@ void MainWindow::downloadFinished(int exitCode, QProcess::ExitStatus exitStatus)
|
|||||||
tr("Rsync process crashed"));
|
tr("Rsync process crashed"));
|
||||||
}
|
}
|
||||||
//test result code of command (if 20 then command stopped by user)
|
//test result code of command (if 20 then command stopped by user)
|
||||||
if (exitCode != 0 and exitCode != 20)
|
if (exitCode != 0)
|
||||||
{
|
{
|
||||||
|
if (exitCode == 20)
|
||||||
|
{
|
||||||
|
aborted = tr("stopped by user");
|
||||||
|
}else if (exitCode == 5) // password asked
|
||||||
|
{
|
||||||
|
loginDialog.show();
|
||||||
|
retry = true;
|
||||||
|
}
|
||||||
|
|
||||||
// displaying warning with exit code
|
// displaying warning with exit code
|
||||||
QMessageBox::warning(
|
reply = QMessageBox::warning(
|
||||||
NULL,
|
this,
|
||||||
"RsyncUI",
|
"RsyncUI",
|
||||||
rsyncErrorStrings[exitCode]);
|
rsyncErrorStrings[exitCode] + tr("\nDo you want to retry?"),
|
||||||
}else if (exitCode == 20)
|
QMessageBox::Yes|QMessageBox::No,
|
||||||
{
|
QMessageBox::Yes);
|
||||||
aborted = tr("stopped by user");
|
if (reply == QMessageBox::Yes)
|
||||||
}else if (exitCode == 5) // password asked
|
{
|
||||||
{
|
retry = true;
|
||||||
loginDialog.show();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this->trayIcon->showMessage("RsyncUI", tr("Download ") + aborted + "\n" + this->downloading.path, QSystemTrayIcon::Information);
|
this->trayIcon->showMessage("RsyncUI", tr("Download ") + aborted + "\n" + this->downloading.path, QSystemTrayIcon::Information);
|
||||||
@ -876,7 +909,11 @@ void MainWindow::downloadFinished(int exitCode, QProcess::ExitStatus exitStatus)
|
|||||||
// reset variables and window
|
// reset variables and window
|
||||||
this->downloading.process->close();
|
this->downloading.process->close();
|
||||||
ui->progressBar->hide();
|
ui->progressBar->hide();
|
||||||
delete ui->listDownload->takeItem(0);
|
|
||||||
|
if (retry == false)
|
||||||
|
{
|
||||||
|
delete ui->listDownload->takeItem(0);
|
||||||
|
}
|
||||||
this->downloading.clear();
|
this->downloading.clear();
|
||||||
|
|
||||||
// Some downloads staying in queue
|
// Some downloads staying in queue
|
||||||
@ -1201,7 +1238,7 @@ void MainWindow::on_loginBox_accepted()
|
|||||||
if (this->rescan == true)
|
if (this->rescan == true)
|
||||||
{
|
{
|
||||||
this->rescan = false;
|
this->rescan = false;
|
||||||
populateTree(NULL);
|
populateTree();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1212,3 +1249,18 @@ void MainWindow::setDlSpeed(QString speed)
|
|||||||
speed.squeeze();
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
28
mainwindow.h
28
mainwindow.h
@ -58,6 +58,7 @@ class Connexion
|
|||||||
public:
|
public:
|
||||||
int bandwidthLimit = 0;
|
int bandwidthLimit = 0;
|
||||||
int bandwidthLimitUnit;
|
int bandwidthLimitUnit;
|
||||||
|
int contimeout = 20;
|
||||||
QString server;
|
QString server;
|
||||||
QString service;
|
QString service;
|
||||||
QString user;
|
QString user;
|
||||||
@ -85,7 +86,7 @@ class About
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QString title = "RsyncUI";
|
QString title = "RsyncUI";
|
||||||
QString version = "2.6";
|
QString version = "2.9";
|
||||||
QString author = "Daniel TARTAVEL-JEANNOT";
|
QString author = "Daniel TARTAVEL-JEANNOT";
|
||||||
QString licence = "GPL_V3";
|
QString licence = "GPL_V3";
|
||||||
QString description;
|
QString description;
|
||||||
@ -117,12 +118,13 @@ class MainWindow : public QMainWindow
|
|||||||
QString icon = "/usr/share/icons/RsyncUI.png";
|
QString icon = "/usr/share/icons/RsyncUI.png";
|
||||||
bool rescan = false;
|
bool rescan = false;
|
||||||
|
|
||||||
QList<QString> bwUnitText {
|
QList<QString> UnitText {
|
||||||
"KB",
|
tr("B"),
|
||||||
"MB",
|
tr("KB"),
|
||||||
"TB",
|
tr("MB"),
|
||||||
"GB",
|
tr("GB"),
|
||||||
"PB"
|
tr("TB"),
|
||||||
|
tr("PB")
|
||||||
};
|
};
|
||||||
QList<QChar> bwUnitChar{
|
QList<QChar> bwUnitChar{
|
||||||
'K',
|
'K',
|
||||||
@ -143,13 +145,14 @@ class MainWindow : public QMainWindow
|
|||||||
};
|
};
|
||||||
|
|
||||||
void displayTree();
|
void displayTree();
|
||||||
void populateTree(QTreeWidgetItem * parent);
|
void populateTree();
|
||||||
void populateList();
|
void populateList();
|
||||||
void listServices();
|
void listServices();
|
||||||
bool validateServer(QString server);
|
bool validateServer(QString server);
|
||||||
bool isIpAddress(QString server);
|
bool isIpAddress(QString server);
|
||||||
QTreeWidgetItem * addTreeRoot(QString name, QString description, bool isDir);
|
void addTreeItem(QString name, QString fileSize, QString fullsize, QString type, QString date, bool isDir, QTreeWidgetItem *parent);
|
||||||
QTreeWidgetItem * addTreeChild(QTreeWidgetItem *parent, QString name, QString size, bool isDir);
|
//QTreeWidgetItem * addTreeRoot(QString name, QString size, QString fullsize, bool isDir);
|
||||||
|
//QTreeWidgetItem * addTreeChild(QTreeWidgetItem *parent, QString name, QString size, QString fullsize, bool isDir);
|
||||||
bool scanDir(QString server, int portN, QTreeWidgetItem *parent = NULL, QString path = "" );
|
bool scanDir(QString server, int portN, QTreeWidgetItem *parent = NULL, QString path = "" );
|
||||||
void startDownloading();
|
void startDownloading();
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
@ -163,6 +166,7 @@ class MainWindow : public QMainWindow
|
|||||||
void showWindow();
|
void showWindow();
|
||||||
void init();
|
void init();
|
||||||
bool getUserPassword(bool);
|
bool getUserPassword(bool);
|
||||||
|
void preparePopulateTree();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
@ -214,7 +218,9 @@ class MainWindow : public QMainWindow
|
|||||||
|
|
||||||
void on_loginBox_accepted();
|
void on_loginBox_accepted();
|
||||||
|
|
||||||
signals:
|
void on_actionHiddenService_triggered();
|
||||||
|
|
||||||
|
signals:
|
||||||
void stopDownloading(QProcess *);
|
void stopDownloading(QProcess *);
|
||||||
void progressSignal(int);
|
void progressSignal(int);
|
||||||
void speed(QString);
|
void speed(QString);
|
||||||
|
@ -325,6 +325,9 @@
|
|||||||
<property name="inputMethodHints">
|
<property name="inputMethodHints">
|
||||||
<set>Qt::ImhNoAutoUppercase</set>
|
<set>Qt::ImhNoAutoUppercase</set>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Filter...</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@ -399,6 +402,7 @@
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</attribute>
|
</attribute>
|
||||||
<addaction name="DefaultSaveFolder"/>
|
<addaction name="DefaultSaveFolder"/>
|
||||||
|
<addaction name="actionHiddenService"/>
|
||||||
<addaction name="action_Settings"/>
|
<addaction name="action_Settings"/>
|
||||||
<addaction name="actionAbout"/>
|
<addaction name="actionAbout"/>
|
||||||
<addaction name="actionAbout_Qt"/>
|
<addaction name="actionAbout_Qt"/>
|
||||||
@ -466,6 +470,15 @@
|
|||||||
<string>Ctrl+Q</string>
|
<string>Ctrl+Q</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionHiddenService">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="folder-open">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>hidden service</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
59
password.cpp
Normal file
59
password.cpp
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
#include "mainwindow.h"
|
||||||
|
#include "password.h"
|
||||||
|
#include <qt5keychain/keychain.h>
|
||||||
|
#include <qt5keychain/qkeychain_export.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
/*Password::Password()
|
||||||
|
{
|
||||||
|
this->passwdJob->setObjectName(this->appName);
|
||||||
|
this->passwdJob->setAutoDelete(false);
|
||||||
|
this->passwdJob->connect(this->passwdJob, SIGNAL(finished(QKeychain::Job*)), this, SLOT(finished(QKeychain::Job*)));
|
||||||
|
//this->readPass->connect(this->readPass, SIGNAL(finished()))
|
||||||
|
}
|
||||||
|
|
||||||
|
void Password::store (QString account, QString password)
|
||||||
|
{
|
||||||
|
this->passwdJob->setKey(account);
|
||||||
|
this->passwdJob->setTextData(password);
|
||||||
|
this->passwdJob->start();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString Password::read(QString account)
|
||||||
|
{
|
||||||
|
this->readPass->setObjectName("");
|
||||||
|
this->readPass->setKey(account);
|
||||||
|
this->readPass->start();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Password::remove(QString)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Password::finished(QKeychain::Job * passwdJob)
|
||||||
|
{
|
||||||
|
if(passwdJob->error()) {
|
||||||
|
QMessageBox::warning(
|
||||||
|
NULL,
|
||||||
|
"RsyncUI",
|
||||||
|
QString(this->mw->tr("Error: Unable to save password!")) + QString(passwdJob->error()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Password::readReturn()
|
||||||
|
{
|
||||||
|
if(this->readPass->error())
|
||||||
|
{
|
||||||
|
QMessageBox::warning(
|
||||||
|
NULL,
|
||||||
|
"RsyncUI",
|
||||||
|
QString(this->mw->tr("Error: Unable to read password!")) + QString(readPass->error()));
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
this->password = readPass->textData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
29
password.h
Normal file
29
password.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#ifndef PASSWORD_H
|
||||||
|
#define PASSWORD_H
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include <qt5keychain/keychain.h>
|
||||||
|
#include <qt5keychain/qkeychain_export.h>
|
||||||
|
|
||||||
|
class Password : QObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QString appName;
|
||||||
|
QKeychain::WritePasswordJob * passwdJob;
|
||||||
|
QKeychain::ReadPasswordJob * readPass;
|
||||||
|
MainWindow * mw;
|
||||||
|
QString password;
|
||||||
|
|
||||||
|
Password();
|
||||||
|
~Password();
|
||||||
|
|
||||||
|
void store(QString, QString);
|
||||||
|
QString read(QString);
|
||||||
|
bool remove(QString);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void finished(QKeychain::Job*);
|
||||||
|
void readReturn();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // PASSWORD_H
|
@ -71,4 +71,10 @@ bool testRsyncReturn(MainWindow * w, QProcess * myProcess)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString getFileType(QString filename)
|
||||||
|
{
|
||||||
|
QMimeDatabase db;
|
||||||
|
QMimeType mime = db.mimeTypeForFile(filename);
|
||||||
|
QString returnValue = mime.name().section('/',0 ,0);
|
||||||
|
return returnValue;
|
||||||
|
}
|
||||||
|
3
tools.h
3
tools.h
@ -9,6 +9,8 @@
|
|||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
#include <QMimeDatabase>
|
||||||
|
#include <QMimeType>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -19,5 +21,6 @@ FILE * popen2(array<string,8> argv, string type, int & pid);
|
|||||||
int pclose2(FILE * fp, pid_t pid);
|
int pclose2(FILE * fp, pid_t pid);
|
||||||
|
|
||||||
bool testRsyncReturn(MainWindow *, QProcess *);
|
bool testRsyncReturn(MainWindow *, QProcess *);
|
||||||
|
QString getFileType(QString finename);
|
||||||
|
|
||||||
#endif // TOOLS_H
|
#endif // TOOLS_H
|
||||||
|
Reference in New Issue
Block a user