From 830b0efc7a3be96f6b42837b60f698d1d156fd18 Mon Sep 17 00:00:00 2001 From: tc-wleite Date: Wed, 22 Nov 2023 21:17:36 -0300 Subject: [PATCH] '#1993: Disable pause button until workers are created. --- .../src/main/java/iped/app/processing/ui/ProgressFrame.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iped-app/src/main/java/iped/app/processing/ui/ProgressFrame.java b/iped-app/src/main/java/iped/app/processing/ui/ProgressFrame.java index aa72feafa0..4d0b9dfe8f 100644 --- a/iped-app/src/main/java/iped/app/processing/ui/ProgressFrame.java +++ b/iped-app/src/main/java/iped/app/processing/ui/ProgressFrame.java @@ -143,6 +143,7 @@ public ProgressFrame(UIPropertyListenerProvider task) { pause = new JButton(Messages.getString("ProgressFrame.Pause")); //$NON-NLS-1$ pause.addActionListener(this); + pause.setEnabled(false); openApp = new JButton(Messages.getString("ProgressFrame.OpenApp")); //$NON-NLS-1$ openApp.addActionListener(this); @@ -266,6 +267,7 @@ public void propertyChange(PropertyChangeEvent evt) { workers = (Worker[]) evt.getNewValue(); lastWorkerTaskItemId = new String[workers.length]; lastWorkerTime = new long[workers.length]; + pause.setEnabled(true); } } @@ -647,7 +649,7 @@ private void finishTable(StringBuilder sb) { @Override public void actionPerformed(ActionEvent e) { - if (e.getSource().equals(pause)) { + if (e.getSource().equals(pause) && workers != null) { paused = !paused; if (paused) pause.setText(Messages.getString("ProgressFrame.Continue")); //$NON-NLS-1$