Skip to content

Commit

Permalink
v2.53.02-beta
Browse files Browse the repository at this point in the history
- 新特性:加入[禁止Gitee]选项,启用本选项将禁止本软件从码云下载文件.(可能影响自动检查更新)
- 性能优化,减少对python扩展的多余调用.
- 在文本框内展示当前正在进行的联网活动.
- 更新Python扩展,优化性能.
- 将[找不到已保存的文件列表]的提示改为弹窗展示.
- 更改檢查更新按鈕的網頁打開順序,以及不再跳轉到latest release頁面而是release頁面.
- 為所有插件和引擎添加對應的許可協議文件.
- 添加隐私政策的本地文件
  • Loading branch information
AaronFeng753 committed Jul 6, 2020
1 parent 136b608 commit c3f75bc
Show file tree
Hide file tree
Showing 15 changed files with 1,184 additions and 873 deletions.
45 changes: 31 additions & 14 deletions SRC/Waifu2x-Extension-QT/Donate.cpp
Expand Up @@ -24,30 +24,47 @@ online update for QRCode at donate tab
*/
int MainWindow::Donate_DownloadOnlineQRCode()
{
bool isGiteeBanned = ui->checkBox_BanGitee->isChecked();
//============================
QString Github_OnlineQRCode = Current_Path+"/Online_Donate_QRCode_Github.jpg";
QString Gitee_OnlineQRCode = Current_Path+"/Online_Donate_QRCode_Gitee.jpg";
QFile::remove(Github_OnlineQRCode);
QFile::remove(Gitee_OnlineQRCode);
QString Github_OnlineQRCode_online = "https://raw.githubusercontent.com/AaronFeng753/Waifu2x-Extension-GUI/master/.github/Online_Donate_QRCode.jpg";
QString Gitee_OnlineQRCode_online = "https://gitee.com/aaronfeng0711/Waifu2x-Extension-GUI/raw/master/.github/Online_Donate_QRCode.jpg";
//=
QString Github_OnlineQRCode_local = Current_Path+"/Online_Donate_QRCode_Github.jpg";
QString Gitee_OnlineQRCode_local = Current_Path+"/Online_Donate_QRCode_Gitee.jpg";
//=
QFile::remove(Github_OnlineQRCode_local);
QFile::remove(Gitee_OnlineQRCode_local);
//===========================
QString program = Current_Path+"/python_ext_waifu2xEX.exe";
QProcess DownloadOnlineQRCode;
DownloadOnlineQRCode.start("\""+program+"\" \""+Current_Path+"\" DownloadDonateQRCode");
//==================== 从Github下载文件 ========================
emit Send_TextBrowser_NewMessage(tr("Starting to download QRCode image(for [Donate] tab) from Github."));
DownloadOnlineQRCode.start("\""+program+"\" \""+Github_OnlineQRCode_online+"\" download2 \""+Github_OnlineQRCode_local+"\"");
while(!DownloadOnlineQRCode.waitForStarted(500)&&!QProcess_stop) {}
while(!DownloadOnlineQRCode.waitForFinished(500)&&!QProcess_stop) {}
//========= 先检查github的文件是否下载成功 =================
QFileInfo *Github_OnlineQRCode_QFileInfo = new QFileInfo(Github_OnlineQRCode);
if(QFile::exists(Github_OnlineQRCode)&&(Github_OnlineQRCode_QFileInfo->size()>1000))
emit Send_TextBrowser_NewMessage(tr("Finished to download QRCode image from Github."));
//========= 检查github的文件是否下载成功 =================
QFileInfo *Github_OnlineQRCode_QFileInfo = new QFileInfo(Github_OnlineQRCode_local);
if(QFile::exists(Github_OnlineQRCode_local)&&(Github_OnlineQRCode_QFileInfo->size()>1000))
{
emit Send_Donate_ReplaceQRCode(Github_OnlineQRCode);
emit Send_Donate_ReplaceQRCode(Github_OnlineQRCode_local);
return 1;
}
//========= 再检查gitee的文件是否下载成功 =================
QFileInfo *Gitee_OnlineQRCode_QFileInfo = new QFileInfo(Gitee_OnlineQRCode);
if(QFile::exists(Gitee_OnlineQRCode)&&(Gitee_OnlineQRCode_QFileInfo->size()>1000))
//==================== 从码云下载文件 ========================
if(isGiteeBanned==false)
{
emit Send_Donate_ReplaceQRCode(Gitee_OnlineQRCode);
return 1;
emit Send_TextBrowser_NewMessage(tr("Starting to download QRCode image(for [Donate] tab) from Gitee."));
DownloadOnlineQRCode.start("\""+program+"\" \""+Gitee_OnlineQRCode_online+"\" download2 \""+Gitee_OnlineQRCode_local+"\"");
while(!DownloadOnlineQRCode.waitForStarted(500)&&!QProcess_stop) {}
while(!DownloadOnlineQRCode.waitForFinished(500)&&!QProcess_stop) {}
emit Send_TextBrowser_NewMessage(tr("Finished to download QRCode image from Gitee."));
//========= 检查gitee的文件是否下载成功 =================
QFileInfo *Gitee_OnlineQRCode_QFileInfo = new QFileInfo(Gitee_OnlineQRCode_local);
if(QFile::exists(Gitee_OnlineQRCode_local)&&(Gitee_OnlineQRCode_QFileInfo->size()>1000)&&!isGiteeBanned)
{
emit Send_Donate_ReplaceQRCode(Gitee_OnlineQRCode_local);
return 1;
}
}
emit Send_Donate_ReplaceQRCode("");//下载失败,直接跳转
return 0;
Expand Down
2 changes: 1 addition & 1 deletion SRC/Waifu2x-Extension-QT/Waifu2x-Extension-QT.pro.user
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.10.1, 2020-07-03T20:16:07. -->
<!-- Written by QtCreator 4.10.1, 2020-07-05T23:12:26. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down
76 changes: 46 additions & 30 deletions SRC/Waifu2x-Extension-QT/checkupdate.cpp
Expand Up @@ -33,50 +33,57 @@ check update :[python_ext_waifu2xEX.exe Current_Path checkupdate]
*/
void MainWindow::on_pushButton_CheckUpdate_clicked()
{
QDesktopServices::openUrl(QUrl("https://github.com/AaronFeng753/Waifu2x-Extension-GUI/releases/latest"));
if(ui->comboBox_language->currentIndex()==1)
{
QDesktopServices::openUrl(QUrl("https://gitee.com/aaronfeng0711/Waifu2x-Extension-GUI/releases"));
}
QDesktopServices::openUrl(QUrl("https://github.com/AaronFeng753/Waifu2x-Extension-GUI/releases"));
}
/*
自动检查更新:
启动软件时以单独线程运行,调用python扩展检测更新,如有则弹窗
*/
int MainWindow::CheckUpadte_Auto()
{
bool isGiteeBanned = ui->checkBox_BanGitee->isChecked();
//============
QString Latest_Ver="";
QString Current_Ver="";
QString checkupdate_cmd="";
QString Github_UpdateInfo_online = "";
QString Gitee_UpdateInfo_online = "";
switch(ui->comboBox_UpdateChannel->currentIndex())
{
case 0:
Current_Ver=LastStableVer;
checkupdate_cmd="checkupdate";
Github_UpdateInfo_online = "https://raw.githubusercontent.com/AaronFeng753/Waifu2x-Extension-GUI/master/.github/Update_Info.ini";
Gitee_UpdateInfo_online = "https://gitee.com/aaronfeng0711/Waifu2x-Extension-GUI/raw/master/.github/Update_Info.ini";
break;
case 1:
Current_Ver=VERSION;
checkupdate_cmd="checkupdate_beta";
Github_UpdateInfo_online = "https://raw.githubusercontent.com/AaronFeng753/Waifu2x-Extension-GUI/master/.github/Update_Info_Beta.ini";
Gitee_UpdateInfo_online = "https://gitee.com/aaronfeng0711/Waifu2x-Extension-GUI/raw/master/.github/Update_Info_Beta.ini";
break;
default:
break;
}
//============================
QString Github_UpdateInfo = Current_Path+"/Update_Info_Github.ini";
QString Gitee_UpdateInfo = Current_Path+"/Update_Info_Gitee.ini";
QFile::remove(Github_UpdateInfo);
QFile::remove(Gitee_UpdateInfo);
//===========================
QString Github_UpdateInfo_local = Current_Path+"/Update_Info_Github.ini";
QString Gitee_UpdateInfo_local = Current_Path+"/Update_Info_Gitee.ini";
//=
QFile::remove(Github_UpdateInfo_local);
QFile::remove(Gitee_UpdateInfo_local);
//============= 从Github下载更新信息 ==============
QString program = Current_Path+"/python_ext_waifu2xEX.exe";
QProcess checkupdate;
checkupdate.start("\""+program+"\" \""+Current_Path+"\" "+checkupdate_cmd);
emit Send_TextBrowser_NewMessage(tr("Starting to download update information(for auto-check update) from Github."));
checkupdate.start("\""+program+"\" \""+Github_UpdateInfo_online+"\" download2 \""+Github_UpdateInfo_local+"\"");
while(!checkupdate.waitForStarted(500)&&!QProcess_stop) {}
while(!checkupdate.waitForFinished(500)&&!QProcess_stop) {}
//========= 先检查github的文件是否下载成功 =================
if(QFile::exists(Github_UpdateInfo))
emit Send_TextBrowser_NewMessage(tr("Finished to download update information from Github."));
//========= 检查github的文件是否下载成功 =================
if(QFile::exists(Github_UpdateInfo_local))
{
QSettings *configIniRead = new QSettings(Github_UpdateInfo, QSettings::IniFormat);
QSettings *configIniRead = new QSettings(Github_UpdateInfo_local, QSettings::IniFormat);
configIniRead->setIniCodec(QTextCodec::codecForName("UTF-8"));
Latest_Ver = configIniRead->value("/Latest_Version/Ver").toString();
QString Change_log = configIniRead->value("/Change_log/log").toString();
Expand All @@ -85,34 +92,43 @@ int MainWindow::CheckUpadte_Auto()
{
emit Send_CheckUpadte_NewUpdate(Latest_Ver,Change_log);
//=====
QFile::remove(Github_UpdateInfo);
QFile::remove(Gitee_UpdateInfo);
QFile::remove(Github_UpdateInfo_local);
QFile::remove(Gitee_UpdateInfo_local);
return 0;
}
}
//========= 再检查gitee的文件是否下载成功 =================
if(QFile::exists(Gitee_UpdateInfo))
//============= 从码云下载更新信息 ==============
if(isGiteeBanned==false)
{
QSettings *configIniRead = new QSettings(Gitee_UpdateInfo, QSettings::IniFormat);
configIniRead->setIniCodec(QTextCodec::codecForName("UTF-8"));
Latest_Ver = configIniRead->value("/Latest_Version/Ver").toString();
QString Change_log = configIniRead->value("/Change_log/log").toString();
Latest_Ver = Latest_Ver.trimmed();
if(Latest_Ver!=Current_Ver&&Latest_Ver!="")
emit Send_TextBrowser_NewMessage(tr("Starting to download update information(for auto-check update) from Gitee."));
checkupdate.start("\""+program+"\" \""+Gitee_UpdateInfo_online+"\" download2 \""+Gitee_UpdateInfo_local+"\"");
while(!checkupdate.waitForStarted(500)&&!QProcess_stop) {}
while(!checkupdate.waitForFinished(500)&&!QProcess_stop) {}
emit Send_TextBrowser_NewMessage(tr("Finished to download update information from Gitee."));
//========= 检查gitee的文件是否下载成功 =================
if(QFile::exists(Gitee_UpdateInfo_local))
{
emit Send_CheckUpadte_NewUpdate(Latest_Ver,Change_log);
//=====
QFile::remove(Github_UpdateInfo);
QFile::remove(Gitee_UpdateInfo);
return 0;
QSettings *configIniRead = new QSettings(Gitee_UpdateInfo_local, QSettings::IniFormat);
configIniRead->setIniCodec(QTextCodec::codecForName("UTF-8"));
Latest_Ver = configIniRead->value("/Latest_Version/Ver").toString();
QString Change_log = configIniRead->value("/Change_log/log").toString();
Latest_Ver = Latest_Ver.trimmed();
if(Latest_Ver!=Current_Ver&&Latest_Ver!="")
{
emit Send_CheckUpadte_NewUpdate(Latest_Ver,Change_log);
//=====
QFile::remove(Github_UpdateInfo_local);
QFile::remove(Gitee_UpdateInfo_local);
return 0;
}
}
}
if(Latest_Ver=="")
{
emit Send_TextBrowser_NewMessage(tr("Unable to check for updates automatically! Please check your network or check for updates manually."));
}
QFile::remove(Github_UpdateInfo);
QFile::remove(Gitee_UpdateInfo);
QFile::remove(Github_UpdateInfo_local);
QFile::remove(Gitee_UpdateInfo_local);
return 0;
}
/*
Expand Down
Binary file modified SRC/Waifu2x-Extension-QT/language_Chinese.qm
Binary file not shown.

0 comments on commit c3f75bc

Please sign in to comment.