From: Son Hyunjun Date: Fri, 23 Mar 2012 06:11:15 +0000 (+0900) Subject: [Title] store skin properties creating new file at first time, portrait mode booting X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1759 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0885ea6ef46e750dca72870e2f8cb5eaa9980e5a;p=sdk%2Femulator%2Fqemu.git [Title] store skin properties creating new file at first time, portrait mode booting [Type] Bugfix [Module] [Priority] Minor [CQ#] [Redmine#] [Problem] [Cause] [Solution] Change-Id: Iaf45ea0cea819dbc9d01ce290b852ab4e6b2626d --- diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java index f4e3ee7b2b..4b5edc8df3 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java @@ -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; } diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java index 915d2f00b0..da7a1f1e51 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java @@ -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 );