Skip to content
Snippets Groups Projects
Commit f0b5d19f authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

Add Changelog Menu, Remove ChangeLog Dialog

parent fc203350
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,8 @@ main.menuitem.projectSettings=Projekteinstellungen...
main.menuitem.profileSettings=Profileinstellungen...
main.menuitem.globalSettings=Globale Einstellungen...
main.menuitem.about=\u00DCber Play Wall...
main.menuitem.website=Webseite besuchen...
main.menuitem.changelog=Changelog anzeigen...
main.menuitem.website=Webseite anzeigen...
main.menuitem.senderror=Fehler senden...
main.menuitem.fullScreen=Vollbild
main.menuitem.searchPad=Kachel suchen...
......
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.input.*?>
<?import javafx.scene.text.*?>
<?import javafx.scene.control.CheckMenuItem?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.SeparatorMenuItem?>
<?import javafx.scene.control.Slider?>
<?import javafx.scene.control.ToolBar?>
<?import javafx.scene.input.KeyCodeCombination?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<VBox maxHeight="-Infinity" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<VBox maxHeight="-Infinity" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1">
<children>
<MenuBar fx:id="menuBar" prefHeight="29.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<menus>
......@@ -101,6 +108,7 @@
<Menu fx:id="infoMenu" mnemonicParsing="false" text="%main.menu.info">
<items>
<MenuItem mnemonicParsing="false" onAction="#aboutMenuHandler" text="%main.menuitem.about" />
<MenuItem mnemonicParsing="false" onAction="#showChangelogMenuHandler" text="%main.menuitem.changelog" />
<MenuItem mnemonicParsing="false" onAction="#visiteWebsiteMenuHandler" text="%main.menuitem.website" />
<MenuItem mnemonicParsing="false" onAction="#sendErrorMenuItem" text="%main.menuitem.senderror" />
</items>
......
......@@ -13,5 +13,5 @@ userInfo:
PluginsURL:
Stable: http://tobisan.no-ip.org/files/PlayWall/stable/plugins.yml
Beta: http://tobisan.no-ip.org/files/PlayWall/beta/plugins.yml
ChangelogURL: http://tobisan.no-ip.org/whatsnew-2.php?id=1
ChangelogURL: http://s522730663.online.de/programmer/roadmap/php/index.php?id=1
UpdaterProgram: http://tobisan.no-ip.org/files/Updater/
package de.tobias.playpad;
import java.io.IOException;
import java.net.MalformedURLException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Locale;
import java.util.Optional;
import java.util.ResourceBundle;
import java.util.UUID;
import de.tobias.playpad.profile.ref.ProfileReferences;
import de.tobias.playpad.project.Project;
import de.tobias.playpad.project.ref.ProjectReferences;
......@@ -17,7 +8,6 @@ import de.tobias.playpad.update.PlayPadUpdater;
import de.tobias.playpad.update.Updates;
import de.tobias.playpad.viewcontroller.LaunchDialog;
import de.tobias.playpad.viewcontroller.dialog.AutoUpdateDialog;
import de.tobias.playpad.viewcontroller.dialog.ChangelogDialog;
import de.tobias.updater.client.UpdateRegistery;
import de.tobias.utils.application.App;
import de.tobias.utils.application.ApplicationUtils;
......@@ -36,6 +26,15 @@ import javafx.scene.image.Image;
import javafx.stage.Stage;
import javafx.stage.Window;
import java.io.IOException;
import java.net.MalformedURLException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Locale;
import java.util.Optional;
import java.util.ResourceBundle;
import java.util.UUID;
/*
* TODOS
*/
......@@ -143,9 +142,6 @@ public class PlayPadMain extends Application implements LocalizationDelegate {
ProfileReferences.loadProfiles();
ProjectReferences.loadProjects();
// Changelog nach Update anzeigen
ViewController.create(ChangelogDialog.class);
// Auto Open Project
if (getParameters().getRaw().size() > 0) {
if (getParameters().getNamed().containsKey("project")) {
......@@ -156,8 +152,8 @@ public class PlayPadMain extends Application implements LocalizationDelegate {
}
}
// Zeigt Launch Stage
ViewController.create(LaunchDialog.class, stage);
// Show Launch Stage
new LaunchDialog(stage);
// Check Updates
checkUpdates(impl.globalSettings, stage);
......
......@@ -699,6 +699,16 @@ public class DesktopMenuToolbarViewController extends BasicMenuToolbarViewContro
}
}
@FXML
void showChangelogMenuHandler(ActionEvent event) {
String website = ApplicationUtils.getApplication().getInfo().getUserInfo().getString(AppUserInfoStrings.CHANGELOG_URL);
try {
Desktop.getDesktop().browse(new URI(website));
} catch (IOException | URISyntaxException e) {
e.printStackTrace();
}
}
@FXML
void visiteWebsiteMenuHandler(ActionEvent event) {
String website = ApplicationUtils.getApplication().getInfo().getUserInfo().getString(AppUserInfoStrings.WEBSITE);
......
package de.tobias.playpad.viewcontroller.dialog;
import de.tobias.playpad.AppUserInfoStrings;
import de.tobias.playpad.PlayPadMain;
import de.tobias.playpad.Strings;
import de.tobias.utils.application.ApplicationUtils;
import de.tobias.utils.ui.ViewController;
import de.tobias.utils.util.Localization;
import javafx.concurrent.Worker.State;
import javafx.fxml.FXML;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import netscape.javascript.JSObject;
public class ChangelogDialog extends ViewController {
@FXML private WebView contentView;
private JSBridge bridge;
public ChangelogDialog() {
super("changelogDialog", "de/tobias/playpad/assets/dialog/", null, PlayPadMain.getUiResourceBundle());
if (ApplicationUtils.getApplication().isUpdated()) {
bridge = new JSBridge();
contentView.getEngine().getLoadWorker().stateProperty().addListener((ov, oldState, newState) ->
{
if (newState == State.SUCCEEDED) {
JSObject window = (JSObject) contentView.getEngine().executeScript("window");
window.setMember("app", bridge);
getStage().show();
}
});
String url = ApplicationUtils.getApplication().getInfo().getUserInfo().getString(AppUserInfoStrings.CHANGELOG_URL) + "&version="
+ ApplicationUtils.getApplication().getOldVersionNumber();
contentView.getEngine().load(url);
getStage().show();
}
}
@Override
public void init() {
addCloseKeyShortcut(() -> getStage().close());
}
@Override
public void initStage(Stage stage) {
PlayPadMain.stageIcon.ifPresent(stage.getIcons()::add);
stage.setWidth(500);
stage.setMinWidth(500);
stage.setMaxWidth(500);
stage.setMinHeight(700);
stage.setTitle(Localization.getString(Strings.UI_Window_Changelog_Title));
stage.setAlwaysOnTop(true);
}
public class JSBridge {
public void close() {
getStage().close();
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment