[Title] store skin properties creating new file at first time, portrait mode booting
authorSon Hyunjun <hj79.son@samsung.com>
Fri, 23 Mar 2012 06:11:15 +0000 (15:11 +0900)
committerSon Hyunjun <hj79.son@samsung.com>
Fri, 23 Mar 2012 06:11:15 +0000 (15:11 +0900)
[Type] Bugfix
[Module]
[Priority] Minor
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]

Change-Id: Iaf45ea0cea819dbc9d01ce290b852ab4e6b2626d

tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java

index f4e3ee7..4b5edc8 100644 (file)
@@ -161,9 +161,11 @@ public class EmulatorSkin {
                int lcdHeight = Integer.parseInt( config.getArg( ArgsConstants.RESOLUTION_HEIGHT ) );
                
                int scale = SkinUtil.getValidScale( config );
-               short rotationId = config.getPropertyShort( PropertiesConstants.WINDOW_DIRECTION, (short) 0 );
-
-               arrangeSkin( lcdWidth, lcdHeight, scale, (short) rotationId );
+               
+//             short rotationId = config.getPropertyShort( PropertiesConstants.WINDOW_DIRECTION, (short) 0 );
+               // has to be portrait mode at first booting time
+               arrangeSkin( lcdWidth, lcdHeight, scale, RotationInfo.PORTRAIT.id() );
+               
                decideHoverColor();
 
                Menu menu = new Menu( shell );
@@ -625,6 +627,13 @@ public class EmulatorSkin {
                        }
                } );
 
+               deviceInfoItem.addListener( SWT.PaintItem, new Listener() {
+                       @Override
+                       public void handleEvent( Event event ) {
+                               event.gc.drawImage( imageRegistry.getIcon( IconName.DEVICE_INFO ), 0, 0 );
+                       }
+               } );
+               
                new MenuItem( menu, SWT.SEPARATOR );
 
                final MenuItem aotItem = new MenuItem( menu, SWT.CHECK );
@@ -855,7 +864,7 @@ public class EmulatorSkin {
                        public void widgetSelected( SelectionEvent e ) {
                                if( !isOpen ) {
                                        isOpen = true;
-                                       ScreenShotDialog dialog = new ScreenShotDialog( shell, lcdCanvas );
+                                       ScreenShotDialog dialog = new ScreenShotDialog( shell, lcdCanvas, config );
                                        dialog.open();
                                        isOpen = false;
                                }
index 915d2f0..da7a1f1 100644 (file)
@@ -29,6 +29,7 @@
 
 package org.tizen.emulator.skin.config;
 
+import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.Map;
@@ -82,12 +83,27 @@ public class EmulatorConfig {
        
        public void saveProperties() {
                
+               File file = new File( propertiesFilePath );
+
+               if( !file.exists() ) {
+                       
+                       try {
+                               if( !file.createNewFile() ) {
+                                       return;
+                               }
+                       } catch ( IOException e ) {
+                               logger.log( Level.SEVERE, "Fail to create skin properties file.", e );
+                               return;
+                       }
+                       
+               }
+               
                FileOutputStream fos = null;
                
                try {
                        
-                       fos = new FileOutputStream( propertiesFilePath );
-                       properties.store( fos, "Generated automatically by emulator." );
+                       fos = new FileOutputStream( file );
+                       properties.store( fos, "Automatically generated by emulator skin." );
                        
                } catch ( IOException e ) {
                        logger.log( Level.SEVERE, e.getMessage(), e );