完善安装版本功能

This commit is contained in:
yangjiaxuan 2022-07-19 18:06:08 +08:00
parent c80380b8d0
commit 52c14f8038
9 changed files with 310 additions and 127 deletions

View File

@ -2,6 +2,7 @@
<qresource prefix="/translation">
<file>Scanner_zh_CN.qm</file>
<file>qt_zh_CN.qm</file>
<file>../upgrade/Upgrade_zh_CN.qm</file>
</qresource>
<qresource prefix="/images">
<file>image_rsc/action/btnEmailScanedImages.png</file>

View File

@ -303,25 +303,25 @@
<translation></translation>
</message>
<message>
<location filename="dialog_aquireinto.cpp" line="51"/>
<location filename="dialog_aquireinto.cpp" line="174"/>
<location filename="dialog_aquireinto.cpp" line="201"/>
<location filename="dialog_aquireinto.cpp" line="208"/>
<location filename="dialog_aquireinto.cpp" line="56"/>
<location filename="dialog_aquireinto.cpp" line="180"/>
<location filename="dialog_aquireinto.cpp" line="207"/>
<location filename="dialog_aquireinto.cpp" line="214"/>
<source>e.g. &apos;%1%2&apos;</source>
<translation>.%1%2</translation>
</message>
<message>
<location filename="dialog_aquireinto.cpp" line="60"/>
<location filename="dialog_aquireinto.cpp" line="65"/>
<source>ok</source>
<translation></translation>
</message>
<message>
<location filename="dialog_aquireinto.cpp" line="61"/>
<location filename="dialog_aquireinto.cpp" line="66"/>
<source>cancel</source>
<translation></translation>
</message>
<message>
<location filename="dialog_aquireinto.cpp" line="126"/>
<location filename="dialog_aquireinto.cpp" line="132"/>
<source>Browse directory</source>
<translation></translation>
</message>
@ -481,9 +481,9 @@ Page range will be &quot;Chosen Pages&quot;.
<translation>(TIFF/PDF/OFD)</translation>
</message>
<message>
<location filename="dialog_export.cpp" line="112"/>
<location filename="dialog_export.cpp" line="283"/>
<location filename="dialog_export.cpp" line="294"/>
<location filename="dialog_export.cpp" line="121"/>
<location filename="dialog_export.cpp" line="292"/>
<location filename="dialog_export.cpp" line="303"/>
<source>Input is not valid.
Page range will be &apos;Chosen Pages&apos;.</source>
<translation>
@ -1947,16 +1947,16 @@ Please make sure the two passwords are the same.</source>
<message>
<location filename="mainwindow.cpp" line="478"/>
<location filename="mainwindow.cpp" line="533"/>
<location filename="mainwindow.cpp" line="1371"/>
<location filename="mainwindow.cpp" line="1395"/>
<location filename="mainwindow.cpp" line="2122"/>
<location filename="mainwindow.cpp" line="2442"/>
<location filename="mainwindow.cpp" line="1372"/>
<location filename="mainwindow.cpp" line="1396"/>
<location filename="mainwindow.cpp" line="2123"/>
<location filename="mainwindow.cpp" line="2443"/>
<source>Question</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="479"/>
<location filename="mainwindow.cpp" line="1372"/>
<location filename="mainwindow.cpp" line="1373"/>
<source>modified, save it?</source>
<translation>
</translation>
@ -1988,189 +1988,189 @@ Please make sure the two passwords are the same.</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1392"/>
<location filename="mainwindow.cpp" line="1393"/>
<source>Clear, then start scan</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1393"/>
<location filename="mainwindow.cpp" line="1394"/>
<source>Do NOT clear, then start scan</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1396"/>
<location filename="mainwindow.cpp" line="1397"/>
<source>Already exist images in image list.
Do you want to clear?</source>
<translation>
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1430"/>
<location filename="mainwindow.cpp" line="1431"/>
<source>Information</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1431"/>
<location filename="mainwindow.cpp" line="1432"/>
<source>Insufficient disk space</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1617"/>
<location filename="mainwindow.cpp" line="1618"/>
<source>Open images</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1628"/>
<location filename="mainwindow.cpp" line="1629"/>
<source>Insert images</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1802"/>
<location filename="mainwindow.cpp" line="1807"/>
<location filename="mainwindow.cpp" line="1862"/>
<location filename="mainwindow.cpp" line="1938"/>
<location filename="mainwindow.cpp" line="1943"/>
<location filename="mainwindow.cpp" line="1803"/>
<location filename="mainwindow.cpp" line="1808"/>
<location filename="mainwindow.cpp" line="1863"/>
<location filename="mainwindow.cpp" line="1939"/>
<location filename="mainwindow.cpp" line="1944"/>
<source>info</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1802"/>
<location filename="mainwindow.cpp" line="1862"/>
<location filename="mainwindow.cpp" line="1938"/>
<location filename="mainwindow.cpp" line="1803"/>
<location filename="mainwindow.cpp" line="1863"/>
<location filename="mainwindow.cpp" line="1939"/>
<source>save failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1807"/>
<location filename="mainwindow.cpp" line="1943"/>
<location filename="mainwindow.cpp" line="1808"/>
<location filename="mainwindow.cpp" line="1944"/>
<source>find savePath in thumbnail</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2027"/>
<location filename="mainwindow.cpp" line="2028"/>
<source>File name</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2027"/>
<location filename="mainwindow.cpp" line="2028"/>
<source>File path</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2027"/>
<location filename="mainwindow.cpp" line="2028"/>
<source>File size</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2027"/>
<location filename="mainwindow.cpp" line="2028"/>
<source>Creation date/time</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2027"/>
<location filename="mainwindow.cpp" line="2028"/>
<source>Modified date/time</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2027"/>
<location filename="mainwindow.cpp" line="2028"/>
<source>Accessed date/time</source>
<translation>访</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2070"/>
<location filename="mainwindow.cpp" line="2071"/>
<source>Format</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2070"/>
<location filename="mainwindow.cpp" line="2071"/>
<source>Width</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2070"/>
<location filename="mainwindow.cpp" line="2071"/>
<source>Height</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2070"/>
<location filename="mainwindow.cpp" line="2071"/>
<source>depth</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2070"/>
<location filename="mainwindow.cpp" line="2071"/>
<source>Color model</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2070"/>
<location filename="mainwindow.cpp" line="2071"/>
<source>DPI</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2070"/>
<location filename="mainwindow.cpp" line="2071"/>
<source>Print size</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2070"/>
<location filename="mainwindow.cpp" line="2071"/>
<source>Frame</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2078"/>
<location filename="mainwindow.cpp" line="2079"/>
<source>None</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2078"/>
<location filename="mainwindow.cpp" line="2079"/>
<source>Mono</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2078"/>
<location filename="mainwindow.cpp" line="2079"/>
<source>Gray</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2078"/>
<location filename="mainwindow.cpp" line="2079"/>
<source>Color</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2099"/>
<location filename="mainwindow.cpp" line="2100"/>
<source>Warning</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2099"/>
<location filename="mainwindow.cpp" line="2100"/>
<source>Device is Running!
Please finish scanning first.</source>
<translation>
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3110"/>
<location filename="mainwindow.cpp" line="3111"/>
<source>Are you sure to close </source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3110"/>
<location filename="mainwindow.cpp" line="3111"/>
<source> ?</source>
<translation>?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3119"/>
<location filename="mainwindow.cpp" line="3120"/>
<location filename="mainwindow.cpp" line="3121"/>
<source>close </source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3157"/>
<location filename="mainwindow.cpp" line="3158"/>
<source>error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3157"/>
<location filename="mainwindow.cpp" line="3158"/>
<source>get versionlist failed</source>
<translation></translation>
</message>
@ -2181,96 +2181,96 @@ Continue to close?</source>
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2443"/>
<location filename="mainwindow.cpp" line="2444"/>
<source>Sure to sign out administrator account?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2564"/>
<location filename="mainwindow.cpp" line="2565"/>
<source>confirm the operation</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2565"/>
<location filename="mainwindow.cpp" line="2566"/>
<source>Are you sure to clear the rollor acount?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2581"/>
<location filename="mainwindow.cpp" line="2582"/>
<source>Please re-enter the Abount screen to obtain the latest value</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2626"/>
<location filename="mainwindow.cpp" line="2627"/>
<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="2628"/>
<location filename="mainwindow.cpp" line="2629"/>
<source>&lt;p&gt;%1: %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2630"/>
<location filename="mainwindow.cpp" line="2631"/>
<source>roller number</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2980"/>
<location filename="mainwindow.cpp" line="2981"/>
<source>open scanner </source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2981"/>
<location filename="mainwindow.cpp" line="3044"/>
<location filename="mainwindow.cpp" line="2982"/>
<location filename="mainwindow.cpp" line="3045"/>
<source>app name</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2986"/>
<location filename="mainwindow.cpp" line="3083"/>
<location filename="mainwindow.cpp" line="2987"/>
<location filename="mainwindow.cpp" line="3084"/>
<source>success</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2995"/>
<location filename="mainwindow.cpp" line="2996"/>
<source>apply setting </source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2995"/>
<location filename="mainwindow.cpp" line="2996"/>
<source> success</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2995"/>
<location filename="mainwindow.cpp" line="2996"/>
<source> failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3013"/>
<location filename="mainwindow.cpp" line="3098"/>
<location filename="mainwindow.cpp" line="3014"/>
<location filename="mainwindow.cpp" line="3099"/>
<source>failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3036"/>
<location filename="mainwindow.cpp" line="3037"/>
<source>warning</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3036"/>
<location filename="mainwindow.cpp" line="3037"/>
<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="3052"/>
<location filename="mainwindow.cpp" line="3053"/>
<source>lost config</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3079"/>
<location filename="mainwindow.cpp" line="3080"/>
<source>apply setting</source>
<translation></translation>
</message>
@ -2278,18 +2278,18 @@ Continue to close?</source>
<location filename="mainwindow.cpp" line="1051"/>
<location filename="mainwindow.cpp" line="1052"/>
<location filename="mainwindow.cpp" line="1053"/>
<location filename="mainwindow.cpp" line="2716"/>
<location filename="mainwindow.cpp" line="2717"/>
<location filename="mainwindow.cpp" line="2718"/>
<location filename="mainwindow.cpp" line="2764"/>
<location filename="mainwindow.cpp" line="2719"/>
<location filename="mainwindow.cpp" line="2765"/>
<location filename="mainwindow.cpp" line="2766"/>
<location filename="mainwindow.cpp" line="2827"/>
<location filename="mainwindow.cpp" line="2767"/>
<location filename="mainwindow.cpp" line="2828"/>
<location filename="mainwindow.cpp" line="2829"/>
<location filename="mainwindow.cpp" line="2890"/>
<location filename="mainwindow.cpp" line="2830"/>
<location filename="mainwindow.cpp" line="2891"/>
<location filename="mainwindow.cpp" line="2892"/>
<location filename="mainwindow.cpp" line="2893"/>
<source>start failed</source>
<translation></translation>
</message>
@ -2331,14 +2331,14 @@ Continue to close?</source>
<message>
<location filename="mainwindow.cpp" line="481"/>
<location filename="mainwindow.cpp" line="536"/>
<location filename="mainwindow.cpp" line="1374"/>
<location filename="mainwindow.cpp" line="1432"/>
<location filename="mainwindow.cpp" line="2125"/>
<location filename="mainwindow.cpp" line="2139"/>
<location filename="mainwindow.cpp" line="2444"/>
<location filename="mainwindow.cpp" line="2498"/>
<location filename="mainwindow.cpp" line="2567"/>
<location filename="mainwindow.cpp" line="3112"/>
<location filename="mainwindow.cpp" line="1375"/>
<location filename="mainwindow.cpp" line="1433"/>
<location filename="mainwindow.cpp" line="2126"/>
<location filename="mainwindow.cpp" line="2140"/>
<location filename="mainwindow.cpp" line="2445"/>
<location filename="mainwindow.cpp" line="2499"/>
<location filename="mainwindow.cpp" line="2568"/>
<location filename="mainwindow.cpp" line="3113"/>
<source>yes</source>
<translation></translation>
</message>
@ -2350,13 +2350,13 @@ Continue to close?</source>
<message>
<location filename="mainwindow.cpp" line="483"/>
<location filename="mainwindow.cpp" line="537"/>
<location filename="mainwindow.cpp" line="1375"/>
<location filename="mainwindow.cpp" line="2126"/>
<location filename="mainwindow.cpp" line="2140"/>
<location filename="mainwindow.cpp" line="2445"/>
<location filename="mainwindow.cpp" line="2499"/>
<location filename="mainwindow.cpp" line="2568"/>
<location filename="mainwindow.cpp" line="3113"/>
<location filename="mainwindow.cpp" line="1376"/>
<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"/>
<source>no</source>
<translation></translation>
</message>
@ -2382,57 +2382,57 @@ Continue to close?</source>
<translation>%1%2%3.%4</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2123"/>
<location filename="mainwindow.cpp" line="2124"/>
<source>There are pictures that have not been saved.
Are you sure to close?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2136"/>
<location filename="mainwindow.cpp" line="2137"/>
<source>tips</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2137"/>
<location filename="mainwindow.cpp" line="2138"/>
<source>Are you sure to close?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2495"/>
<location filename="mainwindow.cpp" line="2496"/>
<source>confirm operation</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2496"/>
<location filename="mainwindow.cpp" line="2497"/>
<source>are you sure to clear the roller count?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2508"/>
<location filename="mainwindow.cpp" line="2510"/>
<location filename="mainwindow.cpp" line="2586"/>
<location filename="mainwindow.cpp" line="2509"/>
<location filename="mainwindow.cpp" line="2511"/>
<location filename="mainwindow.cpp" line="2587"/>
<source>hint</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2508"/>
<location filename="mainwindow.cpp" line="2578"/>
<location filename="mainwindow.cpp" line="2509"/>
<location filename="mainwindow.cpp" line="2579"/>
<source>Roller scanned count has been set to 0.</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2510"/>
<location filename="mainwindow.cpp" line="2584"/>
<location filename="mainwindow.cpp" line="2511"/>
<location filename="mainwindow.cpp" line="2585"/>
<source>Roller scanned count reset failed.</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2553"/>
<location filename="mainwindow.cpp" line="2554"/>
<source>Error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2553"/>
<location filename="mainwindow.cpp" line="2554"/>
<source>Document missing! It would be deleted or renamed.</source>
<translation></translation>
</message>
@ -2465,28 +2465,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="2604"/>
<location filename="mainwindow.cpp" line="2605"/>
<source>About %1</source>
<translation> %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2605"/>
<location filename="mainwindow.cpp" line="2606"/>
<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="2620"/>
<location filename="mainwindow.cpp" line="2621"/>
<source>about %1</source>
<translation> %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2621"/>
<location filename="mainwindow.cpp" line="2622"/>
<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="2622"/>
<location filename="mainwindow.cpp" line="2623"/>
<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>

