解决导出日志异常问题,BUG-1183
This commit is contained in:
parent
5aeba0677e
commit
4c8691bb4e
|
@ -129,6 +129,11 @@ HGResult DeviceUser::ClearRollerCount()
|
||||||
QString DeviceUser::GetDriverLog()
|
QString DeviceUser::GetDriverLog()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getSaveFileName(m_wnd, tr("Select log file path"), ".", tr("text(*.txt)"));
|
QString fileName = QFileDialog::getSaveFileName(m_wnd, tr("Select log file path"), ".", tr("text(*.txt)"));
|
||||||
|
if (fileName.isEmpty())
|
||||||
|
{
|
||||||
|
return "NULL";
|
||||||
|
}
|
||||||
|
|
||||||
std::string f = getStdFileName(fileName).toLocal8Bit().data();
|
std::string f = getStdFileName(fileName).toLocal8Bit().data();
|
||||||
HGResult ret = HGTwain_GetDSDriverLog(m_twainDS, f.c_str());
|
HGResult ret = HGTwain_GetDSDriverLog(m_twainDS, f.c_str());
|
||||||
if (ret == HGBASE_ERR_OK)
|
if (ret == HGBASE_ERR_OK)
|
||||||
|
@ -145,6 +150,11 @@ HGResult DeviceUser::ClearDriverLog()
|
||||||
QString DeviceUser::GetDeviceLog()
|
QString DeviceUser::GetDeviceLog()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getSaveFileName(m_wnd, tr("Select log file path"), ".", tr("text(*.txt)"));
|
QString fileName = QFileDialog::getSaveFileName(m_wnd, tr("Select log file path"), ".", tr("text(*.txt)"));
|
||||||
|
if (fileName.isEmpty())
|
||||||
|
{
|
||||||
|
return "NULL";
|
||||||
|
}
|
||||||
|
|
||||||
std::string f = getStdFileName(fileName).toLocal8Bit().data();
|
std::string f = getStdFileName(fileName).toLocal8Bit().data();
|
||||||
HGResult ret = HGTwain_GetDSDeviceLog(m_twainDS, f.c_str());
|
HGResult ret = HGTwain_GetDSDeviceLog(m_twainDS, f.c_str());
|
||||||
if (ret == HGBASE_ERR_OK)
|
if (ret == HGBASE_ERR_OK)
|
||||||
|
@ -344,6 +354,11 @@ int DeviceUser::GetDeviceRollerLife()
|
||||||
QString DeviceUser::GetDriverLog()
|
QString DeviceUser::GetDriverLog()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getSaveFileName(m_wnd, tr("Select log file path"), ".", tr("text(*.txt)"));
|
QString fileName = QFileDialog::getSaveFileName(m_wnd, tr("Select log file path"), ".", tr("text(*.txt)"));
|
||||||
|
if (fileName.isEmpty())
|
||||||
|
{
|
||||||
|
return "NULL";
|
||||||
|
}
|
||||||
|
|
||||||
std::string f = getStdFileName(fileName).toLocal8Bit().data();
|
std::string f = getStdFileName(fileName).toLocal8Bit().data();
|
||||||
HGResult ret = HGSane_GetDriverLog(m_saneDev, f.c_str());
|
HGResult ret = HGSane_GetDriverLog(m_saneDev, f.c_str());
|
||||||
if (ret == HGBASE_ERR_OK)
|
if (ret == HGBASE_ERR_OK)
|
||||||
|
@ -360,6 +375,11 @@ HGResult DeviceUser::ClearDriverLog()
|
||||||
QString DeviceUser::GetDeviceLog()
|
QString DeviceUser::GetDeviceLog()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getSaveFileName(m_wnd, tr("Select log file path"), ".", tr("text(*.txt)"));
|
QString fileName = QFileDialog::getSaveFileName(m_wnd, tr("Select log file path"), ".", tr("text(*.txt)"));
|
||||||
|
if (fileName.isEmpty())
|
||||||
|
{
|
||||||
|
return "NULL";
|
||||||
|
}
|
||||||
|
|
||||||
std::string f = getStdFileName(fileName).toLocal8Bit().data();
|
std::string f = getStdFileName(fileName).toLocal8Bit().data();
|
||||||
HGResult ret = HGSane_GetDeviceLog(m_saneDev, f.c_str());
|
HGResult ret = HGSane_GetDeviceLog(m_saneDev, f.c_str());
|
||||||
if (ret == HGBASE_ERR_OK)
|
if (ret == HGBASE_ERR_OK)
|
||||||
|
|
|
@ -4902,6 +4902,11 @@ void MainWindow::on_act_driver_log_triggered()
|
||||||
if (driverLogPath == "Fail")
|
if (driverLogPath == "Fail")
|
||||||
{
|
{
|
||||||
QMessageBox::information(this, tr("tips"), tr("The device does not support this operation"));
|
QMessageBox::information(this, tr("tips"), tr("The device does not support this operation"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (driverLogPath == "NULL")
|
||||||
|
{
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
QDesktopServices::openUrl(QUrl::fromLocalFile(driverLogPath));
|
QDesktopServices::openUrl(QUrl::fromLocalFile(driverLogPath));
|
||||||
}
|
}
|
||||||
|
@ -4919,6 +4924,10 @@ void MainWindow::on_act_device_log_triggered()
|
||||||
{
|
{
|
||||||
QMessageBox::information(this, tr("tips"), tr("The device does not support this operation"));
|
QMessageBox::information(this, tr("tips"), tr("The device does not support this operation"));
|
||||||
}
|
}
|
||||||
|
else if (deviceLogPath == "NULL")
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QDesktopServices::openUrl(QUrl::fromLocalFile(deviceLogPath));
|
QDesktopServices::openUrl(QUrl::fromLocalFile(deviceLogPath));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue