完善‘移除链接’操作
This commit is contained in:
parent
ce2e12962e
commit
719fd134b1
|
|
@ -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<DBStructureModel*>(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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue