diff --git a/RsyncUI_fr_FR.ts b/RsyncUI_fr_FR.ts
index 20b3414..f070867 100644
--- a/RsyncUI_fr_FR.ts
+++ b/RsyncUI_fr_FR.ts
@@ -74,96 +74,111 @@
Fenêtre principale
-
+ ServerServeurServeur
-
+ Enter server's URLEntrez l'adresse du serveur
-
+ PortPort
-
+ Enter rsync port on serverEntrez le port du serveur rsync
-
+ Press button to connect to rsync serverConnect to serverCliquez pour se connecter au serveur rsync
-
+ ConnectionConnexion
-
+ ReturnRetour
-
+ Click to view the list of files of this folderCliquez pour afficher la liste des documents
-
+ Click to add to download queueCliquez pour ajouter à la file de téléchargement
-
+ Click on file to stop downloadingCliquez sur le document pour arrêter le téléchargement et l'enlever de la file
-
+ %p%DownloadingTéléchargement
-
+ toolBarBarre d'outils
-
+ DownloadTélécharger
-
+ Click on menu button to download the entire folderCliquer 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
+
+
+
+ Change save folderChanger le dossier de destination
-
+ AboutÀ propos
-
+ About QtÀ propos de Qt
-
+ SettingsParamètres
@@ -222,123 +237,133 @@ Cliquez sur un fichier pour l'ajouter dans la file de téléchargementUne liste de téléchargement existe, voulez-vous utiliser cette liste ? si non, elle sera effacée
-
+
+ &Quit
+ &Quitter
+
+
+ Clicking Save button, You can save the list of downloads
Vous pouvez enregistrer la liste des téléchargements en cliquant sur "enregister"
-
+ Exiting will stop downloading, and will clear the download queue.
Do you want to exit ?Si vous sortez, les téléchargements seront arrêter.
Voulez-vous vraiment sortir ?
-
+
+ The program will keep running in the system tray. To terminate the program, choose <b>Quit</b> in the context menu of the system tray entry.
+ Le programme continue dans la boîte à miniatures. Pour quitter le programme cliquez sur l'icône <b>Quitter</b> ou dans les menu contextuel.
+
+
+ server does not existsLe serveur n'existe pas
-
-
+
+ Dirdossier
-
-
+
+ FileDoc
-
+ File is already downloaded. Do you want to reload it ? The old file will be deletedLe document est déjà téléchargé. Voulez-vous le télécharger à nouveau ? L'ancien fichier sera effacé
-
+ File is already downloadingLe document est déjà en téléchargement
-
+ Rsync process crashedLe processus rsync à planté
-
+ VersionVersion
-
+ LicenceLicense
-
+ AuthorAuteur
-
+ EMailCourriel
-
+ Source codeCode source
-
+ Since the save path is linked to service, you need to select a service before you can select a folderVous devez sélectionnez un service pour pouvoir sélectionnez un dossier par défaut
-
+ Choose folder where to save fileChoisissez 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 ?
-
+ The process failed to start. Either the invoked program is missing, or you may have insufficient permissions or resources to invoke the program.Le processus échoué, soit le programme est manquant, soit vous n'avez pas l'autorisation de l'exécuter.
-
+ The process crashed some time after starting successfully.Le processus à planté après avoir démarré avec succès.
-
+ The last waitFor...() function timed out. The state of QProcess is unchanged, and you can try calling waitFor...() again.La fonction waitFor...() a dépassé la limite de temps, you pouvez essayer de la relancer.
-
+ An error occurred when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel.Une erreur est survenue lors de l'envoi des données vers le processus. Le processus est peut être arrté ou il a fermé son canal d'entrée.
-
+ An error occurred when attempting to read from the process. For example, the process may not be running.Une erreur est survenue lors de la lecturee de données, le processus est probablement arrêté.
-
+ An unknown error occurred. This is the default return value of error().Une erreur inconnue est survenue. C'est la valeur de retour par défaut de error().
diff --git a/languages/fr_FR/RsyncUI_fr_FR.qm b/languages/fr_FR/RsyncUI_fr_FR.qm
index 66e5449..334f2d4 100644
Binary files a/languages/fr_FR/RsyncUI_fr_FR.qm and b/languages/fr_FR/RsyncUI_fr_FR.qm differ
diff --git a/mainwindow.cpp b/mainwindow.cpp
index bfde7f3..a7a8fda 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -111,15 +111,59 @@ MainWindow::MainWindow(QWidget *parent)
}
// load list of services
populateList();
+ initSystemTrayIcon();
+}
+
+void MainWindow::initSystemTrayIcon()
+{
+ QMenu *trayIconMenu;
+ QAction * quitAction;
+
+ this->trayIcon = new QSystemTrayIcon;
+ this->trayIcon->setIcon(this->windowIcon());
+
+ quitAction = new QAction(tr("&Quit"), this);
+ connect(quitAction, &QAction::triggered, this, &MainWindow::quitApp);
+
+ trayIconMenu = new QMenu(this);
+ trayIconMenu->addAction(quitAction);
+ trayIcon->setContextMenu(trayIconMenu);
+
+ connect(this->trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(on_trayIcon_clicked(QSystemTrayIcon::ActivationReason)));
+ this->trayIcon->show();
+}
+
+void MainWindow::on_trayIcon_clicked(QSystemTrayIcon::ActivationReason reason)
+{
+ if (reason == QSystemTrayIcon::Trigger)
+ {
+ if (this->isHidden())
+ {
+ this->show();
+ }else
+ {
+ this->hide();
+ }
+ }
+}
+
+void MainWindow::hideWindow()
+{
+ this->hide();
+}
+
+void MainWindow::showWindow()
+{
+ this->show();
}
MainWindow::~MainWindow()
{
delete ui;
+ QCoreApplication::quit();
}
-// Close window has been clicked
-void MainWindow::closeEvent (QCloseEvent *event)
+void MainWindow::quitApp()
{
QMessageBox::StandardButton reply;
QMessageBox::StandardButtons param;
@@ -144,12 +188,7 @@ void MainWindow::closeEvent (QCloseEvent *event)
param,
QMessageBox::No);
- if (reply == QMessageBox::No)
- {
- // continuing
- event->ignore();
- return;
- }else if(reply == QMessageBox::Yes)
+ if(reply == QMessageBox::Yes)
{
// emission of signal to downloading thread and stopping
emit (stopDownloading(this->downloading.process));
@@ -158,7 +197,45 @@ void MainWindow::closeEvent (QCloseEvent *event)
saveDownloadList();
}
}
- event->accept();
+ delete ui;
+ QCoreApplication::quit();
+}
+
+// Close window has been clicked
+void MainWindow::closeEvent (QCloseEvent *event)
+{
+ QMessageBox msgBox;
+ QCheckBox *cb = new QCheckBox("Don't show this again ?");
+ QAbstractButton * reply;
+
+ if (!event->spontaneous() || !isVisible())
+ return;
+ if (trayIcon->isVisible() and this->settings.value("CloseCheckbox").toBool() == false)
+ {
+ msgBox.setWindowTitle("RsyncUI");
+ msgBox.setInformativeText(tr("The program will keep running in the "
+ "system tray. To terminate the program, "
+ "choose Quit in the context menu "
+ "of the system tray entry."));
+
+ msgBox.addButton(QMessageBox::Ok);
+ //msgBox.addButton(QMessageBox::No);
+ // msgBox.setDefaultButton(QMessageBox::Yes);
+ msgBox.setCheckBox(cb);
+ msgBox.exec();
+ reply = msgBox.clickedButton();
+
+ // if response is yes then loading list
+ if (cb->isChecked())
+ {
+ this->settings.setValue("CloseCheckbox", true);
+ }
+ hide();
+
+
+ //event->accept();
+ event->ignore();
+ }
}
// Populate treeview with list of files
@@ -569,7 +646,7 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadD
this->downloading.server = this->connexion.server;
this->downloading.service = this->connexion.service;
startDownloading();
- // wit 1 second to process start
+ // wait 1 second to process start
//sleep(1);
}
@@ -951,3 +1028,8 @@ void MainWindow::on_comboBox_currentIndexChanged(int index)
{
ui->toolBar->setToolButtonStyle((Qt::ToolButtonStyle)index);
}
+
+void MainWindow::on_actionExit_triggered()
+{
+ quitApp();
+}
diff --git a/mainwindow.h b/mainwindow.h
index 9986a8c..6963bc4 100644
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -39,6 +39,8 @@
#include
#include
#include
+#include
+#include
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
@@ -98,6 +100,7 @@ class MainWindow : public QMainWindow
QDialog Configuration;
Ui::Configuration config;
std::vector serversList;
+ QSystemTrayIcon * trayIcon;
QList bwUnitText {
"KB",
"MB",
@@ -139,6 +142,9 @@ class MainWindow : public QMainWindow
void saveDownloadList();
void loadDownloadList();
void download();
+ void initSystemTrayIcon();
+ void hideWindow();
+ void showWindow();
private slots:
@@ -180,7 +186,13 @@ class MainWindow : public QMainWindow
void cancelled(QProcess *);
- signals:
+ void on_trayIcon_clicked(QSystemTrayIcon::ActivationReason reason);
+
+ void quitApp();
+
+ void on_actionExit_triggered();
+
+signals:
void stopDownloading(QProcess *);
void progressSignal(int);
void finishedSignal(bool = true);
diff --git a/mainwindow.ui b/mainwindow.ui
index c97aa3f..e87d43b 100644
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -20,6 +20,9 @@
MainWindow
+
+
+ Qt::ToolButtonTextUnderIcon
@@ -395,6 +398,7 @@
+
@@ -443,6 +447,20 @@
Click on menu button to download the entire folder
+
+
+
+
+
+ Exit
+
+
+ Terminate the program
+
+
+ Ctrl+Q
+
+