From 17f1c3aec6bcb34b67461f388db8ba7cb9ab957c Mon Sep 17 00:00:00 2001 From: 0xb00bface <0xboobface@gmail.com> Date: Wed, 19 Aug 2020 11:42:50 +0200 Subject: [PATCH] Add confirmation dialog for pause all and resume all --- CHANGELOG.md | 3 +++ .../src/main/java/ctbrec/ui/action/FollowAction.java | 2 +- client/src/main/java/ctbrec/ui/action/PauseAction.java | 2 +- .../src/main/java/ctbrec/ui/action/ResumeAction.java | 2 +- .../java/ctbrec/ui/action/StartRecordingAction.java | 2 +- .../main/java/ctbrec/ui/tabs/RecordedModelsTab.java | 10 ++++++++-- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91872b35..cc2ad4ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ 3.8.7 ======================== +* Added support for Manyvids Live + * no login / favorites + * media player isn't working because of their authetication mechanism * Fixed bug in recorder servlet. Actions for unpin and notes were mixed up * Recordings now start immediately for newly added models diff --git a/client/src/main/java/ctbrec/ui/action/FollowAction.java b/client/src/main/java/ctbrec/ui/action/FollowAction.java index 4df34ccb..2cb53c84 100644 --- a/client/src/main/java/ctbrec/ui/action/FollowAction.java +++ b/client/src/main/java/ctbrec/ui/action/FollowAction.java @@ -23,7 +23,7 @@ public class FollowAction extends ModelMassEditAction { } catch(Exception e) { LOG.error("Couldn't follow model {}", m, e); Platform.runLater(() -> - Dialogs.showError("Couldn't follow model", "Following " + m.getName() + " failed: " + e.getMessage(), e)); + Dialogs.showError(source.getScene(), "Couldn't follow model", "Following " + m.getName() + " failed: " + e.getMessage(), e)); } }; } diff --git a/client/src/main/java/ctbrec/ui/action/PauseAction.java b/client/src/main/java/ctbrec/ui/action/PauseAction.java index 9ac5783e..b938160e 100644 --- a/client/src/main/java/ctbrec/ui/action/PauseAction.java +++ b/client/src/main/java/ctbrec/ui/action/PauseAction.java @@ -17,7 +17,7 @@ public class PauseAction extends ModelMassEditAction { recorder.suspendRecording(m); } catch(Exception e) { Platform.runLater(() -> - Dialogs.showError("Couldn't suspend recording of model", "Suspending recording of " + m.getName() + " failed", e)); + Dialogs.showError(source.getScene(), "Couldn't suspend recording of model", "Suspending recording of " + m.getName() + " failed", e)); } }; } diff --git a/client/src/main/java/ctbrec/ui/action/ResumeAction.java b/client/src/main/java/ctbrec/ui/action/ResumeAction.java index 00f649a2..2bbff45f 100644 --- a/client/src/main/java/ctbrec/ui/action/ResumeAction.java +++ b/client/src/main/java/ctbrec/ui/action/ResumeAction.java @@ -17,7 +17,7 @@ public class ResumeAction extends ModelMassEditAction { recorder.resumeRecording(m); } catch(Exception e) { Platform.runLater(() -> - Dialogs.showError("Couldn't resume recording of model", "Resuming recording of " + m.getName() + " failed", e)); + Dialogs.showError(source.getScene(), "Couldn't resume recording of model", "Resuming recording of " + m.getName() + " failed", e)); } }; } diff --git a/client/src/main/java/ctbrec/ui/action/StartRecordingAction.java b/client/src/main/java/ctbrec/ui/action/StartRecordingAction.java index 56e3e67c..0f92466c 100644 --- a/client/src/main/java/ctbrec/ui/action/StartRecordingAction.java +++ b/client/src/main/java/ctbrec/ui/action/StartRecordingAction.java @@ -17,7 +17,7 @@ public class StartRecordingAction extends ModelMassEditAction { recorder.startRecording(m); } catch(Exception e) { Platform.runLater(() -> - Dialogs.showError("Couldn't start recording", "Starting recording of " + m.getName() + " failed", e)); + Dialogs.showError(source.getScene(), "Couldn't start recording", "Starting recording of " + m.getName() + " failed", e)); } }; } diff --git a/client/src/main/java/ctbrec/ui/tabs/RecordedModelsTab.java b/client/src/main/java/ctbrec/ui/tabs/RecordedModelsTab.java index 96721f8c..11890010 100644 --- a/client/src/main/java/ctbrec/ui/tabs/RecordedModelsTab.java +++ b/client/src/main/java/ctbrec/ui/tabs/RecordedModelsTab.java @@ -423,11 +423,17 @@ public class RecordedModelsTab extends Tab implements TabSelectionListener { } private void pauseAll(ActionEvent evt) { - new PauseAction(getTabPane(), recorder.getModels(), recorder).execute(); + boolean yes = Dialogs.showConfirmDialog("Pause all models", "", "Pause the recording of all models?", getTabPane().getScene()); + if (yes) { + new PauseAction(getTabPane(), recorder.getModels(), recorder).execute(); + } } private void resumeAll(ActionEvent evt) { - new ResumeAction(getTabPane(), recorder.getModels(), recorder).execute(); + boolean yes = Dialogs.showConfirmDialog("Resume all models", "", "Resume the recording of all models?", getTabPane().getScene()); + if (yes) { + new ResumeAction(getTabPane(), recorder.getModels(), recorder).execute(); + } } void initializeUpdateService() {