Skip to content

Commit

Permalink
Adds Luyten Version to About, Closes #29
Browse files Browse the repository at this point in the history
  • Loading branch information
deathmarine committed Jan 6, 2016
1 parent 6e49935 commit 7ec6aee
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
20 changes: 20 additions & 0 deletions src/us/deathmarine/luyten/Luyten.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package us.deathmarine.luyten;

import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

Expand All @@ -10,6 +12,7 @@
public class Luyten {

public static void main(String[] args) {

try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
Expand Down Expand Up @@ -42,4 +45,21 @@ public static File getFileFromCommandLine(String[] args) {
}
return fileFromCommandLine;
}

public static String getVersion(){
String result = "";
try {
String line;
BufferedReader br = new BufferedReader(new InputStreamReader(ClassLoader.getSystemResourceAsStream("META-INF/maven/us.deathmarine/luyten/pom.properties")));
while((line = br.readLine())!= null){
if(line.contains("version"))
result = line.split("=")[1];
}
br.close();
} catch (Exception e) {
return result;
}
return result;

}
}
6 changes: 3 additions & 3 deletions src/us/deathmarine/luyten/MainMenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,9 @@ public void actionPerformed(ActionEvent e) {
@Override
public void actionPerformed(ActionEvent event) {
JOptionPane.showMessageDialog(null,
"Luyten Gui \n" +
"by Deathmarine, Zerdei\n\n" +
"Powered By\nProcyon "+Procyon.version()+
"Luyten " + Luyten.getVersion() +
"\nby Deathmarine, Zerdei\n\n" +
"Powered By\nProcyon "+ Procyon.version()+
"\n(c) 2015 Mike Strobel\n\n" +
"RSyntaxTextArea\n" +
"(c) 2012 Robert Futrell\n" +
Expand Down

0 comments on commit 7ec6aee

Please sign in to comment.