View File

@ -169,7 +169,7 @@ MainWindow::MainWindow(QWidget *parent)
m_thumb->setItemSize(120);
m_thumb->setScrollSize(16);
m_thumb->setMinScrollSliderSize(20);
m_thumb->setItemTextHeight(0);
m_thumb->setItemTextHeight(0);
QImage nullScrollImage(":images/image_rsc/scroll/nullScrollImage.png");
m_view->setNullScrollImage(&nullScrollImage);
@ -1099,7 +1099,8 @@ void MainWindow::on_upgradeApp(QString pkgPath)
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("-pkgpath=%1").arg(pkgPath.toStdString().c_str()));
argList.push_back(QString("-type=%1").arg("upgrade"));
proc.startDetached("HGUpgrade.exe", argList);
m_closeTip = false;

Binary file not shown.

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN">
<context>
<name>MainWindow</name>
<message>
<location filename="mainwindow.ui" line="14"/>
<source>MainWindow</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.ui" line="27"/>
<source>gif</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.ui" line="40"/>
<source>text</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="16"/>
<source>Installation</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="19"/>
<source>Installation in progress, please wait...</source>
<translation>...</translation>
</message>
</context>
</TS>

View File

@ -3,6 +3,7 @@
#include <QApplication>
#include <QThread>
#include <QScreen>
#include <QTranslator>
#include "version/HGVersion.h"
#include "HGUpgrade.h"
@ -54,6 +55,10 @@ int main(int argc, char *argv[])
while (AppIsRun(appName))
QThread::msleep(20);
QTranslator translator_upgrade_;
if (translator_upgrade_.load(":translation/upgrade/Upgrade_zh_CN.qm"))
a.installTranslator(&translator_upgrade_);
MainWindow w(appName, pkgPath);
QScreen *screen = QGuiApplication::primaryScreen();
w.move((screen->size().width() - w.width()) / 2, (screen->size().height() - w.height()) / 2);

