Skip to content

Commit

Permalink
check new release
Browse files Browse the repository at this point in the history
  • Loading branch information
josephpei committed Jan 6, 2021
1 parent d5a2e06 commit 4481689
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 53 deletions.
50 changes: 25 additions & 25 deletions lang/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
</message>
<message>
<location filename="../build/ui_mainwindow.h" line="228"/>
<location filename="../src/mainwindow.cpp" line="46"/>
<location filename="../src/mainwindow.cpp" line="48"/>
<source>Overview</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../build/ui_mainwindow.h" line="229"/>
<location filename="../src/mainwindow.cpp" line="50"/>
<location filename="../src/mainwindow.cpp" line="52"/>
<source>Proxies</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -76,120 +76,120 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="123"/>
<location filename="../src/mainwindow.cpp" line="125"/>
<source>Show MainWindow</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="126"/>
<location filename="../src/mainwindow.cpp" line="128"/>
<source>&amp;Quit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="132"/>
<location filename="../src/mainwindow.cpp" line="134"/>
<source>Global</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="135"/>
<location filename="../src/mainwindow.cpp" line="137"/>
<source>Rule</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="138"/>
<location filename="../src/mainwindow.cpp" line="140"/>
<source>Direct</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="152"/>
<location filename="../src/mainwindow.cpp" line="154"/>
<source>Set as system proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="157"/>
<location filename="../src/mainwindow.cpp" line="159"/>
<source>Copy shell command</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="160"/>
<location filename="../src/mainwindow.cpp" line="162"/>
<source>Start at login</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="165"/>
<location filename="../src/mainwindow.cpp" line="167"/>
<source>Allow connect from lan</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="170"/>
<location filename="../src/mainwindow.cpp" line="172"/>
<source>Manage</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="173"/>
<location filename="../src/mainwindow.cpp" line="175"/>
<source>Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="176"/>
<location filename="../src/mainwindow.cpp" line="178"/>
<source>Auto Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="180"/>
<location filename="../src/mainwindow.cpp" line="183"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="181"/>
<location filename="../src/mainwindow.cpp" line="186"/>
<source>Check Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="227"/>
<location filename="../src/mainwindow.cpp" line="232"/>
<source>Proxy Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="250"/>
<location filename="../src/mainwindow.cpp" line="255"/>
<source>Config</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="274"/>
<location filename="../src/mainwindow.cpp" line="279"/>
<source>Help</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SubscribeDialog</name>
<message>
<location filename="../src/dialogs/subscribeDialog.cpp" line="16"/>
<location filename="../src/dialogs/subscribeDialog.cpp" line="17"/>
<source>New</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/dialogs/subscribeDialog.cpp" line="17"/>
<location filename="../src/dialogs/subscribeDialog.cpp" line="18"/>
<source>Delete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/dialogs/subscribeDialog.cpp" line="18"/>
<location filename="../src/dialogs/subscribeDialog.cpp" line="19"/>
<source>Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/dialogs/subscribeDialog.cpp" line="36"/>
<location filename="../src/dialogs/subscribeDialog.cpp" line="37"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/dialogs/subscribeDialog.cpp" line="37"/>
<location filename="../src/dialogs/subscribeDialog.cpp" line="38"/>
<source>Url</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/dialogs/subscribeDialog.cpp" line="38"/>
<location filename="../src/dialogs/subscribeDialog.cpp" line="39"/>
<source>Time</source>
<translation type="unfinished"></translation>
</message>
Expand Down
50 changes: 25 additions & 25 deletions lang/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
</message>
<message>
<location filename="../build/ui_mainwindow.h" line="228"/>
<location filename="../src/mainwindow.cpp" line="46"/>
<location filename="../src/mainwindow.cpp" line="48"/>
<source>Overview</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../build/ui_mainwindow.h" line="229"/>
<location filename="../src/mainwindow.cpp" line="50"/>
<location filename="../src/mainwindow.cpp" line="52"/>
<source>Proxies</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -76,120 +76,120 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="123"/>
<location filename="../src/mainwindow.cpp" line="125"/>
<source>Show MainWindow</source>
<translation>显示主窗口</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="126"/>
<location filename="../src/mainwindow.cpp" line="128"/>
<source>&amp;Quit</source>
<translation>&amp;退出</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="132"/>
<location filename="../src/mainwindow.cpp" line="134"/>
<source>Global</source>
<translation>全局连接</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="135"/>
<location filename="../src/mainwindow.cpp" line="137"/>
<source>Rule</source>
<translation>规则判断</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="138"/>
<location filename="../src/mainwindow.cpp" line="140"/>
<source>Direct</source>
<translation>直接连接</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="152"/>
<location filename="../src/mainwindow.cpp" line="154"/>
<source>Set as system proxy</source>
<translation>设置为系统代理</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="157"/>
<location filename="../src/mainwindow.cpp" line="159"/>
<source>Copy shell command</source>
<translation>复制终端代理命令</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="160"/>
<location filename="../src/mainwindow.cpp" line="162"/>
<source>Start at login</source>
<translation>开机启动</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="165"/>
<location filename="../src/mainwindow.cpp" line="167"/>
<source>Allow connect from lan</source>
<translation>允许局域网连接</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="170"/>
<location filename="../src/mainwindow.cpp" line="172"/>
<source>Manage</source>
<translation>管理</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="173"/>
<location filename="../src/mainwindow.cpp" line="175"/>
<source>Update</source>
<translation>更新</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="176"/>
<location filename="../src/mainwindow.cpp" line="178"/>
<source>Auto Update</source>
<translation>自动更新</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="180"/>
<location filename="../src/mainwindow.cpp" line="183"/>
<source>About</source>
<translation>关于</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="181"/>
<location filename="../src/mainwindow.cpp" line="186"/>
<source>Check Update</source>
<translation>检查更新</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="227"/>
<location filename="../src/mainwindow.cpp" line="232"/>
<source>Proxy Mode</source>
<translation>代理模式</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="250"/>
<location filename="../src/mainwindow.cpp" line="255"/>
<source>Config</source>
<translation>配置</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="274"/>
<location filename="../src/mainwindow.cpp" line="279"/>
<source>Help</source>
<translation>帮助</translation>
</message>
</context>
<context>
<name>SubscribeDialog</name>
<message>
<location filename="../src/dialogs/subscribeDialog.cpp" line="16"/>
<location filename="../src/dialogs/subscribeDialog.cpp" line="17"/>
<source>New</source>
<translation>新建</translation>
</message>
<message>
<location filename="../src/dialogs/subscribeDialog.cpp" line="17"/>
<location filename="../src/dialogs/subscribeDialog.cpp" line="18"/>
<source>Delete</source>
<translation>删除</translation>
</message>
<message>
<location filename="../src/dialogs/subscribeDialog.cpp" line="18"/>
<location filename="../src/dialogs/subscribeDialog.cpp" line="19"/>
<source>Update</source>
<translation>更新</translation>
</message>
<message>
<location filename="../src/dialogs/subscribeDialog.cpp" line="36"/>
<location filename="../src/dialogs/subscribeDialog.cpp" line="37"/>
<source>Name</source>
<translation>名称</translation>
</message>
<message>
<location filename="../src/dialogs/subscribeDialog.cpp" line="37"/>
<location filename="../src/dialogs/subscribeDialog.cpp" line="38"/>
<source>Url</source>
<translation>链接</translation>
</message>
<message>
<location filename="../src/dialogs/subscribeDialog.cpp" line="38"/>
<location filename="../src/dialogs/subscribeDialog.cpp" line="39"/>
<source>Time</source>
<translation>时间</translation>
</message>
Expand Down
20 changes: 17 additions & 3 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#include "mainwindow.h"
#include "BuildConfig.h"
#include "./ui_mainwindow.h"
#include "./core/configurator.h"
#include "./core/clashApi.h"
#include "./utils/iconsForkAwesome.h"
#include "./utils/utility.h"
#include <string>

