This commit is contained in:
gb 2022-07-23 09:33:02 +08:00
commit beefaad609
17 changed files with 692 additions and 332 deletions

Binary file not shown.

View File

@ -1544,42 +1544,64 @@ Please make sure the two passwords are the same.</source>
<translation></translation>
</message>
<message>
<location filename="dialog_upgrade.cpp" line="15"/>
<location filename="dialog_upgrade.cpp" line="17"/>
<source>upgrade online</source>
<translation></translation>
</message>
<message>
<location filename="dialog_upgrade.cpp" line="35"/>
<source>upgrade contents: </source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="dialog_upgrade.cpp" line="35"/>
<source> bug description: </source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="dialog_upgrade.cpp" line="52"/>
<location filename="dialog_upgrade.cpp" line="37"/>
<source>bug description:
</source>
<translation>
</translation>
</message>
<message>
<location filename="dialog_upgrade.cpp" line="41"/>
<location filename="dialog_upgrade.cpp" line="45"/>
<source>upgrade contents:
</source>
<translation>
</translation>
</message>
<message>
<location filename="dialog_upgrade.cpp" line="45"/>
<source>
bug description:
</source>
<translation>
</translation>
</message>
<message>
<location filename="dialog_upgrade.cpp" line="63"/>
<source>The current version is the latest! The current version number is : </source>
<translation></translation>
</message>
<message>
<location filename="dialog_upgrade.cpp" line="59"/>
<location filename="dialog_upgrade.cpp" line="69"/>
<source>Discover the new version : </source>
<translation></translation>
</message>
<message>
<location filename="dialog_upgrade.cpp" line="61"/>
<location filename="dialog_upgrade.cpp" line="71"/>
<source> ,the current version is : </source>
<translation> </translation>
</message>
<message>
<location filename="dialog_upgrade.cpp" line="98"/>
<location filename="dialog_upgrade.cpp" line="107"/>
<source>tip</source>
<translation></translation>
</message>
<message>
<location filename="dialog_upgrade.cpp" line="98"/>
<location filename="dialog_upgrade.cpp" line="107"/>
<source>Already in current version</source>
<translation></translation>
</message>
@ -2003,46 +2025,46 @@ Please make sure the two passwords are the same.</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="228"/>
<location filename="mainwindow.cpp" line="231"/>
<source>Grid</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="233"/>
<location filename="mainwindow.cpp" line="236"/>
<source>Move To...</source>
<translation>...</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="237"/>
<location filename="mainwindow.cpp" line="240"/>
<source>Insert files</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="263"/>
<location filename="mainwindow.cpp" line="264"/>
<location filename="mainwindow.cpp" line="265"/>
<location filename="mainwindow.cpp" line="266"/>
<location filename="mainwindow.cpp" line="267"/>
<location filename="mainwindow.cpp" line="268"/>
<source>nodevice</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="479"/>
<location filename="mainwindow.cpp" line="534"/>
<location filename="mainwindow.cpp" line="1373"/>
<location filename="mainwindow.cpp" line="1397"/>
<location filename="mainwindow.cpp" line="2124"/>
<location filename="mainwindow.cpp" line="2444"/>
<location filename="mainwindow.cpp" line="482"/>
<location filename="mainwindow.cpp" line="537"/>
<location filename="mainwindow.cpp" line="1476"/>
<location filename="mainwindow.cpp" line="1500"/>
<location filename="mainwindow.cpp" line="2227"/>
<location filename="mainwindow.cpp" line="2547"/>
<source>Question</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="480"/>
<location filename="mainwindow.cpp" line="1374"/>
<location filename="mainwindow.cpp" line="483"/>
<location filename="mainwindow.cpp" line="1477"/>
<source>modified, save it?</source>
<translation>
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="535"/>
<location filename="mainwindow.cpp" line="538"/>
<source>file lost, remove it?</source>
<translation></translation>
</message>
@ -2051,7 +2073,7 @@ Please make sure the two passwords are the same.</source>
<translation type="vanished"> </translation>
</message>
<message>
<location filename="mainwindow.cpp" line="765"/>
<location filename="mainwindow.cpp" line="768"/>
<source> disconnected</source>
<translation> </translation>
</message>
@ -2068,189 +2090,190 @@ Please make sure the two passwords are the same.</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1394"/>
<location filename="mainwindow.cpp" line="1497"/>
<source>Clear, then start scan</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1395"/>
<location filename="mainwindow.cpp" line="1498"/>
<source>Do NOT clear, then start scan</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1398"/>
<location filename="mainwindow.cpp" line="1501"/>
<source>Already exist images in image list.
Do you want to clear?</source>
<translation>
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1432"/>
<location filename="mainwindow.cpp" line="1535"/>
<source>Information</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1433"/>
<location filename="mainwindow.cpp" line="1536"/>
<source>Insufficient disk space</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1619"/>
<location filename="mainwindow.cpp" line="1722"/>
<source>Open images</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1630"/>
<location filename="mainwindow.cpp" line="1733"/>
<source>Insert images</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1804"/>
<location filename="mainwindow.cpp" line="1809"/>
<location filename="mainwindow.cpp" line="1864"/>
<location filename="mainwindow.cpp" line="1940"/>
<location filename="mainwindow.cpp" line="1945"/>
<location filename="mainwindow.cpp" line="1907"/>
<location filename="mainwindow.cpp" line="1912"/>
<location filename="mainwindow.cpp" line="1967"/>
<location filename="mainwindow.cpp" line="2043"/>
<location filename="mainwindow.cpp" line="2048"/>
<source>info</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1804"/>
<location filename="mainwindow.cpp" line="1864"/>
<location filename="mainwindow.cpp" line="1940"/>
<location filename="mainwindow.cpp" line="1907"/>
<location filename="mainwindow.cpp" line="1967"/>
<location filename="mainwindow.cpp" line="2043"/>
<source>save failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1809"/>
<location filename="mainwindow.cpp" line="1945"/>
<location filename="mainwindow.cpp" line="1912"/>
<location filename="mainwindow.cpp" line="2048"/>
<source>find savePath in thumbnail</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2029"/>
<location filename="mainwindow.cpp" line="2132"/>
<source>File name</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2029"/>
<location filename="mainwindow.cpp" line="2132"/>
<source>File path</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2029"/>
<location filename="mainwindow.cpp" line="2132"/>
<source>File size</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2029"/>
<location filename="mainwindow.cpp" line="2132"/>
<source>Creation date/time</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2029"/>
<location filename="mainwindow.cpp" line="2132"/>
<source>Modified date/time</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2029"/>
<location filename="mainwindow.cpp" line="2132"/>
<source>Accessed date/time</source>
<translation>访</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2072"/>
<location filename="mainwindow.cpp" line="2175"/>
<source>Format</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2072"/>
<location filename="mainwindow.cpp" line="2175"/>
<source>Width</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2072"/>
<location filename="mainwindow.cpp" line="2175"/>
<source>Height</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2072"/>
<location filename="mainwindow.cpp" line="2175"/>
<source>depth</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2072"/>
<location filename="mainwindow.cpp" line="2175"/>
<source>Color model</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2072"/>
<location filename="mainwindow.cpp" line="2175"/>
<source>DPI</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2072"/>
<location filename="mainwindow.cpp" line="2175"/>
<source>Print size</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2072"/>
<location filename="mainwindow.cpp" line="2175"/>
<source>Frame</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2080"/>
<location filename="mainwindow.cpp" line="2183"/>
<source>None</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2080"/>
<location filename="mainwindow.cpp" line="2183"/>
<source>Mono</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2080"/>
<location filename="mainwindow.cpp" line="2183"/>
<source>Gray</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2080"/>
<location filename="mainwindow.cpp" line="2183"/>
<source>Color</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2101"/>
<location filename="mainwindow.cpp" line="2204"/>
<source>Warning</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2101"/>
<location filename="mainwindow.cpp" line="2204"/>
<source>Device is Running!
Please finish scanning first.</source>
<translation>
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3112"/>
<location filename="mainwindow.cpp" line="3215"/>
<source>Are you sure to close </source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3112"/>
<location filename="mainwindow.cpp" line="3215"/>
<source> ?</source>
<translation>?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3121"/>
<location filename="mainwindow.cpp" line="3122"/>
<location filename="mainwindow.cpp" line="3224"/>
<location filename="mainwindow.cpp" line="3225"/>
<source>close </source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3159"/>
<location filename="mainwindow.cpp" line="1206"/>
<location filename="mainwindow.cpp" line="3315"/>
<source>error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3159"/>
<location filename="mainwindow.cpp" line="3315"/>
<source>get versionlist failed</source>
<translation></translation>
</message>
@ -2261,115 +2284,115 @@ Continue to close?</source>
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2445"/>
<location filename="mainwindow.cpp" line="2548"/>
<source>Sure to sign out administrator account?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2566"/>
<location filename="mainwindow.cpp" line="2669"/>
<source>confirm the operation</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2567"/>
<location filename="mainwindow.cpp" line="2670"/>
<source>Are you sure to clear the rollor acount?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2583"/>
<location filename="mainwindow.cpp" line="2686"/>
<source>Please re-enter the Abount screen to obtain the latest value</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2628"/>
<location filename="mainwindow.cpp" line="2731"/>
<source>&lt;p&gt;%1: &lt;a href=&apos;%2&apos;&gt;%3&lt;/a&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2630"/>
<location filename="mainwindow.cpp" line="2733"/>
<source>&lt;p&gt;%1: %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2632"/>
<location filename="mainwindow.cpp" line="2735"/>
<source>roller number</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2982"/>
<location filename="mainwindow.cpp" line="3085"/>
<source>open scanner </source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2983"/>
<location filename="mainwindow.cpp" line="3046"/>
<location filename="mainwindow.cpp" line="3086"/>
<location filename="mainwindow.cpp" line="3149"/>
<source>app name</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2988"/>
<location filename="mainwindow.cpp" line="3085"/>
<location filename="mainwindow.cpp" line="3091"/>
<location filename="mainwindow.cpp" line="3188"/>
<source>success</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2997"/>
<location filename="mainwindow.cpp" line="3100"/>
<source>apply setting </source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2997"/>
<location filename="mainwindow.cpp" line="3100"/>
<source> success</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2997"/>
<location filename="mainwindow.cpp" line="3100"/>
<source> failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3015"/>
<location filename="mainwindow.cpp" line="3100"/>
<location filename="mainwindow.cpp" line="3118"/>
<location filename="mainwindow.cpp" line="3203"/>
<source>failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3038"/>
<location filename="mainwindow.cpp" line="3141"/>
<source>warning</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3038"/>
<location filename="mainwindow.cpp" line="3141"/>
<source>the disk space in the current path is unsufficient, please select a new path or clear the disk space in time.</source>
<translation>,
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3054"/>
<location filename="mainwindow.cpp" line="3157"/>
<source>lost config</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3081"/>
<location filename="mainwindow.cpp" line="3184"/>
<source>apply setting</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1052"/>
<location filename="mainwindow.cpp" line="1053"/>
<location filename="mainwindow.cpp" line="1054"/>
<location filename="mainwindow.cpp" line="2718"/>
<location filename="mainwindow.cpp" line="2719"/>
<location filename="mainwindow.cpp" line="2720"/>
<location filename="mainwindow.cpp" line="2766"/>
<location filename="mainwindow.cpp" line="2767"/>
<location filename="mainwindow.cpp" line="2768"/>
<location filename="mainwindow.cpp" line="2829"/>
<location filename="mainwindow.cpp" line="2830"/>
<location filename="mainwindow.cpp" line="2831"/>
<location filename="mainwindow.cpp" line="2892"/>
<location filename="mainwindow.cpp" line="2893"/>
<location filename="mainwindow.cpp" line="2894"/>
<location filename="mainwindow.cpp" line="1055"/>
<location filename="mainwindow.cpp" line="1056"/>
<location filename="mainwindow.cpp" line="1057"/>
<location filename="mainwindow.cpp" line="2821"/>
<location filename="mainwindow.cpp" line="2822"/>
<location filename="mainwindow.cpp" line="2823"/>
<location filename="mainwindow.cpp" line="2869"/>
<location filename="mainwindow.cpp" line="2870"/>
<location filename="mainwindow.cpp" line="2871"/>
<location filename="mainwindow.cpp" line="2932"/>
<location filename="mainwindow.cpp" line="2933"/>
<location filename="mainwindow.cpp" line="2934"/>
<location filename="mainwindow.cpp" line="2995"/>
<location filename="mainwindow.cpp" line="2996"/>
<location filename="mainwindow.cpp" line="2997"/>
<source>start failed</source>
<translation></translation>
</message>
@ -2384,135 +2407,141 @@ Continue to close?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="284"/>
<location filename="mainwindow.cpp" line="287"/>
<source>auto save</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="285"/>
<location filename="mainwindow.cpp" line="288"/>
<source>when switching pictures, save the edited pictures directly without reminding</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="437"/>
<location filename="mainwindow.cpp" line="440"/>
<source>enabling automatic saving</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="441"/>
<location filename="mainwindow.cpp" line="444"/>
<source>cancel auto save</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="474"/>
<location filename="mainwindow.cpp" line="477"/>
<source>Automatically save the edited the edited iamge when switching pictures. To cancel, uncheck the menu item: image-&gt; automatically save</source>
<translation>-&gt;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="482"/>
<location filename="mainwindow.cpp" line="537"/>
<location filename="mainwindow.cpp" line="1376"/>
<location filename="mainwindow.cpp" line="1434"/>
<location filename="mainwindow.cpp" line="2127"/>
<location filename="mainwindow.cpp" line="2141"/>
<location filename="mainwindow.cpp" line="2446"/>
<location filename="mainwindow.cpp" line="2500"/>
<location filename="mainwindow.cpp" line="2569"/>
<location filename="mainwindow.cpp" line="3114"/>
<location filename="mainwindow.cpp" line="485"/>
<location filename="mainwindow.cpp" line="540"/>
<location filename="mainwindow.cpp" line="1209"/>
<location filename="mainwindow.cpp" line="1479"/>
<location filename="mainwindow.cpp" line="1537"/>
<location filename="mainwindow.cpp" line="2230"/>
<location filename="mainwindow.cpp" line="2244"/>
<location filename="mainwindow.cpp" line="2549"/>
<location filename="mainwindow.cpp" line="2603"/>
<location filename="mainwindow.cpp" line="2672"/>
<location filename="mainwindow.cpp" line="3217"/>
<source>yes</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="483"/>
<location filename="mainwindow.cpp" line="486"/>
<source>save, do not remind again</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="484"/>
<location filename="mainwindow.cpp" line="538"/>
<location filename="mainwindow.cpp" line="1377"/>
<location filename="mainwindow.cpp" line="2128"/>
<location filename="mainwindow.cpp" line="2142"/>
<location filename="mainwindow.cpp" line="2447"/>
<location filename="mainwindow.cpp" line="2501"/>
<location filename="mainwindow.cpp" line="2570"/>
<location filename="mainwindow.cpp" line="3115"/>
<location filename="mainwindow.cpp" line="487"/>
<location filename="mainwindow.cpp" line="541"/>
<location filename="mainwindow.cpp" line="1480"/>
<location filename="mainwindow.cpp" line="2231"/>
<location filename="mainwindow.cpp" line="2245"/>
<location filename="mainwindow.cpp" line="2550"/>
<location filename="mainwindow.cpp" line="2604"/>
<location filename="mainwindow.cpp" line="2673"/>
<location filename="mainwindow.cpp" line="3218"/>
<source>no</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="717"/>
<location filename="mainwindow.cpp" line="720"/>
<source>found device </source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="727"/>
<location filename="mainwindow.cpp" line="730"/>
<source> reconnected</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="729"/>
<location filename="mainwindow.cpp" line="732"/>
<source>already connected, but open faild</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="845"/>
<location filename="mainwindow.cpp" line="944"/>
<location filename="mainwindow.cpp" line="848"/>
<location filename="mainwindow.cpp" line="947"/>
<source>%1%2%3.%4</source>
<translation>%1%2%3.%4</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2125"/>
<location filename="mainwindow.cpp" line="1207"/>
<source>start failed!</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2228"/>
<source>There are pictures that have not been saved.
Are you sure to close?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2138"/>
<location filename="mainwindow.cpp" line="2241"/>
<source>tips</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2139"/>
<location filename="mainwindow.cpp" line="2242"/>
<source>Are you sure to close?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2497"/>
<location filename="mainwindow.cpp" line="2600"/>
<source>confirm operation</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2498"/>
<location filename="mainwindow.cpp" line="2601"/>
<source>are you sure to clear the roller count?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2510"/>
<location filename="mainwindow.cpp" line="2512"/>
<location filename="mainwindow.cpp" line="2588"/>
<location filename="mainwindow.cpp" line="2613"/>
<location filename="mainwindow.cpp" line="2615"/>
<location filename="mainwindow.cpp" line="2691"/>
<source>hint</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2510"/>
<location filename="mainwindow.cpp" line="2580"/>
<location filename="mainwindow.cpp" line="2613"/>
<location filename="mainwindow.cpp" line="2683"/>
<source>Roller scanned count has been set to 0.</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2512"/>
<location filename="mainwindow.cpp" line="2586"/>
<location filename="mainwindow.cpp" line="2615"/>
<location filename="mainwindow.cpp" line="2689"/>
<source>Roller scanned count reset failed.</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2555"/>
<location filename="mainwindow.cpp" line="2658"/>
<source>Error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2555"/>
<location filename="mainwindow.cpp" line="2658"/>
<source>Document missing! It would be deleted or renamed.</source>
<translation></translation>
</message>
@ -2545,28 +2574,28 @@ Are you sure to close?</source>
<translation type="vanished">&lt;br&gt;: &lt;a href=&apos;https://j.map.baidu.com/7e/1TO&apos;&gt;百度地图访问&lt;/a&gt;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2606"/>
<location filename="mainwindow.cpp" line="2709"/>
<source>About %1</source>
<translation> %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2607"/>
<location filename="mainwindow.cpp" line="2710"/>
<source>&lt;p&gt;%1&lt;/p&gt;&lt;p&gt;Version: %2&lt;br&gt;CopyRight: &amp;#169; %3&lt;/p&gt;&lt;p&gt;%4%5%6%7%8%9&lt;/p&gt;</source>
<translation>&lt;p&gt;%1&lt;/p&gt;&lt;p&gt;: %2&lt;br&gt;: &amp;#169; %3&lt;/p&gt;&lt;p&gt;%4%5%6%7%8%9&lt;/p&gt;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2622"/>
<location filename="mainwindow.cpp" line="2725"/>
<source>about %1</source>
<translation> %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2623"/>
<location filename="mainwindow.cpp" line="2726"/>
<source>&lt;p&gt;Version: %1&lt;/p&gt;</source>
<oldsource>&lt;p&gt;: %1&lt;/p&gt;</oldsource>
<translation>&lt;p&gt; %1&lt;/p&gt;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2624"/>
<location filename="mainwindow.cpp" line="2727"/>
<source>&lt;p&gt;CopyRight: &amp;#169; %1&lt;/p&gt;</source>
<oldsource>&lt;p&gt;: &amp;#169; %1&lt;/p&gt;</oldsource>
<translation>&lt;p&gt; &amp;#169; %1&lt;/p&gt;</translation>
@ -2580,6 +2609,13 @@ Are you sure to close?</source>
<translation type="vanished">&lt;p&gt;%1: %2&lt;/p&gt;</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<source>error</source>
<translation type="obsolete"></translation>
</message>
</context>
<context>
<name>Widget</name>
<message>

