forked from j62/ctbrec
Add manual refresh to context menu of thumb overviews
This commit is contained in:
parent
46797a8467
commit
127ed0ab91
|
@ -444,6 +444,9 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
|
||||||
MenuItem ignore = new MenuItem("Ignore");
|
MenuItem ignore = new MenuItem("Ignore");
|
||||||
ignore.setOnAction(e -> ignore(getSelectedThumbCells(cell)));
|
ignore.setOnAction(e -> ignore(getSelectedThumbCells(cell)));
|
||||||
|
|
||||||
|
MenuItem refresh = new MenuItem("Refresh");
|
||||||
|
refresh.setOnAction(e -> refresh());
|
||||||
|
|
||||||
MenuItem copyUrl = createCopyUrlMenuItem(cell);
|
MenuItem copyUrl = createCopyUrlMenuItem(cell);
|
||||||
MenuItem sendTip = createTipMenuItem(cell);
|
MenuItem sendTip = createTipMenuItem(cell);
|
||||||
|
|
||||||
|
@ -465,7 +468,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);
|
contextMenu.getItems().addAll(copyUrl, refresh);
|
||||||
if(cell.getModel() instanceof MyFreeCamsModel && Objects.equals(System.getenv("CTBREC_DEV"), "1")) {
|
if(cell.getModel() 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(cell.getModel()));
|
debug.setOnAction(e -> MyFreeCamsClient.getInstance().getSessionState(cell.getModel()));
|
||||||
|
@ -474,6 +477,14 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
|
||||||
return contextMenu;
|
return contextMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void refresh() {
|
||||||
|
if (updateService.isRunning()) {
|
||||||
|
updateService.cancel();
|
||||||
|
updateService.reset();
|
||||||
|
updateService.restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* check, if other cells are selected, too. in that case, we have to disable menu items, which make sense only for
|
/* check, if other cells are selected, too. in that case, we have to disable menu items, which make sense only for
|
||||||
* single selections. but only do that, if the popup has been triggered on a selected cell. otherwise remove the
|
* single selections. but only do that, if the popup has been triggered on a selected cell. otherwise remove the
|
||||||
* selection and show the normal menu
|
* selection and show the normal menu
|
||||||
|
|
Loading…
Reference in New Issue