View File

@ -1,6 +1,8 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "HGUpgrade.h"
#include <QLabel>
#include <QMovie>
MainWindow::MainWindow(const std::string &appName, const std::string& pkgPath, QWidget *parent)
: QMainWindow(parent)
@ -11,9 +13,18 @@ MainWindow::MainWindow(const std::string &appName, const std::string& pkgPath, Q
{
ui->setupUi(this);
setWindowTitle(tr("Installation in progress, please wait..."));
setWindowTitle(tr("Installation"));
setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint);
ui->label_text->setText(tr("Installation in progress, please wait..."));
QMovie *movie = new QMovie(":images/image_rsc/logo/waiting.gif");
ui->label_gif->setMovie(movie);
movie->setCacheMode(QMovie::CacheAll);
movie->setScaledSize(QSize(ui->label_gif->width(), ui->label_gif->height()));
movie->start();
ui->label_gif->show();
connect(this, SIGNAL(closeWnd()), this, SLOT(close()), Qt::QueuedConnection);
HGBase_OpenThread(ThreadFunc, this, &m_thread);

View File

@ -6,15 +6,139 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
<width>460</width>
<height>152</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget"/>
<widget class="QMenuBar" name="menubar"/>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_gif">
<property name="minimumSize">
<size>
<width>41</width>
<height>41</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>41</width>
<height>41</height>
</size>
</property>
<property name="text">
<string>gif</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_text">
<property name="text">
<string>text</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>2</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>460</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>

View File

@ -129,3 +129,12 @@ HEADERS += \
FORMS += \
../../../app/upgrade/mainwindow.ui
RESOURCES += \
../../../app/scanner/Scanner_resource.qrc
TRANSLATIONS += \
../../../app/upgrade/Upgrade_zh_CN.ts \
DISTFILES += \
../../../app/upgrade/Upgrade_zh_CN.qm \