-corrected bug in localization

This commit is contained in:
2023-02-12 19:11:06 +01:00
parent 3e0bd57029
commit 65896b087f
5 changed files with 66 additions and 35 deletions
+13 -7
View File
@@ -197,7 +197,7 @@ void MainWindow::quitApp()
saveDownloadList();
}
}
delete ui;
//delete ui;
QCoreApplication::quit();
}
@@ -206,7 +206,6 @@ void MainWindow::closeEvent (QCloseEvent *event)
{
QMessageBox msgBox;
QCheckBox *cb = new QCheckBox("Don't show this again ?");
QAbstractButton * reply;
if (!event->spontaneous() || !isVisible())
return;
@@ -223,7 +222,7 @@ void MainWindow::closeEvent (QCloseEvent *event)
// msgBox.setDefaultButton(QMessageBox::Yes);
msgBox.setCheckBox(cb);
msgBox.exec();
reply = msgBox.clickedButton();
msgBox.clickedButton();
// if response is yes then loading list
if (cb->isChecked())
@@ -372,7 +371,6 @@ void MainWindow::scanDir(QString server, int portN, QTreeWidgetItem *parent, QSt
QString line;
QString size;
QString filename;
QTreeWidgetItem * item;
QProcess * myProcess;
bool isDir = false;
bool flag = false;
@@ -383,7 +381,7 @@ void MainWindow::scanDir(QString server, int portN, QTreeWidgetItem *parent, QSt
myProcess = new QProcess(this);
myProcess->start(cmd, param);
// waiting for response of the server with a timeout of 10 seconds
// waiting for responsiteme of the server with a timeout of 10 seconds
while(myProcess->waitForReadyRead(100000))
{
while (!flag)
@@ -411,11 +409,11 @@ void MainWindow::scanDir(QString server, int portN, QTreeWidgetItem *parent, QSt
if (parent != NULL)
{
//adding item to tree
item = addTreeChild(parent, filename, size, isDir);
addTreeChild(parent, filename, size, isDir);
}else
{
//adding item to tree (as directory)
item = addTreeRoot(filename, size, isDir);
addTreeRoot(filename, size, isDir);
}
}
}
@@ -681,6 +679,7 @@ void MainWindow::startDownloading()
//QtConcurrent::run(&this->downloadO, &downloadFile::download, this);
download();
this->trayIcon->showMessage("RsyncUI", tr("Starting downloading\n") + this->downloading.path, QSystemTrayIcon::Information);
}
// Slot stopping download
@@ -695,6 +694,7 @@ void MainWindow::downloadFinished(int exitCode, QProcess::ExitStatus exitStatus)
QString path;
QString str;
int pos;
QString aborted = tr("finished");
// test if process crashed
if (exitStatus == QProcess::CrashExit)
@@ -712,8 +712,14 @@ void MainWindow::downloadFinished(int exitCode, QProcess::ExitStatus exitStatus)
NULL,
"RsyncUI",
rsyncErrorStrings[exitCode]);
}else if (exitCode == 20)
{
aborted = tr("stopped by user");
}
this->trayIcon->showMessage("RsyncUI", tr("Download ") + aborted + "\n" + this->downloading.path, QSystemTrayIcon::Information);
// disconnecting signals to slots
disconnect(this->downloading.process, 0, 0, 0);