Skip to content

Commit

Permalink
Updated the About box.
Browse files Browse the repository at this point in the history
Made a small fix in UpdateWindow. The program should avoid to close if the updater failed to launch. Still need to figure out why the Updater doesn't launch.
  • Loading branch information
danijel.korzinek@gmail.com committed Jun 28, 2012
1 parent 59f3de8 commit 59be8cb
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 42 deletions.
Binary file added images/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 45 additions & 40 deletions src/org/jmc/gui/About.java
Expand Up @@ -18,47 +18,52 @@ private static void init()
if(initialized)
return;

String msg="<html><div style=\"width:200px\">";
String logo=About.class.getResource("logo.png").toExternalForm();

msg+="<div style=\"font-size:24pt\">jMC2Obj</div>";
msg+="<div style=\"font-size:14pt\">A Java Minecraft to OBJ converter</div>";
msg+="<div style=\"font-size:12pt\">version: "+Version.VERSION+" build "+Version.REVISION()+"</div>";
msg+="<div style=\"font-size:12pt;margin-bottom:20px\">build date: "+Version.DATE().toString()+"</div>";

List<String> developer_list=new LinkedList<String>();

developer_list.add("Max Tangelder - programming");
developer_list.add("Danijel Kor&#x017e;inek - programming");
developer_list.add("Pedro Lopes - programming");

//I hate ordering people so I used this trick...
Collections.shuffle(developer_list);

msg+="Made by:";
msg+="<ul style=\"list-style-type:none\">";
for(String s:developer_list)
msg+="<li>"+s+"</li>";
msg+="</ul>";


List<String> donations=new LinkedList<String>();

donations.add("Hilum");
donations.add("The Pixel Artist");
donations.add("Justin \"Rip_Shot\" Goran");
donations.add("Slamacow Creations");

Collections.shuffle(donations);

msg+="We would like to thank these people for their donations:";
msg+="<ul style=\"list-style-type:none\">";
for(String s:donations)
msg+="<li>"+s+"</li>";
msg+="</ul>";

msg+="</div></html>";

about_msg=msg;
// define the about box with a width of 300px
String msg="<html><div style='width:300px'><div style='text-align:center;'><img src=\""+logo+"\"></div>";
msg+="<div style='text-align:center;font-weight:bold; font-size:20pt;'>jMC2Obj</div>";
msg+="<div style='text-align:center;font-weight:bold; font-size:16pt;'>A Java Minecraft to OBJ converter</div><p>";
msg+="<table width=\"100%\" border=\"0\"><tr><td width=\"100px\">version:</td><td>"+Version.VERSION+Version.REVISION()+"</td></tr>"
+"<tr><td width=\"100px\">build date:</td><td>"+Version.DATE().toString()+"</td></tr>"
+ "</table><p>";
List<String> developer_list=new LinkedList<String>();

developer_list.add("<td>Max Tangelder</td><td>programming</td>");
developer_list.add("<td>Danijel Kor&#x017e;inek</td><td>programming</td>");
developer_list.add("<td>Pedro Lopes</td><td>programming</td>");

Collections.shuffle(developer_list);

msg+="<table width=\"100%\" border=\"0\">";
msg+="<tr><td width=\"100px\"<b>name</b></td><td>&nbsp;</td></tr>";

for(String s:developer_list)
msg+="<tr>"+s+"</tr>";

msg+="</table><br><p>";

List<String> donations=new LinkedList<String>();

donations.add("Hilum");
donations.add("The Pixel Artist");
donations.add("Justin \"Rip_Shot\" Goran");
donations.add("Slamacow Creations");
donations.add("darkinnit");

Collections.shuffle(donations);

msg+="<u>We would like to thank these people for their donations:</u><br><p>";
msg+="<table width=\"100%\" border=\"0\">";
for(String s:donations)
msg+="<tr><td>"+s+"</td></tr>";

msg+="</table><p><br>";
msg+="<div style='text-align:center;'>Source and Binary avilable at Google Source:<br>" +
"http://code.google.com/p/j-mc-2-obj/<br>" +
"<a href=\"http://www.jmc2obj.net/\">http://www.jmc2obj.net/</a></div>";
msg+="</div><p><br></html>";
about_msg=msg;
initialized=true;
}

Expand Down
14 changes: 12 additions & 2 deletions src/org/jmc/gui/UpdateWindow.java
Expand Up @@ -143,9 +143,19 @@ public void actionPerformed(ActionEvent e) {

Log.info("running: "+cmd);

Runtime.getRuntime().exec(cmd);
Process p = Runtime.getRuntime().exec(cmd);

System.exit(0);
int ret=0;
try{

Thread.sleep(1000);
ret=p.exitValue();

}catch (Exception ex) {
System.exit(0);
}

Log.info("Updater exited with value: "+ret);

} catch (IOException e1) {
Log.info("Cannot run updater: "+e1);
Expand Down
Binary file added src/org/jmc/gui/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 59be8cb

Please sign in to comment.