View File

@ -169,6 +169,7 @@ HGResult VersionDll::Free()
m_mgr = NULL;
HGBase_DestroyDll(m_dll);
m_dll = NULL;
return HGBASE_ERR_OK;
}
HGBool VersionDll::IsValid()

View File

@ -28,7 +28,23 @@ Dialog_upgrade::Dialog_upgrade(class VersionDll *versionDll, HGVersionInfo *vers
{
QListWidgetItem *listwidgetItem = new QListWidgetItem;
listwidgetItem->setText(QString(m_versionInfo[i].version));
listwidgetItem->setToolTip(tr("upgrade contents: ") + m_versionInfo[i].desc + tr(" bug description: ") + m_versionInfo[i].bugInfo);
std::string desc = m_versionInfo[i].desc;
std::string bugInfo = m_versionInfo[i].bugInfo;
if(desc.empty() && !bugInfo.empty())
{
listwidgetItem->setToolTip(tr("bug description: \n") + m_versionInfo[i].bugInfo);
}
if(!desc.empty() && bugInfo.empty())
{
listwidgetItem->setToolTip(tr("upgrade contents: \n") + m_versionInfo[i].desc);
}
if(!desc.empty() && !bugInfo.empty())
{
listwidgetItem->setToolTip(tr("upgrade contents: \n") + m_versionInfo[i].desc + tr("\nbug description: \n") + m_versionInfo[i].bugInfo);
}
ui->listWidget->addItem(listwidgetItem);
}

View File

@ -1097,84 +1097,6 @@ void MainWindow::on_statusInfoDblClick()
m_dialogLog->show();
}
void MainWindow::on_upgradeApp(QString pkgPath)
{
QString curPath = QDir::currentPath();
QString tmpPath = QDir::tempPath();
QFile file(curPath);
#if defined(HG_CMP_MSC)
#if defined(OEM_HANWANG)
file.copy("HwUpgradeApp.exe", tmpPath + "/HwUpgradeApp.exe");
file.copy("HwBase.dll", tmpPath + "/HwBase.dll");
file.copy("HwVersion.dll", tmpPath + "/HwVersion.dll");
#elif defined(OEM_LISICHENG)
file.copy("LscUpgradeApp.exe", tmpPath + "/LscUpgradeApp.exe");
file.copy("LscBase.dll", tmpPath + "/LscBase.dll");
file.copy("LscVersion.dll", tmpPath + "/LscVersion.dll");
#else
file.copy("HGUpgradeApp.exe", tmpPath + "/HGUpgradeApp.exe");
file.copy("HGBase.dll", tmpPath + "/HGBase.dll");
file.copy("HGVersion.dll", tmpPath + "/HGVersion.dll");
#endif
file.copy("msvcp140.dll", tmpPath + "/msvcp140.dll");
file.copy("Qt5Core.dll", tmpPath + "/Qt5Core.dll");
file.copy("Qt5Gui.dll", tmpPath + "/Qt5Gui.dll");
file.copy("Qt5Widgets.dll", tmpPath + "/Qt5Widgets.dll");
file.copy("vcruntime140.dll", tmpPath + "/vcruntime140.dll");
QDir dir;
dir.mkdir(tmpPath + "/platforms");
file.copy("platforms/qwindows.dll", tmpPath + "/platforms/qwindows.dll");
dir.mkdir(tmpPath + "/imageformats");
file.copy("imageformats/qgif.dll", tmpPath + "/imageformats/qgif.dll");
#else
#if defined(OEM_HANWANG)
file.copy("HwUpgradeApp", tmpPath + "/HwUpgradeApp");
file.copy("libHwBase.so", tmpPath + "/libHwBase.so");
file.copy("libHwVersion.so", tmpPath + "/libHwVersion.so");
#elif defined(OEM_LISICHENG)
file.copy("LscUpgradeApp", tmpPath + "/LscUpgradeApp");
file.copy("libLscBase.so", tmpPath + "/libLscBase.so");
file.copy("libLscVersion.so", tmpPath + "/libLscVersion.so");
#else
file.copy("HGUpgradeApp", tmpPath + "/HGUpgradeApp");
file.copy("libHGBase.so", tmpPath + "/libHGBase.so");
file.copy("libHGVersion.so", tmpPath + "/libHGVersion.so");
#endif
#endif
QProcess proc;
QStringList argList;
argList.push_back(QString("-appName=%1").arg(HGVERSION_APPNAME_SCANNER));
argList.push_back(QString("-pkgpath=%1").arg(pkgPath.toStdString().c_str()));
argList.push_back(QString("-type=%1").arg("upgrade"));
#if defined(HG_CMP_MSC)
#if defined(OEM_HANWANG)
proc.startDetached(tmpPath + "/HwUpgradeApp.exe", argList);
#elif defined(OEM_LISICHENG)
proc.startDetached(tmpPath + "/LscUpgradeApp.exe", argList);
#else
proc.startDetached(tmpPath + "/HGUpgradeApp.exe", argList);
#endif
#else
#if defined(OEM_HANWANG)
proc.startDetached(tmpPath + "/HwUpgradeApp", argList);
#elif defined(OEM_LISICHENG)
proc.startDetached(tmpPath + "/LscUpgradeApp", argList);
#else
proc.startDetached(tmpPath + "/HGUpgradeApp", argList);
#endif
#endif
m_closeTip = false;
close();
}
void MainWindow::on_act_thumbnailBar_triggered(bool checked)
{
ui->dockWidget->setVisible(checked);
@ -3108,6 +3030,118 @@ bool MainWindow::judgeDiskSpace(QString currentPath)
return true;
}
void MainWindow::upgradeApp(QString pkgPath)
{
QString curPath = QDir::currentPath();
QString tmpPath = QDir::tempPath();
#if defined(HG_CMP_MSC)
#if defined(OEM_HANWANG)
QFile::remove(tmpPath + "/HwUpgradeApp.exe");
QFile::copy(curPath + "/HwUpgradeApp.exe", tmpPath + "/HwUpgradeApp.exe");
QFile::remove(tmpPath + "/HwBase.dll");
QFile::copy(curPath + "/HwBase.dll", tmpPath + "/HwBase.dll");
QFile::remove(tmpPath + "/HwVersion.dll");
QFile::copy(curPath + "/HwVersion.dll", tmpPath + "/HwVersion.dll");
#elif defined(OEM_LISICHENG)
QFile::remove(tmpPath + "/LscUpgradeApp.exe");
QFile::copy(curPath + "/LscUpgradeApp.exe", tmpPath + "/LscUpgradeApp.exe");
QFile::remove(tmpPath + "/LscBase.dll");
QFile::copy(curPath + "/LscBase.dll", tmpPath + "/LscBase.dll");
QFile::remove(tmpPath + "/LscVersion.dll");
QFile::copy(curPath + "/LscVersion.dll", tmpPath + "/LscVersion.dll");
#else
QFile::remove(tmpPath + "/HGUpgradeApp.exe");
QFile::copy(curPath + "/HGUpgradeApp.exe", tmpPath + "/HGUpgradeApp.exe");
QFile::remove(tmpPath + "/HGBase.dll");
QFile::copy(curPath + "/HGBase.dll", tmpPath + "/HGBase.dll");
QFile::remove(tmpPath + "/HGVersion.dll");
QFile::copy(curPath + "/HGVersion.dll", tmpPath + "/HGVersion.dll");
#endif
QFile::remove(tmpPath + "/msvcp140.dll");
QFile::copy(curPath + "/msvcp140.dll", tmpPath + "/msvcp140.dll");
QFile::remove(tmpPath + "/Qt5Core.dll");
QFile::copy(curPath + "/Qt5Core.dll", tmpPath + "/Qt5Core.dll");
QFile::remove(tmpPath + "/Qt5Gui.dll");
QFile::copy(curPath + "/Qt5Gui.dll", tmpPath + "/Qt5Gui.dll");
QFile::remove(tmpPath + "/Qt5Widgets.dll");
QFile::copy(curPath + "/Qt5Widgets.dll", tmpPath + "/Qt5Widgets.dll");
QFile::remove(tmpPath + "/vcruntime140.dll");
QFile::copy(curPath + "/vcruntime140.dll", tmpPath + "/vcruntime140.dll");
QDir dir;
dir.mkdir(tmpPath + "/platforms");
QFile::remove(tmpPath + "/platforms/qwindows.dll");
QFile::copy(curPath + "/platforms/qwindows.dll", tmpPath + "/platforms/qwindows.dll");
dir.mkdir(tmpPath + "/imageformats");
QFile::remove(tmpPath + "/imageformats/qgif.dll");
QFile::copy(curPath + "/imageformats/qgif.dll", tmpPath + "/imageformats/qgif.dll");
#else
#if defined(OEM_HANWANG)
QFile::remove(tmpPath + "/HwUpgradeApp");
QFile::copy(curPath + "/HwUpgradeApp", tmpPath + "/HwUpgradeApp");
QFile::remove(tmpPath + "/libHwBase.so");
QFile::copy(curPath + "/libHwBase.so", tmpPath + "/libHwBase.so");
QFile::remove(tmpPath + "/libHwVersion.so");
QFile::copy(curPath + "/libHwVersion.so", tmpPath + "/libHwVersion.so");
#elif defined(OEM_LISICHENG)
QFile::remove(tmpPath + "/LscUpgradeApp");
QFile::copy(curPath + "/LscUpgradeApp", tmpPath + "/LscUpgradeApp");
QFile::remove(tmpPath + "/libLscBase.so");
QFile::copy(curPath + "/libLscBase.so", tmpPath + "/libLscBase.so");
QFile::remove(tmpPath + "/libLscVersion.so");
QFile::copy(curPath + "/libLscVersion.so", tmpPath + "/libLscVersion.so");
#else
QFile::remove(tmpPath + "/HGUpgradeApp");
QFile::copy(curPath + "/HGUpgradeApp", tmpPath + "/HGUpgradeApp");
QFile::remove(tmpPath + "/libHGBase.so");
QFile::copy(curPath + "/libHGBase.so", tmpPath + "/libHGBase.so");
QFile::remove(tmpPath + "/libHGVersion.so");
QFile::copy(curPath + "/libHGVersion.so", tmpPath + "/libHGVersion.so");
#endif
#endif
QProcess proc;
bool isSuccessdStart = false;
QStringList argList;
argList.push_back(QString("-appName=%1").arg(HGVERSION_APPNAME_SCANNER));
argList.push_back(QString("-pkgpath=%1").arg(pkgPath.toStdString().c_str()));
argList.push_back(QString("-type=%1").arg("upgrade"));
#if defined(HG_CMP_MSC)
#if defined(OEM_HANWANG)
isSuccessdStart = proc.startDetached(tmpPath + "/HwUpgradeApp.exe", argList);
#elif defined(OEM_LISICHENG)
isSuccessdStart = proc.startDetached(tmpPath + "/LscUpgradeApp.exe", argList);
#else
isSuccessdStart = proc.startDetached(tmpPath + "/HGUpgradeApp.exe", argList);
#endif
#else
#if defined(OEM_HANWANG)
isSuccessdStart = proc.startDetached(tmpPath + "/HwUpgradeApp", argList);
#elif defined(OEM_LISICHENG)
isSuccessdStart = proc.startDetached(tmpPath + "/LscUpgradeApp", argList);
#else
isSuccessdStart = proc.startDetached(tmpPath + "/HGUpgradeApp", argList);
#endif
#endif
if (isSuccessdStart)
{
m_closeTip = false;
close();
}
else
{
QMessageBox msg(QMessageBox::Critical, tr("error"),
tr("start failed!"),
QMessageBox::Ok, this);
msg.setButtonText(QMessageBox::Ok, tr("yes"));
msg.exec();
}
}
void MainWindow::on_scanOptions_changed(const QString &device, const QString &option, bool checked_now)
{
QString title(tr("app name"));
@ -3234,10 +3268,15 @@ void MainWindow::on_actionact_update_triggered()
assert(!url.isEmpty() && !md5.isEmpty());
HGChar suffix[64];
HGBase_GetFileSuffix(url.toStdString().c_str(), suffix, 64);
HGChar savePath[512];
HGBase_GetConfigPath(savePath, 512);
HGBase_CreateDir(savePath);
strcat(savePath, (versionNum + QString("%1").arg(".exe")).toLatin1().data());
HGChar fileName[128];
sprintf(fileName, "%s.%s", versionNum.toStdString().c_str(), suffix);
strcat(savePath, fileName);
QFile saveFile(savePath);
saveFile.open(QFile::ReadOnly);
@ -3259,13 +3298,13 @@ void MainWindow::on_actionact_update_triggered()
if (md5 == md5_2)
{
on_upgradeApp(savePath);
upgradeApp(savePath);
}
}
}
else
{
on_upgradeApp(savePath);
upgradeApp(savePath);
}
}
}

