menu: uncheck the AlwaysOnTop menu item
authorgiwoong.kim <giwoong.kim@samsung.com>
Mon, 6 May 2013 02:26:12 +0000 (11:26 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Mon, 6 May 2013 02:26:12 +0000 (11:26 +0900)
uncheck the AlwaysOnTop menu item if it got failure.

Change-Id: Iad8f7bc265d82b88951e53744cea2ca2e96f2c45
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java
tizen/src/skin/client/src/org/tizen/emulator/skin/layout/PhoneShapeSkinComposer.java
tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java

index cf8822d633a18449c25e0e6d3359787dd50f8a5b..fe93359c37b17758cd5da0009d1587a86ec252b0 100644 (file)
@@ -1200,6 +1200,8 @@ public class EmulatorSkin {
 
                                        if (SkinUtil.setTopMost(shell, isOnTop) == false) {
                                                logger.info("failed to Always On Top");
+
+                                               onTopItem.setSelection(isOnTop = false);
                                        } else {
                                                if (keyWindow != null) {
                                                        SkinUtil.setTopMost(keyWindow.getShell(), isOnTop);
index 8a86922dc192123762509b2c7f2fd9fac3222098..a4b8ce07caa2368ae5b375883b74c4c75a6c44ca 100644 (file)
@@ -143,6 +143,7 @@ public class GeneralPurposeSkinComposer implements ISkinComposer {
                //shell.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_BLACK));
                shell.setLocation(x, y);
 
+               /* This string must match the definition of Emulator-Manager */
                String emulatorName = SkinUtil.makeEmulatorName(config);
                shell.setText("Emulator - " + emulatorName);
 
index 489336141209986b3c362c5585382f8113c82ecc..f113f7b4932b0d201a4de10cc209ed16fc75e2ea 100644 (file)
@@ -136,6 +136,7 @@ public class PhoneShapeSkinComposer implements ISkinComposer {
                //shell.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_BLACK));
                shell.setLocation(x, y);
 
+               /* This string must match the definition of Emulator-Manager */
                String emulatorName = SkinUtil.makeEmulatorName(config);
                shell.setText("Emulator - " + emulatorName);
 
index b4d0a510240814934b0c035ccebb5e6f77bb5559..81a4db4edd474d69b09433643e85c0433f9b59b6 100644 (file)
@@ -82,34 +82,32 @@ public class SkinUtil {
                /* do nothing */
        }
 
-       public static String getVmName( EmulatorConfig config ) {
-               
-               String vmPath = config.getArg( ArgsConstants.VM_PATH );
+       public static String getVmName(EmulatorConfig config) {
+               String vmPath = config.getArg(ArgsConstants.VM_PATH);
 
                String regex = "";
-               if ( SwtUtil.isWindowsPlatform() ) {
+               if (SwtUtil.isWindowsPlatform()) {
                        regex = "\\" + File.separator;
                } else {
                        regex = File.separator;
                }
-               String[] split = StringUtil.nvl( vmPath ).split( regex );
+
+               String[] split = StringUtil.nvl(vmPath).split(regex);
                String vmName = split[split.length - 1];
 
                return vmName;
-               
        }
-       
-       public static String makeEmulatorName( EmulatorConfig config ) {
 
-               String vmName = getVmName( config );
+       public static String makeEmulatorName(EmulatorConfig config) {
+               String vmName = getVmName(config);
 
-               if ( StringUtil.isEmpty( vmName ) ) {
+               if (StringUtil.isEmpty(vmName)) {
                        vmName = EMULATOR_PREFIX;
                }
 
-               int portNumber = config.getArgInt( ArgsConstants.NET_BASE_PORT );
-               return vmName + ":" + portNumber;
+               int portNumber = config.getArgInt(ArgsConstants.NET_BASE_PORT);
 
+               return vmName + ":" + portNumber;
        }
 
        public static String getSdbPath() {
@@ -183,17 +181,17 @@ public class SkinUtil {
                return null;
        }
 
-       public static boolean isInGeometry( int currentX, int currentY, int targetX, int targetY, int targetWidth,
-                       int targetHeight ) {
+       public static boolean isInGeometry(int currentX, int currentY,
+                       int targetX, int targetY, int targetWidth, int targetHeight) {
 
-               if ( ( currentX >= targetX ) && ( currentY >= targetY ) ) {
-                       if ( ( currentX <= ( targetX + targetWidth ) ) && ( currentY <= ( targetY + targetHeight ) ) ) {
+               if ((currentX >= targetX) && (currentY >= targetY)) {
+                       if ((currentX <= (targetX + targetWidth)) &&
+                                       (currentY <= (targetY + targetHeight))) {
                                return true;
                        }
                }
 
                return false;
-
        }
 
        public static void trimShell( Shell shell, Image image ) {
@@ -282,8 +280,8 @@ public class SkinUtil {
 
        }
 
-       public static Image createScaledImage( ImageRegistry imageRegistry, Shell shell, short rotationId, int scale,
-                       ImageType type ) {
+       public static Image createScaledImage(ImageRegistry imageRegistry,
+                       Shell shell, short rotationId, int scale, ImageType type) {
 
                ImageData originalImageData = imageRegistry.getSkinImageData( rotationId, type );