From 187fa0080a3eb7669eb55f1f908cc62fd5d78bc1 Mon Sep 17 00:00:00 2001 From: driftingsun Date: Wed, 30 Dec 2020 17:03:05 +0300 Subject: [PATCH] General improvements and bug fixes --- client/client.pro | 4 +- client/main.cpp | 4 +- client/settings.cpp | 64 +++ client/settings.h | 36 ++ client/translations/amneziavpn_ru.qm | Bin 1188 -> 4190 bytes client/translations/amneziavpn_ru.ts | 627 +++++++++++++++++++++++---- client/ui/mainwindow.cpp | 86 +++- client/ui/mainwindow.h | 23 +- client/ui/mainwindow.ui | 60 +-- service/server/localserver.cpp | 2 +- 10 files changed, 762 insertions(+), 144 deletions(-) create mode 100644 client/settings.cpp create mode 100644 client/settings.h diff --git a/client/client.pro b/client/client.pro index 803107e7..93b43650 100644 --- a/client/client.pro +++ b/client/client.pro @@ -2,7 +2,7 @@ QT += widgets core gui network xml TARGET = AmneziaVPN TEMPLATE = app -#CONFIG += console +CONFIG += console DEFINES += QT_DEPRECATED_WARNINGS @@ -21,6 +21,7 @@ HEADERS += \ message.h \ openvpnprotocol.h \ runguard.h \ + settings.h \ ui/Controls/SlidingStackedWidget.h \ ui/mainwindow.h \ utils.h \ @@ -39,6 +40,7 @@ SOURCES += \ message.cpp \ openvpnprotocol.cpp \ runguard.cpp \ + settings.cpp \ ui/Controls/SlidingStackedWidget.cpp \ ui/mainwindow.cpp \ utils.cpp \ diff --git a/client/main.cpp b/client/main.cpp index 319124b4..ee6bb3f7 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -26,9 +26,9 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); loadTranslator(); - if (! RunGuard::instance().tryToRun()) { + if (!RunGuard::instance().tryToRun()) { qDebug() << "Tried to run second instance. Exiting..."; - QMessageBox::information(NULL, QObject::tr("Notify"), QObject::tr("AmneziaVPN is already running.")); + QMessageBox::information(NULL, QObject::tr("Notification"), QObject::tr("AmneziaVPN is already running.")); return 0; } diff --git a/client/settings.cpp b/client/settings.cpp new file mode 100644 index 00000000..299ac878 --- /dev/null +++ b/client/settings.cpp @@ -0,0 +1,64 @@ +#include + +#include "defines.h" +#include "settings.h" + +Settings::Settings(QObject* parent) : QObject(parent) +{ + m_settings = new QSettings(ORGANIZATION_NAME, APPLICATION_NAME, this); + read(); +} + +void Settings::read() +{ + m_settings->beginGroup("Server"); + m_login = m_settings->value("login", QString()).toString(); + m_password = m_settings->value("password", QString()).toString(); + m_serverName = m_settings->value("serverName", QString()).toString(); + m_settings->endGroup(); +} + + +void Settings::save() +{ + m_settings->beginGroup("Server"); + m_settings->setValue("login", m_login); + m_settings->setValue("password", m_password); + m_settings->setValue("serverName", m_serverName); + m_settings->endGroup(); +} + +bool Settings::haveAuthData() const +{ + return (!serverName().isEmpty() && !login().isEmpty() && !password().isEmpty()); +} + +void Settings::setLogin(const QString& login) +{ + m_login = login; +} + +void Settings::setPassword(const QString& password) +{ + m_password = password; +} + +void Settings::setServerName(const QString& serverName) +{ + m_serverName = serverName; +} + +QString Settings::login() const +{ + return m_login; +} + +QString Settings::password() const +{ + return m_password; +} + +QString Settings::serverName() const +{ + return m_serverName; +} diff --git a/client/settings.h b/client/settings.h new file mode 100644 index 00000000..9e74f97c --- /dev/null +++ b/client/settings.h @@ -0,0 +1,36 @@ +#ifndef SETTINGS_H +#define SETTINGS_H + +#include +#include + +class QSettings; + +class Settings : public QObject +{ + Q_OBJECT + +public: + explicit Settings(QObject* parent = nullptr); + + void read(); + void save(); + + void setLogin(const QString& login); + void setPassword(const QString& password); + void setServerName(const QString& serverName); + + QString login() const; + QString password() const; + QString serverName() const; + + bool haveAuthData() const; + +protected: + QSettings* m_settings; + QString m_login; + QString m_password; + QString m_serverName; +}; + +#endif // SETTINGS_H diff --git a/client/translations/amneziavpn_ru.qm b/client/translations/amneziavpn_ru.qm index 66b197e107013233a1a066dd969b58965a621a58..1da6f4204ac41b098b4f70013ecf528e45975df0 100644 GIT binary patch literal 4190 zcma)9TWlOx89sK8V|(o+q_!f{rr~%?n?|ws7CTF8=IO-5sY`v?o64T znaqs6aS)F|JoTXxs1FFKQUwwfswyf}At(|&pr95WfJY?MA|V7SJRpIPO8EXWv*Wch zsqkv%%(?uR^Z(y}arte1h7O^ z%UJ(+djInH2aKhD(D&LsobUTd-}gWG6JrB!_m4G(F#ffFr}++J-M{I7_x?+aoxYc1 zAO0HWKbw+kIM;JG)p+gq*ncTyyovo&UrfFJ2I%_#HE49%)O!apwI5ve{2@PZ`fq) zYzdUCn_cO{z)s=mx&m63+R#jU*R*w~)kPbMa!t%+RL4?MFLWb{B!S5jqKtdtF@>6LO*2AZ(7 zrkqXR!Wkoww}Z5(Id&lJU^bmki)^Lr2Zxpv!J&&&bRb*veK2yzgk_4aik4vpa@=>d znk)&|ljAK{zn8QmA^)4X}OS+NBp>&>UYk z_v?mM*XsVh(YPgFY#95#^o)k3nYz)?u&7xLO>e+rU)CqPkF6nS37Y*L-WK7A<_7WpL3UQ_QmKCjfHpqS2jdD( zUR744u%E{oy>l!RyW_0|`_Qo^LdFr6)9{69iN0J~%vvrXbjwf8r z_gjvqBh)+!bz9Z~)3HexbsWe%ke={m5SVtu&m=&HE%7ICxdO~K1=m;LZnywu0Gwcw zdA=4ohKxIhl`8fKOraBUpeeG^*eoMe&9ZS=n?)Yh?xM>&^rqH z@W^J&t{3TqE|o-m^I_Cbu7sx=A@>Mjvvf5mtgg`ESIk4i#&R!5a>-NVJk5e%kn%$J z=z_c!8aGL^&nIX`k))7?u>(^_F%rc?QdFsEJfY#mwuYUKj&KF-lGGYLp%#TyCBAZh z#8B!zr!s|nCZEq|ib*$orsIak%@^KPRYvkl zEbCE{6`F|PYl>5UU# zu6xo?6z~jilT+#E{|)3bD^9Cj5FQe^I{-LAk(^AKjaq{;utdfnu+Jga0T9rd5Jsz1 z`^k}$d{x1ry&g3c$4qy5-Sm;L>nhPTaZ}+s?!Kj=ym*db?!lH}4JKF`H`&uxb_ z`r~1hR-xJ1t5Cm_%<*i*v0e3(Y*IYNubrz1UwLI8>UWOvRfn8d@AKO-5c_V}XE-gi z&gvdX!ZK0qn1rF@5+9lPWS&M^j75B6+t57OMg{tsB<3Zy!we>wk4NBbB3aQ)uok{8 z`~=dLi!~cx2UycEs{S+<^u&%K;aZh7!mdrVF9gGfL}Z!mDyg25O6gIs2EGG~HOy@M zB)$U3qnThjr^yOHt*fk_B2;?_l%%kiqbPfN@z5n%>lP-K6)}#zg{TEtu1zl>n z7g$pXy`!!eHsD81Pzd#ElnyE#HT&X1)0THkjanLXuI*08+qZ2h9dF`X38=YKs5> delta 226 zcmcbou!M7hNPPwa1A{gYGcd3$t7Kqc%wzR_a0SS_#~QZ&CIbWW4c4+>n;96GRn7oB6a&jJb z=;Wik0h62fVkckVuh9nS7GqInF=8=gF=4S|v0MainWindow - Подключиться к уже - созданному серверу VPN - + Connect to the already created VPN server + Подключиться к уже созданному серверу VPN - - Код для подключения - + + Connection code + Код для подключения - - - Подключение... - + + + Connecting... + Подключение... - - - Подключиться - + + + Connect + Подключиться - - Настроить собственный сервер - + + Set up your own server + Настроить собственный сервер - - Подключите ваш сервер, - чтобы использовать VPN - + + Connect your server to use VPN + Подключите ваш сервер, чтобы использовать VPN - - IP-адрес сервера - + + Server IP address + IP адрес сервера - - Логин для подключения по SSH - + + Login to connect via SSH + Логин для подключения по SSH - - Пароль - + + Password + Пароль - - 51.83.180.158 - + + Where to get connection data → + Where to get connection data → - - root - - - - - qazqazwsxwsx - - - - - Где взять данные для подключения → - - - - - + + 0 Mbps - + 0 Мбит/сек - + Add site Добавить сайт - + Connected Подключено - + How to use VPN Как использовать VPN - + For all connections Для всех соединений - + For selected sites Для выбранных сайтов - - List of most popular prohibited sites - + + List of the most popular prohibited sites + Список самых популярных запрещенных сайтов - - Эти сайты будут открываться через VPN - + + For example, rutor.org or 17.21.111.8 + Например, rutor.org или 17.21.111.8 - - Например, rutor.org или 17.21.111.8 - + + Anyone who logs in with this code will have the same rights to use the VPN as you. To create a new code, change your login and / or password for connection in your server settings. + Тот, кто зайдёт с этим кодом, будет иметь те же права на использование VPN, что и вы. Чтобы создать новый код смените логин и/или пароль для подлючения в настройках вашего сервера. - + + These sites will open via VPN + These sites will open via VPN + + + + Delete selected item + Удалить выбранный элемент + + + + Hostname or IP address + Имя хоста или IP адрес + + + + + - - Удалить выбранный - - - - - Адрес сайта или ip-адрес - - - - + Server settings Настройки сервера - + Share connection Поделиться подключением - + Connection string Строка подключения - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Consolas'; font-size:22px; font-weight:600; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:20pt;">vpn:\\aosdiufhafafsuhgqejghuserhglaidhgauhgalgadg</span></p></body></html> - + - + Copy Копировать - - Тот, кто зайдёт с этим кодом, будет иметь те же права на испольтование VPN, что и вы. Чтобы создать новый код смените логин и/или пароль для подлючения в настройках вашего сервера. - - - - + Cannot open logs folder! Невозможно открыть папку с логами! + + + Please fill in all fields + Пожалуйста, заполните все поля + QObject - Notify - Уведомление + AmneziaVPN is already running. + Приложение AmneziaVPN уже запущено. - AmneziaVPN is already running. - Приложение AmneziaVPN уже запущено. + Notification + + + + + QSsh::Internal::SftpChannelPrivate + + + Server could not start SFTP subsystem. + + + + + The SFTP server finished unexpectedly with exit code %1. + + + + + The SFTP server crashed: %1. + + + + + Unexpected packet of type %1. + + + + + Protocol version mismatch: Expected %1, got %2 + + + + + Unknown error. + + + + + Created remote directory "%1". + + + + + Remote directory "%1" already exists. + + + + + Error creating directory "%1": %2 + + + + + Could not open local file "%1": %2 + + + + + Remote directory could not be opened for reading. + + + + + Failed to list remote directory contents. + + + + + Failed to close remote directory. + + + + + Failed to open remote file for reading. + + + + + Failed to retrieve information on the remote file ('stat' failed). + + + + + Failed to read remote file. + + + + + + Failed to close remote file. + + + + + Failed to open remote file for writing. + + + + + Failed to write remote file. + + + + + Cannot append to remote file: Server does not support the file size attribute. + + + + + SFTP channel closed unexpectedly. + + + + + Server could not start session: %1 + + + + + Error reading local file: %1 + + + + + QSsh::Internal::SshChannelManager + + + Unexpected request success packet. + + + + + Unexpected request failure packet. + + + + + Invalid channel id %1 + + + + + QSsh::Internal::SshConnectionPrivate + + + SSH Protocol error: %1 + + + + + Botan library exception: %1 + + + + + Server identification string is %n characters long, but the maximum allowed length is 255. + + + + + + + + + Server identification string contains illegal NUL character. + + + + + Server Identification string "%1" is invalid. + + + + + Server protocol version is "%1", but needs to be 2.0 or 1.99. + + + + + Server identification string is invalid (missing carriage return). + + + + + Server reports protocol version 1.99, but sends data before the identification string, which is not allowed. + + + + + + + + Unexpected packet of type %1. + + + + + Password expired. + + + + + Server rejected key. + + + + + Server rejected password. + + + + + The server sent an unexpected SSH packet of type SSH_MSG_UNIMPLEMENTED. + + + + + Server closed connection: %1 + + + + + Connection closed unexpectedly. + + + + + Timeout waiting for reply from server. + + + + + No private key file given. + + + + + Private key file error: %1 + + + + + QSsh::Internal::SshRemoteProcessPrivate + + + Process killed by signal + + + + + Server sent invalid signal "%1" + + + + + QSsh::SftpFileSystemModel + + + File Type + + + + + File Name + + + + + Error getting "stat" info about "%1": %2 + + + + + Error listing contents of directory "%1": %2 + + + + + QSsh::Ssh + + + Failed to open key file "%1" for reading: %2 + + + + + Failed to open key file "%1" for writing: %2 + + + + + Password Required + + + + + Please enter the password for your private key. + + + + + QSsh::SshKeyCreationDialog + + + SSH Key Configuration + + + + + Options + + + + + Key algorithm: + + + + + &RSA + + + + + &DSA + + + + + ECDSA + + + + + Key &size: + + + + + Private key file: + + + + + + Browse... + + + + + Public key file: + + + + + &Generate And Save Key Pair + + + + + &Cancel + + + + + Choose... + + + + + Key Generation Failed + + + + + Choose Private Key File Name + + + + + Cannot Save Key File + + + + + Failed to create directory: "%1". + + + + + Cannot Save Private Key File + + + + + The private key file could not be saved: %1 + + + + + Cannot Save Public Key File + + + + + The public key file could not be saved: %1 + + + + + File Exists + + + + + There already is a file of that name. Do you want to overwrite it? + + + + + SshConnection + + + Server and client capabilities don't match. Client list was: %1. +Server list was %2. + + + + + SshKeyGenerator + + + Error generating key: %1 + + + + + Password for Private Key + + + + + It is recommended that you secure your private key +with a password, which you can enter below. + + + + + Encrypt Key File + + + + + Do Not Encrypt Key File + VpnConnection - + Mbps diff --git a/client/ui/mainwindow.cpp b/client/ui/mainwindow.cpp index bebdc0bf..5c657722 100644 --- a/client/ui/mainwindow.cpp +++ b/client/ui/mainwindow.cpp @@ -4,25 +4,32 @@ #include #include "communicator.h" +#include "core/openvpnconfigurator.h" +#include "core/servercontroller.h" #include "debug.h" #include "defines.h" #include "mainwindow.h" +#include "settings.h" #include "ui_mainwindow.h" #include "utils.h" #include "vpnconnection.h" -#include - MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), + m_settings(new Settings), m_vpnConnection(nullptr) { ui->setupUi(this); // Post initialization ui->widget_tittlebar->hide(); - ui->stackedWidget_main->setCurrentIndex(2); + + if (m_settings->haveAuthData()) { + goToPage(Page::Vpn); + } else { + goToPage(Page::Initialization); + } connect(ui->pushButton_blocked_list, SIGNAL(clicked(bool)), this, SLOT(onPushButtonBlockedListClicked(bool))); connect(ui->pushButton_connect, SIGNAL(toggled(bool)), this, SLOT(onPushButtonConnectToggled(bool))); @@ -30,6 +37,9 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->pushButton_back_from_sites, SIGNAL(clicked(bool)), this, SLOT(onPushButtonBackFromSitesClicked(bool))); connect(ui->pushButton_back_from_settings, SIGNAL(clicked(bool)), this, SLOT(onPushButtonBackFromSettingsClicked(bool))); + connect(ui->pushButton_new_server_setup, SIGNAL(clicked(bool)), this, SLOT(onPushButtonNewServerSetup(bool))); + connect(ui->pushButton_back_from_new_server, SIGNAL(clicked(bool)), this, SLOT(onPushButtonBackFromNewServerClicked(bool))); + connect(ui->pushButton_new_server_connect_with_new_data, SIGNAL(clicked(bool)), this, SLOT(onPushButtonNewServerConnectWithNewData(bool))); setFixedSize(width(),height()); @@ -66,9 +76,9 @@ MainWindow::~MainWindow() qDebug() << "Application closed"; } -void MainWindow::goToIndex(int index) +void MainWindow::goToPage(Page page) { - ui->stackedWidget_main->setCurrentIndex(index); + ui->stackedWidget_main->setCurrentIndex(static_cast(page)); } void MainWindow::keyPressEvent(QKeyEvent *event) @@ -84,30 +94,60 @@ void MainWindow::keyPressEvent(QKeyEvent *event) } } +void MainWindow::onPushButtonNewServerConnectWithNewData(bool clicked) +{ + if (ui->lineEdit_new_server_ip->text().isEmpty() || + ui->lineEdit_new_server_login->text().isEmpty() || + ui->lineEdit_new_server_password->text().isEmpty() ) { + QMessageBox::warning(this, APPLICATION_NAME, tr("Please fill in all fields")); + return; + } else { + qDebug() << "Start connection with new data"; + m_settings->setServerName(ui->lineEdit_new_server_ip->text()); + m_settings->setLogin(ui->lineEdit_new_server_login->text()); + m_settings->setPassword(ui->lineEdit_new_server_password->text()); + m_settings->save(); + + if (requestOvpnConfig(m_settings->serverName(), m_settings->login(), m_settings->password())) { + goToPage(Page::Vpn); + } + } +} + void MainWindow::onBytesChanged(quint64 receivedData, quint64 sentData) { ui->label_speed_received->setText(VpnConnection::bytesToText(receivedData)); ui->label_speed_sent->setText(VpnConnection::bytesToText(sentData)); } +void MainWindow::onPushButtonBackFromNewServerClicked(bool) +{ + goToPage(Page::Initialization); +} + +void MainWindow::onPushButtonNewServerSetup(bool) +{ + goToPage(Page::NewServer); +} + void MainWindow::onPushButtonBackFromSettingsClicked(bool) { - goToIndex(2); + goToPage(Page::Vpn); } void MainWindow::onPushButtonBackFromSitesClicked(bool) { - goToIndex(2); + goToPage(Page::Vpn); } void MainWindow::onPushButtonBlockedListClicked(bool) { - goToIndex(3); + goToPage(Page::Sites); } void MainWindow::onPushButtonSettingsClicked(bool) { - goToIndex(4); + goToPage(Page::SomeSettings); } void MainWindow::onConnectionStateChanged(VpnProtocol::ConnectionState state) @@ -162,4 +202,32 @@ void MainWindow::onPushButtonConnectToggled(bool checked) } } +bool MainWindow::requestOvpnConfig(const QString& hostName, const QString& userName, const QString& password, int port, int timeout) +{ + QSsh::SshConnectionParameters sshParams; + sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationTypePassword; + sshParams.host = hostName; + sshParams.userName = userName; + sshParams.password = password; + sshParams.timeout = timeout; + sshParams.port = port; + sshParams.hostKeyCheckingMode = QSsh::SshHostKeyCheckingMode::SshHostKeyCheckingNone; + if (!ServerController::setupServer(sshParams, ServerController::OpenVPN)) { + return false; + } + + QString configData = OpenVpnConfigurator::genOpenVpnConfig(sshParams); + if (configData.isEmpty()) { + return false; + } + + QFile file(Utils::defaultVpnConfigFileName()); + if (file.open(QIODevice::WriteOnly | QIODevice::Truncate)){ + QTextStream stream(&file); + stream << configData << endl; + return true; + } + + return false; +} diff --git a/client/ui/mainwindow.h b/client/ui/mainwindow.h index 369b6ff9..27560dd0 100644 --- a/client/ui/mainwindow.h +++ b/client/ui/mainwindow.h @@ -5,6 +5,7 @@ #include "vpnprotocol.h" +class Settings; class VpnConnection; namespace Ui { @@ -22,28 +23,30 @@ public: explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); -public slots: - + enum class Page {Initialization = 0, NewServer = 1, Vpn = 2, Sites = 3, SomeSettings = 4, Share = 5}; private slots: - void onPushButtonBlockedListClicked(bool clicked); - void onPushButtonConnectToggled(bool checked); - void onPushButtonSettingsClicked(bool clicked); - - void onPushButtonBackFromSettingsClicked(bool clicked); - void onPushButtonBackFromSitesClicked(bool clicked); - void onBytesChanged(quint64 receivedBytes, quint64 sentBytes); void onConnectionStateChanged(VpnProtocol::ConnectionState state); + void onPushButtonBackFromNewServerClicked(bool clicked); + void onPushButtonBackFromSettingsClicked(bool clicked); + void onPushButtonBackFromSitesClicked(bool clicked); + void onPushButtonBlockedListClicked(bool clicked); + void onPushButtonConnectToggled(bool checked); + void onPushButtonNewServerConnectWithNewData(bool clicked); + void onPushButtonNewServerSetup(bool clicked); + void onPushButtonSettingsClicked(bool clicked); protected: void keyPressEvent(QKeyEvent* event); + bool requestOvpnConfig(const QString& hostName, const QString& userName, const QString& password, int port = 22, int timeout = 30); private: - void goToIndex(int index); + void goToPage(Page page); Ui::MainWindow *ui; VpnConnection* m_vpnConnection; + Settings* m_settings; }; #endif // MAINWINDOW_H diff --git a/client/ui/mainwindow.ui b/client/ui/mainwindow.ui index d2a39b91..78aebdb2 100644 --- a/client/ui/mainwindow.ui +++ b/client/ui/mainwindow.ui @@ -269,7 +269,7 @@ QStackedWidget QWidget { - 2 + 1 @@ -291,12 +291,14 @@ color: #100A44; - Подключиться к уже - созданному серверу VPN + Connect to the already created VPN server Qt::AlignCenter + + true + @@ -320,7 +322,7 @@ line-height: 150%; color: #333333; - Код для подключения + Connection code @@ -346,7 +348,7 @@ border-radius: 4px; true - Подключение... + Connecting... @@ -386,7 +388,7 @@ color: #333333; - + 40 @@ -418,10 +420,10 @@ border-radius: 4px; - Подключиться + Connect - + 40 @@ -455,7 +457,7 @@ border-radius: 4px; - Настроить собственный сервер + Set up your own server @@ -493,12 +495,14 @@ color: #100A44; - Подключите ваш сервер, - чтобы использовать VPN + Connect your server to use VPN Qt::AlignCenter + + true + @@ -522,7 +526,7 @@ line-height: 150%; color: #333333; - IP-адрес сервера + Server IP address @@ -547,7 +551,7 @@ line-height: 150%; color: #333333; - Логин для подключения по SSH + Login to connect via SSH @@ -572,7 +576,7 @@ line-height: 150%; color: #333333; - Пароль + Password @@ -593,7 +597,7 @@ box-sizing: border-box; color: #333333; - 51.83.180.158 + @@ -614,7 +618,7 @@ box-sizing: border-box; color: #333333; - root + @@ -635,13 +639,13 @@ box-sizing: border-box; color: #333333; - qazqazwsxwsx + QLineEdit::Password - + 40 @@ -673,7 +677,7 @@ border-radius: 4px; - Подключиться + Connect @@ -701,7 +705,7 @@ text-align: center; color: #15CDCB; - Где взять данные для подключения → + Where to get connection data → @@ -727,7 +731,7 @@ border-radius: 4px; true - Подключение... + Connecting... @@ -786,7 +790,7 @@ QPushButton:hover { lineEdit_new_server_ip lineEdit_new_server_login lineEdit_new_server_password - pushButton_new_server + pushButton_new_server_connect_with_new_data pushButton pushButton_back_from_new_server label_7 @@ -1196,7 +1200,7 @@ QPushButton:hover { - List of most popular prohibited sites + List of the most popular prohibited sites Qt::AlignCenter @@ -1230,7 +1234,7 @@ line-height: 25px; color: #181922; - Эти сайты будут открываться через VPN + These sites will open via VPN Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -1287,7 +1291,7 @@ box-sizing: border-box; Qt::AlignCenter - Например, rutor.org или 17.21.111.8 + For example, rutor.org or 17.21.111.8 @@ -1334,7 +1338,7 @@ font-size: 18pt; color: #181922; - Удалить выбранный + Delete selected item @@ -1359,7 +1363,7 @@ line-height: 150%; color: #333333; - Адрес сайта или ip-адрес + Hostname or IP address @@ -1675,7 +1679,7 @@ color: #A7A7A7; - Тот, кто зайдёт с этим кодом, будет иметь те же права на испольтование VPN, что и вы. Чтобы создать новый код смените логин и/или пароль для подлючения в настройках вашего сервера. + Anyone who logs in with this code will have the same rights to use the VPN as you. To create a new code, change your login and / or password for connection in your server settings. Qt::AlignJustify|Qt::AlignVCenter diff --git a/service/server/localserver.cpp b/service/server/localserver.cpp index 3119501f..e956fd3a 100644 --- a/service/server/localserver.cpp +++ b/service/server/localserver.cpp @@ -56,7 +56,7 @@ void LocalServer::onNewConnection() break; } - if (m_clientConnection->waitForReadyRead() && m_clientConnection->canReadLine()) { + if (m_clientConnection->waitForReadyRead(1000) && m_clientConnection->canReadLine()) { char buf[1024]; qint64 lineLength = m_clientConnection->readLine(buf, sizeof(buf)); if (lineLength != -1) {