Commit 1fd62344 authored by Marian Dovgialo's avatar Marian Dovgialo

#46033 fixed prolem with BusyDialog not appearing when selecting stream in AddCamera window

parent f14f3c9c
......@@ -43,14 +43,17 @@ public void previewRequested(VideoStreamSpecification stream) {
public void refreshRequested() {
GetAvailableVideoWorker worker = new GetAvailableVideoWorker(getParent());
worker.addPropertyChangeListener(new OnlineVideoFrameInitializer(worker, OnlineVideoFrame.this));
worker.execute();
worker.execute();
}
@Override
public void videoStreamSelected(VideoStreamSpecification stream) {
VideoStreamSelectedWorker change_stream_worker = new VideoStreamSelectedWorker(previewPanel, manager, component, streamSelectionPanel, stream);
if (!stream.equals(manager.getCurrentStream())) {
change_stream_worker.execute();
change_stream_worker.executeWithWialog();
}
}
......
......@@ -33,8 +33,6 @@ public VideoStreamSelectedWorker(OnlineMediaPlayerPanel previewPanel, VideoStrea
@Override
protected Void doInBackground() throws Exception {
showBusyDialog();
component.release();
try {
String rtspURL = manager.replace(stream);
......@@ -44,8 +42,9 @@ protected Void doInBackground() throws Exception {
streamSelectionPanel.clearSelection();
ex.showErrorDialog(_("Error initializing video preview"));
}
return null;
}
}
......@@ -11,7 +11,6 @@
import org.signalml.app.view.common.dialogs.BusyDialog;
import org.signalml.app.view.common.dialogs.DummyBusyDialog;
import org.signalml.app.view.common.dialogs.IBusyDialog;
public abstract class SwingWorkerWithBusyDialog<T, S> extends SwingWorker<T, S> implements PropertyChangeListener {
private final IBusyDialog busyDialog;
......@@ -45,15 +44,29 @@ public IBusyDialog getBusyDialog() {
protected void showBusyDialog() {
if (!busyDialogShouldBeShown)
return;
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
busyDialog.setVisible(busyDialogVisible);
}
busyDialog.setVisible(busyDialogVisible);
}
});
}
/** blocking **/
public void executeWithWialog()
{
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
execute();
}
}
);
if (busyDialogShouldBeShown)
busyDialog.setVisible(busyDialogVisible);
}
protected void hideBusyDialog() {
busyDialogVisible = false;
busyDialog.setVisible(busyDialogVisible);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment