Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

去除1.12版本的“版本更新”弹窗 #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added finalspeed_client.jar
Binary file not shown.
49 changes: 0 additions & 49 deletions src/net/fs/client/ClientUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ public class ClientUI implements ClientUII, WindowListener {

private SystemTray tray;

int serverVersion = -1;

int localVersion = 3;

boolean checkingUpdate = false;

String domain = "";

String homeUrl;
Expand Down Expand Up @@ -131,8 +125,6 @@ public class ClientUI implements ClientUII, WindowListener {
public boolean isVisible = true;

JRadioButton r_tcp, r_udp;

String updateUrl;

boolean min=false;

Expand All @@ -145,7 +137,6 @@ public class ClientUI implements ClientUII, WindowListener {
{
domain = "ip4a.com";
homeUrl = "http://www.ip4a.com/?client_fs";
updateUrl = "http://fs.d1sm.net/finalspeed/update.properties";
}

ClientUI(final boolean isVisible,boolean min) {
Expand Down Expand Up @@ -650,13 +641,7 @@ public void run() {
mapClient.setMapServer(config.getServerAddress(), config.getServerPort(), config.getRemotePort(), null, null, config.isDirect_cn(), config.getProtocal().equals("tcp"),
null);

Route.es.execute(new Runnable() {

@Override
public void run() {
checkUpdate();
}
});

setSpeed(config.getDownloadSpeed(), config.getUploadSpeed());
if (isVisible&!min) {
Expand Down Expand Up @@ -1072,40 +1057,6 @@ JButton createButton(String name) {
return button;
}

boolean haveNewVersion() {
return serverVersion > localVersion;
}

public void checkUpdate() {
for (int i = 0; i < 3; i++) {
checkingUpdate = true;
try {
Properties propServer = new Properties();
HttpURLConnection uc = Tools.getConnection(updateUrl);
uc.setUseCaches(false);
InputStream in = uc.getInputStream();
propServer.load(in);
serverVersion = Integer.parseInt(propServer.getProperty("version"));
break;
} catch (Exception e) {
e.printStackTrace();
try {
Thread.sleep(3 * 1000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
} finally {
checkingUpdate = false;
}
}
if (this.haveNewVersion()) {
int option = JOptionPane.showConfirmDialog(mainFrame, "发现新版本,立即更新吗?", "提醒", JOptionPane.WARNING_MESSAGE);
if (option == JOptionPane.YES_OPTION) {
openUrl(homeUrl);
}
}

}

void initUI() {
SwingUtilities.invokeLater(new Runnable() {
Expand Down