View File

@ -122,7 +122,6 @@ private slots:
void on_continueScan();
void on_stopScan();
void on_statusInfoDblClick();
void on_upgradeApp(QString pkgPath);
void on_act_thumbnailBar_triggered(bool checked);
@ -229,6 +228,7 @@ private:
QString passwordDecrypt(const QString& transcode);
bool open_scanner(const QString& name, OPTSCHEME* schm);
bool judgeDiskSpace(QString currentPath);
void upgradeApp(QString pkgPath);
private:
Ui::MainWindow *ui;

View File

@ -1236,14 +1236,6 @@ Please make sure the two passwords are the same.</source>
<source>upgrade online</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>upgrade contents: </source>
<translation type="unfinished"></translation>
</message>
<message>
<source> bug description: </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The current version is the latest! The current version number is : </source>
<translation type="unfinished"></translation>
@ -1264,6 +1256,22 @@ Please make sure the two passwords are the same.</source>
<source>Already in current version</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>bug description:
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>upgrade contents:
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>
bug description:
</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>GraphicsScene</name>
@ -1983,6 +1991,10 @@ Are you sure to close?</source>
<source>act_feedback</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>start failed!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Phonon::</name>

View File

@ -80,6 +80,7 @@ bool AppIsRun(const std::string& appName)
std::string cmd;
std::string appPath;
#if defined (UOS)
#if defined(OEM_HANWANG)
cmd = "ps -wef | grep HanvonScan";
appPath = "/opt/apps/com.hanvonchina.hanvonscan/files/bin/HanvonScan";
@ -90,6 +91,18 @@ bool AppIsRun(const std::string& appName)
cmd = "ps -wef | grep HuaGoScan";
appPath = "/opt/apps/com.huagaochina.huagoscan/files/bin/HuaGoScan";
#endif
#else
#if defined(OEM_HANWANG)
cmd = "ps -wef | grep HanvonScan";
appPath = "/opt/apps/scanner-driver-hanvon/HanvonScan";
#elif defined(OEM_LISICHENG)
cmd = "ps -wef | grep LanxumScan";
appPath = "/opt/apps/scanner-driver-lanxum/LanxumScan";
#else
cmd = "ps -wef | grep HuaGoScan";
appPath = "/opt/apps/scanner-driver-huagao/HuaGoScan";
#endif
#endif
bool ret = false;
FILE *fp = popen(cmd.c_str(), "r");
@ -116,36 +129,6 @@ bool AppIsRun(const std::string& appName)
return false;
}
bool Upgrade(const std::string& pkgPath)
{
bool ret = false;
#if defined(HG_CMP_MSC)
PROCESS_INFORMATION ProcessInfo;
STARTUPINFOA StartupInfo;
ZeroMemory(&StartupInfo, sizeof(StartupInfo));
StartupInfo.cb = sizeof(StartupInfo);
char command[256];
sprintf(command, "%s %s", pkgPath.c_str(), "/verysilent");
if (CreateProcessA(nullptr, command, nullptr, nullptr, FALSE, 0, nullptr, nullptr, &StartupInfo, &ProcessInfo))
{
WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
CloseHandle(ProcessInfo.hThread);
CloseHandle(ProcessInfo.hProcess);
ret = true;
}
#else
std::string cmd = "dpkg -i \"" + pkgPath + "\"";
if (0 == system(cmd.c_str()))
ret = true;
#endif
return ret;
}
void RunApp(const std::string& appName)
{
if (appName == HGVERSION_APPNAME_SCANNER)
@ -184,6 +167,7 @@ void RunApp(const std::string& appName)
#else
std::string appPath;
#if defined (UOS)
#if defined(OEM_HANWANG)
appPath = "sh /opt/apps/com.hanvonchina.hanvonscan/files/bin/HanvonScan.sh &";
#elif defined(OEM_LISICHENG)
@ -191,6 +175,15 @@ void RunApp(const std::string& appName)
#else
appPath = "sh /opt/apps/com.huagaochina.huagoscan/files/bin/HuaGoScan.sh &";
#endif
#else
#if defined(OEM_HANWANG)
appPath = "sh /opt/apps/scanner-driver-hanvon/HanvonScan.sh &";
#elif defined(OEM_LISICHENG)
appPath = "sh /opt/apps/scanner-driver-lanxum/LanxumScan.sh &";
#else
appPath = "sh /opt/apps/scanner-driver-huagao/HuaGoScan.sh &";
#endif
#endif
system(appPath.c_str());

View File

@ -6,9 +6,6 @@
// 判断app是否在运行
bool AppIsRun(const std::string& appName);
// 升级安装, 使用之前的安装路径
bool Upgrade(const std::string& pkgPath);
// 运行app
void RunApp(const std::string& appName);

Binary file not shown.

View File

@ -19,14 +19,43 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="16"/>
<location filename="mainwindow.cpp" line="23"/>
<source>Installation</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="19"/>
<location filename="mainwindow.cpp" line="26"/>
<source>Installation in progress, please wait...</source>
<translation>...</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="main.cpp" line="71"/>
<source>tip</source>
<translation></translation>
</message>
<message>
<location filename="main.cpp" line="72"/>
<source>install succeed!</source>
<translation></translation>
</message>
<message>
<location filename="main.cpp" line="74"/>
<location filename="main.cpp" line="85"/>
<source>yes</source>
<translation></translation>
</message>
<message>
<location filename="main.cpp" line="82"/>
<source>error</source>
<translation></translation>
</message>
<message>
<location filename="main.cpp" line="83"/>
<source>install failed!</source>
<translation></translation>
</message>
</context>
</TS>

View File

@ -4,6 +4,7 @@
#include <QThread>
#include <QScreen>
#include <QTranslator>
#include <QMessageBox>
#include "version/HGVersion.h"
#include "HGUpgrade.h"
@ -65,9 +66,26 @@ int main(int argc, char *argv[])
w.show();
a.exec();
if (w.isInstallSuccess())
{
QMessageBox msg(QMessageBox::Information, QObject::tr("tip"),
QObject::tr("install succeed!"),
QMessageBox::Ok);
msg.setButtonText(QMessageBox::Ok, QObject::tr("yes"));
msg.exec();
if (!AppIsRun(appName))
RunApp(appName);
}
else
{
QMessageBox msg(QMessageBox::Critical, QObject::tr("error"),
QObject::tr("install failed!"),
QMessageBox::Ok);
msg.setButtonText(QMessageBox::Ok, QObject::tr("yes"));
msg.exec();
}
}
return 0;
}

