完善‘移除链接’操作
This commit is contained in:
parent
ce2e12962e
commit
719fd134b1
|
|
@ -266,20 +266,22 @@ void DBStructureView::showContextMenu(const QPoint& pos)
|
||||||
if(model && index.isValid())
|
if(model && index.isValid())
|
||||||
expand(index);
|
expand(index);
|
||||||
})->setEnabled(!isConnected);
|
})->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]{
|
menu.addAction(QString::fromWCharArray(L"刷新"), [this, &connName]{
|
||||||
DBStructureModel* model = dynamic_cast<DBStructureModel*>(this->model());
|
DBStructureModel* model = dynamic_cast<DBStructureModel*>(this->model());
|
||||||
if(model)
|
if(model)
|
||||||
model->refreshStructure_Connection(connName);
|
model->refreshStructure_Connection(connName);
|
||||||
})->setEnabled(isConnected);
|
})->setEnabled(isConnected);
|
||||||
menu.addAction(QString::fromWCharArray(L"移除链接"), [this, &connName, node]{
|
menu.addAction(QString::fromWCharArray(L"移除链接"), [this, &connName, node, isConnected]{
|
||||||
if(m_pMainWindow)
|
if(m_pMainWindow)
|
||||||
{
|
{
|
||||||
m_pMainWindow->showMessageDialog(type_question, QString::fromWCharArray(L"提示"),
|
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)
|
if(g_msgDlgBtn == btn_No)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(isConnected)
|
||||||
|
disconnectCurConnection();
|
||||||
removeNode(node);
|
removeNode(node);
|
||||||
});
|
});
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue