From 719fd134b10a984396641483870654e11975a4b7 Mon Sep 17 00:00:00 2001 From: duanshengchao <519970194@qq.com> Date: Mon, 19 May 2025 15:11:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E2=80=98=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E2=80=99=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/dbStructureView.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/dbStructureView.cpp b/source/dbStructureView.cpp index 74f1f4a..2895cd1 100644 --- a/source/dbStructureView.cpp +++ b/source/dbStructureView.cpp @@ -266,20 +266,22 @@ void DBStructureView::showContextMenu(const QPoint& pos) if(model && index.isValid()) expand(index); })->setEnabled(!isConnected); - menu.addAction(QString::fromWCharArray(L"断开链接"), [this, &connName]{disconnectCurConnection();})->setEnabled(isConnected); + menu.addAction(QString::fromWCharArray(L"断开链接"), [this]{disconnectCurConnection();})->setEnabled(isConnected); menu.addAction(QString::fromWCharArray(L"刷新"), [this, &connName]{ DBStructureModel* model = dynamic_cast(this->model()); if(model) model->refreshStructure_Connection(connName); })->setEnabled(isConnected); - menu.addAction(QString::fromWCharArray(L"移除链接"), [this, &connName, node]{ + menu.addAction(QString::fromWCharArray(L"移除链接"), [this, &connName, node, isConnected]{ if(m_pMainWindow) { m_pMainWindow->showMessageDialog(type_question, QString::fromWCharArray(L"提示"), - QString::fromWCharArray(L"确认删除链接 '%1' 吗").arg(connName)); + QString::fromWCharArray(L"确认移除链接 '%1' 吗").arg(connName)); if(g_msgDlgBtn == btn_No) return; } + if(isConnected) + disconnectCurConnection(); removeNode(node); }); menu.addSeparator();