Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
finishing the 2.0.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fadi Asbih committed Jan 29, 2016
1 parent e4d2dca commit c4965f7
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 99 deletions.
1 change: 0 additions & 1 deletion history.html

This file was deleted.

19 changes: 3 additions & 16 deletions src/de/unihannover/elsa/iui/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.controlsfx.dialog.Dialogs;

import au.com.bytecode.opencsv.CSVParser;
import au.com.bytecode.opencsv.CSVReader;
import de.unihannover.elsa.iui.model.Password;
import de.unihannover.elsa.iui.model.User;
import de.unihannover.elsa.iui.model.UserListWrapper;
import de.unihannover.elsa.iui.util.FxDialogs;
import de.unihannover.elsa.iui.util.PasswordUtility;
import de.unihannover.elsa.iui.util.Updater;
import de.unihannover.elsa.iui.view.ChooseHeaderDialog;
Expand Down Expand Up @@ -69,8 +69,6 @@ public class MainApp extends Application {
private int emailIndex;
private int loginIndex;
private int numberOfUsers;
private String currentVersion;
private String newVersion;
private Updater update;

/**
Expand Down Expand Up @@ -436,8 +434,7 @@ public void loadUserDataFromFile(File file) {
setUserFilePath(file);

} catch (Exception e) { // catches ANY exception
Dialogs.create().title("Error").masthead("Could not load data from file:\n" + file.getPath())
.showException(e);
FxDialogs.showException("Error", "Could not load data from file:\n" + file.getPath(), e);
}
}

Expand All @@ -462,8 +459,7 @@ public void saveUserDataToFile(File file) {
// Save the file path to the registry.
setUserFilePath(file);
} catch (Exception e) { // catches ANY exception
Dialogs.create().title("Error").masthead("Could not save data to file:\n" + file.getPath())
.showException(e);
FxDialogs.showException("Error", "Could not save data to file:\n" + file.getPath(), e);
}
}

Expand Down Expand Up @@ -891,16 +887,7 @@ public String getCurrentVersion() throws Exception {
return update.getCurrentVersion();
}

public void setCurrentVersion(String currentVersion) {
this.currentVersion = currentVersion;
}

public String getNewVersion() throws Exception {
return update.getNewVersion();
}

public void setNewVersion(String newVersion) {
this.newVersion = newVersion;
}

}
3 changes: 0 additions & 3 deletions src/de/unihannover/elsa/iui/model/Password.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlValue;
Expand Down
16 changes: 6 additions & 10 deletions src/de/unihannover/elsa/iui/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@

import java.time.LocalDate;

import javafx.beans.property.IntegerProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import de.unihannover.elsa.iui.util.DateUtil;
import de.unihannover.elsa.iui.util.LocalDateAdapter;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

/**
* Model class for a ILIAS User.
Expand Down
15 changes: 2 additions & 13 deletions src/de/unihannover/elsa/iui/util/Updater.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
package de.unihannover.elsa.iui.util;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;

public class Updater {
private final String versionURL = "https://github.com/iFadi/ilias-userimport/blob/master/version.html";
private final String historyURL = "https://github.com/iFadi/ilias-userimport/blob/master/history.html";
private final String versionURL = "https://github.com/iFadi/ilias-userimport/blob/master/resources/version.html";
private final String historyURL = "https://github.com/iFadi/ilias-userimport/blob/master/resources/history.html";
private InputStream version = getClass().getResourceAsStream("/version.html");
private String currentVersion;
private String newVersion;
private int currentMajor,currentMinor,currenPatch;

public int getMajorVersion() throws Exception {
Expand Down Expand Up @@ -95,15 +91,8 @@ public String getCurrentVersion() throws Exception {
return currentMajor+"."+currentMinor+"."+currenPatch;
}

public void setCurrentVersion(String currentVersion) {
this.currentVersion = currentVersion;
}

public String getNewVersion() throws Exception {
return getMajorVersion()+"."+getMinorVersion()+"."+getPatchVersion();
}

public void setNewVersion(String newVersion) {
this.newVersion = newVersion;
}
}
4 changes: 1 addition & 3 deletions src/de/unihannover/elsa/iui/view/ChooseHeaderDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
import java.io.IOException;
import java.security.NoSuchAlgorithmException;

import de.unihannover.elsa.iui.MainApp;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleButton;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import de.unihannover.elsa.iui.MainApp;

public class ChooseHeaderDialog {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
package de.unihannover.elsa.iui.view;

import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import de.unihannover.elsa.iui.MainApp;
import de.unihannover.elsa.iui.model.Password;
import de.unihannover.elsa.iui.model.User;
import de.unihannover.elsa.iui.util.DateUtil;
import javafx.fxml.FXML;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleButton;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import de.unihannover.elsa.iui.MainApp;
import de.unihannover.elsa.iui.model.Password;
import de.unihannover.elsa.iui.model.User;
import de.unihannover.elsa.iui.util.DateUtil;

/**
* @author Fadi Asbih
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,13 @@

import java.security.NoSuchAlgorithmException;

import de.unihannover.elsa.iui.MainApp;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.ComboBox;
import javafx.scene.control.ListCell;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleButton;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import javafx.util.StringConverter;
import de.unihannover.elsa.iui.MainApp;
import de.unihannover.elsa.iui.model.Password;
import de.unihannover.elsa.iui.model.User;

/**
* @author Fadi Asbih
Expand Down
12 changes: 4 additions & 8 deletions src/de/unihannover/elsa/iui/view/SettingsDialogController.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
package de.unihannover.elsa.iui.view;

import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import de.unihannover.elsa.iui.MainApp;
import de.unihannover.elsa.iui.model.Password;
import de.unihannover.elsa.iui.model.User;
import de.unihannover.elsa.iui.util.PasswordUtility;
import javafx.fxml.FXML;
import javafx.scene.control.CheckBox;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleButton;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import de.unihannover.elsa.iui.MainApp;
import de.unihannover.elsa.iui.model.Password;
import de.unihannover.elsa.iui.model.User;
import de.unihannover.elsa.iui.util.DateUtil;
import de.unihannover.elsa.iui.util.PasswordUtility;

/**
* @author Fadi Asbih
Expand Down
11 changes: 0 additions & 11 deletions src/de/unihannover/elsa/iui/view/UpdateDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ public class UpdateDialog {
@FXML
private Label labelNewVersion;

private String currentVersion;
private String newVersion;
private Stage dialogStage;
private boolean okClicked = false;
// Reference to the main application.
Expand Down Expand Up @@ -103,16 +101,7 @@ public String getNewVersion() throws Exception {
return mainApp.getNewVersion();
}

public void setNewVersion(String newVersion) {
this.newVersion = newVersion;
}

public String getCurrentVersion() throws Exception {
return mainApp.getCurrentVersion();
}

public void setCurrentVersion(String currentVersion) {
this.currentVersion = currentVersion;
}

}
19 changes: 9 additions & 10 deletions src/de/unihannover/elsa/iui/view/UserEditDialogController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

import java.security.NoSuchAlgorithmException;

import de.unihannover.elsa.iui.model.Password;
import de.unihannover.elsa.iui.model.User;
import de.unihannover.elsa.iui.util.FxDialogs;
import javafx.fxml.FXML;
import javafx.scene.control.TextField;
import javafx.scene.image.Image;
import javafx.stage.Stage;

import org.controlsfx.dialog.Dialogs;

import de.unihannover.elsa.iui.model.Password;
import de.unihannover.elsa.iui.model.User;

/**
* Dialog to edit details of a user.
*
Expand Down Expand Up @@ -171,11 +169,12 @@ private boolean isInputValid() {
return true;
} else {
// Show the error message.
Dialogs.create()
.title("Invalid Fields")
.masthead("Please correct invalid fields")
.message(errorMessage)
.showError();
// Dialogs.create()
// .title("Invalid Fields")
// .masthead("Please correct invalid fields")
// .message(errorMessage)
// .showError();
FxDialogs.showError("Please correct invalid fields", errorMessage);
return false;
}
}
Expand Down
18 changes: 9 additions & 9 deletions src/de/unihannover/elsa/iui/view/UserOverviewController.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package de.unihannover.elsa.iui.view;

import de.unihannover.elsa.iui.MainApp;
import de.unihannover.elsa.iui.model.User;
import de.unihannover.elsa.iui.util.FxDialogs;
import javafx.beans.property.SimpleStringProperty;
import javafx.fxml.FXML;
import javafx.print.PrinterJob;
import javafx.scene.control.Label;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;

import org.controlsfx.dialog.Dialogs;

import de.unihannover.elsa.iui.MainApp;
import de.unihannover.elsa.iui.model.User;

/**
*
* @author Marco Jakob
Expand Down Expand Up @@ -185,8 +183,9 @@ private void handleEditPerson() {

} else {
// Nothing selected.
Dialogs.create().title("No Selection").masthead("No Person Selected")
.message("Please select a person in the table.").showWarning();
// Dialogs.create().title("No Selection").masthead("No Person Selected")
// .message("Please select a person in the table.").showWarning();
FxDialogs.showError("No Person Selected", "Please select a person in the table.");
}
}

Expand All @@ -201,8 +200,9 @@ private void handleDeletePerson() {
numberOfUsersLabel.setText(getNumberOfUsers()+"");
} else {
// Nothing selected.
Dialogs.create().title("No Selection").masthead("No Person Selected")
.message("Please select a person in the table.").showWarning();
// Dialogs.create().title("No Selection").masthead("No Person Selected")
// .message("Please select a person in the table.").showWarning();
FxDialogs.showError("No Person Selected", "Please select a person in the table.");
}
}

Expand Down

0 comments on commit c4965f7

Please sign in to comment.