Dispose the ProgressBar when booting is completed.
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.eclipse.swt.widgets.Display;
import org.tizen.emulator.skin.EmulatorSkin;
import org.tizen.emulator.skin.comm.ICommunicator;
import org.tizen.emulator.skin.comm.ICommunicator.SendCommand;
/* draw progress bar */
if (skin.bootingProgress != null) {
skin.bootingProgress.setSelection(value);
+
+ if (value == 100 | value == 0) {
+ /* this means progressbar will be
+ dispose soon */
+ if (skin.bootingProgress != null) {
+ skin.bootingProgress = null;
+ }
+ }
}
}
- //TODO: resetDataTransfer(progressDataTransfer)
+
+ resetDataTransfer(progressDataTransfer);
break;
}
skin.bootingProgress.setBounds(lcdBounds.x,
lcdBounds.y + lcdBounds.height + 1, lcdBounds.width, 2);
- skin.bootingProgress.dispose(); //TODO
+ //TODO : delete this line
+ skin.bootingProgress.setSelection(0); /* dispose */
skin.bootingProgress = null;
}
skin.bootingProgress.setBounds(lcdBounds.x,
lcdBounds.y + lcdBounds.height + 1, lcdBounds.width, 2);
- skin.bootingProgress.dispose(); //TODO:
+ //TODO : delete this line
+ skin.bootingProgress.setSelection(0); /* dispose */
skin.bootingProgress = null;
}
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
-import org.tizen.emulator.skin.dialog.DetailInfoDialog;
import org.tizen.emulator.skin.log.SkinLogger;
public class CustomProgressBar extends Canvas {
SkinLogger.getSkinLogger(CustomProgressBar.class).getLogger();
private Composite parent;
- private int selection = 0;
+ private int selection;
public CustomProgressBar(final Composite parent, int style) {
super(parent, style);
this.parent = parent;
+ this.selection = 1;
this.addPaintListener(new PaintListener() {
@Override
Rectangle bounds = getBounds();
int width = (bounds.width * selection) / 100;
e.gc.fillRectangle(0, 0, width, bounds.height);
+
+ if (selection == 0) {
+ logger.info("progress : complete!");
+
+ parent.getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ dispose();
+ }
+ });
+ }
}
});
}
@Override
public void run() {
redraw();
+
+ if (selection == 100) {
+ selection = 0;
+ }
}
});
}