Extracted the codes about installing

This commit is contained in:
huanghongxun
2015-12-11 21:15:56 +08:00
parent 78c46aeb64
commit d052442aea
14 changed files with 545 additions and 1049 deletions

View File

@@ -69,9 +69,9 @@ public class SwingUtils {
*
* @param link
*/
public static void openLink(URI link) {
public static void openLink(String link) {
try {
java.awt.Desktop.getDesktop().browse(link);
java.awt.Desktop.getDesktop().browse(new URI(link));
} catch (Throwable e) {
HMCLog.warn("Failed to open link: " + link, e);
}
@@ -138,7 +138,6 @@ public class SwingUtils {
DefaultTableModel model = (DefaultTableModel) table.getModel();
while (model.getRowCount() > 0)
model.removeRow(0);
table.updateUI();
return model;
}

View File

@@ -69,16 +69,6 @@ public final class Utils {
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(text), null);
}
public static boolean openLink(String url) {
try {
Desktop.getDesktop().browse(new URI(url));
return true;
} catch (Exception ex) {
HMCLog.warn("Failed to open link:" + url, ex);
return false;
}
}
public static void openFolder(File f) {
try {
f.mkdirs();

View File

@@ -29,6 +29,7 @@ import org.jackhuang.hellominecraft.utils.functions.NonFunction;
import org.jackhuang.hellominecraft.utils.DoubleOutputStream;
import org.jackhuang.hellominecraft.utils.LauncherPrintStream;
import org.jackhuang.hellominecraft.utils.LogWindowOutputStream;
import org.jackhuang.hellominecraft.utils.SwingUtils;
import org.jackhuang.hellominecraft.utils.Utils;
/**
@@ -224,15 +225,15 @@ public class LogWindow extends javax.swing.JFrame {
}//GEN-LAST:event_btnCopyActionPerformed
private void btnMCBBSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMCBBSActionPerformed
Utils.openLink(C.URL_PUBLISH);
SwingUtils.openLink(C.URL_PUBLISH);
}//GEN-LAST:event_btnMCBBSActionPerformed
private void btnTieBaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTieBaActionPerformed
Utils.openLink(C.URL_TIEBA);
SwingUtils.openLink(C.URL_TIEBA);
}//GEN-LAST:event_btnTieBaActionPerformed
private void btnMCFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMCFActionPerformed
Utils.openLink(C.URL_MINECRAFTFORUM);
SwingUtils.openLink(C.URL_MINECRAFTFORUM);
}//GEN-LAST:event_btnMCFActionPerformed
private void btnTerminateGameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTerminateGameActionPerformed
@@ -241,7 +242,7 @@ public class LogWindow extends javax.swing.JFrame {
}//GEN-LAST:event_btnTerminateGameActionPerformed
private void btnGitHubActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGitHubActionPerformed
Utils.openLink(C.URL_GITHUB);
SwingUtils.openLink(C.URL_GITHUB);
}//GEN-LAST:event_btnGitHubActionPerformed
public void log(String status) {

View File

@@ -29,7 +29,7 @@ launch.exited_abnormally=\u6e38\u620f\u975e\u6b63\u5e38\u9000\u51fa\uff0c\u8bf7\
install.no_version=\u672a\u627e\u5230\u8981\u5b89\u88c5\u7684\u5bf9\u5e94MC\u7248\u672c
install.no_version_if_intall=\u672a\u627e\u5230\u8981\u5b89\u88c5\u7684\u5bf9\u5e94MC\u7248\u672c\uff0c\u662f\u5426\u81ea\u52a8\u5b89\u88c5\u9700\u8981\u7684MC\u7248\u672c\uff1f
install.not_refrehsed=\u672a\u5237\u65b0\u5217\u8868
install.not_refreshed=\u672a\u5237\u65b0\u5217\u8868
install.download_list=\u4e0b\u8f7d\u5217\u8868
install.liteloader.get_list=\u83b7\u53d6LiteLoader\u5217\u8868

View File

@@ -29,7 +29,7 @@ launch.exited_abnormally=Game exited abnormally, please visit the log, or ask so
install.no_version=The version is not found.
install.no_version_if_intall=The needed version is not found, should install the version automatically?
install.not_refrehsed=The installer list is not refreshed.
install.not_refreshed=The installer list is not refreshed.
install.download_list=Download List
install.liteloader.get_list=Get LiteLoader List

View File

@@ -29,7 +29,7 @@ launch.exited_abnormally=\u904a\u6232\u975e\u6b63\u5e38\u9000\u51fa\uff0c\u8acb\
install.no_version=\u672a\u627e\u5230\u8981\u5b89\u88dd\u7684\u5c0d\u61c9MC\u7248\u672c
install.no_version_if_intall=\u672a\u627e\u5230\u8981\u5b89\u88dd\u7684\u5c0d\u61c9MC\u7248\u672c\uff0c\u662f\u5426\u81ea\u52a8\u5b89\u88c5\u9700\u8981\u7684MC\u7248\u672c\uff1f
install.not_refrehsed=\u672a\u5237\u65b0\u5217\u8868
install.not_refreshed=\u672a\u5237\u65b0\u5217\u8868
install.download_list=\u4e0b\u8f09\u5217\u8868
install.liteloader.get_list=\u7372\u53d6LiteLoader\u5217\u8868

View File

@@ -29,7 +29,7 @@ launch.exited_abnormally=\u6e38\u620f\u975e\u6b63\u5e38\u9000\u51fa\uff0c\u8bf7\
install.no_version=\u672a\u627e\u5230\u8981\u5b89\u88c5\u7684\u5bf9\u5e94MC\u7248\u672c
install.no_version_if_intall=\u672a\u627e\u5230\u8981\u5b89\u88c5\u7684\u5bf9\u5e94MC\u7248\u672c\uff0c\u662f\u5426\u81ea\u52a8\u5b89\u88c5\u9700\u8981\u7684MC\u7248\u672c\uff1f
install.not_refrehsed=\u672a\u5237\u65b0\u5217\u8868
install.not_refreshed=\u672a\u5237\u65b0\u5217\u8868
install.download_list=\u4e0b\u8f7d\u5217\u8868
install.liteloader.get_list=\u83b7\u53d6LiteLoader\u5217\u8868