#include <QAction>
Expand Down Expand Up @@ -43,11 +45,11 @@ MainWindow::MainWindow(QWidget *parent)
ui->logoLabel->setPixmap(logo);

ui->overviewButton->setFont(font);
QString overviewStr = QString("%1 %2").arg(QChar(0xf0e4)).arg(tr("Overview"));
QString overviewStr = QString("%1 %2").arg(ICON_FK_TACHOMETER).arg(tr("Overview"));
ui->overviewButton->setText(overviewStr);
pageButtons->addButton(ui->overviewButton);
ui->proxiesButton->setFont(font);
QString proxiesStr = QString("%1 %2").arg(QChar(0xf1d8)).arg(tr("Proxies"));
QString proxiesStr = QString("%1 %2").arg(ICON_FK_PAPER_PLANE).arg(tr("Proxies"));
ui->proxiesButton->setText(proxiesStr);
pageButtons->addButton(ui->proxiesButton);

Expand Down Expand Up @@ -179,8 +181,10 @@ void MainWindow::createActions()
connect(autoUpdateSubConfig, &QAction::triggered, this, &MainWindow::autoUpdateSubConfigChange);

about = new QAction(tr("About"), this);
checkUpdate = new QAction(tr("Check Update"), this);
connect(about, &QAction::triggered, this, &MainWindow::showAboutDialog);

checkUpdate = new QAction(tr("Check Update"), this);
connect(checkUpdate, &QAction::triggered, this, &MainWindow::checkLatestRelease);
}

void MainWindow::proxyGroupMenusChange()
Expand Down Expand Up @@ -429,6 +433,16 @@ void MainWindow::showAboutDialog()
}
}

void MainWindow::checkLatestRelease()
{
QString version = Utility::getLatestVersion();
if (Utility::isVersionNewer(QCLASH_VERSION, version)) {
QMessageBox::information(this, "Latest Version", QString("Found newer version %1").arg(version));
} else {
qDebug() << "You use the latest version, enjoy youself!";
}
}

void MainWindow::showSubscribeDialog()
{
if (subscribeDialog)
Expand Down
2 changes: 2 additions & 0 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ private slots:
void showMainWindow();

void showAboutDialog();
void checkLatestRelease();

void showSubscribeDialog();
void updateSubActions();

Expand Down
Loading

0 comments on commit 4481689

Please sign in to comment.