Skip to content

Commit

Permalink
Alpha_2.1 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
movcmpret committed Jan 27, 2019
1 parent ceb1f4c commit ccb0f25
Show file tree
Hide file tree
Showing 36 changed files with 227 additions and 149 deletions.
2 changes: 1 addition & 1 deletion launch4j/launch4jconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<launch4jConfig>
<dontWrapJar>false</dontWrapJar>
<headerType>gui</headerType>
<jar>..\target\ezovpnclient-Alpha_1.4.jar</jar>
<jar>..\target\ezovpnclient-Alpha_2.1.jar</jar>
<outfile>..\target\ezOVPNClient.exe</outfile>
<errTitle>Please download Java.</errTitle>
<cmdLine></cmdLine>
Expand Down
2 changes: 1 addition & 1 deletion launch4j/launch4jconfig_linux.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<launch4jConfig>
<dontWrapJar>false</dontWrapJar>
<headerType>gui</headerType>
<jar>../target/ezovpnclient-Alpha_2.0.jar</jar>
<jar>../target/ezovpnclient-Alpha_2.1.jar</jar>
<outfile>../target/ezOVPNClient.exe</outfile>
<errTitle>Please download Java.</errTitle>
<cmdLine></cmdLine>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.movcmpret.ezovpn</groupId>
<artifactId>ezovpnclient</artifactId>
<version>Alpha_2.0</version>
<version>Alpha_2.1</version>
<inceptionYear>2018</inceptionYear>

<organization>
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/com/movcmpret/application/MainView.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
import java.util.Optional;

import com.movcmpret.constants.Constants;
import com.movcmpret.dialog.credentials.CredentialInputController;
import com.movcmpret.importManager.fileimport.ImportManagerController;
import com.movcmpret.importManager.nordvpnapi.ImportManagerNordVPNController;
import com.movcmpret.osBridge.OSBridge;
import com.movcmpret.ovpn.connection.OVPNConnector;
import com.movcmpret.persistence.UserProfile;
Expand All @@ -37,7 +34,6 @@
import com.movcmpret.utility.panes.YesNoCheckboxDialogPane;

