diff --git a/app/scanner/HGVersion.cpp b/app/scanner/HGVersion.cpp new file mode 100644 index 00000000..d28cff63 --- /dev/null +++ b/app/scanner/HGVersion.cpp @@ -0,0 +1,36 @@ +#include "HGVersion.h" + +bool GetServerConfig(ServerConfig& cfg) +{ + return false; +} + +bool PostCrashInfo(const char* crashFilePath) +{ + return false; +} + +bool PostUserHabits(const std::string& habits) +{ + return false; +} + +std::string GetCurrVersion() +{ + return ""; +} + +bool GetVersionInfoList(std::list& versionList) +{ + return false; +} + +int CompareVersion(const std::string& version1, const std::string& version2) +{ + return 0; +} + +bool HttpDownload(const char* url, const char* saveFilePath, HttpDownloadFunc func, void* param) +{ + return false; +} \ No newline at end of file diff --git a/app/scanner/HGVersion.h b/app/scanner/HGVersion.h new file mode 100644 index 00000000..e6fa0d9e --- /dev/null +++ b/app/scanner/HGVersion.h @@ -0,0 +1,51 @@ +#ifndef __HGVERSION_H__ +#define __HGVERSION_H__ + +#include +#include + +struct ServerConfig +{ + // 是否上传崩溃日志 + bool postCrashInfo; + // 是否上传用户使用习惯 + bool postUserHabits; +}; + +struct VersionInfo +{ + std::string version; + std::string desc; + std::string bugInfo; + std::string url; + unsigned long long size; + std::string md5; +}; + +/* http下载进度回调 +* 返回值: 如果需要停止下载,返回非0;否则返回0 +*/ +typedef int (*HttpDownloadFunc)(long long totalSize, long long nowSize, void *param); + +// 获取服务器配置 +bool GetServerConfig(ServerConfig &cfg); + +// 上传崩溃日志 +bool PostCrashInfo(const char* crashFilePath); + +// 上传用户使用习惯 +bool PostUserHabits(const std::string& habits); + +// 获取当前版本号 +std::string GetCurrVersion(); + +// 获取服务器上所有版本的信息 +bool GetVersionInfoList(std::list &versionList); + +// 比较版本号, 负数表示version1version2 +int CompareVersion(const std::string& version1, const std::string& version2); + +// 下载HTTP文件 +bool HttpDownload(const char* url, const char* saveFilePath, HttpDownloadFunc func, void *param); + +#endif /* __HGVERSION_H__ */ \ No newline at end of file diff --git a/app/upgrade/HGUpgrade.cpp b/app/upgrade/HGUpgrade.cpp new file mode 100644 index 00000000..def242b9 --- /dev/null +++ b/app/upgrade/HGUpgrade.cpp @@ -0,0 +1,16 @@ +#include "HGUpgrade.h" + +bool PostInstallInfo() +{ + return false; +} + +bool PostUninstallInfo() +{ + return false; +} + +bool Upgrade(const std::string& pkgPath) +{ + return false; +} \ No newline at end of file diff --git a/app/upgrade/HGUpgrade.h b/app/upgrade/HGUpgrade.h new file mode 100644 index 00000000..6725ffc6 --- /dev/null +++ b/app/upgrade/HGUpgrade.h @@ -0,0 +1,15 @@ +#ifndef __HGUPGRADE_H__ +#define __HGUPGRADE_H__ + +#include + +// 上传安装日志 +bool PostInstallInfo(); + +// 上传卸载日志 +bool PostUninstallInfo(); + +// 升级安装, 使用之前的安装路径 +bool Upgrade(const std::string& pkgPath); + +#endif /* __HGUPGRADE_H__ */ \ No newline at end of file diff --git a/app/upgrade/image_rsc/logo/HG_Logo.png b/app/upgrade/image_rsc/logo/HG_Logo.png new file mode 100644 index 00000000..4c2f5189 Binary files /dev/null and b/app/upgrade/image_rsc/logo/HG_Logo.png differ diff --git a/app/upgrade/image_rsc/logo/HUAGO-LOGO-for UI.jpg b/app/upgrade/image_rsc/logo/HUAGO-LOGO-for UI.jpg new file mode 100644 index 00000000..ede0c4a4 Binary files /dev/null and b/app/upgrade/image_rsc/logo/HUAGO-LOGO-for UI.jpg differ diff --git a/app/upgrade/image_rsc/logo/HUAGO-LOGO-for UI.png b/app/upgrade/image_rsc/logo/HUAGO-LOGO-for UI.png new file mode 100644 index 00000000..99b0730d Binary files /dev/null and b/app/upgrade/image_rsc/logo/HUAGO-LOGO-for UI.png differ diff --git a/app/upgrade/image_rsc/logo/Hanvon_logo1.ico b/app/upgrade/image_rsc/logo/Hanvon_logo1.ico new file mode 100644 index 00000000..cf47eb31 Binary files /dev/null and b/app/upgrade/image_rsc/logo/Hanvon_logo1.ico differ diff --git a/app/upgrade/image_rsc/logo/Hanvon_logo2.ico b/app/upgrade/image_rsc/logo/Hanvon_logo2.ico new file mode 100644 index 00000000..637c35e6 Binary files /dev/null and b/app/upgrade/image_rsc/logo/Hanvon_logo2.ico differ diff --git a/app/upgrade/image_rsc/logo/Lanxum_logo.ico b/app/upgrade/image_rsc/logo/Lanxum_logo.ico new file mode 100644 index 00000000..3f04624b Binary files /dev/null and b/app/upgrade/image_rsc/logo/Lanxum_logo.ico differ diff --git a/app/upgrade/image_rsc/logo/NoBrand_logo.ico b/app/upgrade/image_rsc/logo/NoBrand_logo.ico new file mode 100644 index 00000000..569a7ac5 Binary files /dev/null and b/app/upgrade/image_rsc/logo/NoBrand_logo.ico differ diff --git a/app/upgrade/image_rsc/logo/RightWay_logo.ico b/app/upgrade/image_rsc/logo/RightWay_logo.ico new file mode 100644 index 00000000..8692896a Binary files /dev/null and b/app/upgrade/image_rsc/logo/RightWay_logo.ico differ diff --git a/app/upgrade/image_rsc/logo/auge_logo.ico b/app/upgrade/image_rsc/logo/auge_logo.ico new file mode 100644 index 00000000..bdbc6191 Binary files /dev/null and b/app/upgrade/image_rsc/logo/auge_logo.ico differ diff --git a/app/upgrade/image_rsc/logo/logo.ico b/app/upgrade/image_rsc/logo/logo.ico new file mode 100644 index 00000000..bb062276 Binary files /dev/null and b/app/upgrade/image_rsc/logo/logo.ico differ diff --git a/app/upgrade/image_rsc/logo/waiting.gif b/app/upgrade/image_rsc/logo/waiting.gif new file mode 100644 index 00000000..915c1984 Binary files /dev/null and b/app/upgrade/image_rsc/logo/waiting.gif differ diff --git a/app/upgrade/main.cpp b/app/upgrade/main.cpp new file mode 100644 index 00000000..fd3e5334 --- /dev/null +++ b/app/upgrade/main.cpp @@ -0,0 +1,11 @@ +#include "mainwindow.h" + +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/app/upgrade/mainwindow.cpp b/app/upgrade/mainwindow.cpp new file mode 100644 index 00000000..41a26bdf --- /dev/null +++ b/app/upgrade/mainwindow.cpp @@ -0,0 +1,15 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + diff --git a/app/upgrade/mainwindow.h b/app/upgrade/mainwindow.h new file mode 100644 index 00000000..4643e322 --- /dev/null +++ b/app/upgrade/mainwindow.h @@ -0,0 +1,21 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +QT_BEGIN_NAMESPACE +namespace Ui { class MainWindow; } +QT_END_NAMESPACE + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + +private: + Ui::MainWindow *ui; +}; +#endif // MAINWINDOW_H diff --git a/app/upgrade/mainwindow.ui b/app/upgrade/mainwindow.ui new file mode 100644 index 00000000..b232854b --- /dev/null +++ b/app/upgrade/mainwindow.ui @@ -0,0 +1,22 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + + + diff --git a/build-qt/HGSolution/HGScanner.pro b/build-qt/HGSolution/HGScanner.pro deleted file mode 100644 index f060e5fd..00000000 --- a/build-qt/HGSolution/HGScanner.pro +++ /dev/null @@ -1,249 +0,0 @@ -QT += core gui - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -CONFIG += c++11 - -# The following define makes your compiler emit warnings if you use -# any Qt feature that has been marked deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# OEM definition -DEFINES += OEM_HUAGAO - -RC_ICONS = ../../app/scanner/image_rsc/logo/logo.ico - -# You can also make your code fail to compile if it uses deprecated APIs. -# In order to do so, uncomment the following line. -# You can also select to disable deprecated APIs only up to a certain version of Qt. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - -TARGET = HuaGoScan - -win32 { - DEFINES += _CRT_SECURE_NO_WARNINGS - - contains(QT_ARCH, i386) { - LIBS += -L../../../sdk/lib/win/x86/Release -lHGBase -lHGImgFmt -lHGImgProc -lsane - CONFIG(release, debug|release) { - DESTDIR = ../../../release/win/x86/Release/ - } - CONFIG(debug, debug|release) { - - } - } - else { - LIBS += -L../../../sdk/lib/win/x64/Release -lHGBase -lHGImgFmt -lHGImgProc -lsane - CONFIG(release, debug|release) { - DESTDIR = ../../../release/win/x64/Release/ - } - CONFIG(debug, debug|release) { - - } - } -} - -unix { - DISTRIBUTION = $$system(cat /etc/issue | cut -d\' \' -f1) - message($$DISTRIBUTION) - ARCH = $$system(arch) - message($$ARCH) - - contains(DISTRIBUTION, UnionTech){ - message('UOS') - DEFINES += UOS - contains(ARCH, x86_64){ - LIBS += -L../../../release/uos/x86_64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver - CONFIG(release, debug|release) { - DESTDIR = ../../../release/uos/x86_64/ - } - CONFIG(debug, debug|release) { - - } - } - contains(ARCH, aarch64){ - LIBS += -L../../../release/uos/aarch64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver - CONFIG(release, debug|release) { - DESTDIR = ../../../release/uos/aarch64/ - } - CONFIG(debug, debug|release) { - - } - } - contains(ARCH, mips64){ - LIBS += -L../../../release/uos/mips64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver - CONFIG(release, debug|release) { - DESTDIR = ../../../release/uos/mips64/ - } - CONFIG(debug, debug|release) { - - } - } - }else{ - message('KYLIN') - DEFINES += KYLIN - contains(ARCH, x86_64){ - LIBS += -L../../../release/kylin/x86_64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver - CONFIG(release, debug|release) { - DESTDIR = ../../../release/kylin/x86_64/ - } - CONFIG(debug, debug|release) { - - } - } - contains(ARCH, aarch64){ - LIBS += -L../../../release/kylin/aarch64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver - CONFIG(release, debug|release) { - DESTDIR = ../../../release/kylin/aarch64/ - } - CONFIG(debug, debug|release) { - - } - } - contains(ARCH, mips64){ - LIBS += -L../../../release/kylin/mips64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver - CONFIG(release, debug|release) { - DESTDIR = ../../../release/kylin/mips64/ - } - CONFIG(debug, debug|release) { - - } - } - } -} - -INCLUDEPATH += $$PWD/../../app/scanner/ -INCLUDEPATH += $$PWD/../../utility/ -INCLUDEPATH += $$PWD/../../modules/ -INCLUDEPATH += $$PWD/../../../sdk/include/ - -SOURCES += \ - ../../app/scanner/app_cfg.cpp \ - ../../app/scanner/cutdialog.cpp \ - ../../app/scanner/cutpapertool.cpp \ - ../../app/scanner/device_menu.cpp \ - ../../app/scanner/dialog_aquireinto.cpp \ - ../../app/scanner/dialog_clrcache.cpp \ - ../../app/scanner/dialog_export.cpp \ - ../../app/scanner/dialog_exportimagefile.cpp \ - ../../app/scanner/dialog_fullscreen.cpp \ - ../../app/scanner/dialog_imageeditor.cpp \ - ../../app/scanner/dialog_imageinfo.cpp \ - ../../app/scanner/dialog_imgproc_adjust.cpp \ - ../../app/scanner/dialog_imgproc_autocrop.cpp \ - ../../app/scanner/dialog_insertindex.cpp \ - ../../app/scanner/dialog_logmanager.cpp \ - ../../app/scanner/dialog_moveto.cpp \ - ../../app/scanner/dialog_multirotate.cpp \ - ../../app/scanner/dialog_multirotateimagefile.cpp \ - ../../app/scanner/dialog_openimageindex.cpp \ - ../../app/scanner/dialog_passwordchange.cpp \ - ../../app/scanner/dialog_saveas.cpp \ - ../../app/scanner/dialog_writesettings.cpp \ - ../../app/scanner/gaosixy.cpp \ - ../../app/scanner/graphicsscene.cpp \ - ../../app/scanner/hg_settingdialog.cpp \ - ../../app/scanner/main.cpp \ - ../../app/scanner/mainwindow.cpp \ - ../../app/scanner/sane_device.cpp \ - ../../app/scanner/setpicclrtool.cpp \ - ../../app/scanner/widget.cpp \ - ../../app/scanner/widget_imgproc_base.cpp \ - ../../app/scanner/widget_statusbar.cpp \ - ../../app/scanner/dialog_admin.cpp \ - ../../app/scanner/dialog_log.cpp \ - ../../app/scanner/config.cpp \ - ../../app/scanner/json.cpp \ - ../../app/scanner/cJSON.c \ - ../../app/scanner/HGImgThumb.cpp \ - ../../app/scanner/HGImgView.cpp \ - ../../app/scanner/HGUIGlobal.cpp \ - ../../utility/HGString.cpp \ - ../../app/scanner/dialog_input.cpp - -HEADERS += \ - ../../app/scanner/app_cfg.h \ - ../../app/scanner/cutdialog.h \ - ../../app/scanner/cutpapertool.h \ - ../../app/scanner/device_menu.h \ - ../../app/scanner/dialog_aquireinto.h \ - ../../app/scanner/dialog_clrcache.h \ - ../../app/scanner/dialog_export.h \ - ../../app/scanner/dialog_exportimagefile.h \ - ../../app/scanner/dialog_fullscreen.h \ - ../../app/scanner/dialog_imageeditor.h \ - ../../app/scanner/dialog_imageinfo.h \ - ../../app/scanner/dialog_imgproc_adjust.h \ - ../../app/scanner/dialog_imgproc_autocrop.h \ - ../../app/scanner/dialog_insertindex.h \ - ../../app/scanner/dialog_logmanager.h \ - ../../app/scanner/dialog_moveto.h \ - ../../app/scanner/dialog_multirotate.h \ - ../../app/scanner/dialog_multirotateimagefile.h \ - ../../app/scanner/dialog_openimageindex.h \ - ../../app/scanner/dialog_passwordchange.h \ - ../../app/scanner/dialog_saveas.h \ - ../../app/scanner/dialog_writesettings.h \ - ../../app/scanner/gaosixy.h \ - ../../app/scanner/graphicsscene.h \ - ../../app/scanner/hg_settingdialog.h \ - ../../app/scanner/mainwindow.h \ - ../../app/scanner/sane_device.h \ - ../../app/scanner/setpicclrtool.h \ - ../../app/scanner/widget.h \ - ../../app/scanner/widget_imgproc_base.h \ - ../../app/scanner/widget_statusbar.h \ - ../../app/scanner/dialog_admin.h \ - ../../app/scanner/dialog_log.h \ - ../../app/scanner/config.h \ - ../../app/scanner/json.h \ - ../../app/scanner/cJSON.h \ - ../../app/scanner/HGImgThumb.h \ - ../../app/scanner/HGImgView.h \ - ../../app/scanner/HGUIGlobal.h \ - ../../utility/HGString.h \ - ../../app/scanner/dialog_input.h \ - ../../app/scanner/custom_file_dialog.h - -FORMS += \ - ../../app/scanner/cutdialog.ui \ - ../../app/scanner/cutpapertool.ui \ - ../../app/scanner/dialog_admin.ui \ - ../../app/scanner/dialog_aquireinto.ui \ - ../../app/scanner/dialog_clrcache.ui \ - ../../app/scanner/dialog_export.ui \ - ../../app/scanner/dialog_exportimagefile.ui \ - ../../app/scanner/dialog_fullscreen.ui \ - ../../app/scanner/dialog_imageeditor.ui \ - ../../app/scanner/dialog_imageinfo.ui \ - ../../app/scanner/dialog_imgproc_adjust.ui \ - ../../app/scanner/dialog_imgproc_autocrop.ui \ - ../../app/scanner/dialog_insertindex.ui \ - ../../app/scanner/dialog_logmanager.ui \ - ../../app/scanner/dialog_moveto.ui \ - ../../app/scanner/dialog_multirotate.ui \ - ../../app/scanner/dialog_multirotateimagefile.ui \ - ../../app/scanner/dialog_openimageindex.ui \ - ../../app/scanner/dialog_passwordchange.ui \ - ../../app/scanner/dialog_saveas.ui \ - ../../app/scanner/dialog_writesettings.ui \ - ../../app/scanner/mainwindow.ui \ - ../../app/scanner/setpicclrtool.ui \ - ../../app/scanner/widget.ui \ - ../../app/scanner/widget_imgproc_base.ui \ - ../../app/scanner/widget_statusbar.ui \ - ../../app/scanner/dialog_log.ui \ - ../../app/scanner/dialog_input.ui - -TRANSLATIONS += \ - ../../app/scanner/Scanner_zh_CN.ts \ - ../../app/scanner/qt_zh_CN.ts - -RESOURCES += \ - ../../app/scanner/Scanner_resource.qrc - -DISTFILES += \ - ../../app/scanner/Scanner_zh_CN.qm \ - ../../app/scanner/qt_zh_CN.qm diff --git a/build-qt/HGSolution/HGScanner/HGScanner.pro b/build-qt/HGSolution/HGScanner/HGScanner.pro new file mode 100644 index 00000000..1df777a2 --- /dev/null +++ b/build-qt/HGSolution/HGScanner/HGScanner.pro @@ -0,0 +1,251 @@ +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++11 + +# The following define makes your compiler emit warnings if you use +# any Qt feature that has been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# OEM definition +DEFINES += OEM_HUAGAO + +RC_ICONS = ../../../app/scanner/image_rsc/logo/logo.ico + +# You can also make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +TARGET = HuaGoScan + +win32 { + DEFINES += _CRT_SECURE_NO_WARNINGS + + contains(QT_ARCH, i386) { + LIBS += -L../../../../sdk/lib/win/x86/Release -lHGBase -lHGImgFmt -lHGImgProc -lsane + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/win/x86/Release/ + } + CONFIG(debug, debug|release) { + + } + } + else { + LIBS += -L../../../../sdk/lib/win/x64/Release -lHGBase -lHGImgFmt -lHGImgProc -lsane + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/win/x64/Release/ + } + CONFIG(debug, debug|release) { + + } + } +} + +unix { + DISTRIBUTION = $$system(cat /etc/issue | cut -d\' \' -f1) + message($$DISTRIBUTION) + ARCH = $$system(arch) + message($$ARCH) + + contains(DISTRIBUTION, UnionTech){ + message('UOS') + DEFINES += UOS + contains(ARCH, x86_64){ + LIBS += -L../../../../release/uos/x86_64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/uos/x86_64/ + } + CONFIG(debug, debug|release) { + + } + } + contains(ARCH, aarch64){ + LIBS += -L../../../../release/uos/aarch64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/uos/aarch64/ + } + CONFIG(debug, debug|release) { + + } + } + contains(ARCH, mips64){ + LIBS += -L../../../../release/uos/mips64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/uos/mips64/ + } + CONFIG(debug, debug|release) { + + } + } + }else{ + message('KYLIN') + DEFINES += KYLIN + contains(ARCH, x86_64){ + LIBS += -L../../../../release/kylin/x86_64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/kylin/x86_64/ + } + CONFIG(debug, debug|release) { + + } + } + contains(ARCH, aarch64){ + LIBS += -L../../../../release/kylin/aarch64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/kylin/aarch64/ + } + CONFIG(debug, debug|release) { + + } + } + contains(ARCH, mips64){ + LIBS += -L../../../../release/kylin/mips64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/kylin/mips64/ + } + CONFIG(debug, debug|release) { + + } + } + } +} + +INCLUDEPATH += $$PWD/../../../app/scanner/ +INCLUDEPATH += $$PWD/../../../utility/ +INCLUDEPATH += $$PWD/../../../modules/ +INCLUDEPATH += $$PWD/../../../../sdk/include/ + +SOURCES += \ + ../../../app/scanner/HGVersion.cpp \ + ../../../app/scanner/app_cfg.cpp \ + ../../../app/scanner/cutdialog.cpp \ + ../../../app/scanner/cutpapertool.cpp \ + ../../../app/scanner/device_menu.cpp \ + ../../../app/scanner/dialog_aquireinto.cpp \ + ../../../app/scanner/dialog_clrcache.cpp \ + ../../../app/scanner/dialog_export.cpp \ + ../../../app/scanner/dialog_exportimagefile.cpp \ + ../../../app/scanner/dialog_fullscreen.cpp \ + ../../../app/scanner/dialog_imageeditor.cpp \ + ../../../app/scanner/dialog_imageinfo.cpp \ + ../../../app/scanner/dialog_imgproc_adjust.cpp \ + ../../../app/scanner/dialog_imgproc_autocrop.cpp \ + ../../../app/scanner/dialog_insertindex.cpp \ + ../../../app/scanner/dialog_logmanager.cpp \ + ../../../app/scanner/dialog_moveto.cpp \ + ../../../app/scanner/dialog_multirotate.cpp \ + ../../../app/scanner/dialog_multirotateimagefile.cpp \ + ../../../app/scanner/dialog_openimageindex.cpp \ + ../../../app/scanner/dialog_passwordchange.cpp \ + ../../../app/scanner/dialog_saveas.cpp \ + ../../../app/scanner/dialog_writesettings.cpp \ + ../../../app/scanner/gaosixy.cpp \ + ../../../app/scanner/graphicsscene.cpp \ + ../../../app/scanner/hg_settingdialog.cpp \ + ../../../app/scanner/main.cpp \ + ../../../app/scanner/mainwindow.cpp \ + ../../../app/scanner/sane_device.cpp \ + ../../../app/scanner/setpicclrtool.cpp \ + ../../../app/scanner/widget.cpp \ + ../../../app/scanner/widget_imgproc_base.cpp \ + ../../../app/scanner/widget_statusbar.cpp \ + ../../../app/scanner/dialog_admin.cpp \ + ../../../app/scanner/dialog_log.cpp \ + ../../../app/scanner/config.cpp \ + ../../../app/scanner/json.cpp \ + ../../../app/scanner/cJSON.c \ + ../../../app/scanner/HGImgThumb.cpp \ + ../../../app/scanner/HGImgView.cpp \ + ../../../app/scanner/HGUIGlobal.cpp \ + ../../../utility/HGString.cpp \ + ../../../app/scanner/dialog_input.cpp + +HEADERS += \ + ../../../app/scanner/HGVersion.h \ + ../../../app/scanner/app_cfg.h \ + ../../../app/scanner/cutdialog.h \ + ../../../app/scanner/cutpapertool.h \ + ../../../app/scanner/device_menu.h \ + ../../../app/scanner/dialog_aquireinto.h \ + ../../../app/scanner/dialog_clrcache.h \ + ../../../app/scanner/dialog_export.h \ + ../../../app/scanner/dialog_exportimagefile.h \ + ../../../app/scanner/dialog_fullscreen.h \ + ../../../app/scanner/dialog_imageeditor.h \ + ../../../app/scanner/dialog_imageinfo.h \ + ../../../app/scanner/dialog_imgproc_adjust.h \ + ../../../app/scanner/dialog_imgproc_autocrop.h \ + ../../../app/scanner/dialog_insertindex.h \ + ../../../app/scanner/dialog_logmanager.h \ + ../../../app/scanner/dialog_moveto.h \ + ../../../app/scanner/dialog_multirotate.h \ + ../../../app/scanner/dialog_multirotateimagefile.h \ + ../../../app/scanner/dialog_openimageindex.h \ + ../../../app/scanner/dialog_passwordchange.h \ + ../../../app/scanner/dialog_saveas.h \ + ../../../app/scanner/dialog_writesettings.h \ + ../../../app/scanner/gaosixy.h \ + ../../../app/scanner/graphicsscene.h \ + ../../../app/scanner/hg_settingdialog.h \ + ../../../app/scanner/mainwindow.h \ + ../../../app/scanner/sane_device.h \ + ../../../app/scanner/setpicclrtool.h \ + ../../../app/scanner/widget.h \ + ../../../app/scanner/widget_imgproc_base.h \ + ../../../app/scanner/widget_statusbar.h \ + ../../../app/scanner/dialog_admin.h \ + ../../../app/scanner/dialog_log.h \ + ../../../app/scanner/config.h \ + ../../../app/scanner/json.h \ + ../../../app/scanner/cJSON.h \ + ../../../app/scanner/HGImgThumb.h \ + ../../../app/scanner/HGImgView.h \ + ../../../app/scanner/HGUIGlobal.h \ + ../../../utility/HGString.h \ + ../../../app/scanner/dialog_input.h \ + ../../../app/scanner/custom_file_dialog.h + +FORMS += \ + ../../../app/scanner/cutdialog.ui \ + ../../../app/scanner/cutpapertool.ui \ + ../../../app/scanner/dialog_admin.ui \ + ../../../app/scanner/dialog_aquireinto.ui \ + ../../../app/scanner/dialog_clrcache.ui \ + ../../../app/scanner/dialog_export.ui \ + ../../../app/scanner/dialog_exportimagefile.ui \ + ../../../app/scanner/dialog_fullscreen.ui \ + ../../../app/scanner/dialog_imageeditor.ui \ + ../../../app/scanner/dialog_imageinfo.ui \ + ../../../app/scanner/dialog_imgproc_adjust.ui \ + ../../../app/scanner/dialog_imgproc_autocrop.ui \ + ../../../app/scanner/dialog_insertindex.ui \ + ../../../app/scanner/dialog_logmanager.ui \ + ../../../app/scanner/dialog_moveto.ui \ + ../../../app/scanner/dialog_multirotate.ui \ + ../../../app/scanner/dialog_multirotateimagefile.ui \ + ../../../app/scanner/dialog_openimageindex.ui \ + ../../../app/scanner/dialog_passwordchange.ui \ + ../../../app/scanner/dialog_saveas.ui \ + ../../../app/scanner/dialog_writesettings.ui \ + ../../../app/scanner/mainwindow.ui \ + ../../../app/scanner/setpicclrtool.ui \ + ../../../app/scanner/widget.ui \ + ../../../app/scanner/widget_imgproc_base.ui \ + ../../../app/scanner/widget_statusbar.ui \ + ../../../app/scanner/dialog_log.ui \ + ../../../app/scanner/dialog_input.ui + +TRANSLATIONS += \ + ../../../app/scanner/Scanner_zh_CN.ts \ + ../../../app/scanner/qt_zh_CN.ts + +RESOURCES += \ + ../../../app/scanner/Scanner_resource.qrc + +DISTFILES += \ + ../../../app/scanner/Scanner_zh_CN.qm \ + ../../../app/scanner/qt_zh_CN.qm diff --git a/build-qt/HGSolution/HGSolution.pro b/build-qt/HGSolution/HGSolution.pro new file mode 100644 index 00000000..07d36517 --- /dev/null +++ b/build-qt/HGSolution/HGSolution.pro @@ -0,0 +1,5 @@ +TEMPLATE = subdirs + +SUBDIRS += \ + HGScanner \ + HGUpgrade \ No newline at end of file diff --git a/build-qt/HGSolution/HGUpgrade/HGUpgrade.pro b/build-qt/HGSolution/HGUpgrade/HGUpgrade.pro new file mode 100644 index 00000000..18f2ca8d --- /dev/null +++ b/build-qt/HGSolution/HGUpgrade/HGUpgrade.pro @@ -0,0 +1,123 @@ +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++11 + +# The following define makes your compiler emit warnings if you use +# any Qt feature that has been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# OEM definition +DEFINES += OEM_HUAGAO + +RC_ICONS = ../../../app/scanner/image_rsc/logo/logo.ico + +# You can also make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +TARGET = HuaGoScanUpgrade + +win32 { + DEFINES += _CRT_SECURE_NO_WARNINGS + + contains(QT_ARCH, i386) { + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/win/x86/Release/ + } + CONFIG(debug, debug|release) { + + } + } + else { + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/win/x64/Release/ + } + CONFIG(debug, debug|release) { + + } + } +} + +unix { + DISTRIBUTION = $$system(cat /etc/issue | cut -d\' \' -f1) + message($$DISTRIBUTION) + ARCH = $$system(arch) + message($$ARCH) + + contains(DISTRIBUTION, UnionTech){ + message('UOS') + DEFINES += UOS + contains(ARCH, x86_64){ + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/uos/x86_64/ + } + CONFIG(debug, debug|release) { + + } + } + contains(ARCH, aarch64){ + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/uos/aarch64/ + } + CONFIG(debug, debug|release) { + + } + } + contains(ARCH, mips64){ + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/uos/mips64/ + } + CONFIG(debug, debug|release) { + + } + } + }else{ + message('KYLIN') + DEFINES += KYLIN + contains(ARCH, x86_64){ + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/kylin/x86_64/ + } + CONFIG(debug, debug|release) { + + } + } + contains(ARCH, aarch64){ + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/kylin/aarch64/ + } + CONFIG(debug, debug|release) { + + } + } + contains(ARCH, mips64){ + CONFIG(release, debug|release) { + DESTDIR = ../../../../release/kylin/mips64/ + } + CONFIG(debug, debug|release) { + + } + } + } +} + +INCLUDEPATH += $$PWD/../../../app/upgrade/ +INCLUDEPATH += $$PWD/../../../utility/ +INCLUDEPATH += $$PWD/../../../modules/ + +SOURCES += \ + ../../../app/upgrade/HGUpgrade.cpp \ + ../../../app/upgrade/main.cpp \ + ../../../app/upgrade/mainwindow.cpp + +HEADERS += \ + ../../../app/upgrade/HGUpgrade.h \ + ../../../app/upgrade/mainwindow.h + +FORMS += \ + ../../../app/upgrade/mainwindow.ui diff --git a/build.bat b/build.bat index 4c8eeeaf..1282fae4 100644 --- a/build.bat +++ b/build.bat @@ -1,12 +1,23 @@ -MSBuild.exe ./build/windows/HGSolution.sln /p:Configuration=Release /p:Platform=x86 /t:Rebuild +MSBuild.exe ./build/windows/HGSolution.sln /p:Configuration=Release /p:Platform=x86 -cd /d ./build-qt/HGSolution/ +cd /d ./build-qt/HGSolution/HGScanner qmake -r -tp vc HGScanner.pro -MSBuild.exe HGScanner.vcxproj /p:Configuration=Release /p:Platform=x86 +MSBuild.exe HuaGoScan.vcxproj /p:Configuration=Release /p:Platform=x86 del /f /s /q *.h del /f /s /q .qmake.stash -del /f /s /q HGScanner_resource.rc -del /f /s /q HGScanner.vcxproj.filters -del /f /s /q HGScanner.vcxproj +del /f /s /q HuaGoScan_resource.rc +del /f /s /q HuaGoScan.vcxproj.filters +del /f /s /q HuaGoScan.vcxproj +rd /s /q debug +rd /s /q release + +cd /d ../HGUpgrade +qmake -r -tp vc HGUpgrade.pro +MSBuild.exe HuaGoScanUpgrade.vcxproj /p:Configuration=Release /p:Platform=x86 +del /f /s /q *.h +del /f /s /q .qmake.stash +del /f /s /q HuaGoScanUpgrade_resource.rc +del /f /s /q HuaGoScanUpgrade.vcxproj.filters +del /f /s /q HuaGoScanUpgrade.vcxproj rd /s /q debug rd /s /q release diff --git a/build/windows/HGSolution.sln b/build/windows/HGSolution.sln index 8e0b40c4..2c567381 100644 --- a/build/windows/HGSolution.sln +++ b/build/windows/HGSolution.sln @@ -45,13 +45,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HGTwainUser", "HGTwainUser\ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HGUpload", "HGUpload\HGUpload.vcxproj", "{FC39DAEA-2BB2-45AE-A7F3-F3879692A66B}" - ProjectSection(ProjectDependencies) = postProject - {F85F4457-1B42-46E7-BA86-F088D6D5994F} = {F85F4457-1B42-46E7-BA86-F088D6D5994F} - {EFAE5F69-A4C2-4A07-8BE6-68714D86BCE2} = {EFAE5F69-A4C2-4A07-8BE6-68714D86BCE2} - {4954F36B-A0A3-4550-9C4E-3B3D210F5CE4} = {4954F36B-A0A3-4550-9C4E-3B3D210F5CE4} - {5D85F2AC-FACD-436C-A67B-E13056DD0C03} = {5D85F2AC-FACD-436C-A67B-E13056DD0C03} - {4909ACEA-80FF-482E-9FA2-5E8534789A82} = {4909ACEA-80FF-482E-9FA2-5E8534789A82} - EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/sdk/webservice/ManagerV2.cpp b/sdk/webservice/ManagerV2.cpp index 32d97b7a..16eb2e14 100644 --- a/sdk/webservice/ManagerV2.cpp +++ b/sdk/webservice/ManagerV2.cpp @@ -2827,6 +2827,12 @@ namespace ver_2 return (HGBASE_ERR_OK == HGBase_SetProfileInt(cfgPath, app.c_str(), key.c_str(), (HGInt)val)); } + static int xferinfo(void* p, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) + { + HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "ulnow=%lld, ultotal=%lld", ulnow, ultotal); + return 0; + } + int ManagerV2::HttpUpload(const std::string& host, int port, const std::string& path, const std::string& filePath, const std::string& remoteFilePath) { @@ -2849,6 +2855,9 @@ namespace ver_2 curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); + curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, xferinfo); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0); + /* Perform the request, res will get the return code */ CURLcode res = curl_easy_perform(curl); /* Check for errors */ @@ -2925,9 +2934,6 @@ namespace ver_2 curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS, 1); - /* pass in that last of FTP commands to run after the transfer */ - //curl_easy_setopt(curl, CURLOPT_POSTQUOTE, headerlist); - /* now specify which file to upload */ curl_easy_setopt(curl, CURLOPT_READDATA, file); @@ -2937,6 +2943,9 @@ namespace ver_2 make sure that to pass in a type 'long' argument. */ curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)fsize); + curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, xferinfo); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0); + /* Now run off and do what you have been told! */ CURLcode res = curl_easy_perform(curl); /* Check for errors */