From d1e45b8ba8b5058bd3c3f81ba9d21de27a664c1e Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Mon, 23 Jan 2023 10:04:54 +0100 Subject: [PATCH] debug --- RsyncUI.pro | 6 +- configuration.ui | 17 ++++-- languages/{fr => fr_FR}/RsyncUI_fr_FR.qm | Bin 2901 -> 4286 bytes languages/{fr => fr_FR}/RsyncUI_fr_FR.ts | 71 ++++++++++++++++++----- main.cpp | 10 +--- mainwindow.h | 2 +- mainwindow.ui | 37 +++++++++++- tools.cpp | 17 ++---- tools.h | 2 +- 9 files changed, 116 insertions(+), 46 deletions(-) rename languages/{fr => fr_FR}/RsyncUI_fr_FR.qm (55%) rename languages/{fr => fr_FR}/RsyncUI_fr_FR.ts (67%) diff --git a/RsyncUI.pro b/RsyncUI.pro index 0b5fc16..4d0a7db 100644 --- a/RsyncUI.pro +++ b/RsyncUI.pro @@ -31,7 +31,7 @@ FORMS += \ mainwindow.ui TRANSLATIONS += \ - languages/fr/RsyncUI_fr_FR.ts + languages/fr_FR/RsyncUI_fr_FR.ts INCLUDEPATH += \ /usr/include/KF5 @@ -41,6 +41,6 @@ qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /usr/bin/ !isEmpty(target.path): INSTALLS += target -lang.path = /languages -lang.files = languages/* +lang.path = /languages/fr_FR/ +lang.files = languages/fr_FR/* INSTALLS += lang diff --git a/configuration.ui b/configuration.ui index a91fcbe..fd5de72 100644 --- a/configuration.ui +++ b/configuration.ui @@ -10,7 +10,7 @@ 0 0 400 - 300 + 127 @@ -22,12 +22,18 @@ 9 9 381 - 251 + 61 + + Enter the bandwidth limit + + + 5000 + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -52,7 +58,10 @@ - + Select th unit of bandwidth limit in Bytes, KiloBytes, MegaBytes, GigaBytes or PetaBytes + + + 5000 -1 @@ -71,7 +80,7 @@ 70 - 260 + 80 321 34 diff --git a/languages/fr/RsyncUI_fr_FR.qm b/languages/fr_FR/RsyncUI_fr_FR.qm similarity index 55% rename from languages/fr/RsyncUI_fr_FR.qm rename to languages/fr_FR/RsyncUI_fr_FR.qm index 68138d65e5c53bde2fa0f82317b35c3aa8399b7e..bb5f1ac4bc851c3eb5e6e8d978df187839ceff96 100644 GIT binary patch delta 1321 zcmaJ=U1%It7(KH)v&}Zi2C6i);^szL_91Dp23q_@T57~viN->OQaihIH@S5>lg^#p zxV|jvn-u>>@?tF!5sGMq1`%wj(5CpHrBA+Sp}rO)t)imX2G5<@F6crZX3jU~e)oLe z`R<+X*Pk1GyWD;puulX12Z_HCUk99Z#4E&|z(9-m8c0>KULtVA;n$ zuQK6=eQs?DC|t15UwVP*~6KL4rn^1wH2?jz^e**Af~cb((M&l4{=Us`O)dA0Du zw|BA7jlzn%3cy`+_V5Z&TkB0Xq3>@RzUYyihJx%f#YH>H4#qD2NR6qeHqp0<8H?0YlTt zChOGj6WEOaF(OF30s$Ycc_(Am)?uveGn)&1HtY^!8HspSifZCnn}7Y}AwOkxdtHsneJ^hsYS{P0)+xI5d zt>Q>ID?nk_^Njv&X>qh68`7w^_uo;yjyk>9Fx%1ZTn2KQr>GY)Ps^6EKdY!D&$@}?xmL9SXiZ%GwX;V$cnfZuJi&v@E zExj?jq>*j~H8B@PEE)(cqh_+0Uq8LQr%Htb_0pTKQ}zE>lICE$>gzIfqbH+^7Wg`{|{4kjX_dmwca?I>CR+);V)}q>oV>;r=*1{l2e}hn@ NZk?{prFV+U*1t9dJeL3f delta 303 zcmdm|cvWnITs;E=1Is1`2DbA+`V)};!oa{P#K6Gr3#6TZ^eZ6U#K6E=&cL9f3RJv` zfn~u`1_s7=46HVxK>7U)tQjj97&!PDSj(mWX*&kig{(mJ91Lu441n|;2KQ-4fcjoA zc$xnJnq|fG^T<)4K1t@=#pw(T_3T9~J?oQz2FA1O0IIbT%GH`?4A<0mYf5 zS$p>M0S(S%oipbUke`iT{8GCvxg?0v*O_&S|*oD^PtOXHFu}6O1z4 z|GMr2EzIND%~%Z7cb4ycpbAhu1B7Orz+WsU&%nXJBAv;=z@;_0l_h9$1C#LNlZ>95 Y7c*xtZPw<9VcML^{hMj?FTNv;0B}x5)Bpeg diff --git a/languages/fr/RsyncUI_fr_FR.ts b/languages/fr_FR/RsyncUI_fr_FR.ts similarity index 67% rename from languages/fr/RsyncUI_fr_FR.ts rename to languages/fr_FR/RsyncUI_fr_FR.ts index 4b41b76..0e669d4 100644 --- a/languages/fr/RsyncUI_fr_FR.ts +++ b/languages/fr_FR/RsyncUI_fr_FR.ts @@ -9,11 +9,23 @@ Configuration - + + Enter the bandwidth limit + Entrez la limite de bande passante + + + + Bandwidth limit Bandwidth limit Limite de bande passante + + + Select th unit of bandwidth limit in Bytes, KiloBytes, MegaBytes, GigaBytes or PetaBytes + Unit of bandwidth + Sélectionnez l'unité de limite de bande passante en otctets, Ko, Mo, Go, Po + MainWindow @@ -29,40 +41,71 @@ Serveur - + + Enter server's URL + Entrez l'adresse du serveur + + + Port Port - + + Enter rsync port on server + Entrez le port du servuer rsync + + + + Press button to connect to rsync server + Connect to server + Cliquez pour se connecter au serveur rsync + + + Connection Connexion - + Return Retour - + + Click to view the list of files of this folder + Cliquez pour afficher la liste des documents + + + + Click to add to download queue + Cliquez pour ajouter à la file de téléchargement + + + + Click on file to stop downloading + Cliquez sur le document pour arrêter le téléchargement et l'enleveer de la file + + + %p% Downloading Téléchargement - - + + Menu Menu - + help Aide - - + + Change save folder Changer le dossier de destination @@ -71,22 +114,22 @@ Dossier d'enregistrement - + Bandwidth limit Limite de bande passante - + About À propos - + About Qt À propos de Qt - + Settings Paramètres diff --git a/main.cpp b/main.cpp index d149ea1..2d03fcd 100644 --- a/main.cpp +++ b/main.cpp @@ -1,11 +1,6 @@ #include "mainwindow.h" -#include -#include -#include -#include -#include + #include -#include int main(int argc, char *argv[]) @@ -14,14 +9,13 @@ int main(int argc, char *argv[]) QTranslator myappTranslator; QLocale localeName = QLocale::system(); - QString localeFile = "usr/share/locale/" + localeName.name() + "LC_MESSAGES/RsyncUI_" + localeName.name() + ".qm"; + QString localeFile = "/usr/share/locale/" + localeName.name() + "/LC_MESSAGES/RsyncUI_" + localeName.name() + ".qm"; if (myappTranslator.load(localeFile)) { a.installTranslator(&myappTranslator); } MainWindow w; - w.show(); return a.exec(); } diff --git a/mainwindow.h b/mainwindow.h index d729934..fa2ed58 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -62,7 +62,7 @@ class About QString title = "RsyncUI"; QString author = "Daniel TARTAVEL-JEANNOT"; QString licence = "GPL_V3"; - QString description = "Client for rsync server"; + QString description = "Client for rsync server\n\nYou click on file to enqueue it, and RyncUI Download one file a time"; QString email = "dtux@free.fr"; QString git = "https://git.labolyon.fr/dtux/RsyncUI/issues"; }; diff --git a/mainwindow.ui b/mainwindow.ui index ecab1a4..2a6d695 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -98,6 +98,12 @@ 0 + + Enter server's URL + + + 5000 + @@ -133,6 +139,12 @@ 16777215 + + Enter rsync port on server + + + 5000 + Qt::ImhPreferNumbers @@ -162,7 +174,10 @@ - + Press button to connect to rsync server + + + 5000 Connection @@ -190,6 +205,12 @@ 0 + + Click to view the list of files of this folder + + + 5000 + QAbstractItemView::SelectedClicked @@ -211,7 +232,16 @@ - Qt::CustomContextMenu + Qt::NoContextMenu + + + Click to add to download queue + + + 5000 + + + QAbstractItemView::NoEditTriggers @@ -273,6 +303,9 @@ + + Click on file to stop downloading + true diff --git a/tools.cpp b/tools.cpp index 9577d8f..13eb514 100644 --- a/tools.cpp +++ b/tools.cpp @@ -1,11 +1,4 @@ #include "mainwindow.h" -#include -#include -#include -#include -#include -#include -#include using namespace std; @@ -44,11 +37,12 @@ const vector explode(const string& s, const char& c, int n = 0) return v; } -FILE * popen2(array argv, string type, int & pid) +FILE * popen2(char * const argv, string type, int & pid) { pid_t child_pid; int fd[2]; QString message; + string command; if (pipe(fd) == -1) { @@ -80,7 +74,8 @@ FILE * popen2(array argv, string type, int & pid) } setpgid(child_pid, child_pid); //Needed so negative PIDs can kill children of /bin/sh - if (execl(argv[0].c_str(), argv[0].c_str(), argv[1].c_str(), argv[2].c_str(), argv[3].c_str(), argv[4].c_str(), argv[5].c_str(), NULL ) == -1) + //if (execlp(argv[0].c_str(), argv[0].c_str(), argv[1].c_str(), argv[2].c_str(), argv[3].c_str(), argv[4].c_str(), argv[5].c_str(), NULL ) == -1) + if (execvp(command.c_str(), &argv)) { perror("execl error => "); } @@ -98,14 +93,11 @@ FILE * popen2(array argv, string type, int & pid) } } - pid = child_pid; - if (type == "r") { return fdopen(fd[READ], "r"); } - return fdopen(fd[WRITE], "w"); } return 0; @@ -124,7 +116,6 @@ int pclose2(FILE * fp, pid_t pid) break; } } - return stat; } diff --git a/tools.h b/tools.h index 01593d8..f91ea53 100644 --- a/tools.h +++ b/tools.h @@ -9,7 +9,7 @@ using namespace std; const vector explode(const string& s, const char& c, int n); -FILE * popen2(array argv, string type, int & pid); +FILE * popen2(char * const argv, string type, int & pid); int pclose2(FILE * fp, pid_t pid);