change to C.i18n

This commit is contained in:
huanghongxun
2015-12-17 20:35:23 +08:00
parent 38460678db
commit eff087d9f0
10 changed files with 201 additions and 551 deletions

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -42,7 +42,6 @@ import org.jackhuang.hellominecraft.views.LogWindow;
import org.jackhuang.hellominecraft.launcher.settings.Settings;
import org.jackhuang.hellominecraft.launcher.utils.upgrade.IUpgrader;
import org.jackhuang.hellominecraft.launcher.views.MainFrame;
import org.jackhuang.hellominecraft.launcher.views.ServerListView;
import org.jackhuang.hellominecraft.lookandfeel.HelloMinecraftLookAndFeel;
import org.jackhuang.hellominecraft.utils.MathUtils;
import org.jackhuang.hellominecraft.utils.StrUtils;
@@ -86,9 +85,9 @@ public final class Main implements Runnable {
HttpsURLConnection.setDefaultHostnameVerifier(HNV);
}
public static String launcherName = "Hello Minecraft! Launcher";
public static byte firstVer = 2, secondVer = 3, thirdVer = 1, forthVer = 6;
public static int minimumLauncherVersion = 16;
public static final String LAUNCHER_NAME = "Hello Minecraft! Launcher";
public static final byte VERSION_FIRST = 2, VERSION_SECOND = 3, VERSION_THIRD = 1, VERSION_FORTH = 6;
public static final int MINIMUM_LAUNCHER_VERSION = 16;
//public static Proxy PROXY;
/**
@@ -97,7 +96,7 @@ public final class Main implements Runnable {
* @return the version: firstVer.secondVer.thirdVer
*/
public static String makeVersion() {
return "" + firstVer + '.' + secondVer + '.' + thirdVer + '.' + forthVer;
return "" + VERSION_FIRST + '.' + VERSION_SECOND + '.' + VERSION_THIRD + '.' + VERSION_FORTH;
}
/**
@@ -106,15 +105,15 @@ public final class Main implements Runnable {
* @return the MainWindow title.
*/
public static String makeTitle() {
return launcherName + ' ' + makeVersion();
return LAUNCHER_NAME + ' ' + makeVersion();
}
public static final Main INSTANCE = new Main();
@SuppressWarnings( {"CallToPrintStackTrace", "UseSpecificCatch"})
@SuppressWarnings({"CallToPrintStackTrace", "UseSpecificCatch"})
public static void main(String[] args) {
{
if (IUpgrader.NOW_UPGRADER.parseArguments(new VersionNumber(firstVer, secondVer, thirdVer), args))
if (IUpgrader.NOW_UPGRADER.parseArguments(new VersionNumber(VERSION_FIRST, VERSION_SECOND, VERSION_THIRD), args))
return;
System.setProperty("sun.java2d.noddraw", "true");
@@ -143,8 +142,8 @@ public final class Main implements Runnable {
}
Settings.UPDATE_CHECKER.outdated.register(IUpgrader.NOW_UPGRADER);
Settings.UPDATE_CHECKER.process(false).subscribeOn(Schedulers.newThread()).subscribe(t ->
Main.invokeUpdate());
Settings.UPDATE_CHECKER.process(false).subscribeOn(Schedulers.newThread()).subscribe(t
-> Main.invokeUpdate());
if (StrUtils.isNotBlank(Settings.getInstance().getProxyHost()) && StrUtils.isNotBlank(Settings.getInstance().getProxyPort()) && MathUtils.canParseInt(Settings.getInstance().getProxyPort())) {
HMCLog.log("Initializing customized proxy");

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -50,7 +50,8 @@ public final class Settings {
private static boolean isFirstLoading;
private static final Config SETTINGS;
public static final UpdateChecker UPDATE_CHECKER;
public static final UpdateChecker UPDATE_CHECKER = new UpdateChecker(new VersionNumber(Main.VERSION_FIRST, Main.VERSION_SECOND, Main.VERSION_THIRD),
"hmcl");
public static final List<Java> JAVA;
public static Config getInstance() {
@@ -69,9 +70,6 @@ public final class Settings {
for (Profile e : getProfiles().values())
e.checkFormat();
UPDATE_CHECKER = new UpdateChecker(new VersionNumber(Main.firstVer, Main.secondVer, Main.thirdVer),
"hmcl");
List<Java> temp = new ArrayList<>();
temp.add(new Java("Default", System.getProperty("java.home")));
temp.add(new Java("Custom", null));

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -17,9 +17,6 @@
*/
package org.jackhuang.hellominecraft.launcher.utils.upgrade;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -46,6 +43,7 @@ import org.jackhuang.hellominecraft.tasks.download.FileDownloadTask;
import org.jackhuang.hellominecraft.utils.ArrayUtils;
import org.jackhuang.hellominecraft.utils.MessageBox;
import org.jackhuang.hellominecraft.utils.UpdateChecker;
import org.jackhuang.hellominecraft.utils.Utils;
import org.jackhuang.hellominecraft.utils.VersionNumber;
import org.jackhuang.hellominecraft.utils.system.FileUtils;
import org.jackhuang.hellominecraft.utils.system.IOUtils;
@@ -118,9 +116,7 @@ public class AppDataUpgrader extends IUpgrader {
java.awt.Desktop.getDesktop().browse(new URI(url));
} catch (URISyntaxException | IOException e) {
HMCLog.warn("Failed to browse uri: " + url, e);
Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
cb.setContents(new StringSelection(url), null);
Utils.setClipborad(url);
MessageBox.Show(C.i18n("update.no_browser"));
}
}

View File

@@ -18,6 +18,8 @@
package org.jackhuang.hellominecraft.launcher.utils.upgrade;
import org.jackhuang.hellominecraft.utils.Event;
import org.jackhuang.hellominecraft.utils.Event;
import org.jackhuang.hellominecraft.utils.VersionNumber;
import org.jackhuang.hellominecraft.utils.VersionNumber;
/**