From 87baaf01dc0e69399a5dbd71480cb656a31bd849 Mon Sep 17 00:00:00 2001 From: "giwoong.kim" Date: Thu, 17 May 2012 14:29:46 +0900 Subject: [PATCH] [Title] Gave the cooltime to screenshot toolbar button [Type] enhancement [Module] Emulator / skin [Priority] minor [Jira#] [Redmine#] [Problem] [Cause] visibility [Solution] [TestCase] --- .../emulator/skin/screenshot/ScreenShotDialog.java | 31 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java index 7ae9c67..e9714f0 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java @@ -88,6 +88,7 @@ public class ScreenShotDialog { public final static int COLOR_DEPTH = 32; public final static int CANVAS_MARGIN = 30; + public final static int TOOLITEM_COOLTIME = 200; private Logger logger = SkinLogger.getSkinLogger( ScreenShotDialog.class ).getLogger(); @@ -103,6 +104,8 @@ public class ScreenShotDialog { private RotationInfo currentRotation; private boolean reserveImage; + private ToolItem refreshItem; + private ToolItem copyItem; public ScreenShotDialog( Shell parent, SocketCommunicator communicator, EmulatorSkin emulatorSkin, EmulatorConfig config, Image icon ) throws ScreenShotException { @@ -376,7 +379,7 @@ public class ScreenShotDialog { } ); - ToolItem copyItem = new ToolItem( toolBar, SWT.FLAT ); + copyItem = new ToolItem( toolBar, SWT.FLAT ); copyItem.setImage( ImageRegistry.getInstance().getIcon( IconName.COPY_SCREEN_SHOT ) ); copyItem.setToolTipText( "Copy to clipboard" ); @@ -389,6 +392,18 @@ public class ScreenShotDialog { return; } + copyItem.setEnabled(false); + shell.getDisplay().asyncExec(new Runnable() { + public void run() { + try { + Thread.sleep(TOOLITEM_COOLTIME); + } catch (InterruptedException e) { + e.printStackTrace(); + } + copyItem.setEnabled(true); + } + }); + ImageLoader loader = new ImageLoader(); ImageData data = null; @@ -420,7 +435,7 @@ public class ScreenShotDialog { } ); - ToolItem refreshItem = new ToolItem( toolBar, SWT.FLAT ); + refreshItem = new ToolItem( toolBar, SWT.FLAT ); refreshItem.setImage( ImageRegistry.getInstance().getIcon( IconName.REFRESH_SCREEN_SHOT ) ); refreshItem.setToolTipText( "Refresh image" ); @@ -428,6 +443,18 @@ public class ScreenShotDialog { @Override public void widgetSelected( SelectionEvent e ) { + refreshItem.setEnabled(false); + shell.getDisplay().asyncExec(new Runnable() { + public void run() { + try { + Thread.sleep(TOOLITEM_COOLTIME); + } catch (InterruptedException e) { + e.printStackTrace(); + } + refreshItem.setEnabled(true); + } + }); + try { clickShutter(); } catch ( ScreenShotException ex ) { -- 2.7.4