修改了设备类返回名字的方法,返回时加上了能否充值的信息。修改对应的调用代码。

This commit is contained in:
2024-07-29 00:41:15 +08:00
parent 6cca0535bc
commit f229cd4a28
2 changed files with 5 additions and 7 deletions

View File

@@ -88,13 +88,8 @@ void MainWindow::on_connectDatabaseButton_clicked()
if (!device.is_connected())
{
QMessageBox::warning(this, QString("设备名提示"), QString("该设备名无效,请重试。"));
deviceLabel->setText(device.getName());
}
else
{
if (device.is_depositAllowed()) deviceLabel->setText(device.getName() + QString("(可充值)"));
else deviceLabel->setText(device.getName() + QString("(仅可消费)"));
}
deviceLabel->setText(device.getName());
}