import javafx.application.Application;
import javafx.application.HostServices;
import javafx.application.Platform;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
Expand Down Expand Up @@ -181,7 +177,7 @@ public Stage getStage() {
// Close the stage
public void handle(WindowEvent event) {
if (UserProfile.getInstance().getUserProfileData().isShowExitDialog()) {
Alert exitDialog = AlertManager.createYesNoDoNotShowAgainAlert(AlertType.INFORMATION,
Alert exitDialog = AlertManager.createYesNoDoNotShowAgainAlert(AlertType.WARNING,
Constants.getYesNoCheckBoxDialogPane_ExitDialogText(), Constants.getYesNoCheckboxDialogPane_Exit());
Optional result = exitDialog.showAndWait();
if (((YesNoCheckboxDialogPane) exitDialog.getDialogPane()).isNotShowAgain())
Expand Down
74 changes: 47 additions & 27 deletions src/main/java/com/movcmpret/application/MainViewController.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,29 @@
import java.util.Optional;
import java.util.ResourceBundle;

import com.movcmpret.constants.Constants;
import com.movcmpret.constants.Language;
import com.movcmpret.dialog.aboutdialog.AboutDialogController;
import com.movcmpret.dialog.credentials.CredentialInputController;
import com.movcmpret.dialog.editconfig.EditConfigController;
import com.movcmpret.event.EventManager;
import com.movcmpret.event.ListChangeEvent;
import com.movcmpret.importManager.fileimport.ImportManagerController;
import com.movcmpret.importManager.nordvpnapi.ImportManagerNordVPNController;
import com.movcmpret.interfaces.DefaultController;
import com.movcmpret.interfaces.ListChangeHandler;
import com.movcmpret.osBridge.OSBridge;
import com.movcmpret.ovpn.config.OVPNConfig;
import com.movcmpret.ovpn.tables.DefaultOVPNTable;
import com.movcmpret.ovpn.tables.NordVPNTable;
import com.movcmpret.persistence.UserProfile;
import com.movcmpret.tabs.TabHistoryController;
import com.movcmpret.tabs.TabNetworkingController;
import com.movcmpret.tabs.TabOverviewController;
import com.movcmpret.utility.AlertManager;
import com.movcmpret.utility.Logger;
import com.sun.javafx.tk.FileChooserType;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
Expand All @@ -46,33 +69,10 @@
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.control.ToggleGroup;
import javafx.scene.image.Image;
import javafx.scene.layout.GridPane;
import javafx.stage.DirectoryChooser;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
import com.movcmpret.osBridge.OSBridge;
import com.movcmpret.ovpn.OVPNFileParser;
import com.movcmpret.ovpn.config.OVPNConfig;
import com.movcmpret.ovpn.tables.DefaultOVPNTable;
import com.movcmpret.ovpn.tables.NordVPNTable;
import com.movcmpret.persistence.UserProfile;
import com.movcmpret.tabs.TabHistoryController;
import com.movcmpret.tabs.TabNetworkingController;
import com.movcmpret.tabs.TabOverviewController;
import com.movcmpret.utility.AlertManager;
import com.movcmpret.utility.Logger;
import com.sun.javafx.tk.FileChooserType;
import com.movcmpret.constants.Constants;
import com.movcmpret.constants.Language;
import com.movcmpret.dialog.aboutdialog.AboutDialogController;
import com.movcmpret.dialog.credentials.CredentialInputController;
import com.movcmpret.dialog.editconfig.EditConfigController;
import com.movcmpret.event.EventManager;
import com.movcmpret.event.ListChangeEvent;
import com.movcmpret.importManager.fileimport.ImportManagerController;
import com.movcmpret.importManager.nordvpnapi.ImportManagerNordVPNController;
import com.movcmpret.interfaces.DefaultController;
import com.movcmpret.interfaces.ListChangeHandler;

public class MainViewController implements Initializable, DefaultController,ListChangeHandler{

Expand Down Expand Up @@ -139,7 +139,9 @@ public class MainViewController implements Initializable, DefaultController,List
@FXML
private Menu MenuHelp;
@FXML
private MenuItem MenuItemClear;
private MenuItem MenuItemOverviewClear;
@FXML
private MenuItem MenuItemHistoryClear;
@FXML
private Menu MenuChangeLanguage;
@FXML
Expand Down Expand Up @@ -210,15 +212,18 @@ public void InitializeComponent()

//ImportManager
importStage = new Stage();
importStage.getIcons().add(new Image(this.getClass().getResourceAsStream("ezOVPN_logo.png")));
importFXMLLoader = new FXMLLoader(getClass().getResource(Constants.getFXML_ImportManagerFilename()));

//ImportManager NordVPN
importNordVPNStage = new Stage();
importNordVPNStage.getIcons().add(new Image(this.getClass().getResourceAsStream("ezOVPN_logo.png")));
importNordVPNFXMLLoader = new FXMLLoader(getClass().getResource(Constants.getFXML_ImportManagerNordVPNFilename()));


//CredentialInput
credentialInputStage = new Stage();
credentialInputStage.getIcons().add(new Image(this.getClass().getResourceAsStream("ezOVPN_logo.png")));
credentialInputFXMLLoader = new FXMLLoader(getClass().getResource(Constants.getFXML_CredentialInputFilename()));

//Load Tabs
Expand All @@ -235,6 +240,9 @@ public void InitializeComponent()
//Set RadioMenuItem selected for Language
setupLanguageRadioMenuItems();

// Hide unfinished tabs
// this.OverviewTabPane.getTabs().remove(HistoryTab);
this.OverviewTabPane.getTabs().remove(SettingsTab);

updateTexts();
bind();
Expand Down Expand Up @@ -295,12 +303,23 @@ protected void importFromNordVPNServerMenuItemOnClick(ActionEvent event) {
*
*/
@FXML
protected void menuItemClearOnClick(ActionEvent event)
protected void menuItemOverviewClearOnClick(ActionEvent event)
{
this.tabOverviewController.getOverviewTableData().clear();
UserProfile.getInstance().getUserProfileData().setLastConfig(null);
}


/**
* Clear HistoryTable
*
*/
@FXML
protected void menuItemClearHistoryOnClick(ActionEvent event)
{
this.tabHistoryController.getHistoryTableData().clear();
}

/**
* Clear OverviewTable
*
Expand Down Expand Up @@ -594,7 +613,8 @@ public void updateTexts()


this.MenuEdit.setText(Constants.getEdit());
this.MenuItemClear.setText(Constants.getClear());
this.MenuItemOverviewClear.setText(Constants.getOverviewClear());
this.MenuItemHistoryClear.setText(Constants.getHistoryClear());

//Menu Help
this.MenuHelp.setText(Constants.getHelp());
Expand Down
29 changes: 19 additions & 10 deletions src/main/java/com/movcmpret/constants/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@
import org.joda.time.format.PeriodFormatterBuilder;

import com.movcmpret.event.EventManager;
import com.movcmpret.event.UpdateViewArgs;
import com.movcmpret.utility.Logger;
import com.movcmpret.osBridge.OSBridge;
import com.movcmpret.osBridge.OSType;
import com.movcmpret.utility.Logger;

public class Constants {

Expand Down Expand Up @@ -153,7 +152,6 @@ private static final void parseMavenProperties()
private static String DE_Import = "Importieren...";
private static String DE_ChangeLanguage = "Sprache";
private static String DE_Help = "Hilfe";
private static String DE_Clear = "Übersicht-Tabelle Leeren";
private static String DE_German ="Deutsch";
private static String DE_English ="Englisch";
private static String DE_FileName = "Dateiname";
Expand Down Expand Up @@ -193,8 +191,8 @@ private static final void parseMavenProperties()
private static String DE_MenuItem_Import_Failed = "Beim Import ist ein Fehler aufgetreten.";
private static String DE_MenuItem_Export_Failed = "Beim Export ist ein Fehler aufgetreten.";
private static String DE_MenuItem_Import_Warning = "Ein Import benötigt einen Neustart. Alle Verbindungen werden dabei geschlossen. Fortfahren?";


private static String DE_MenuItem_OverviewClear = "Übersicht-Tabelle leeren";
private static String DE_MenuItem_HistoryClear = "Historie leeren";
//Button
private static String DE_Connect = "Verbinden";

Expand Down Expand Up @@ -273,7 +271,6 @@ private static final void parseMavenProperties()
private static String EN_Import = "Import...";
private static String EN_ChangeLanguage = "Language";
private static String EN_Help = "Help";
private static String EN_Clear = "Clear Overview table";
private static String EN_German = "German";
private static String EN_English = "English";
private static String EN_FileName = "Filename";
Expand Down Expand Up @@ -312,6 +309,8 @@ private static final void parseMavenProperties()
private static String EN_MenuItem_Import_Failed = "An error occured while importing.";
private static String EN_MenuItem_Export_Failed = "An error occured while exporting.";
private static String EN_MenuItem_Import_Warning = "An import requires a restart. All connections will be closed. Are you sure to continue?";
private static String EN_MenuItem_OverviewClear = "Clear Overview Table";
private static String EN_MenuItem_HistoryClear = "Clear History";

//Button
private static String EN_Connect = "Connect";
Expand Down Expand Up @@ -732,13 +731,23 @@ public static String getHelp()
}
}

public static String getClear()
public static String getOverviewClear()
{
switch(activeLanguage)
{
case GERMAN: return DE_MenuItem_OverviewClear;
case ENGLISH: return EN_MenuItem_OverviewClear;
default: return EN_MenuItem_OverviewClear;
}
}

public static String getHistoryClear()
{
switch(activeLanguage)
{
case GERMAN: return DE_Clear;
case ENGLISH: return EN_Clear;
default: return EN_Clear;
case GERMAN: return DE_MenuItem_HistoryClear;
case ENGLISH: return EN_MenuItem_HistoryClear;
default: return EN_MenuItem_HistoryClear;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.movcmpret.dialog;

import com.movcmpret.application.MainViewController;

/*-
* #%L
* ezOVPNClient
Expand All @@ -26,6 +28,7 @@
import com.movcmpret.interfaces.DefaultController;

import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

/**
Expand Down Expand Up @@ -63,7 +66,8 @@ public OutputDialogController(Stage kStage)
protected void initializeComponent()
{
scene = new Scene(view, windowWidth, windowHeight);
stage = new Stage();
stage = new Stage();
stage.getIcons().add(new Image(MainViewController.class.getResourceAsStream("ezOVPN_logo.png")));
stage.setScene(scene);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

import com.movcmpret.dialog.OutputDialogController;

import javafx.stage.Stage;

/**
* A dialog, providing information about the Software.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,16 @@


import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;

import javax.swing.SwingUtilities;

import com.movcmpret.application.MainView;
import com.movcmpret.constants.Constants;
import com.movcmpret.dialog.OutputDialogView;
import com.movcmpret.utility.Logger;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.HPos;
import javafx.geometry.Insets;
import javafx.geometry.VPos;
import javafx.scene.control.Hyperlink;
import javafx.scene.control.Label;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@
import com.movcmpret.dialog.OutputDialogController;
import com.movcmpret.dialog.OutputDialogView;
import com.movcmpret.event.EventManager;
import com.movcmpret.utility.Logger;

import javafx.scene.Node;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import com.movcmpret.utility.Logger;

public class ConsoleOutputDialog extends OutputDialogController<OutputDialogView>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
import com.movcmpret.constants.Constants;
import com.movcmpret.event.EventManager;
import com.movcmpret.interfaces.DefaultController;
import com.movcmpret.persistence.UserProfile;
import com.movcmpret.utility.Logger;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
Expand All @@ -38,8 +41,6 @@
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
import com.movcmpret.persistence.UserProfile;
import com.movcmpret.utility.Logger;

public class CredentialInputController implements Initializable, DefaultController
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
import com.movcmpret.constants.Constants;
import com.movcmpret.event.EventManager;
import com.movcmpret.interfaces.DefaultController;
import com.movcmpret.osBridge.OSBridge;
import com.movcmpret.ovpn.OVPNFileParser;
import com.movcmpret.ovpn.config.OVPNConfig;
import com.movcmpret.tabs.TabOverviewController;
import com.movcmpret.utility.AlertManager;
import com.movcmpret.utility.Logger;

import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
Expand All @@ -42,17 +49,11 @@
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.TextArea;
import javafx.scene.control.Alert.AlertType;
import javafx.stage.Stage;
import com.movcmpret.osBridge.OSBridge;
import com.movcmpret.ovpn.OVPNFileParser;
import com.movcmpret.ovpn.config.OVPNConfig;
import com.movcmpret.tabs.TabOverviewController;
import com.movcmpret.utility.AlertManager;
import com.movcmpret.utility.Logger;

public class EditConfigController implements Initializable, DefaultController
{
Expand Down
Loading

0 comments on commit ccb0f25

Please sign in to comment.