View File

@ -1,8 +1,14 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "HGUpgrade.h"
#include "base/HGDef.h"
#include "base/HGInc.h"
#include <QLabel>
#include <QMovie>
#include <QMessageBox>
#if defined(HG_CMP_MSC)
#include <shellapi.h>
#include <tlhelp32.h>
#endif
MainWindow::MainWindow(const std::string &appName, const std::string& pkgPath, QWidget *parent)
: QMainWindow(parent)
@ -10,6 +16,7 @@ MainWindow::MainWindow(const std::string &appName, const std::string& pkgPath, Q
, m_appName(appName)
, m_pkgPath(pkgPath)
, m_thread(nullptr)
, m_success(false)
{
ui->setupUi(this);
@ -38,11 +45,49 @@ MainWindow::~MainWindow()
delete ui;
}
bool MainWindow::isInstallSuccess()
{
return m_success;
}
bool MainWindow::Upgrade(const std::string& pkgPath)
{
bool ret = false;
#if defined(HG_CMP_MSC)
PROCESS_INFORMATION ProcessInfo;
STARTUPINFOA StartupInfo;
ZeroMemory(&StartupInfo, sizeof(StartupInfo));
StartupInfo.cb = sizeof(StartupInfo);
char command[256];
sprintf(command, "%s %s", pkgPath.c_str(), "/verysilent");
if (CreateProcessA(nullptr, command, nullptr, nullptr, FALSE, 0, nullptr, nullptr, &StartupInfo, &ProcessInfo))
{
WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
DWORD dwCode = 0;
GetExitCodeProcess(ProcessInfo.hProcess, &dwCode);
CloseHandle(ProcessInfo.hThread);
CloseHandle(ProcessInfo.hProcess);
ret = (0 == dwCode);
}
#else
std::string cmd = "pkexec dpkg -i \"" + pkgPath + "\"";
int status = system(cmd.c_str());
if (-1 != status && WIFEXITED(status) && 0 == WEXITSTATUS(status))
ret = true;
#endif
return ret;
}
void MainWindow::ThreadFunc(HGThread thread, HGPointer param)
{
(void)thread;
MainWindow* p = (MainWindow*)param;
Upgrade(p->m_pkgPath);
p->m_success = Upgrade(p->m_pkgPath);
emit p->closeWnd();
}

View File

@ -16,10 +16,13 @@ public:
MainWindow(const std::string &appName, const std::string &pkgPath, QWidget *parent = nullptr);
~MainWindow();
bool isInstallSuccess();
signals:
void closeWnd();
private:
static bool Upgrade(const std::string& pkgPath);
static void ThreadFunc(HGThread thread, HGPointer param);
private:
@ -28,5 +31,6 @@ private:
std::string m_appName;
std::string m_pkgPath;
HGThread m_thread;
bool m_success;
};
#endif // MAINWINDOW_H

