完成页码想过逻辑
This commit is contained in:
parent
1695da875e
commit
753a4a9e0c
|
|
@ -141,6 +141,11 @@ void DatabaseBrowser::onCurrentTabChanged(int index)
|
|||
ui->btnRefresh->setEnabled(false);
|
||||
ui->btnSave->setEnabled(false);
|
||||
ui->btnCancle->setEnabled(false);
|
||||
|
||||
ui->btnFirstPage->setEnabled(false);
|
||||
ui->btnPreviousPage->setEnabled(false);
|
||||
ui->btnNextPage->setEnabled(false);
|
||||
ui->btnLastPage->setEnabled(false);
|
||||
ui->recordInfo->clear();
|
||||
ui->lineEditPage->setEnabled(false);
|
||||
ui->lineEditPage->setText("1");
|
||||
|
|
@ -156,6 +161,13 @@ void DatabaseBrowser::onCurrentTabChanged(int index)
|
|||
ui->btnRemove->setEnabled(true);
|
||||
ui->btnCancle->setEnabled(true);
|
||||
ui->btnRefresh->setEnabled(true);
|
||||
|
||||
ui->btnFirstPage->setEnabled(true);
|
||||
ui->btnPreviousPage->setEnabled(true);
|
||||
ui->btnNextPage->setEnabled(true);
|
||||
ui->btnLastPage->setEnabled(true);
|
||||
ui->lineEditPage->setEnabled(true);
|
||||
|
||||
attributeView->active();
|
||||
}
|
||||
}
|
||||
|
|
@ -308,7 +320,9 @@ void DatabaseBrowser::onEditingFinished_page()
|
|||
if(view && model)
|
||||
{
|
||||
QString strPage = ui->lineEditPage->text();
|
||||
model->setCurrentPage(strPage.toInt());
|
||||
bool result = model->setCurrentPage(strPage.toInt());
|
||||
if(!result)
|
||||
ui->lineEditPage->setText(QString::number(model->currentPage()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -322,7 +336,6 @@ void DatabaseBrowser::onSyncDataStatus(bool hasModifiedData, const PaginationInf
|
|||
QString recordInfo = QString::fromWCharArray(L"共 %1 条记录").arg(paginationInfo.totalEntries);
|
||||
ui->recordInfo->setText(recordInfo);
|
||||
ui->lineEditPage->setText(QString::number(paginationInfo.currentPage));
|
||||
ui->lineEditPage->setEnabled(true);
|
||||
}
|
||||
|
||||
void DatabaseBrowser::onShowMessage(MessageDialogType type,const QString& strTitle,const QString& strContent)
|
||||
|
|
|
|||
|
|
@ -308,18 +308,9 @@ void DBStructureView::showContextMenu(const QPoint& pos)
|
|||
else if(node && node->type() == GroupNode)
|
||||
{
|
||||
CustomMenu menu;
|
||||
bool isPublic = node->data(Qt::UserRole + NodeDataRole::Type).toBool();
|
||||
menu.addAction(QString::fromWCharArray(L"打开"), [this, node]{openAttributeGroup(node);});
|
||||
menu.addAction(QString::fromWCharArray(L"删除"), [this, node]{
|
||||
bool isPublic = node->data(Qt::UserRole + NodeDataRole::Type).toBool();
|
||||
if(isPublic)
|
||||
{
|
||||
if(m_pMainWindow)
|
||||
{
|
||||
m_pMainWindow->showMessageDialog(type_warning, QString::fromWCharArray(L"错误"),
|
||||
QString::fromWCharArray(L"该属性组属于必备组别,不可删除"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(m_pMainWindow)
|
||||
{
|
||||
m_pMainWindow->showMessageDialog(type_question, QString::fromWCharArray(L"提示"),
|
||||
|
|
@ -331,7 +322,7 @@ void DBStructureView::showContextMenu(const QPoint& pos)
|
|||
closeAttributeGroup(node);
|
||||
//移除节点
|
||||
removeNode(node);
|
||||
});
|
||||
})->setEnabled(!isPublic);
|
||||
menu.addSeparator();
|
||||
menu.addAction(QString::fromWCharArray(L"清空数据"), []{});
|
||||
QPoint originPoint = this->mapToGlobal(QPoint(0,0));
|
||||
|
|
|
|||
Loading…
Reference in New Issue