modify:修改逻辑

This commit is contained in:
2024-07-24 19:28:54 +08:00
parent dd43222a20
commit 1d071d5739
8 changed files with 76 additions and 46 deletions
+4 -3
View File
@@ -22,6 +22,7 @@ int main(int argc, char *argv[])
QApplication a(argc, argv);
loadQss();
UpdaterDialog w;
if(argc > 1)
{
@@ -32,12 +33,12 @@ int main(int argc, char *argv[])
}
else
{
APPNAME = "FlightDataAnalysis";
APPNAME = "";
APPVERSION = "0";
}
CHECK_URL = CHECK_URL + APPNAME + "/updates.json";
// FlightDataAnalysis
CHECK_URL = ORIGIN_URL + APPNAME + "/updates.json";
UpdaterDialog w;
w.show();
return a.exec();
}
+12 -1
View File
@@ -11,6 +11,8 @@
#include <private/qzipreader_p.h>
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 APPVERSION = "";
@@ -31,11 +33,12 @@ UpdaterDialog::UpdaterDialog(QWidget *parent) :
m_version = APPVERSION;
ui->versionInput->setText(m_version);
ui->appNameInput->setText(APPNAME);
ui->show->setEnabled(0);
ui->label_2->setText("");
ui->label_3->setText("");
ui->label_4->setText(APPNAME);
// ui->label_4->setText(APPNAME);
// ui->versionInput->setEnabled(false);
}
@@ -52,6 +55,12 @@ void UpdaterDialog::showStatus(const QString &s)
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->btn_update->setEnabled(0);
//version
@@ -62,6 +71,8 @@ void UpdaterDialog::on_btn_check_clicked()
m_pManager = new QNetworkAccessManager(this);
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);
m_pManager->get(request);
+1
View File
@@ -6,6 +6,7 @@
#include "downloader.h"
extern QString APPVERSION;
extern QString ORIGIN_URL;
extern QString APPNAME;
extern QString CHECK_URL;
extern QString APPDATE;
+53 -39
View File
@@ -35,45 +35,15 @@
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="labelIcon">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
<width>48</width>
<height>48</height>
<width>100</width>
<height>0</height>
</size>
</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">
<font>
<family>Times New Roman</family>
@@ -82,18 +52,41 @@
</font>
</property>
<property name="text">
<string>updater</string>
<string>AppName:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</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">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
@@ -108,6 +101,12 @@
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<family>Times New Roman</family>
@@ -118,10 +117,25 @@
<property name="text">
<string>Version:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<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">
<font>
<family>Times New Roman</family>