diff --git a/src/english.qm b/src/english.qm
new file mode 100644
index 0000000..cd74b29
Binary files /dev/null and b/src/english.qm differ
diff --git a/src/english.ts b/src/english.ts
new file mode 100644
index 0000000..dbdc5d0
--- /dev/null
+++ b/src/english.ts
@@ -0,0 +1,236 @@
+
+
+
+
+ About
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MainWindow
+
+
+ Start
+
+
+
+ Stop
+
+
+
+ Parameter List
+
+
+
+ Settings
+
+
+
+ About
+
+
+
+ Working in background.
+
+
+
+ Started.
+
+
+
+ [-] Stopped
+
+
+
+ [+] Started
+[+] PID:
+
+
+
+
+
+
+
+
+
+
+
+ all_dnsredir (Recommended)
+
+
+
+ Settings
+
+
+ Parameter Settings
+
+
+
+ Use Quick Parameters
+
+
+
+ Use Custom Parameters
+
+
+
+ Parameters
+
+
+
+ Parameter 1
+
+
+
+ Parameter 2
+
+
+
+ Quick Settings
+
+
+
+ Default Settings
+
+
+
+ Enable Quick Settings
+
+
+
+ Software Settings
+
+
+
+ Schedule Autostart (Will be implemented in next update)
+
+
+
+ Minimize to Tray
+
+
+
+ Add Startup
+
+
+
+ Schedule Times
+
+
+
+ Disable Notifications
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main.cpp b/src/main.cpp
index 1ba1d4e..07d59cb 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2,10 +2,23 @@
#include
#include
#include
+#include
+#include
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
+
+ QString systemLang = QLocale::languageToString(QLocale::system().language());
+
+ QTranslator t;
+
+ if(systemLang != "Turkish")
+ {
+ t.load(":/english.qm");
+ a.installTranslator(&t);
+ }
+
MainWindow w(a.arguments());
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 4302281..e014648 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -87,7 +87,7 @@ MainWindow::MainWindow(QStringList arguments, QWidget *parent) :
ui->comboParametre->addItem("russia_blacklist", QVariant("-1 --blacklist blacklist.txt"));
ui->comboParametre->addItem("russia_blacklist_dnsredir", QVariant("-1 --dns-addr 1.1.1.1 --dns-port 1253 --dnsv6-addr 2a02:6b8::feed:0ff --dnsv6-port 1253 --blacklist blacklist.txt"));
ui->comboParametre->addItem("all", QVariant("-1"));
- ui->comboParametre->addItem("all_dnsredir (Tavsiye Edilen)", QVariant("-1 --dns-addr 1.1.1.1 --dns-port 1253 --dnsv6-addr 2a02:6b8::feed:0ff --dnsv6-port 1253"));
+ ui->comboParametre->addItem(tr("all_dnsredir (Tavsiye Edilen)"), QVariant("-1 --dns-addr 1.1.1.1 --dns-port 1253 --dnsv6-addr 2a02:6b8::feed:0ff --dnsv6-port 1253"));
ui->comboParametre->addItem("all_dnsredir_hardcore", QVariant("-1 -a -m --dns-addr 1.1.1.1 --dns-port 1253 --dnsv6-addr 2a02:6b8::feed:0ff --dnsv6-port 1253"));
ui->comboParametre->setCurrentIndex(3);
@@ -113,6 +113,8 @@ MainWindow::MainWindow(QStringList arguments, QWidget *parent) :
hideAction->setEnabled(false);
showAction->setEnabled(true);
}
+
+ connect(proc, &QProcess::errorOccurred, this, &MainWindow::catchError);
}
MainWindow::~MainWindow()
@@ -135,7 +137,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
{
qDebug() << "Message will shown";
QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::MessageIcon(QSystemTrayIcon::Information);
- trayIcon->showMessage("GoodByeDPI GUI", "Arka planda çalışıyor.", icon, 4000);
+ trayIcon->showMessage("GoodByeDPI GUI", tr("Arka planda çalışıyor."), icon, 1000);
}
}
else
@@ -148,8 +150,16 @@ void MainWindow::procStart()
{
proc->setArguments(prepareParameters(ui->comboParametre->isEnabled()));
//ui->debugArea->appendPlainText("[*] " + ui->comboParametre->currentText());
- proc->start(QDir::currentPath() + "/goodbyedpi/goodbyedpi.exe", QProcess::ReadWrite);
+ //ui->debugArea->appendPlainText("Exe Path: " + QDir::currentPath() + "/goodbyedpi/goodbyedpi.exe");
+ proc->start(QDir::currentPath() + "/goodbyedpi/goodbyedpi.exe", QProcess::ReadOnly);
proc->waitForStarted(1000);
+
+ if(!settings->value("System/disableNotifications").toBool() && !this->isVisible())
+ {
+ qDebug() << "Message will shown";
+ QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::MessageIcon(QSystemTrayIcon::Information);
+ trayIcon->showMessage("GoodByeDPI GUI", tr("Başlatıldı."), icon, 1000);
+ }
}
void MainWindow::procStop()
@@ -182,7 +192,7 @@ void MainWindow::handleState()
{
if(proc->state() == QProcess::NotRunning)
{
- ui->debugArea->appendPlainText("[-] Durduruldu");
+ ui->debugArea->appendPlainText(tr("[-] Durduruldu"));
ui->btnStart->setEnabled(true);
ui->btnStop->setEnabled(false);
trayMenu->actions().at(1)->setEnabled(false);
@@ -190,7 +200,7 @@ void MainWindow::handleState()
}
else if(proc->state() == QProcess::Running)
{
- ui->debugArea->appendPlainText("[+] Başlatıldı\n[+] PID:" + QString::number(proc->processId()) + "\n");
+ ui->debugArea->appendPlainText(tr("[+] Başlatıldı\n[+] PID:") + QString::number(proc->processId()) + "\n");
ui->btnStart->setEnabled(false);
ui->btnStop->setEnabled(true);
trayMenu->actions().at(0)->setEnabled(false);
@@ -330,3 +340,8 @@ QStringList MainWindow::prepareParameters(bool isComboParametreEnabled)
}
}
+
+void MainWindow::catchError(QProcess::ProcessError err)
+{
+ ui->debugArea->appendPlainText(proc->errorString());
+}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 0d1eb83..2f8bf3f 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -40,6 +40,8 @@ public slots:
QStringList prepareParameters(bool isComboParametreEnabled);
+ void catchError(QProcess::ProcessError err);
+
private:
Ui::MainWindow *ui;
diff --git a/src/res.qrc b/src/res.qrc
index 4210e76..0b8b6e9 100644
--- a/src/res.qrc
+++ b/src/res.qrc
@@ -1,5 +1,7 @@
-
+
+ english.qm
+
images/info-button.png
images/play-button.png