mirror of
https://github.com/maxkratz/lectureStudio.git
synced 2024-05-18 20:00:16 +00:00
editor: added manual menu item
This commit is contained in:
parent
15c27abfd4
commit
3923294b02
|
@ -25,6 +25,7 @@ import com.google.common.eventbus.Subscribe;
|
|||
import java.awt.Desktop;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.nio.file.Path;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
|
@ -117,6 +118,7 @@ public class MenuPresenter extends Presenter<MenuView> {
|
|||
|
||||
view.bindFullscreen(context.fullscreenProperty());
|
||||
|
||||
view.setOnManual(this::showManual);
|
||||
view.setOnOpenLog(this::showLog);
|
||||
view.setOnOpenAbout(this::showAboutView);
|
||||
}
|
||||
|
@ -395,10 +397,18 @@ public class MenuPresenter extends Presenter<MenuView> {
|
|||
eventBus.post(new ShowPresenterCommand<>(SettingsPresenter.class));
|
||||
}
|
||||
|
||||
public void showManual() {
|
||||
try {
|
||||
Desktop.getDesktop().browse(URI.create("https://lect.stream/manual/de/index.html"));
|
||||
}
|
||||
catch (IOException e) {
|
||||
handleException(e, "Open manual uri failed", "generic.error");
|
||||
}
|
||||
}
|
||||
|
||||
public void showLog() {
|
||||
try {
|
||||
Desktop.getDesktop().open(new File(
|
||||
context.getDataLocator().getAppDataPath()));
|
||||
Desktop.getDesktop().open(new File(context.getDataLocator().getAppDataPath()));
|
||||
}
|
||||
catch (IOException e) {
|
||||
handleException(e, "Open log path failed", "generic.error");
|
||||
|
|
|
@ -86,6 +86,8 @@ public interface MenuView extends View {
|
|||
* Info Menu
|
||||
*/
|
||||
|
||||
void setOnManual(Action action);
|
||||
|
||||
void setOnOpenLog(Action action);
|
||||
|
||||
void setOnOpenAbout(Action action);
|
||||
|
|
|
@ -98,6 +98,9 @@ public class FxMenuView extends MenuBar implements MenuView {
|
|||
@FXML
|
||||
private CheckMenuItem fullscreenMenuItem;
|
||||
|
||||
@FXML
|
||||
private MenuItem manualMenuItem;
|
||||
|
||||
@FXML
|
||||
private MenuItem logMenuItem;
|
||||
|
||||
|
@ -262,6 +265,11 @@ public class FxMenuView extends MenuBar implements MenuView {
|
|||
* Info Menu
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void setOnManual(Action action) {
|
||||
FxUtils.bindAction(manualMenuItem, action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnOpenLog(Action action) {
|
||||
FxUtils.bindAction(logMenuItem, action);
|
||||
|
|
|
@ -33,7 +33,8 @@
|
|||
<CheckMenuItem fx:id="fullscreenMenuItem" accelerator="alt+enter" text="%menu.fullscreen" />
|
||||
</Menu>
|
||||
<Menu text="%menu.info">
|
||||
<MenuItem fx:id="logMenuItem" text="%menu.log"/>
|
||||
<MenuItem fx:id="aboutMenuItem" text="%menu.about"/>
|
||||
<MenuItem fx:id="manualMenuItem" text="%menu.info.manual"/>
|
||||
<MenuItem fx:id="logMenuItem" text="%menu.info.log"/>
|
||||
<MenuItem fx:id="aboutMenuItem" text="%menu.info.about"/>
|
||||
</Menu>
|
||||
</fx:root>
|
||||
|
|
|
@ -16,5 +16,6 @@ menu.undo = R\u00fcckgangig
|
|||
menu.redo = Wiederherstellen
|
||||
menu.fullscreen = Vollbild
|
||||
menu.options = Einstellungen
|
||||
menu.log = Log
|
||||
menu.about = \u00dcber
|
||||
menu.info.manual = Benutzeranleitung
|
||||
menu.info.log = Log
|
||||
menu.info.about = \u00dcber
|
|
@ -16,5 +16,6 @@ menu.undo = Undo
|
|||
menu.redo = Redo
|
||||
menu.fullscreen = Fullscreen
|
||||
menu.options = Settings
|
||||
menu.log = Log
|
||||
menu.about = About
|
||||
menu.info.manual = Manual
|
||||
menu.info.log = Log
|
||||
menu.info.about = About
|
Loading…
Reference in a new issue