Skip to content
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