mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +08:00
fix tray again &&
fix table item update && improve cmake
This commit is contained in:
parent
62035c5049
commit
183c5e4236
@ -7,7 +7,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
|
||||
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND WIN32)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
|
||||
endif ()
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Widgets Network Svg LinguistTools QuickControls2)
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
find_package(Protobuf CONFIG REQUIRED)
|
||||
|
||||
set(PROTO_FILES
|
||||
core/grpc_server/gen/libcore.proto
|
||||
core/cmd/nekobox_core/server/gen/libcore.proto
|
||||
)
|
||||
|
||||
add_library(myproto STATIC ${PROTO_FILES})
|
||||
|
||||
@ -245,10 +245,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
connect(tray, &QSystemTrayIcon::activated, this, [=](QSystemTrayIcon::ActivationReason reason) {
|
||||
if (reason == QSystemTrayIcon::Context)
|
||||
{
|
||||
QTimer::singleShot(100, this, [=]
|
||||
{
|
||||
ui->menu_program->popup(QCursor::pos());
|
||||
});
|
||||
ui->menu_program->exec(QCursor::pos());
|
||||
}
|
||||
if (reason == QSystemTrayIcon::Trigger) {
|
||||
if (this->isVisible()) {
|
||||
@ -1048,12 +1045,12 @@ void MainWindow::refresh_proxy_list_impl(const int &id, GroupSortAction groupSor
|
||||
void MainWindow::refresh_proxy_list_impl_refresh_data(const int &id, bool stopping) {
|
||||
if (id >= 0)
|
||||
{
|
||||
auto rowID = ui->proxyListTable->id2Row[id];
|
||||
if (rowID < 0)
|
||||
if (ui->proxyListTable->id2Row.count(id) == 0)
|
||||
{
|
||||
MW_show_log("Invalid proxy list id, data might be corrupted");
|
||||
qDebug("Invalid proxy list id, data might be corrupted");
|
||||
return;
|
||||
}
|
||||
auto rowID = ui->proxyListTable->id2Row[id];
|
||||
auto profile = NekoGui::profileManager->GetProfile(id);
|
||||
refresh_table_item(rowID, profile, stopping);
|
||||
} else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user