mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
feat: restart program
This commit is contained in:
@@ -1192,6 +1192,10 @@ End: %2</source>
|
||||
<source>VPN Settings</source>
|
||||
<translation>VPN 设置</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Restart Program</source>
|
||||
<translation>重启程序</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ProxyItem</name>
|
||||
|
||||
@@ -202,7 +202,7 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent)
|
||||
file.open(QIODevice::ReadWrite | QIODevice::Truncate);
|
||||
file.write(Int2String(neko_core_new).toUtf8());
|
||||
file.close();
|
||||
dialog_message("", "SwitchCore");
|
||||
dialog_message("", "RestartProgram");
|
||||
}
|
||||
};
|
||||
connect(ui->switch_core_v2ray, &QRadioButton::clicked, this, switch_core_on_click);
|
||||
|
||||
@@ -254,6 +254,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
//
|
||||
ui->menu_program_preference->addActions(ui->menu_preferences->actions());
|
||||
connect(ui->menu_add_from_clipboard2, &QAction::triggered, ui->menu_add_from_clipboard, &QAction::trigger);
|
||||
connect(ui->actionRestart_Program, &QAction::triggered, this, [=] { dialog_message("", "RestartProgram"); });
|
||||
//
|
||||
connect(ui->menu_program, &QMenu::aboutToShow, this, [=]() {
|
||||
ui->actionRemember_last_proxy->setChecked(NekoRay::dataStore->remember_enable);
|
||||
@@ -461,7 +462,7 @@ void MainWindow::dialog_message_impl(const QString &sender, const QString &info)
|
||||
}
|
||||
refresh_status();
|
||||
}
|
||||
if (info == "SwitchCore") {
|
||||
if (info == "RestartProgram") {
|
||||
this->exit_reason = 2;
|
||||
on_menu_exit_triggered();
|
||||
}
|
||||
|
||||
@@ -489,6 +489,7 @@
|
||||
<addaction name="menu_spmode"/>
|
||||
<addaction name="menu_program_preference"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionRestart_Program"/>
|
||||
<addaction name="menu_exit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_preferences">
|
||||
@@ -828,6 +829,11 @@
|
||||
<string>VPN Settings</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRestart_Program">
|
||||
<property name="text">
|
||||
<string>Restart Program</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
||||
Reference in New Issue
Block a user