mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +08:00
fix multiple checked profiles
This commit is contained in:
parent
b8dc8be90e
commit
f1e96499c2
@ -183,9 +183,9 @@ private:
|
||||
|
||||
void refresh_proxy_list_impl(const int &id = -1, GroupSortAction groupSortAction = {});
|
||||
|
||||
void refresh_proxy_list_impl_refresh_data(const int &id = -1);
|
||||
void refresh_proxy_list_impl_refresh_data(const int &id = -1, bool stopping = false);
|
||||
|
||||
void refresh_table_item(int row, const std::shared_ptr<NekoGui::ProxyEntity>& profile);
|
||||
void refresh_table_item(int row, const std::shared_ptr<NekoGui::ProxyEntity>& profile, bool stopping);
|
||||
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
|
||||
@ -1045,7 +1045,7 @@ void MainWindow::refresh_proxy_list_impl(const int &id, GroupSortAction groupSor
|
||||
refresh_proxy_list_impl_refresh_data(id);
|
||||
}
|
||||
|
||||
void MainWindow::refresh_proxy_list_impl_refresh_data(const int &id) {
|
||||
void MainWindow::refresh_proxy_list_impl_refresh_data(const int &id, bool stopping) {
|
||||
if (id >= 0)
|
||||
{
|
||||
auto rowID = ui->proxyListTable->id2Row[id];
|
||||
@ -1055,22 +1055,22 @@ void MainWindow::refresh_proxy_list_impl_refresh_data(const int &id) {
|
||||
return;
|
||||
}
|
||||
auto profile = NekoGui::profileManager->GetProfile(id);
|
||||
refresh_table_item(rowID, profile);
|
||||
refresh_table_item(rowID, profile, stopping);
|
||||
} else
|
||||
{
|
||||
for (int row = 0; row < ui->proxyListTable->rowCount(); row++) {
|
||||
auto profileId = ui->proxyListTable->row2Id[row];
|
||||
auto profile = NekoGui::profileManager->GetProfile(profileId);
|
||||
refresh_table_item(row, profile);
|
||||
refresh_table_item(row, profile, stopping);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::refresh_table_item(const int row, const std::shared_ptr<NekoGui::ProxyEntity>& profile)
|
||||
void MainWindow::refresh_table_item(const int row, const std::shared_ptr<NekoGui::ProxyEntity>& profile, bool stopping)
|
||||
{
|
||||
if (profile == nullptr) return;
|
||||
|
||||
auto isRunning = profile->id == NekoGui::dataStore->started_id;
|
||||
auto isRunning = profile->id == NekoGui::dataStore->started_id && !stopping;
|
||||
auto f0 = std::make_unique<QTableWidgetItem>();
|
||||
f0->setData(114514, profile->id);
|
||||
|
||||
|
||||
@ -430,7 +430,7 @@ void MainWindow::neko_stop(bool crash, bool sem, bool manual) {
|
||||
|
||||
runOnUiThread([=] {
|
||||
refresh_status();
|
||||
refresh_proxy_list(id);
|
||||
refresh_proxy_list_impl_refresh_data(id, true);
|
||||
|
||||
mu_stopping.unlock();
|
||||
if (sem) sem_stopped.release();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user