scantool增加崩溃日志
This commit is contained in:
parent
d731b3e1d1
commit
47adcb9a49
|
@ -67,6 +67,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
ui->btnOpenFilePath->setEnabled(false);
|
ui->btnOpenFilePath->setEnabled(false);
|
||||||
ui->btnUpgrade->setEnabled(false);
|
ui->btnUpgrade->setEnabled(false);
|
||||||
ui->btnClearRollCount->setEnabled(false);
|
ui->btnClearRollCount->setEnabled(false);
|
||||||
|
ui->pushButton_restoreSettings->setEnabled(false);
|
||||||
|
|
||||||
ui->comboBox_colorMode->setEnabled(false);
|
ui->comboBox_colorMode->setEnabled(false);
|
||||||
ui->comboBox_dpi->setEnabled(false);
|
ui->comboBox_dpi->setEnabled(false);
|
||||||
|
@ -538,6 +539,7 @@ void MainWindow::on_comboDevList_currentIndexChanged(int index)
|
||||||
ui->btnOpenFilePath->setEnabled(false);
|
ui->btnOpenFilePath->setEnabled(false);
|
||||||
ui->btnUpgrade->setEnabled(false);
|
ui->btnUpgrade->setEnabled(false);
|
||||||
ui->btnClearRollCount->setEnabled(false);
|
ui->btnClearRollCount->setEnabled(false);
|
||||||
|
ui->pushButton_restoreSettings->setEnabled(false);
|
||||||
|
|
||||||
ui->comboBox_colorMode->setEnabled(false);
|
ui->comboBox_colorMode->setEnabled(false);
|
||||||
ui->comboBox_dpi->setEnabled(false);
|
ui->comboBox_dpi->setEnabled(false);
|
||||||
|
@ -619,6 +621,7 @@ void MainWindow::on_comboDevList_currentIndexChanged(int index)
|
||||||
}
|
}
|
||||||
ui->btnOpenFilePath->setEnabled(true);
|
ui->btnOpenFilePath->setEnabled(true);
|
||||||
ui->btnClearRollCount->setEnabled(true);
|
ui->btnClearRollCount->setEnabled(true);
|
||||||
|
ui->pushButton_restoreSettings->setEnabled(true);
|
||||||
|
|
||||||
bool isAndroid = isAndroidDevice();
|
bool isAndroid = isAndroidDevice();
|
||||||
ui->comboBox_colorMode->setEnabled(!isAndroid);
|
ui->comboBox_colorMode->setEnabled(!isAndroid);
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "base/HGTime.h"
|
#include "base/HGTime.h"
|
||||||
#include "base/HGUtility.h"
|
#include "base/HGUtility.h"
|
||||||
#include "base/HGBase64.h"
|
#include "base/HGBase64.h"
|
||||||
|
#include "base/HGCrash.h"
|
||||||
#include "imgproc/HGImgProc.h"
|
#include "imgproc/HGImgProc.h"
|
||||||
#include "imgproc/HGOCR.h"
|
#include "imgproc/HGOCR.h"
|
||||||
#include "dialog_scaninfo.h"
|
#include "dialog_scaninfo.h"
|
||||||
|
@ -32,6 +33,8 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setWindowIcon(QIcon(":images/image_rsc/png/logo.png"));
|
this->setWindowIcon(QIcon(":images/image_rsc/png/logo.png"));
|
||||||
|
|
||||||
|
HGBase_RegisterCrashFunc(CrashFunc, this);
|
||||||
|
|
||||||
ui->pushButtonScan->setEnabled(false);
|
ui->pushButtonScan->setEnabled(false);
|
||||||
ui->pushButtonAdd->setEnabled(false);
|
ui->pushButtonAdd->setEnabled(false);
|
||||||
ui->pushButtonModify->setEnabled(false);
|
ui->pushButtonModify->setEnabled(false);
|
||||||
|
@ -1216,6 +1219,22 @@ void MainWindow::ocrMsgPumpFunc(HGMsgPump msgPump, const HGMsg *msg, HGPointer p
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::CrashFunc(HGPointer crashAddr, HGPointer param)
|
||||||
|
{
|
||||||
|
HGChar crashName[256];
|
||||||
|
HGBase_GetLogFilePath(crashName, 256);
|
||||||
|
strcat(crashName, "crash.dmp");
|
||||||
|
if (HGBASE_ERR_OK == HGBase_MakeCrashFile(crashName))
|
||||||
|
{
|
||||||
|
HGChar excpStr[64];
|
||||||
|
#ifdef HG_64BIT
|
||||||
|
sprintf(excpStr, "0x%016p", crashAddr);
|
||||||
|
#else
|
||||||
|
sprintf(excpStr, "0x%08p", crashAddr);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::closeEvent(QCloseEvent *e)
|
void MainWindow::closeEvent(QCloseEvent *e)
|
||||||
{
|
{
|
||||||
if (m_trayIcon->isVisible()) //托盘是显示的
|
if (m_trayIcon->isVisible()) //托盘是显示的
|
||||||
|
|
|
@ -45,6 +45,7 @@ private:
|
||||||
static int sane_ex_callback(SANE_Handle hdev, int code, void* data, unsigned int* len, void* param);
|
static int sane_ex_callback(SANE_Handle hdev, int code, void* data, unsigned int* len, void* param);
|
||||||
static void HGAPI ocrThreadFunc(HGThread thread, HGPointer param);
|
static void HGAPI ocrThreadFunc(HGThread thread, HGPointer param);
|
||||||
static void HGAPI ocrMsgPumpFunc(HGMsgPump msgPump, const HGMsg* msg, HGPointer param);
|
static void HGAPI ocrMsgPumpFunc(HGMsgPump msgPump, const HGMsg* msg, HGPointer param);
|
||||||
|
static void HGAPI CrashFunc(HGPointer crashAddr, HGPointer param);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void closeEvent(QCloseEvent *e) override;
|
virtual void closeEvent(QCloseEvent *e) override;
|
||||||
|
|
Loading…
Reference in New Issue