修改了设备类返回名字的方法,返回时加上了能否充值的信息。修改对应的调用代码。
This commit is contained in:
parent
6cca0535bc
commit
f229cd4a28
@ -43,7 +43,10 @@ public:
|
|||||||
|
|
||||||
QString getName()
|
QString getName()
|
||||||
{
|
{
|
||||||
if (connected) return name;
|
if (connected) {
|
||||||
|
if (depositAllowed) return name + QString("(可充值)");
|
||||||
|
else return name + QString("(仅可消费)");
|
||||||
|
}
|
||||||
else return QString("未指定设备名");
|
else return QString("未指定设备名");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -88,13 +88,8 @@ void MainWindow::on_connectDatabaseButton_clicked()
|
|||||||
if (!device.is_connected())
|
if (!device.is_connected())
|
||||||
{
|
{
|
||||||
QMessageBox::warning(this, QString("设备名提示"), QString("该设备名无效,请重试。"));
|
QMessageBox::warning(this, QString("设备名提示"), QString("该设备名无效,请重试。"));
|
||||||
|
}
|
||||||
deviceLabel->setText(device.getName());
|
deviceLabel->setText(device.getName());
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (device.is_depositAllowed()) deviceLabel->setText(device.getName() + QString("(可充值)"));
|
|
||||||
else deviceLabel->setText(device.getName() + QString("(仅可消费)"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user