modify:修改逻辑
This commit is contained in:
@@ -2,5 +2,7 @@
|
|||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>140xfd.png</file>
|
<file>140xfd.png</file>
|
||||||
<file>140xfd.ico</file>
|
<file>140xfd.ico</file>
|
||||||
|
<file>update.ico</file>
|
||||||
|
<file>update.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1721820181570" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7019" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M512.487863 109.714286c159.780571 0 292.937143 113.846857 322.852571 264.850285A256.036571 256.036571 0 0 1 768.487863 877.714286h-73.142857a36.571429 36.571429 0 0 1 0-73.142857h73.142857a182.857143 182.857143 0 0 0 7.936-365.531429L768.487863 438.857143l-0.146286-8.777143a256 256 0 0 0-511.268571-8.777143l-0.438857 8.777143L256.487863 438.857143a182.857143 182.857143 0 0 0-7.936 365.531428L256.487863 804.571429h73.142857a36.571429 36.571429 0 0 1 0 73.142857H256.487863a256 256 0 0 1-66.889143-503.186286C219.514149 223.561143 352.707291 109.714286 512.487863 109.714286z" fill="#1296db" p-id="7020"></path><path d="M475.916434 512m36.571429 0l0 0q36.571429 0 36.571428 36.571429l0 329.142857q0 36.571429-36.571428 36.571428l0 0q-36.571429 0-36.571429-36.571428l0-329.142857q0-36.571429 36.571429-36.571429Z" fill="#1296db" p-id="7021"></path><path d="M642.097006 604.745143a36.571429 36.571429 0 0 1-51.712 0L512.780434 527.140571l-77.531428 77.604572A36.571429 36.571429 0 1 1 383.463863 552.96L486.887863 449.572571a36.571429 36.571429 0 0 1 51.748571 0L642.097006 552.96a36.571429 36.571429 0 0 1 0 51.748571z" fill="#1296db" p-id="7022"></path></svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
+4
-3
@@ -22,6 +22,7 @@ int main(int argc, char *argv[])
|
|||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
|
||||||
loadQss();
|
loadQss();
|
||||||
|
UpdaterDialog w;
|
||||||
|
|
||||||
if(argc > 1)
|
if(argc > 1)
|
||||||
{
|
{
|
||||||
@@ -32,12 +33,12 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
APPNAME = "FlightDataAnalysis";
|
APPNAME = "";
|
||||||
APPVERSION = "0";
|
APPVERSION = "0";
|
||||||
}
|
}
|
||||||
CHECK_URL = CHECK_URL + APPNAME + "/updates.json";
|
// FlightDataAnalysis
|
||||||
|
CHECK_URL = ORIGIN_URL + APPNAME + "/updates.json";
|
||||||
|
|
||||||
UpdaterDialog w;
|
|
||||||
w.show();
|
w.show();
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-1
@@ -11,6 +11,8 @@
|
|||||||
#include <private/qzipreader_p.h>
|
#include <private/qzipreader_p.h>
|
||||||
|
|
||||||
QString CHECK_URL = "http://www.tianzd.cn:1995/TianZD/deploy/raw/branch/master/";
|
QString CHECK_URL = "http://www.tianzd.cn:1995/TianZD/deploy/raw/branch/master/";
|
||||||
|
QString ORIGIN_URL = "http://www.tianzd.cn:1995/TianZD/deploy/raw/branch/master/";
|
||||||
|
|
||||||
QString PLATFORM = "windows";
|
QString PLATFORM = "windows";
|
||||||
|
|
||||||
QString APPVERSION = "";
|
QString APPVERSION = "";
|
||||||
@@ -31,11 +33,12 @@ UpdaterDialog::UpdaterDialog(QWidget *parent) :
|
|||||||
|
|
||||||
m_version = APPVERSION;
|
m_version = APPVERSION;
|
||||||
ui->versionInput->setText(m_version);
|
ui->versionInput->setText(m_version);
|
||||||
|
ui->appNameInput->setText(APPNAME);
|
||||||
|
|
||||||
ui->show->setEnabled(0);
|
ui->show->setEnabled(0);
|
||||||
ui->label_2->setText("");
|
ui->label_2->setText("");
|
||||||
ui->label_3->setText("");
|
ui->label_3->setText("");
|
||||||
ui->label_4->setText(APPNAME);
|
// ui->label_4->setText(APPNAME);
|
||||||
// ui->versionInput->setEnabled(false);
|
// ui->versionInput->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,6 +55,12 @@ void UpdaterDialog::showStatus(const QString &s)
|
|||||||
|
|
||||||
void UpdaterDialog::on_btn_check_clicked()
|
void UpdaterDialog::on_btn_check_clicked()
|
||||||
{
|
{
|
||||||
|
APPNAME = ui->appNameInput->text();
|
||||||
|
if(QString(APPNAME) == "")
|
||||||
|
{
|
||||||
|
ui->show->appendPlainText("Please input app name");
|
||||||
|
return;
|
||||||
|
}
|
||||||
ui->show->clear();
|
ui->show->clear();
|
||||||
ui->btn_update->setEnabled(0);
|
ui->btn_update->setEnabled(0);
|
||||||
//version
|
//version
|
||||||
@@ -62,6 +71,8 @@ void UpdaterDialog::on_btn_check_clicked()
|
|||||||
m_pManager = new QNetworkAccessManager(this);
|
m_pManager = new QNetworkAccessManager(this);
|
||||||
connect(m_pManager, SIGNAL(finished(QNetworkReply *)), this, SLOT(onCheckReply(QNetworkReply *)));
|
connect(m_pManager, SIGNAL(finished(QNetworkReply *)), this, SLOT(onCheckReply(QNetworkReply *)));
|
||||||
}
|
}
|
||||||
|
CHECK_URL = ORIGIN_URL + APPNAME + "/updates.json";
|
||||||
|
qDebug() << APPNAME << CHECK_URL;
|
||||||
QNetworkRequest request(CHECK_URL);
|
QNetworkRequest request(CHECK_URL);
|
||||||
|
|
||||||
m_pManager->get(request);
|
m_pManager->get(request);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "downloader.h"
|
#include "downloader.h"
|
||||||
|
|
||||||
extern QString APPVERSION;
|
extern QString APPVERSION;
|
||||||
|
extern QString ORIGIN_URL;
|
||||||
extern QString APPNAME;
|
extern QString APPNAME;
|
||||||
extern QString CHECK_URL;
|
extern QString CHECK_URL;
|
||||||
extern QString APPDATE;
|
extern QString APPDATE;
|
||||||
|
|||||||
+53
-39
@@ -35,45 +35,15 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="labelIcon">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>48</width>
|
<width>100</width>
|
||||||
<height>48</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>48</width>
|
|
||||||
<height>48</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>14</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">border-image: url(:/140xfd.png);</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Times New Roman</family>
|
<family>Times New Roman</family>
|
||||||
@@ -82,18 +52,41 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>updater</string>
|
<string>AppName:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_3">
|
<widget class="QLineEdit" name="appNameInput">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Times New Roman</family>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Preferred</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>40</width>
|
<width>40</width>
|
||||||
@@ -108,6 +101,12 @@
|
|||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Times New Roman</family>
|
<family>Times New Roman</family>
|
||||||
@@ -118,10 +117,25 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Version:</string>
|
<string>Version:</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="versionInput">
|
<widget class="QLineEdit" name="versionInput">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Times New Roman</family>
|
<family>Times New Roman</family>
|
||||||
|
|||||||
+3
-3
@@ -10,10 +10,10 @@ TEMPLATE = app
|
|||||||
|
|
||||||
#生成目录
|
#生成目录
|
||||||
unix {
|
unix {
|
||||||
DESTDIR = $$PWD/../../Build/bin
|
#DESTDIR = $$PWD/../../Build/bin
|
||||||
}
|
}
|
||||||
win32 {
|
win32 {
|
||||||
DESTDIR = $$PWD/../../Build/release
|
#DESTDIR = $$PWD/../../Build/release
|
||||||
}
|
}
|
||||||
|
|
||||||
MOC_DIR = $$PWD/Build/moc
|
MOC_DIR = $$PWD/Build/moc
|
||||||
@@ -38,5 +38,5 @@ RESOURCES += \
|
|||||||
Resources/res.qrc
|
Resources/res.qrc
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
RC_ICONS += $$PWD/Resources/140xfd.ico
|
RC_ICONS += $$PWD/Resources/update.ico
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user