View File

@ -0,0 +1,12 @@
project(testdemo)
FILE(GLOB SRC "*.cpp" "*.h" "*.c")
include_directories(${PROJECT_SOURCE_DIR}/../include)
add_executable(${PROJECT_NAME} ${SRC})
target_link_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/../lib)
target_link_libraries(${PROJECT_NAME} LscBase lscdriver LscImgFmt LscImgProc LscScannerLib mupdf pdf sane-lscsane)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/../bin)

193
test/scannerlib/main.cpp Normal file
View File

@ -0,0 +1,193 @@
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <thread>
#include "HGScannerLib.h"
#include "sane_option_definitions.h"
#define DELEAY_MS(x) std::this_thread::sleep_for(std::chrono::milliseconds((x)))
using namespace std;
//有图事件回调
static void DeviceScanImageFunc(HGLibDevice device, HGLibImage image, HGPointer param)
{
static int indeximg = 0;
string savepath = std::to_string(++indeximg) + ".jpg";
cout << "save image : " << savepath << endl;
auto ret = HGLib_SaveImage(image, savepath.c_str(), 0);
cout << "save image : " << savepath << (ret ? " success" : " failed") << endl;
}
//设备热拔插事件回调
static void DeviceHotPlugEvent(HGUInt event, const HGChar *deviceName, HGPointer param)
{
cout << "Devices : " << deviceName << " DeviceHotPlugEvent : " << (event == HGLIB_DEVHOTPLUG_EVENT_ARRIVE ? "HGLIB_DEVHOTPLUG_EVENT_ARRIVE " : "HGLIB_DEVHOTPLUG_EVENT_LEFT") << endl;
}
//扫描状态事件回调
static void DeviceScanEvent(HGLibDevice device, HGUInt event, HGBool err, const HGChar *info, HGPointer param)
{
switch (event)
{
case HGLIB_DEVSCAN_EVENT_BEGIN:
cout << "DeviceScanEvent Start Scan" << endl;
break;
case HGLIB_DEVSCAN_EVENT_END:
cout << "DeviceScanEvent Scan stopped" << endl;
break;
case HGLIB_DEVSCAN_EVENT_INFO:
cout << "DeviceScanEvent info : " << info << endl;
break;
default:
cout << "Unkownun DeviceScanEvent " << event << endl;
break;
}
}
int main(unsigned char argc, unsigned char *argv[])
{
std::cout << "*********Enter LSC Scanner SDK Demo *********" << std::endl;
HGLib_InitDevice(DeviceHotPlugEvent, 0); //初始化调用模块
DELEAY_MS(5000);
HGChar **devNameList = HGLib_GetDeviceNameList(); //获取已连接的设备列表,已字符数组的形式返回
if (devNameList)
{
HGLibDevice dev = HGLib_OpenDevice(devNameList[0]); //此示例代码中调用设备列表中第一个设备
if (dev)
{
HGUInt grpCount = 0;
HGLibDeviceGetParamGroup *groups = HGLib_GetDeviceParamGroupList(dev, &grpCount);
if (groups)
{
//获取sdk支持的功能项及配置项内容
for (size_t i = 0; i < grpCount; i++)
{
cout << groups[i].groupName << endl;
for (size_t j = 0; j < groups[i].paramCount; j++)
{
cout << " title: " << groups[i].param[j].param.title
<< " type: " << groups[i].param[j].param.type << endl;
switch (groups[i].param[j].rangeType)
{
case HGLIB_DEVPARAM_RANGETYPE_INTLIST:
for (size_t k = 0; k < groups[i].param[j].intValueList.count; k++)
{
cout<<"support value["<<k<<"]="<<groups[i].param[j].intValueList.value[k]<<endl;
}
break;
case HGLIB_DEVPARAM_RANGETYPE_STRINGLIST:
for (size_t k = 0; k < groups[i].param[j].stringValueList.count; k++)
{
cout<<"support value["<<k<<"]="<<groups[i].param[j].stringValueList.value[k]<<endl;
}
break;
case HGLIB_DEVPARAM_RANGETYPE_DOUBLELIST:
for (size_t k = 0; k < groups[i].param[j].doubleValueList.count; k++)
{
cout<<"support value["<<k<<"]="<<groups[i].param[j].doubleValueList.value[k]<<endl;
}
break;
case HGLIB_DEVPARAM_RANGETYPE_INTRANGE:
cout<<"support value range min = "<<groups[i].param[j].intValueRange.minValue <<" max = "<<groups[i].param[j].intValueRange.maxValue<<endl;
break;
case HGLIB_DEVPARAM_RANGETYPE_DOUBLERANGE:
cout<<"support value range min = "<<groups[i].param[j].intValueRange.minValue <<" max = "<<groups[i].param[j].intValueRange.maxValue<<endl;
break;
default:
break;
}
switch (groups[i].param[j].param.type)
{
case HGLIB_DEVPARAM_TYPE_INT:
cout << " intValue: " << groups[i].param[j].param.intValue << endl;
break;
case HGLIB_DEVPARAM_TYPE_STRING:
cout << " stringValue: " << groups[i].param[j].param.stringValue << endl;
break;
case HGLIB_DEVPARAM_TYPE_DOUBLE:
cout << " doubleValue: " << groups[i].param[j].param.doubleValue << endl;
break;
case HGLIB_DEVPARAM_TYPE_BOOL:
cout << " boolValue: " << groups[i].param[j].param.boolValue << endl;
break;
default:
cout << "unkownun type" << endl;
break;
}
}
}
}
//设置颜色模式
HGLibDeviceSetParam setparam;
setparam.title = OPTION_TITLE_YSMS;
setparam.type = HGLIB_DEVPARAM_TYPE_STRING;
setparam.stringValue = OPTION_VALUE_YSMS_HB;
HGLib_SetDeviceParam(dev,&setparam,1);
//设置分辨率
setparam.title = OPTION_TITLE_FBL;
setparam.type = HGLIB_DEVPARAM_TYPE_INT;
setparam.intValue = 300;
HGLib_SetDeviceParam(dev,&setparam,1);
//设置单双面或跳过空白页
setparam.title = OPTION_TITLE_SMYM;
setparam.type = HGLIB_DEVPARAM_TYPE_STRING;
setparam.stringValue = OPTION_VALUE_SMYM_DM;
HGLib_SetDeviceParam(dev,&setparam,1);
//设置纸张尺寸 A3 A4 或匹配原始尺寸
setparam.title = OPTION_TITLE_ZZCC;
setparam.type = HGLIB_DEVPARAM_TYPE_STRING;
setparam.stringValue = OPTION_VALUE_ZZCC_PPYSCC;//匹配原始尺寸
//设置旋转 90° 180° 270°
setparam.title = OPTION_TITLE_WGFX;
setparam.type = HGLIB_DEVPARAM_TYPE_STRING;
setparam.stringValue = OPTION_VALUE_WGFX_90;
HGLib_SetDeviceParam(dev,&setparam,1);
// //设置扫描张数 -1: 连续扫描 其他:>0 指定数量扫描
// setparam.title = OPTION_TITLE_SMZS;
// setparam.type = HGLIB_DEVPARAM_TYPE_STRING;
// setparam.stringValue = OPTION_VALUE_SMZS_LXSM;//连续扫描
// HGLib_SetDeviceParam(dev,&setparam,1);
setparam.title = OPTION_TITLE_SMZS;
setparam.type = HGLIB_DEVPARAM_TYPE_STRING;
setparam.stringValue = OPTION_VALUE_SMZS_SMZDZS;//指定张数扫描
HGLib_SetDeviceParam(dev,&setparam,1);
setparam.title = OPTION_TITLE_SMSL;
setparam.type = HGLIB_DEVPARAM_TYPE_INT;
setparam.intValue = 1;//扫描张数
HGLib_SetDeviceParam(dev,&setparam,1);
if (HGLib_StartDeviceScan(dev, DeviceScanEvent, 0, DeviceScanImageFunc, 0)) //开始启动扫描并注册扫描事件以及图像回调
{
DELEAY_MS(10000); //实际走纸延时等待处理
HGLib_StopDeviceScan(dev);
}
HGBool ret = HGLib_ReleaseDeviceParamGroupList(groups,grpCount);
if(!ret)
cout << "HGLib_ReleaseDeviceParamGroupList failed"<<endl;
HGLib_CloseDevice(dev); //关闭当前打开的设备
}
else
cout << "Open device : " << devNameList[0] << "failed " << endl;
HGLib_ReleaseDeviceNameList(devNameList); //释放设备列表
}
else
cout << "devices not found" << endl;
HGLib_DeinitDevice(); //退出扫描模块
cout << "*********Exit LSC Scanner SDK Demo *********" << endl;
return 0;
}

View File

@ -1,35 +0,0 @@
#include "HGScannerLib.h"
#include <Windows.h>
static void DeviceScanImageFunc(HGLibDevice device, HGLibImage image, HGPointer param)
{
HGLib_SaveImage(image, "D:\\11111.jpg", 0);
}
int main()
{
HGLib_InitDevice(0, 0);
Sleep(100);
HGChar **devNameList = HGLib_GetDeviceNameList();
if (devNameList)
{
HGLibDevice dev = HGLib_OpenDevice(devNameList[0]);
if (dev)
{
if (HGLib_StartDeviceScan(dev, 0, 0, DeviceScanImageFunc, 0))
{
Sleep(10000);
HGLib_StopDeviceScan(dev);
}
HGLib_CloseDevice(dev);
}
HGLib_ReleaseDeviceNameList(devNameList);
}
HGLib_DeinitDevice();
return 0;
}