Skip to content

Commit

Permalink
updated to 0.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Seil0 committed Nov 12, 2016
1 parent 985ca4c commit 42f13f3
Show file tree
Hide file tree
Showing 13 changed files with 106 additions and 51 deletions.
Binary file modified bin/application/MainWindowController$1.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$2.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$3.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$4.class
Binary file not shown.
Binary file modified bin/application/MainWindowController.class
Binary file not shown.
Binary file removed bin/libraries/commons-lang3-3.4.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions bin/recources/HomeFlix-Local_de_DE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ openFolder = Ordner \u00F6ffnen
chooseFolder = Ordner ausw\u00E4hlen
fontSize = Schriftgr\u00F6\u00DFe:
checkUpdates = Auf Update pr\u00FCfen
updateBtnavail = Update verf\u00FCgbar
updateBtnNotavail = Kein Update verf\u00FCgbar
autoUpdate = beim Start nach Updates suchen:
version = Version:
columnName = Name
Expand Down
2 changes: 2 additions & 0 deletions bin/recources/HomeFlix-Local_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ openFolder = open Folder
chooseFolder = choose Directory
fontSize = font size:
checkUpdates = check for updates
updateBtnavail = update available
updateBtnNotavail = no update available
autoUpdate = check at startup for updates:
version = Version:
columnName = Name
Expand Down
147 changes: 97 additions & 50 deletions src/application/MainWindowController.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.math.BigInteger;
import java.net.URI;
import java.net.URISyntaxException;
Expand Down Expand Up @@ -73,14 +76,17 @@
import javafx.scene.control.Label;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextArea;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeTableColumn;
import javafx.scene.control.TreeTableColumn.CellDataFeatures;
import javafx.scene.control.TreeTableView;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
Expand Down Expand Up @@ -155,6 +161,7 @@ public class MainWindowController {
@FXML
private ImageView image1;


@FXML
TreeItem<streamUiData> root = new TreeItem<>(new streamUiData(1, 1, 1, 5.0,"1", "filme","1"));
@FXML
Expand All @@ -180,11 +187,11 @@ public class MainWindowController {
private TableColumn<streamUiData, String> dataNameEndColumn = new TableColumn<>("Datei Name mit Endung");


private boolean menutrue = false; //merker für menubtn (öffnen oder schließen)
private boolean menutrue = false; //saves the position of menubtn (opened or closed)
private boolean settingstrue = false;
private boolean streamingSettingsTrue = false;
private String version = "0.3.8";
private String versionName = "half glowing bucket";
private String version = "0.3.9";
private String versionName = "glowing bucket";
private String versionURL = "https://raw.githubusercontent.com/Seil0/Project-HomeFlix/master/updates/version.txt";
private String downloadLink = "https://raw.githubusercontent.com/Seil0/Project-HomeFlix/master/updates/downloadLink.txt";
private File dir = new File(System.getProperty("user.home") + "/Documents/HomeFlix");
Expand Down Expand Up @@ -286,12 +293,7 @@ private void playbtnclicked(){
try {
Runtime.getRuntime().exec("vlc "+getPath()+"/"+ datPath);
} catch (IOException e) {
Alert alert = new Alert(AlertType.ERROR);
alert.setHeaderText("");
alert.setTitle("Info");
alert.setContentText(errorPlay);
alert.showAndWait();
e.printStackTrace();
showErrorMsg(errorPlay,e);
}
}
}else if(SystemUtils.IS_OS_WINDOWS || SystemUtils.IS_OS_MAC_OSX){
Expand All @@ -300,30 +302,18 @@ private void playbtnclicked(){
try {
Desktop.getDesktop().open(new File(getPath()+"\\"+ datPath));
} catch (IOException e) {
Alert alert = new Alert(AlertType.ERROR);
alert.setHeaderText("");
alert.setTitle("Info");
alert.setContentText(errorPlay);
alert.showAndWait();
e.printStackTrace();
showErrorMsg(errorPlay,e);
}
}else if(mode.equals("streaming")){
try {
Desktop.getDesktop().browse(new URI(datPath)); //opening streaming url in browser (other option?)
Desktop.getDesktop().browse(new URI(datPath)); //opens the streaming url in browser (other option?)
} catch (URISyntaxException | IOException e) {
Alert alert = new Alert(AlertType.ERROR);
alert.setHeaderText("");
alert.setTitle("Error");
alert.setContentText(errorOpenStream);
alert.showAndWait();
e.printStackTrace();
showErrorMsg(errorOpenStream, (IOException) e);
}
}else{
Alert alert = new Alert(AlertType.ERROR);
alert.setHeaderText("");
alert.setTitle("Error");
alert.setContentText(errorMode);
alert.showAndWait();
IOException e = new IOException("error");
showErrorMsg(errorMode, e);

}
}
}
Expand Down Expand Up @@ -415,6 +405,41 @@ private void switchBtnclicked(){
@FXML
private void debugBtnclicked(){
//for testing

Alert alert = new Alert(AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("");
alert.setContentText(errorUpdateV);

Exception ex = new FileNotFoundException("Could not find file blabla.txt");

// Create expandable Exception.
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
ex.printStackTrace(pw);
String exceptionText = sw.toString();

Label label = new Label("The exception stacktrace was:");

TextArea textArea = new TextArea(exceptionText);
textArea.setEditable(false);
textArea.setWrapText(true);

textArea.setMaxWidth(Double.MAX_VALUE);
textArea.setMaxHeight(Double.MAX_VALUE);
GridPane.setVgrow(textArea, Priority.ALWAYS);
GridPane.setHgrow(textArea, Priority.ALWAYS);

GridPane expContent = new GridPane();
expContent.setMaxWidth(Double.MAX_VALUE);
expContent.add(label, 0, 0);
expContent.add(textArea, 0, 1);

// Set expandable Exception into the dialog pane.
alert.getDialogPane().setExpandableContent(expContent);

alert.showAndWait();

}


Expand All @@ -434,8 +459,8 @@ private void directoryBtnAction(){
saveSettings();
tfPath.setText(getPath());
try {
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //starte neu
System.exit(0); //beendet sich selbst
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //start again
System.exit(0); //finishes itself
} catch (IOException e) {
System.out.println("es ist ein Fehler aufgetreten");
e.printStackTrace();
Expand Down Expand Up @@ -479,8 +504,8 @@ private void streamingDirectoryBtnAction(){
saveSettings();
tfStreamingPath.setText(getStreamingPath());
try {
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //starte neu
System.exit(0); //beendet sich selbst
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //start again
System.exit(0); //finishes itself
} catch (IOException e) {
System.out.println("es ist ein Fehler aufgetreten");
e.printStackTrace();
Expand Down Expand Up @@ -527,7 +552,7 @@ public void setMain(Main main) {
@SuppressWarnings({ "unchecked", "rawtypes" })
private void initTabel(){

//Filmtabelle
//filmtabelle
columnRating.setMaxWidth(120);
columnTitel.setMaxWidth(240);
columnStreamUrl.setMaxWidth(0);
Expand Down Expand Up @@ -640,12 +665,7 @@ private void update(){
aktVersion = in.readLine(); //schreibt inputstream in String
in.close();
} catch (IOException e1) {
Alert alert = new Alert(AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("");
alert.setContentText(errorUpdateV);
alert.showAndWait();
e1.printStackTrace();
showErrorMsg(errorUpdateV, e1);
}
System.out.println("Version: "+version+", Update: "+aktVersion);

Expand All @@ -654,11 +674,11 @@ private void update(){
int iaktVersion = Integer.parseInt(aktVersion.replace(".", ""));

if(iversion >= iaktVersion){
updateBtn.setText("kein Update verügbar");
System.out.println("kein Update verfügbar");
updateBtn.setText(bundle.getString("updateBtnNotavail"));
System.out.println("no update available");
}else{
updateBtn.setText("Update verfügbar");
System.out.println("Update verfügbar");
updateBtn.setText(bundle.getString("updateBtnavail"));
System.out.println("update available");
try {
URL website;
URL downloadURL = new URL(downloadLink);
Expand All @@ -672,14 +692,8 @@ private void update(){
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //starte neu
System.exit(0); //beendet sich selbst
} catch (IOException e) {
//Falls ein Fehler auftritt
e.printStackTrace();
Alert alert = new Alert(AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("");
alert.setContentText(errorUpdateD);
alert.showAndWait();
e.printStackTrace();
//in case there is an error
showErrorMsg(errorUpdateD, e);
}
}
}
Expand Down Expand Up @@ -907,6 +921,39 @@ public void setLoaclUI(int local){
vlcNotInstalled = bundle.getString("vlcNotInstalled");
}

private void showErrorMsg(String msg, IOException exception){
Alert alert = new Alert(AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("");
alert.setContentText(msg);

// Create expandable Exception.
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
exception.printStackTrace(pw);
String exceptionText = sw.toString();

TextArea textArea = new TextArea(exceptionText);
textArea.setEditable(false);
textArea.setWrapText(true);

textArea.setMaxWidth(Double.MAX_VALUE);
textArea.setMaxHeight(Double.MAX_VALUE);
GridPane.setVgrow(textArea, Priority.ALWAYS);
GridPane.setHgrow(textArea, Priority.ALWAYS);

GridPane expContent = new GridPane();
expContent.setMaxWidth(Double.MAX_VALUE);
expContent.add(textArea, 0, 1);

// Set expandable Exception into the dialog pane.
alert.getDialogPane().setExpandableContent(expContent);
alert.showAndWait();

exception.printStackTrace();

}

//speichert die Einstellungen
public void saveSettings(){
try {
Expand Down
2 changes: 2 additions & 0 deletions src/recources/HomeFlix-Local_de_DE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ openFolder = Ordner \u00F6ffnen
chooseFolder = Ordner ausw\u00E4hlen
fontSize = Schriftgr\u00F6\u00DFe:
checkUpdates = Auf Update pr\u00FCfen
updateBtnavail = Update verf\u00FCgbar
updateBtnNotavail = Kein Update verf\u00FCgbar
autoUpdate = beim Start nach Updates suchen:
version = Version:
columnName = Name
Expand Down
2 changes: 2 additions & 0 deletions src/recources/HomeFlix-Local_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ openFolder = open Folder
chooseFolder = choose Directory
fontSize = font size:
checkUpdates = check for updates
updateBtnavail = update available
updateBtnNotavail = no update available
autoUpdate = check at startup for updates:
version = Version:
columnName = Name
Expand Down
Binary file modified updates/ProjectHomeFlix.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion updates/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.8
0.3.9

0 comments on commit 42f13f3

Please sign in to comment.