Commit 98ddec75 authored by Matija Obreza's avatar Matija Obreza

Added icons for Pause/Resume

parent 8834532a
......@@ -100,6 +100,8 @@ public class PushDialog extends Dialog {
private static Image deleteDataIcon;
private static Image parseDataIcon;
private static Image pauseIcon;
private static Image playIcon;
@Autowired
private Settings settings;
......@@ -179,7 +181,10 @@ public class PushDialog extends Dialog {
static {
deleteDataIcon = ImageDescriptor.createFromURL(PushDialog.class.getResource("/icon/delete.png")).createImage();
parseDataIcon = ImageDescriptor.createFromURL(PushDialog.class.getResource("/icon/parse.png")).createImage();
}
pauseIcon = ImageDescriptor.createFromURL(PushDialog.class.getResource("/icon/pause.png")).createImage();
playIcon = ImageDescriptor.createFromURL(PushDialog.class.getResource("/icon/play.png")).createImage();
}
/**
* Create the dialog.
......@@ -345,15 +350,18 @@ public class PushDialog extends Dialog {
tltmRemove.setImage(PushDialog.deleteDataIcon);
ToolItem tltmPause = new ToolItem(toolBar, SWT.NONE);
tltmPause.setImage(PushDialog.pauseIcon);
tltmPause.setText("Pause");
tltmPause.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
doPushPaused.set(! doPushPaused.get());
_log.warn("Reading data source is " + (doPushPaused.get() ? "paused" : "resumed"));
tltmPause.setText(doPushPaused.get() ? "Resume" : "Pause");
tltmPause.setText(doPushPaused.get() ? "Go!" : "Pause");
tltmPause.setImage(doPushPaused.get() ? PushDialog.playIcon : PushDialog.pauseIcon);
}
});
tltmPause.setText("Pause");
ToolItem tltmRadioItemDebug = new ToolItem(toolBar, SWT.RADIO);
tltmRadioItemDebug.addSelectionListener(new SelectionAdapter() {
......@@ -486,7 +494,9 @@ public class PushDialog extends Dialog {
}
int readProgress = this.pushProgress.updateReadProgress(this.pushProgress.sourceRowCount, pushedRows);
Display.getDefault().asyncExec(() -> {
progressBar.setSelection(readProgress);
if (! progressBar.isDisposed()) {
progressBar.setSelection(readProgress);
}
});
try {
Thread.sleep(100);
......
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