From 48e04d21735264877b1fc6cf42087b56c4011f15 Mon Sep 17 00:00:00 2001 From: armv9 <48624112+arm64v8a@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:52:02 +0900 Subject: [PATCH] remove DialogFirstSetup --- CMakeLists.txt | 4 -- main/NekoGui.hpp | 2 +- main/main.cpp | 23 -------- translations/fa_IR.ts | 17 ------ translations/ru_RU.ts | 19 ------- translations/zh_CN.ts | 19 ------- ui/dialog_first_setup.cpp | 22 -------- ui/dialog_first_setup.h | 23 -------- ui/dialog_first_setup.ui | 116 -------------------------------------- 9 files changed, 1 insertion(+), 244 deletions(-) delete mode 100644 ui/dialog_first_setup.cpp delete mode 100644 ui/dialog_first_setup.h delete mode 100644 ui/dialog_first_setup.ui diff --git a/CMakeLists.txt b/CMakeLists.txt index b619976..7b03830 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,10 +225,6 @@ set(PROJECT_SOURCES ui/dialog_hotkey.h ui/dialog_hotkey.ui - ui/dialog_first_setup.cpp - ui/dialog_first_setup.h - ui/dialog_first_setup.ui - ui/widget/ProxyItem.cpp ui/widget/ProxyItem.h ui/widget/ProxyItem.ui diff --git a/main/NekoGui.hpp b/main/NekoGui.hpp index 08f9672..c894636 100644 --- a/main/NekoGui.hpp +++ b/main/NekoGui.hpp @@ -8,7 +8,7 @@ // Switch core support namespace NekoGui { - inline int coreType = CoreType::V2RAY; + inline int coreType = CoreType::SING_BOX; QString FindCoreAsset(const QString &name); diff --git a/main/main.cpp b/main/main.cpp index c67f913..c88dc92 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -13,7 +13,6 @@ #include "main/NekoGui.hpp" #include "ui/mainwindow_interface.h" -#include "ui/dialog_first_setup.h" #ifdef Q_OS_WIN #include "sys/windows/MiniDump.h" @@ -159,28 +158,6 @@ int main(int argc, char* argv[]) { QIcon::setThemeName("breeze"); } - // Load coreType - auto coreLoaded = ReadFileText("groups/coreType"); - if (coreLoaded.isEmpty()) { - NekoGui::coreType = -1; - loadTranslate(QLocale().name()); - auto dialogFirstSetup = new DialogFirstSetup; - dialogFirstSetup->exec(); - dialogFirstSetup->deleteLater(); - if (NekoGui::coreType < 0) { - return 0; - } else { - QDir().mkdir("groups"); - QFile file; - file.setFileName("groups/coreType"); - file.open(QIODevice::ReadWrite | QIODevice::Truncate); - file.write(Int2String(NekoGui::coreType).toUtf8()); - file.close(); - } - } else { - NekoGui::coreType = coreLoaded.toInt(); - } - // Dir QDir dir; bool dir_success = true; diff --git a/translations/fa_IR.ts b/translations/fa_IR.ts index cc93287..1ff4ed3 100644 --- a/translations/fa_IR.ts +++ b/translations/fa_IR.ts @@ -490,23 +490,6 @@ For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mod - - DialogFirstSetup - - First time setup - تنظیم دفعه اول - - - It looks like you are using this software for the first time, please select a core. - -These settings can be changed later. - به نظر میرسد که شما برای اولین بار است که از این نرم افزار استفاده میکنید ، لطفا یک هسته را انتخاب کنید ، این تنظیمات میتواند بعدا تغییر یابد. - - - Quit - خروج - - DialogHotkey diff --git a/translations/ru_RU.ts b/translations/ru_RU.ts index 4eeaff3..031ecc3 100644 --- a/translations/ru_RU.ts +++ b/translations/ru_RU.ts @@ -490,25 +490,6 @@ For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mod Подтвердить - - DialogFirstSetup - - First time setup - Первоначальная настройка - - - It looks like you are using this software for the first time, please select a core. - -These settings can be changed later. - Привет! Кажется, вы запустили эту программу впервые. Пожалуйста, выберите ядро. - -Эти настройки будет возможно в дальнейшем изменить. - - - Quit - Выход - - DialogHotkey diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts index 147e5f6..956da7c 100644 --- a/translations/zh_CN.ts +++ b/translations/zh_CN.ts @@ -490,25 +490,6 @@ For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mod Reality short id. 只接受一个值。 - - DialogFirstSetup - - First time setup - 首次设置 - - - It looks like you are using this software for the first time, please select a core. - -These settings can be changed later. - 看来您是第一次使用该软件,请选择内核。 - -这些设置可以稍后更改。 - - - Quit - 退出 - - DialogHotkey diff --git a/ui/dialog_first_setup.cpp b/ui/dialog_first_setup.cpp deleted file mode 100644 index 4fc2499..0000000 --- a/ui/dialog_first_setup.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "dialog_first_setup.h" -#include "ui_dialog_first_setup.h" - -#include "main/NekoGui.hpp" - -DialogFirstSetup::DialogFirstSetup(QWidget *parent) : QDialog(parent), ui(new Ui::DialogFirstSetup) { - ui->setupUi(this); -} - -DialogFirstSetup::~DialogFirstSetup() { - delete ui; -} - -void DialogFirstSetup::onButtonClicked() { - auto s = sender(); - if (s == ui->v2ray) { - NekoGui::coreType = NekoGui::CoreType::V2RAY; - } else if (s == ui->singbox) { - NekoGui::coreType = NekoGui::CoreType::SING_BOX; - } - done(0); -} diff --git a/ui/dialog_first_setup.h b/ui/dialog_first_setup.h deleted file mode 100644 index ac244b5..0000000 --- a/ui/dialog_first_setup.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include - -QT_BEGIN_NAMESPACE -namespace Ui { - class DialogFirstSetup; -} -QT_END_NAMESPACE - -class DialogFirstSetup : public QDialog { - Q_OBJECT - -public: - explicit DialogFirstSetup(QWidget *parent = nullptr); - ~DialogFirstSetup() override; - -private: - Ui::DialogFirstSetup *ui; - -private slots: - void onButtonClicked(); -}; diff --git a/ui/dialog_first_setup.ui b/ui/dialog_first_setup.ui deleted file mode 100644 index aec0aac..0000000 --- a/ui/dialog_first_setup.ui +++ /dev/null @@ -1,116 +0,0 @@ - - - DialogFirstSetup - - - - 0 - 0 - 400 - 300 - - - - First time setup - - - - - - It looks like you are using this software for the first time, please select a core. - -These settings can be changed later. - - - true - - - - - - - <html><head/><body><p><a href="https://matsuridayo.github.io/n-configuration/#nekobox"><span style=" text-decoration: underline; color:#2980b9;">Help</span></a></p></body></html> - - - true - - - - - - - Xray - - - - - - - sing-box - - - - - - - Quit - - - - - - - - - v2ray - clicked() - DialogFirstSetup - onButtonClicked() - - - 199 - 196 - - - 199 - 149 - - - - - singbox - clicked() - DialogFirstSetup - onButtonClicked() - - - 199 - 236 - - - 199 - 149 - - - - - quit - clicked() - DialogFirstSetup - onButtonClicked() - - - 199 - 276 - - - 199 - 149 - - - - - - onButtonClicked() - -