forked from j62/ctbrec
1
0
Fork 0

Add open in browser to context menu of thumb overviews

This commit is contained in:
0xb00bface 2021-03-12 17:44:16 +01:00
parent 052758b11e
commit d15a851a3a
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,7 @@
4.2.0
========================
* Added open in browser to context menu of thumb overviews
4.1.0 4.1.0
======================== ========================
* Added dark mode for the server web interface (improvements on the CSS * Added dark mode for the server web interface (improvements on the CSS

View File

@ -516,6 +516,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
openRecDir.setOnAction(e -> new OpenRecordingsDir(cell, model).execute()); openRecDir.setOnAction(e -> new OpenRecordingsDir(cell, model).execute());
MenuItem copyUrl = createCopyUrlMenuItem(cell); MenuItem copyUrl = createCopyUrlMenuItem(cell);
MenuItem openInBrowser = createOpenInBrowser(cell);
MenuItem sendTip = createTipMenuItem(cell); MenuItem sendTip = createTipMenuItem(cell);
configureItemsForSelection(cell, openInPlayer, copyUrl, sendTip); configureItemsForSelection(cell, openInPlayer, copyUrl, sendTip);
@ -539,7 +540,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
if (site.supportsTips()) { if (site.supportsTips()) {
contextMenu.getItems().add(sendTip); contextMenu.getItems().add(sendTip);
} }
contextMenu.getItems().addAll(copyUrl, ignore, refresh, openRecDir); contextMenu.getItems().addAll(copyUrl, openInBrowser, ignore, refresh, openRecDir);
if (model instanceof MyFreeCamsModel && Objects.equals(System.getenv("CTBREC_DEV"), "1")) { if (model instanceof MyFreeCamsModel && Objects.equals(System.getenv("CTBREC_DEV"), "1")) {
MenuItem debug = new MenuItem("debug"); MenuItem debug = new MenuItem("debug");
debug.setOnAction(e -> MyFreeCamsClient.getInstance().getSessionState(model)); debug.setOnAction(e -> MyFreeCamsClient.getInstance().getSessionState(model));
@ -589,6 +590,12 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
} }
} }
private MenuItem createOpenInBrowser(ThumbCell cell) {
MenuItem openInBrowser = new MenuItem("Open in browser");
openInBrowser.setOnAction(e -> DesktopIntegration.open(cell.getModel().getUrl()));
return openInBrowser;
}
private MenuItem createCopyUrlMenuItem(ThumbCell cell) { private MenuItem createCopyUrlMenuItem(ThumbCell cell) {
MenuItem copyUrl = new MenuItem("Copy URL"); MenuItem copyUrl = new MenuItem("Copy URL");
copyUrl.setOnAction(e -> { copyUrl.setOnAction(e -> {