From 9e3aabf39531a14c4a575390bf59dd0d7ff3f5cb Mon Sep 17 00:00:00 2001 From: jihye kim Date: Thu, 26 Apr 2012 19:48:24 +0900 Subject: [PATCH] Squashed commit of the following: commit 6a0b6acdd1a1c35d07bb296ce49bde84d347828a Author: munkyu.im Date: Mon Apr 23 21:11:16 2012 +0900 [Title]change version name to "TIZEN Larkspur" [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 8cc630dd902bc750ed60cccf5978d3224775eb8a Author: munkyu.im Date: Mon Apr 23 20:37:26 2012 +0900 [Title]change version name to "TIZEN Larkspur" [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit bc3fb0eef0edb94e8f1e6a4b63e44f40833ae462 Author: munkyu.im Date: Sun Apr 22 20:40:35 2012 +0900 [Title]change version name to Larkspur on about dialog [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 418e3775592b24653a06f4b5840e2018189dfe7b Author: munkyu.im Date: Sun Apr 22 20:27:01 2012 +0900 [Title]change version name to Larkspur [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 3fcd76afc9b74342045393e5a963ef312ad5436b Author: munkyu.im Date: Fri Apr 20 11:00:06 2012 +0900 [Title]remove SD Card XMLSchema [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 400073a8af81f93cf506fe59e5812318ddca8be7 Author: munkyu.im Date: Thu Apr 19 22:32:50 2012 +0900 [Title]Remove SD card [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 24a06ddd7bcd2d69141894ade41c5ca5d962e248 Author: munkyu.im Date: Thu Apr 19 18:44:10 2012 +0900 [Title]change version name to Larkspur and fix checking kvm routine [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit f169672b1877d8f78946fd132f5306f36c7c8aad Author: munkyu.im Date: Wed Apr 18 17:25:03 2012 +0900 [Title]add logs and exception handling [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 7e89dd30b128cd108b0a113952344714208f124a Author: munkyu.im Date: Mon Apr 16 16:10:55 2012 +0900 [Title]'Create Base Image' button not changed when check multi VM [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 9ec16b9fa2ad94365cf8e79baa848ae98118cbeb Author: jihye kim Date: Sun Apr 15 18:28:03 2012 +0900 [Title] modify 'reset' and 'delete' button state [Type] bug fix [Module] emulator manager [Priority] major [Jira#] N_SE-602 [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 4cacd07512f0146e4224ec9cedfa7d2f11ff524f Author: munkyu.im Date: Sat Apr 14 00:21:11 2012 +0900 [Title]fix multi instance checking on windows [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 926916b62f5b00455b50938d02083528e8eb4c55 Author: jihye kim Date: Fri Apr 13 04:06:27 2012 +0900 [Title] modify dpi and delete hax dialog [Type] bug fix [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit cf74ea31f73ef015d149c0a92c110a13abb0492f Author: jihye kim Date: Fri Apr 13 01:51:51 2012 +0900 [Title] add check hex program [Type] work [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 8c62fc884ab3d4ada1ec85a4d78064e41ed52128 Author: jihye kim Date: Tue Apr 10 21:21:23 2012 +0900 [Title] change max length of vm name 19 -> 20 [Type] bug fix [Module] emulator manager [Priority] major [Jira#] N_SE-500 [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 31de06bf543720a85819dad1a74d1ab29f904fef Author: munkyu.im Date: Sat Apr 7 17:46:52 2012 +0900 [Title]do not use Create Base Image while VM is running [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit ff77332fdc11d327002057fa11ff92151b022c11 Author: munkyu.im Date: Sat Apr 7 15:24:50 2012 +0900 [Title]version up to 1.0.40 [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit abad36526d3658917e79fdc3ac93f2bb9a721c85 Author: munkyu.im Date: Sat Apr 7 14:17:10 2012 +0900 [Title]fix file sharing not working on windows [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 786ea0fcf7a0d28cff6820aee9bcc8665be26676 Author: munkyu.im Date: Sat Apr 7 04:47:32 2012 +0900 [Title]version up to 1.0.39 [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit f3db9fb4b17985e6269f53d977a31ca85d178283 Merge: e75978a e692f8a Author: munkyu.im Date: Sat Apr 7 04:57:18 2012 +0900 Merge "[Title]fix starting emulator manager routine [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase]" into release-1.0 commit e692f8a733a99e944a668f8a8be626a956da19d9 Author: munkyu.im Date: Sat Apr 7 04:45:11 2012 +0900 [Title]fix starting emulator manager routine [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit e75978ab13de7de5351e8556b8cffefc2c08077b Author: jihye kim Date: Sat Apr 7 01:47:07 2012 +0900 [Title] modify control empty .tizen_vms_path [Type] bug fix [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 5e97754f091ad6e33756825d213c874382dd001d Author: jihye kim Date: Sat Apr 7 01:05:56 2012 +0900 [Title] bug fix -> deselected item issue [Type] bug fix [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 9ee5fcb734145e38d558a3e8a0310eec6aba760e Merge: 7541de5 e0eda3a Author: munkyu.im Date: Sat Apr 7 00:49:46 2012 +0900 Merge "[Title]change javaw to java [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase]" into release-1.0 commit e0eda3a2f15e1f4a55f7d29cd24e8c778895383a Author: munkyu.im Date: Sat Apr 7 00:37:57 2012 +0900 [Title]change javaw to java [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 7541de599acf37950dd912288c633378a15d242f Author: jihye kim Date: Sat Apr 7 00:14:02 2012 +0900 [Title] change skin type popup [Type] work [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 0442811c3fdd5eb992b514d2042ace29a69bd74d Author: jihye kim Date: Sat Apr 7 00:09:59 2012 +0900 [Title] update package version [Type] work [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit a0711bece4d31c30942c93b6dc1c9a939c7e3680 Merge: dd44147 6b55c3d Author: munkyu.im Date: Sat Apr 7 00:08:41 2012 +0900 Merge "[Title]change position of checking authrization [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase]" into release-1.0 commit 90cc7abc3df3dab1e039a2c7c651729b88258c90 Author: jihye kim Date: Sat Apr 7 00:06:22 2012 +0900 [Title] modify select workspace module [Type] bug fix [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 6b55c3de84d8efc73a29c8013af6a8ecd53502ea Author: munkyu.im Date: Fri Apr 6 23:56:36 2012 +0900 [Title]change position of checking authrization [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit dd44147397c29321aff39d46cf61fc63a502876f Merge: 7a49d4f 3b58ad0 Author: yeongkyoon lee Date: Fri Apr 6 23:56:26 2012 +0900 Merge "[Title] UI bugs fix and add context menu icon (create base image) [Type] [Module] Emulator/ [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase]" into release-1.0 commit 7a49d4f77aedfecd5d716574ee3d02e194effc80 Merge: f7e95cc f3866ac Author: yeongkyoon lee Date: Fri Apr 6 23:52:12 2012 +0900 Merge "[Title] Avoid table packing bugs on linux [Type] [Module] Emulator/ [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase]" into release-1.0 commit 3b58ad066024121e6caf7b203c9d33e7569f68dc Author: syeon.hwang Date: Fri Apr 6 23:41:30 2012 +0900 [Title] UI bugs fix and add context menu icon (create base image) [Type] [Module] Emulator/ [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit f7e95cc86138d7ac34d0b1dcc99c049e2f3e4599 Author: munkyu.im Date: Fri Apr 6 23:32:45 2012 +0900 [Title]fix creating directory authorization [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit f3866ac3b275a1c32207f0c4104f13df189979df Author: syeon.hwang Date: Fri Apr 6 23:24:17 2012 +0900 [Title] Avoid table packing bugs on linux [Type] [Module] Emulator/ [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 146e3f7484355ccf8e438c6a373f200e963b1b88 Author: jihye kim Date: Fri Apr 6 21:11:29 2012 +0900 [Title] emulator mamager version up [Type] work [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit e7cdfd9fdb347e9182d34888a244a33f8d441006 Author: munkyu.im Date: Fri Apr 6 17:56:58 2012 +0900 [Title]fix sentence [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 9091c41c8c32ab0ba830fc35919231c83e1e87e9 Author: jihye kim Date: Fri Apr 6 15:55:52 2012 +0900 [Title] change dialog init mode [Type] bug fix [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit a014150b531b46ba9d15fb0a073c37e9a2e99951 Author: munkyu.im Date: Fri Apr 6 15:42:00 2012 +0900 [Title]create thread for run emulator-manager.jar [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 514ebbaa127a019ea6f131f28c43f674355be4e4 Author: jihye kim Date: Fri Apr 6 15:28:37 2012 +0900 [Title] delete literal strings and unused source [Type] work [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit c0ea2b6107669365ed0149654c3f00d940c4b14a Author: jihye kim Date: Fri Apr 6 15:09:59 2012 +0900 [Title] change MessageBox -> MessageDialog [Type] work [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 45ba0b239454e9f5697549b86a75ec000ac7dc3b Author: jihye kim Date: Fri Apr 6 14:39:03 2012 +0900 [Title] change contextmenu order [Type] work [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 65366930cf31b22eb7df4acf463a5bc9e3cd4471 Author: jihye kim Date: Fri Apr 6 14:27:11 2012 +0900 [Title] modify control toolbar [Type] work [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit f05799db796f28b3b4a420436ba1e272def6501b Author: jihye kim Date: Fri Apr 6 14:05:46 2012 +0900 [Title] add create image tool item [Type] work [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 96cd48b89250c4e668d6241902d95e82dbeb6c27 Author: munkyu.im Date: Fri Apr 6 13:58:53 2012 +0900 [Title]fix message of Clone dialog [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 9656214814bd1c75b183ffa1a623c19f0c55123d Author: syeon.hwang Date: Fri Apr 6 12:24:03 2012 +0900 [Title] Add null checking [Type] [Module] Emulator/ [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 2b03320d6be26bc16b7cecdbfd3e2749f575e546 Author: jihye kim Date: Fri Apr 6 11:57:26 2012 +0900 [Title] add selecting vms path [Type] work [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit dabcbb44a328c6b485f9550c7b37e9bdbd1be4d1 Author: munkyu.im Date: Thu Apr 5 23:09:01 2012 +0900 [Title]fix directory authority [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem]raise exception when User can't create file or directory. [Cause] [Solution] [TestCase] commit 71e67b85c2565d548ac4a03fc93a30c9f1b7aa12 Author: munkyu.im Date: Thu Apr 5 22:21:07 2012 +0900 [Title]modify dialog sentences [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit c9dfdd7faebde1715b912e4d4a9ecd6b50434b6f Author: munkyu.im Date: Thu Apr 5 21:30:52 2012 +0900 [Title]fill contents of About Dialog [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit cf8bbac01d0ac0ae6665b1c9d10917d38e671880 Author: munkyu.im Date: Thu Apr 5 18:07:51 2012 +0900 [Title]add save mode when use workspace option [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 1b376bee693a571de08d2074d6812ca0d0ab63fe Author: jihye kim Date: Thu Apr 5 16:29:55 2012 +0900 [Title] modify setting workspace [Type] work [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 5425d93028b115d56702284c80f61205400c5930 Author: syeon.hwang Date: Thu Apr 5 15:34:54 2012 +0900 [Title] disable clone item by default [Type] [Module] Emulator/ [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 502ffe995a3471f4f14946277f27c96fc7f1d265 Author: syeon.hwang Date: Thu Apr 5 15:21:55 2012 +0900 [Title] Introduce new UI based on tool items [Type] [Module] Emulator/ [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit a2c48784b8a7d4ec289212035bf767303db9cfc8 Author: munkyu.im Date: Wed Apr 4 21:14:25 2012 +0900 [Title]remove unused source code [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit df90e4e3b78a58f5c4efb0f129730b76eb33a78a Author: munkyu.im Date: Wed Apr 4 20:36:36 2012 +0900 [Title]use workspace permanently [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 5749f6587535cccef49facd32d66798c607e2c56 Author: munkyu.im Date: Wed Apr 4 17:48:07 2012 +0900 [Title]Version up to 1.0.34 [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 59921fd9e409d950c94ddd40e230fb6ff90c4e51 Author: munkyu.im Date: Wed Apr 4 17:27:34 2012 +0900 [Title]fix Display [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem]made new display every MessageBox call [Cause] [Solution] [TestCase] commit bb853ff2ccb46ca7cffcebef73e65a6345dcfc95 Author: jihye kim Date: Wed Apr 4 16:16:00 2012 +0900 [Title] Add MessageDialog class [Type] work [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] commit 6e966cc31f20219afc14a8d562f7a2f884d256d4 Merge: d8f71b8 fe42ccc Author: syeon.hwang Date: Wed Apr 4 15:33:01 2012 +0900 Merge branch 'develop' into release-1.0 commit d8f71b819a17da66d5b0e6777e9335aed84a5141 Merge: 1526fb7 df265ee Author: syeon.hwang Date: Wed Apr 4 15:21:57 2012 +0900 Merge branch 'release-1.0' of gerrithost:/sdk/emulator/emulator-manager into release-1.0 commit df265ee5283c7f459b1fa9d27951f5cc1bc749e4 Merge: 98f174e 033de98 Author: munkyu.im Date: Wed Apr 4 15:08:51 2012 +0900 Merge "[Title]fix problem related with sending argument to emulator manager [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase]" into release-1.0 commit 033de98c78f2c9428ac50049f0b5951a21333480 Author: munkyu.im Date: Wed Apr 4 14:56:16 2012 +0900 [Title]fix problem related with sending argument to emulator manager [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- VERSION | 1 + build.xml | 31 +- dist/linux/emulator-manager.sh | 6 +- dist/win32/emulator-manager.bat | 12 - dist/win32/emulator-manager.c | 28 +- .../manager/vms/xml/BaseInformationType.java | 2 +- .../tizen/emulator/manager/vms/xml/DeviceType.java | 14 +- .../manager/vms/xml/DiskImageFormatType.java | 2 +- .../emulator/manager/vms/xml/DisplayType.java | 2 +- .../manager/vms/xml/EmulatorConfiguration.java | 2 +- .../emulator/manager/vms/xml/ObjectFactory.java | 94 +++--- .../tizen/emulator/manager/vms/xml/RamType.java | 2 +- .../tizen/emulator/manager/vms/xml/SkinType.java | 2 +- .../emulator/manager/vms/xml/StorageType.java | 133 -------- .../tizen/emulator/manager/vms/xml/TouchType.java | 2 +- .../emulator/manager/vms/xml/UsabilityType.java | 2 +- .../emulator/manager/vms/xml/package-info.java | 2 +- package/pkginfo.manifest | 4 +- resource/res/about.png | Bin 0 -> 3282 bytes resource/res/arm.png | Bin 0 -> 3150 bytes resource/res/createimage.png | Bin 0 -> 3048 bytes resource/res/x86.png | Bin 0 -> 3147 bytes .../tizen/emulator/manager/EmulatorManager.java | 106 +++--- .../tizen/emulator/manager/logging/EMLogger.java | 2 +- .../emulator/manager/tool/CheckVirtualization.java | 139 ++++++++ src/org/tizen/emulator/manager/tool/FileIO.java | 9 + .../emulator/manager/tool/SelectWorkspace.java | 155 +++++++++ .../emulator/manager/tool/StringResource.java | 31 +- .../emulator/manager/ui/ArchitectureGroup.java | 8 +- src/org/tizen/emulator/manager/ui/CloneDialog.java | 39 +-- src/org/tizen/emulator/manager/ui/MainDialog.java | 360 +++++++++++++-------- .../tizen/emulator/manager/ui/MenuHandling.java | 103 +++--- .../tizen/emulator/manager/ui/MessageDialog.java | 85 +++++ .../emulator/manager/ui/ResourceRegistry.java | 3 +- .../emulator/manager/ui/SelectWorkspaceDialog.java | 226 +++++++++++++ .../manager/ui/detail/DetailTableView.java | 8 +- .../emulator/manager/ui/detail/VMPropertyView.java | 149 ++------- .../emulator/manager/ui/detail/VMResource.java | 67 +--- .../emulator/manager/ui/vmstree/ContextMenu.java | 35 +- .../tizen/emulator/manager/ui/vmstree/RowItem.java | 2 +- .../tizen/emulator/manager/ui/vmstree/VMsTree.java | 49 ++- src/org/tizen/emulator/manager/vms/Creator.java | 19 +- .../tizen/emulator/manager/vms/EmulatorVMs.java | 4 - src/org/tizen/emulator/manager/vms/Launcher.java | 294 +++++++++-------- src/org/tizen/emulator/manager/vms/Modifier.java | 72 ----- .../tizen/emulator/manager/vms/VMCreateHelper.java | 52 --- .../emulator/manager/vms/VMPropertyValue.java | 28 -- src/org/tizen/emulator/manager/vms/VMsWorker.java | 33 +- xsd/em.xml | 3 - xsd/em.xsd | 14 +- 50 files changed, 1399 insertions(+), 1037 deletions(-) create mode 100644 VERSION delete mode 100755 dist/win32/emulator-manager.bat delete mode 100644 jaxb_src/org/tizen/emulator/manager/vms/xml/StorageType.java create mode 100644 resource/res/about.png create mode 100644 resource/res/arm.png create mode 100755 resource/res/createimage.png create mode 100644 resource/res/x86.png create mode 100644 src/org/tizen/emulator/manager/tool/CheckVirtualization.java create mode 100644 src/org/tizen/emulator/manager/tool/SelectWorkspace.java create mode 100644 src/org/tizen/emulator/manager/ui/MessageDialog.java create mode 100644 src/org/tizen/emulator/manager/ui/SelectWorkspaceDialog.java diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..4ec2608 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +Larkspur diff --git a/build.xml b/build.xml index 9ad2204..c99d4df 100644 --- a/build.xml +++ b/build.xml @@ -22,8 +22,28 @@ + + + + + + + + + + + + + + + + + + + + - + @@ -31,7 +51,7 @@ - + @@ -39,7 +59,7 @@ - + @@ -59,6 +79,7 @@ + @@ -79,6 +100,7 @@ + @@ -99,6 +121,7 @@ + @@ -107,4 +130,4 @@ - \ No newline at end of file + diff --git a/dist/linux/emulator-manager.sh b/dist/linux/emulator-manager.sh index c41c66d..2182014 100755 --- a/dist/linux/emulator-manager.sh +++ b/dist/linux/emulator-manager.sh @@ -13,11 +13,9 @@ else em_path="." fi -mode=$1 - if [ -f $current_emulmgr ] then -java -jar $current_emulmgr $mode $* +java -jar $current_emulmgr $* else -java -jar $em_path"/emulator-manager.jar" $mode $* +java -jar $em_path"/emulator-manager.jar" $* fi diff --git a/dist/win32/emulator-manager.bat b/dist/win32/emulator-manager.bat deleted file mode 100755 index 40c85a7..0000000 --- a/dist/win32/emulator-manager.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF -set install_path=%localappdata%\.TizenSDK\tizensdkpath -::echo %install_path% - -for /f "tokens=2 delims==" %%i in (%install_path%) do set tizen_path=%%i -::echo %tizen_path% - -set em_path=%tizen_path%\Emulator\bin - -set mode=%1 - -javaw -jar %em_path%\emulator-manager.jar %mode% diff --git a/dist/win32/emulator-manager.c b/dist/win32/emulator-manager.c index 093e469..94a8675 100644 --- a/dist/win32/emulator-manager.c +++ b/dist/win32/emulator-manager.c @@ -4,7 +4,8 @@ #include #include -int main(int argc, char* argv[]) { +int main(int argc, char* argv[]) +{ FILE *propertyFile; HKEY hKey; char strPropertyFilePath[MAX]; @@ -16,6 +17,9 @@ int main(int argc, char* argv[]) { DWORD ret; int i; DWORD fileAttr; + STARTUPINFO sti = { 0 }; + PROCESS_INFORMATION pi = { 0 }; + ret = GetCurrentDirectory(512, currentEmulmgr); strcat(currentEmulmgr, EMULMGR_JAR); // Get a "tizensdkpath" file path @@ -66,7 +70,25 @@ int main(int argc, char* argv[]) { strcat(strCommand, argv[i]); } } - // execute emulator-manager - WinExec(strCommand, SW_SHOWNORMAL); + + if(!CreateProcess(NULL, + strCommand, + NULL, + NULL, + FALSE, + NORMAL_PRIORITY_CLASS, + NULL, + NULL, + &sti, + &pi) + ) { + fprintf(stderr, "Unable to generate Emulator Manager process\n"); + exit(1); + } + + DWORD rc = WaitForSingleObject( + pi.hProcess, // process handle + INFINITE); + return 0; } diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/BaseInformationType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/BaseInformationType.java index 92b5227..6bc60ae 100644 --- a/jaxb_src/org/tizen/emulator/manager/vms/xml/BaseInformationType.java +++ b/jaxb_src/org/tizen/emulator/manager/vms/xml/BaseInformationType.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.04.02 at 05:39:01 오후 KST +// Generated on: 2012.04.20 at 10:49:37 오전 KST // diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/DeviceType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/DeviceType.java index fd661da..aea64d7 100644 --- a/jaxb_src/org/tizen/emulator/manager/vms/xml/DeviceType.java +++ b/jaxb_src/org/tizen/emulator/manager/vms/xml/DeviceType.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.04.02 at 05:39:01 오후 KST +// Generated on: 2012.04.20 at 10:49:37 오전 KST // @@ -25,7 +25,7 @@ import javax.xml.bind.annotation.XmlType; * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> * <element name="display" type="{http://www.tizen.org/em}displayType"/> - * <element name="storage" type="{http://www.tizen.org/em}storageType"/> + * <element name="storage" type="{http://www.w3.org/2001/XMLSchema}string"/> * <element name="RAM" type="{http://www.tizen.org/em}ramType"/> * <element name="touch" type="{http://www.tizen.org/em}touchType" minOccurs="0"/> * </sequence> @@ -48,7 +48,7 @@ public class DeviceType { @XmlElement(required = true) protected DisplayType display; @XmlElement(required = true) - protected StorageType storage; + protected String storage; @XmlElement(name = "RAM", required = true) protected RamType ram; protected TouchType touch; @@ -82,10 +82,10 @@ public class DeviceType { * * @return * possible object is - * {@link StorageType } + * {@link String } * */ - public StorageType getStorage() { + public String getStorage() { return storage; } @@ -94,10 +94,10 @@ public class DeviceType { * * @param value * allowed object is - * {@link StorageType } + * {@link String } * */ - public void setStorage(StorageType value) { + public void setStorage(String value) { this.storage = value; } diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/DiskImageFormatType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/DiskImageFormatType.java index ac336f0..f41a6d6 100644 --- a/jaxb_src/org/tizen/emulator/manager/vms/xml/DiskImageFormatType.java +++ b/jaxb_src/org/tizen/emulator/manager/vms/xml/DiskImageFormatType.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.04.02 at 05:39:01 오후 KST +// Generated on: 2012.04.20 at 10:49:37 오전 KST // diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/DisplayType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/DisplayType.java index d651a3e..fccba72 100644 --- a/jaxb_src/org/tizen/emulator/manager/vms/xml/DisplayType.java +++ b/jaxb_src/org/tizen/emulator/manager/vms/xml/DisplayType.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.04.02 at 05:39:01 오후 KST +// Generated on: 2012.04.20 at 10:49:37 오전 KST // diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/EmulatorConfiguration.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/EmulatorConfiguration.java index 7901954..bc812b2 100644 --- a/jaxb_src/org/tizen/emulator/manager/vms/xml/EmulatorConfiguration.java +++ b/jaxb_src/org/tizen/emulator/manager/vms/xml/EmulatorConfiguration.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.04.02 at 05:39:01 오후 KST +// Generated on: 2012.04.20 at 10:49:37 오전 KST // diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/ObjectFactory.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/ObjectFactory.java index 1cc5fbb..600fed9 100644 --- a/jaxb_src/org/tizen/emulator/manager/vms/xml/ObjectFactory.java +++ b/jaxb_src/org/tizen/emulator/manager/vms/xml/ObjectFactory.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.04.02 at 05:39:01 오후 KST +// Generated on: 2012.04.20 at 10:49:37 오전 KST // @@ -37,6 +37,14 @@ public class ObjectFactory { } /** + * Create an instance of {@link UsabilityType } + * + */ + public UsabilityType createUsabilityType() { + return new UsabilityType(); + } + + /** * Create an instance of {@link BaseInformationType } * */ @@ -45,59 +53,59 @@ public class ObjectFactory { } /** - * Create an instance of {@link RamType.Size } + * Create an instance of {@link DiskImageFormatType } * */ - public RamType.Size createRamTypeSize() { - return new RamType.Size(); + public DiskImageFormatType createDiskImageFormatType() { + return new DiskImageFormatType(); } /** - * Create an instance of {@link DisplayType.Resolution } + * Create an instance of {@link BaseInformationType.DiskImage } * */ - public DisplayType.Resolution createDisplayTypeResolution() { - return new DisplayType.Resolution(); + public BaseInformationType.DiskImage createBaseInformationTypeDiskImage() { + return new BaseInformationType.DiskImage(); } /** - * Create an instance of {@link EmulatorConfiguration } + * Create an instance of {@link UsabilityType.Logging } * */ - public EmulatorConfiguration createEmulatorConfiguration() { - return new EmulatorConfiguration(); + public UsabilityType.Logging createUsabilityTypeLogging() { + return new UsabilityType.Logging(); } /** - * Create an instance of {@link StorageType.SDCard } + * Create an instance of {@link RamType.Size } * */ - public StorageType.SDCard createStorageTypeSDCard() { - return new StorageType.SDCard(); + public RamType.Size createRamTypeSize() { + return new RamType.Size(); } /** - * Create an instance of {@link UsabilityType.Logging } + * Create an instance of {@link EmulatorConfiguration } * */ - public UsabilityType.Logging createUsabilityTypeLogging() { - return new UsabilityType.Logging(); + public EmulatorConfiguration createEmulatorConfiguration() { + return new EmulatorConfiguration(); } /** - * Create an instance of {@link DisplayType } + * Create an instance of {@link UsabilityType.FileSharing } * */ - public DisplayType createDisplayType() { - return new DisplayType(); + public UsabilityType.FileSharing createUsabilityTypeFileSharing() { + return new UsabilityType.FileSharing(); } /** - * Create an instance of {@link UsabilityType } + * Create an instance of {@link DisplayType.Density } * */ - public UsabilityType createUsabilityType() { - return new UsabilityType(); + public DisplayType.Density createDisplayTypeDensity() { + return new DisplayType.Density(); } /** @@ -117,35 +125,11 @@ public class ObjectFactory { } /** - * Create an instance of {@link BaseInformationType.DiskImage } - * - */ - public BaseInformationType.DiskImage createBaseInformationTypeDiskImage() { - return new BaseInformationType.DiskImage(); - } - - /** - * Create an instance of {@link StorageType } - * - */ - public StorageType createStorageType() { - return new StorageType(); - } - - /** - * Create an instance of {@link DiskImageFormatType } - * - */ - public DiskImageFormatType createDiskImageFormatType() { - return new DiskImageFormatType(); - } - - /** - * Create an instance of {@link UsabilityType.FileSharing } + * Create an instance of {@link DeviceType } * */ - public UsabilityType.FileSharing createUsabilityTypeFileSharing() { - return new UsabilityType.FileSharing(); + public DeviceType createDeviceType() { + return new DeviceType(); } /** @@ -157,11 +141,11 @@ public class ObjectFactory { } /** - * Create an instance of {@link DisplayType.Density } + * Create an instance of {@link DisplayType.Resolution } * */ - public DisplayType.Density createDisplayTypeDensity() { - return new DisplayType.Density(); + public DisplayType.Resolution createDisplayTypeResolution() { + return new DisplayType.Resolution(); } /** @@ -173,11 +157,11 @@ public class ObjectFactory { } /** - * Create an instance of {@link DeviceType } + * Create an instance of {@link DisplayType } * */ - public DeviceType createDeviceType() { - return new DeviceType(); + public DisplayType createDisplayType() { + return new DisplayType(); } } diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/RamType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/RamType.java index a1d46a9..230efc9 100644 --- a/jaxb_src/org/tizen/emulator/manager/vms/xml/RamType.java +++ b/jaxb_src/org/tizen/emulator/manager/vms/xml/RamType.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.04.02 at 05:39:01 오후 KST +// Generated on: 2012.04.20 at 10:49:37 오전 KST // diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/SkinType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/SkinType.java index f51136a..cb25e71 100644 --- a/jaxb_src/org/tizen/emulator/manager/vms/xml/SkinType.java +++ b/jaxb_src/org/tizen/emulator/manager/vms/xml/SkinType.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.04.02 at 05:39:01 오후 KST +// Generated on: 2012.04.20 at 10:49:37 오전 KST // diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/StorageType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/StorageType.java deleted file mode 100644 index 7a2fe7b..0000000 --- a/jaxb_src/org/tizen/emulator/manager/vms/xml/StorageType.java +++ /dev/null @@ -1,133 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.04.02 at 05:39:01 오후 KST -// - - -package org.tizen.emulator.manager.vms.xml; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for storageType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="storageType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="SDCard">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="diskImage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "storageType", propOrder = { - "sdCard" -}) -public class StorageType { - - @XmlElement(name = "SDCard", required = true) - protected StorageType.SDCard sdCard; - - /** - * Gets the value of the sdCard property. - * - * @return - * possible object is - * {@link StorageType.SDCard } - * - */ - public StorageType.SDCard getSDCard() { - return sdCard; - } - - /** - * Sets the value of the sdCard property. - * - * @param value - * allowed object is - * {@link StorageType.SDCard } - * - */ - public void setSDCard(StorageType.SDCard value) { - this.sdCard = value; - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <sequence>
-     *         <element name="diskImage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "diskImage" - }) - public static class SDCard { - - protected String diskImage; - - /** - * Gets the value of the diskImage property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getDiskImage() { - return diskImage; - } - - /** - * Sets the value of the diskImage property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setDiskImage(String value) { - this.diskImage = value; - } - - } - -} diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/TouchType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/TouchType.java index 9c665ab..28593d6 100644 --- a/jaxb_src/org/tizen/emulator/manager/vms/xml/TouchType.java +++ b/jaxb_src/org/tizen/emulator/manager/vms/xml/TouchType.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.04.02 at 05:39:01 오후 KST +// Generated on: 2012.04.20 at 10:49:37 오전 KST // diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/UsabilityType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/UsabilityType.java index 4ae8095..efc43bc 100644 --- a/jaxb_src/org/tizen/emulator/manager/vms/xml/UsabilityType.java +++ b/jaxb_src/org/tizen/emulator/manager/vms/xml/UsabilityType.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.04.02 at 05:39:01 오후 KST +// Generated on: 2012.04.20 at 10:49:37 오전 KST // diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/package-info.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/package-info.java index e6d7c74..2c8828a 100644 --- a/jaxb_src/org/tizen/emulator/manager/vms/xml/package-info.java +++ b/jaxb_src/org/tizen/emulator/manager/vms/xml/package-info.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.04.02 at 05:39:01 오후 KST +// Generated on: 2012.04.20 at 10:49:37 오전 KST // @javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tizen.org/em", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index 384b311..b43d962 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,5 +1,5 @@ Package: emulator-manager -Version: 1.0.33 +Version: 1.0.53 OS: linux Build-host-os: linux Maintainer: Yeong-Kyoon Lee @@ -7,7 +7,7 @@ Source: emulator-manager Description: Tizen Emulator Manager Package: emulator-manager -Version: 1.0.33 +Version: 1.0.53 OS: windows Build-host-os: windows Maintainer: Yeong-Kyoon Lee diff --git a/resource/res/about.png b/resource/res/about.png new file mode 100644 index 0000000000000000000000000000000000000000..fbe5841c1a1c31b4bbe3018b558964af5c7be475 GIT binary patch literal 3282 zcmV;@3@!7CP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7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-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0004bNklG91Lq^{uYWZtqY!{<_}2d2N6yvM37scK0KOH84S^InU_&CgA{{K7K@*K}y>Q z0fI;6sm-MYvb9BIfzj1>FhdB6P-UQ6MONX#I~3x~p0{{$@Q&FvV2aqz5>99-IoAl>nq4bpJKrKi2;g1Sus?JT!3d7==d&n@8A!+sM6}E9bvuz&c%ID7k~~!8$dSNI=r^4c od2;e`>bE@^4g{e8`Bgs$02)Hd!eJ+w1ONa407*qoM6N<$g1;}}(EtDd literal 0 HcmV?d00001 diff --git a/resource/res/createimage.png b/resource/res/createimage.png new file mode 100755 index 0000000000000000000000000000000000000000..051beb0c7ed5ab3519aaf3bf24611e98a40acd3c GIT binary patch literal 3048 zcmVP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW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; i++) { if(args[i].equals("--workspace") || args[i].equals("-w")) { if(args.length == i + 1 || args[i + 1].startsWith("--")) { isArgsError = true; } else { - EmulatorVMs.getInstance().setVMsBaseDirectory(args[i + 1]); + /* used workspace option correctly */ + if(args[i+1].endsWith(SAVE_TRUE)) { + workspacePath = args[i=1].substring(0, args[i=1].length() - SAVE_TRUE.length()); + isSave = true; + } + else if(args[i+1].endsWith(SAVE_FALSE)) { + workspacePath = args[i=1].substring(0, args[i=1].length() - SAVE_FALSE.length()); + isSave = false; + } + else { + isArgsError = true; + } } } else if (args[i].equals("--inhouse")) { mode = ManagerModeType.INHOUSE_MODE; } } } - else { - EmulatorVMs.getInstance().setVMsBaseDirectory(FileIO.getInstance().getTizenVmsPath()); - } + + if (!SelectWorkspace.setWorkspace(workspacePath, isSave)) { + exitEmulatorManager(0); + } + + MessageDialog msg = new MessageDialog(new Shell(Display.getCurrent())); if (isArgsError == true) { - getMessageBoxInNewShell(SWT.ICON_INFORMATION, "INFO", "You did not input workspace path after\n" + - "command line option --workspace or -w\n" + - "Emulator Manager sets in default workspace.").open(); + msg.openWarningDialog("Used workspace option parameter is not proper. Aborting...\n" + + "\nSee right examples below.\n" + + "[--workspace {workspace path},save=true]\n" + + "[-w {workspace path},save=true]\n" + + "[--workspace {workspace path},save=false]\n" + + "[-w {workspace path},save=false]\n" + + "\nThe workspace path must be absolute." + ); + exitEmulatorManager(0); } - + return mode; } - - static MessageBox getMessageBoxInNewShell(int style, String text, String message) { - Shell shell = new Shell(Display.getCurrent()); - MessageBox msg = new MessageBox(shell, SWT.ICON_INFORMATION); - msg.setText(text); - msg.setMessage(message); - - return msg; - } - - static void exitEmulatorManager(int returnValue) { + + public static void exitEmulatorManager(int returnValue) { System.exit(returnValue); } public static void main(String[] args) { - ManagerModeType mode = parseArgs(args); - - instance = new EmulatorManager(mode); - - EMLogger.getLogger().log(Level.INFO, "Start Emulator Manager!!\n"); - - try { - EmulatorVMs.getInstance().loadProperties(); - } catch (Exception e) { - e.printStackTrace(); - } - + MessageDialog msg = new MessageDialog(new Shell(Display.getCurrent())); try { FileLock lock = new RandomAccessFile(new File(FileIO.getInstance().getBinPath() + File.separator + "." +System.getProperty("user.name"))+ ".lock", "rw").getChannel().tryLock(); if (lock == null) { - getMessageBoxInNewShell(SWT.ICON_INFORMATION, "INFO", "Can not launch Emulator Manager.\n" + - "Another one with the same user name is running now.").open(); - + msg.openInfoDialog("Can not launch Emulator Manager.\n" + + "Another one with the same user name is running now."); exitEmulatorManager(0); } } catch (Exception e) { - getMessageBoxInNewShell(SWT.ICON_INFORMATION, "INFO", - "Can not launch Emulator Manager.\n" +e.getMessage()).open(); - + msg.openInfoDialog("Can not launch Emulator Manager.\n" +e.getMessage()); exitEmulatorManager(-1); + } + + ManagerModeType mode = parseArgs(args); + instance = new EmulatorManager(mode); + + EMLogger.getLogger().log(Level.INFO, "Start Emulator Manager!!\n"); + + // check hax or kvm + CheckVirtualization.getInstance().check(); + + try { + EmulatorVMs.getInstance().loadProperties(); + } catch (Exception e) { + EMLogger.getLogger().log(Level.WARNING, e.getMessage()); } - + instance.preare(); instance.DrawUI(); instance.dispose(); } - + public enum ManagerModeType { PUBLIC_MODE("public"), INHOUSE_MODE("inhouse"); diff --git a/src/org/tizen/emulator/manager/logging/EMLogger.java b/src/org/tizen/emulator/manager/logging/EMLogger.java index b3c29d8..02b73a0 100644 --- a/src/org/tizen/emulator/manager/logging/EMLogger.java +++ b/src/org/tizen/emulator/manager/logging/EMLogger.java @@ -68,7 +68,7 @@ public class EMLogger { File logFolder; Handler logFileHandler; try { - logFolder = new File(FileIO.getInstance().getEtcPath()); + logFolder = new File(FileIO.getInstance().getTizenVmsArchPath()); if (!logFolder.exists()) { logFolder.mkdirs(); } diff --git a/src/org/tizen/emulator/manager/tool/CheckVirtualization.java b/src/org/tizen/emulator/manager/tool/CheckVirtualization.java new file mode 100644 index 0000000..20f8e1b --- /dev/null +++ b/src/org/tizen/emulator/manager/tool/CheckVirtualization.java @@ -0,0 +1,139 @@ +package org.tizen.emulator.manager.tool; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Level; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.tizen.emulator.manager.logging.EMLogger; + +public class CheckVirtualization { + private static CheckVirtualization instance = new CheckVirtualization(); + private static boolean isSupport = true; + private static String enable_command = null; + private static String disable_command = null; + private static boolean isCheck = false; + + private CheckVirtualization() { + // singleton class + } + + public static CheckVirtualization getInstance() { + return instance; + } + + public boolean isSupportVirtualization() { + return isSupport; + } + + public String getEnableCommnad() { + return enable_command; + } + + public String getDisableCommnad() { + return disable_command; + } + + public void check() { + if (!isCheck) { + checkVirtualization(); + isCheck = true; + } + } + + private void checkVirtualization() { + //CheckDialog dialog = new CheckDialog(); + //dialog.create(); + Work work = new Work(); + work.setDaemon(true); + work.start(); + + //dialog.open(); + + try { + work.join(); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + EMLogger.getLogger().log(Level.INFO, "Exception" + e.getMessage() + "\n"); + } + /* + while(work.isAlive()) { + if(!Display.getCurrent().readAndDispatch()) + Display.getCurrent().sleep(); + } + */ + + //dialog.close(); + } + + private class Work extends Thread { + public void run() { + if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1) { + int exitValue = 0; + + List cmd = new ArrayList(); + cmd.add(FileIO.getInstance().getBinPath() + File.separator + "check-hax.exe"); + ProcessBuilder pb = new ProcessBuilder(cmd); + pb.directory(new File(FileIO.getInstance().getBinPath())); + + try { + Process process = null; + process = pb.start(); + process.waitFor(); + exitValue = process.exitValue(); + EMLogger.getLogger().log(Level.INFO, "Check-hax.exe's exit value : " + exitValue + "\n"); + } catch (IOException e) { + EMLogger.getLogger().log(Level.INFO, "IOException" + e.getMessage() + "\n"); + } catch (InterruptedException e) { + EMLogger.getLogger().log(Level.INFO, "InterruptedException" + e.getMessage() + "\n"); + } catch (Exception e) { + EMLogger.getLogger().log(Level.INFO, "Exception" + e.getMessage() + "\n"); + } + + if(exitValue == 0) { + isSupport = true; + } else { + isSupport = false; + } + enable_command = "-enable-hax"; + } else if (System.getProperty("os.name").toLowerCase().indexOf("linux") > -1) { + if(new File("/dev/kvm").canRead()) { + isSupport = true; + } else { + isSupport = false; + } + enable_command = "-enable-kvm"; + } + } + } +} + +class CheckDialog { + private Shell dialog; + + public void create() { + dialog = new Shell(Display.getCurrent(), SWT.APPLICATION_MODAL); + dialog.setText("Info"); + dialog.setSize(300, 100); + dialog.setLayout(new GridLayout(1, false)); + + Label label = new Label(dialog, SWT.NONE); + label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, true)); + label.setText("Please wait !!\nCheck whether virtualization is supported."); + } + + public void open() { + dialog.open(); + } + + public void close() { + dialog.close(); + } +} diff --git a/src/org/tizen/emulator/manager/tool/FileIO.java b/src/org/tizen/emulator/manager/tool/FileIO.java index ff7eadb..0ea7e19 100644 --- a/src/org/tizen/emulator/manager/tool/FileIO.java +++ b/src/org/tizen/emulator/manager/tool/FileIO.java @@ -107,6 +107,12 @@ public class FileIO { x86KernelPath = dataPath + x86_kernel_suffix; biosPath = dataPath + bios_suffix; + + vmsPath = EmulatorVMs.getInstance().getVMsBaseDirectory(); + vmsArchPath = vmsPath + arch_suffix; + } + + public static void setVMSPath() { vmsPath = EmulatorVMs.getInstance().getVMsBaseDirectory(); vmsArchPath = vmsPath + arch_suffix; //testPrintPath(); @@ -138,6 +144,9 @@ public class FileIO { } } + private FileIO() { + } + public static FileIO getInstance() { return instance; } diff --git a/src/org/tizen/emulator/manager/tool/SelectWorkspace.java b/src/org/tizen/emulator/manager/tool/SelectWorkspace.java new file mode 100644 index 0000000..99cc3f2 --- /dev/null +++ b/src/org/tizen/emulator/manager/tool/SelectWorkspace.java @@ -0,0 +1,155 @@ +/* + * Emulator Manager + * + * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * MunKyu Im + * SeokYeon Hwang + * JiHye Kim + * YeongKyoon Lee + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.emulator.manager.tool; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.util.Properties; + +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.tizen.emulator.manager.EmulatorManager; +import org.tizen.emulator.manager.ui.MessageDialog; +import org.tizen.emulator.manager.ui.SelectWorkspaceDialog; +import org.tizen.emulator.manager.vms.EmulatorVMs; + +public class SelectWorkspace { + private static Properties prop = null; + + private static String oldShow = null; + private static String oldPath = null; + + public static boolean setWorkspace(String workspacePath, boolean isSave) { + boolean isModify = false; + String workspaceConfPath = null; + if (isSave) { + workspaceConfPath = System.getProperty("user.home") + File.separator + StringResource.WORKSPACE_NAME; + prop = new Properties(); + try { + prop.load(new FileInputStream(workspaceConfPath)); + } catch (FileNotFoundException e) { + // make conf file.. + File f = new File(workspaceConfPath); + try { + f.createNewFile(); + BufferedWriter out = new BufferedWriter(new FileWriter(f)); + out.write(StringResource.SHOW_SELECTION_DIAGLOG + "=false\n"); + out.write(StringResource.RECENT_VMS_PATH + "=\n"); + out.close(); + prop.load(new FileInputStream(f)); + } catch (IOException e1) { + prop = null; + } + } catch (IOException e) { + prop = null; + } + + String show = "false"; + if (prop != null) { + oldShow = prop.getProperty(StringResource.SHOW_SELECTION_DIAGLOG); + oldPath = prop.getProperty(StringResource.RECENT_VMS_PATH); + + show = oldShow; + if (workspacePath == null) { + /* There is no workspace option. */ + if (show != null) { + if (show.equals("true")) { + SelectWorkspaceDialog dialog = new SelectWorkspaceDialog(prop); + dialog.create(); + Shell shell = dialog.open(); + while(!shell.isDisposed()) { + if(!Display.getCurrent().readAndDispatch()) + Display.getCurrent().sleep(); + } + + if (dialog.isCanceled()) { + return false; + } + workspacePath = dialog.getSelectedPath(); + show = dialog.isShowDialog() ? "true" : "false"; + } else if (show.equals("false")) { + workspacePath = prop.getProperty(StringResource.RECENT_VMS_PATH); + } + } + } + } + + if (workspacePath != null && !workspacePath.isEmpty()) { + if (prop != null) { + if (show != oldShow) { + prop.setProperty(StringResource.SHOW_SELECTION_DIAGLOG, show); + isModify = true; + } + + if (!workspacePath.equals(oldPath)) { + prop.setProperty(StringResource.RECENT_VMS_PATH, workspacePath); + isModify = true; + } + } + } else { + workspacePath = null; + } + } + + if (workspacePath != null && !workspacePath.isEmpty()) { + File fi = new File(workspacePath + File.separator + "x86"); + if(!fi.exists()) { + boolean result = fi.mkdirs(); + if(!result) { + MessageDialog msg = new MessageDialog(new Shell(Display.getCurrent())); + msg.openWarningDialog("Can not organize workspace. Aborting...\n" + + "User do not have authority to use [" + workspacePath + "]"); + EmulatorManager.exitEmulatorManager(-1); + } + } + + if (isSave && isModify && prop != null) { + try { + prop.store(new FileOutputStream(workspaceConfPath),null); + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + EmulatorVMs.getInstance().setVMsBaseDirectory(workspacePath); + FileIO.setVMSPath(); + } + return true; + } +} diff --git a/src/org/tizen/emulator/manager/tool/StringResource.java b/src/org/tizen/emulator/manager/tool/StringResource.java index d4fe7ae..991fc75 100644 --- a/src/org/tizen/emulator/manager/tool/StringResource.java +++ b/src/org/tizen/emulator/manager/tool/StringResource.java @@ -31,27 +31,50 @@ package org.tizen.emulator.manager.tool; public class StringResource { - + // VMsProperty View public final static String SUPPORTED = "Supported"; public final static String NOT_SUPPORTED = "Not supported"; - // key type public final static String ONE_KEY = "1key"; public final static String THREE_KEYS = "3keys"; - public final static String ONE_KEY_TYPE = "1Key Type"; public final static String THREE_KEYS_TYPE = "3Keys Type"; + // Main Dialog + public static final String MAIN_TITLE = "Emulator Manager"; + public static final String MAIN_TITLE_INHOUSE = "Emulator Manager (Inhouse)"; public static final String REFRESH = "Refresh"; public static final String LAUNCH = "Launch"; public static final String MODIFY = "Modify"; public static final String CREATE = "Create"; public static final String CANCEL = "Cancel"; public static final String CONFIRM = "Confirm"; - + public static final String OK = "OK"; public static final String DETAIL = "Detail"; public static final String DELETE = "Delete"; public static final String RESET = "Reset"; public static final String CLONE = "Clone"; public static final String CREATE_IMAGE = "Create Base Image"; + + // Select Workspace and Dialog + public static final String WORKSPACE_NAME = ".tizen_vms_path"; + public static final String VMS_PATH = "[VMS_PATH]"; + public static final String SHOW_SELECTION_DIAGLOG = "SHOW_PATH_SELECTION_DIALOG"; + public static final String RECENT_VMS_PATH="RECENT_VMS_PATH"; + public static final String SWD_TITLE = "Select VMS path"; + public static final String SWD_BROWSE = "Browse..."; + public static final String SWD_ASK_AGAIN = "Use this as the default and do not ask again"; + public static final String SELECT_DIRECTORY = "Select a Direcory"; + + //ArchitectureGroup + public static final String GROUP_TITLE = "Emulator Architecture"; + public static final String X86 = "X86"; + public static final String x86 = "x86"; + public static final String ARM = "ARM"; + + //About Dialog + public static final String ABOUT_PROP_FILENAME = "about.properties"; + public static final String PROP_KEY_VERSION = "version"; + public static final String PROP_KEY_BUILD_TIME = "build_time"; + public static final String PROP_KEY_GIT_VERSION = "build_git_commit"; } diff --git a/src/org/tizen/emulator/manager/ui/ArchitectureGroup.java b/src/org/tizen/emulator/manager/ui/ArchitectureGroup.java index 60bb4f3..e732624 100644 --- a/src/org/tizen/emulator/manager/ui/ArchitectureGroup.java +++ b/src/org/tizen/emulator/manager/ui/ArchitectureGroup.java @@ -37,6 +37,7 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; +import org.tizen.emulator.manager.tool.StringResource; import org.tizen.emulator.manager.vms.VMsProperty.Architecture; public class ArchitectureGroup { @@ -51,17 +52,17 @@ public class ArchitectureGroup { group = new Group(archComposite, SWT.NONE); - group.setText("Emulator Architecture"); + group.setText(StringResource.GROUP_TITLE); group.setLayout(new GridLayout(2, false)); x86RadioButton = new Button(group, SWT.RADIO); x86RadioButton.setData(Architecture.x86); - x86RadioButton.setText("X86"); + x86RadioButton.setText(StringResource.X86); x86RadioButton.setSelection(true); armRadioButton = new Button(group, SWT.RADIO); armRadioButton.setData(Architecture.ARM); - armRadioButton.setText("ARM"); + armRadioButton.setText(StringResource.ARM); armRadioButton.setSelection(false); // TODO : not support ARM armRadioButton.setEnabled(false); @@ -82,7 +83,6 @@ public class ArchitectureGroup { armRadioButton.addSelectionListener(archSelectionListener); } - public void setLayoutData(Object data) { group.setLayoutData(data); } diff --git a/src/org/tizen/emulator/manager/ui/CloneDialog.java b/src/org/tizen/emulator/manager/ui/CloneDialog.java index 036fa2d..fed9775 100644 --- a/src/org/tizen/emulator/manager/ui/CloneDialog.java +++ b/src/org/tizen/emulator/manager/ui/CloneDialog.java @@ -40,12 +40,12 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; +import org.tizen.emulator.manager.tool.StringResource; +import org.tizen.emulator.manager.ui.MessageDialog; import org.tizen.emulator.manager.ui.ResourceRegistry.ImageName; import org.tizen.emulator.manager.ui.detail.VMPropertyView; -import org.tizen.emulator.manager.ui.vmstree.VMsTree; import org.tizen.emulator.manager.vms.VMCreateHelper; import org.tizen.emulator.manager.vms.VMsProperty; import org.tizen.emulator.manager.vms.VMsWorkerException; @@ -63,9 +63,9 @@ public class CloneDialog { private String vmName = null; - public CloneDialog(MainDialog mainDialog, VMsTree vmsTree) { + public CloneDialog(MainDialog mainDialog, VMsProperty prop) { this.mainDialog = mainDialog; - property = vmsTree.getSelectionItem(); + property = prop; helper = new VMCreateHelper(); } @@ -73,11 +73,11 @@ public class CloneDialog { public void open() { dialog = new Shell(mainDialog.getShell(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); dialog.setText("Emulator Cloning"); - dialog.setSize(300, 180); + dialog.setSize(350, 180); dialog.setLayout(new GridLayout(1, true)); Label info = new Label(dialog, SWT.WRAP); - info.setText("Create new Emulator\nby copying the selected Emulator."); + info.setText("Clone new VM which has the same configurations\nas you selected."); Label sep = new Label(dialog, SWT.SEPARATOR | SWT.HORIZONTAL); sep.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true)); @@ -87,7 +87,7 @@ public class CloneDialog { name.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true)); infoLabel = new Label(dialog, SWT.WRAP); - infoLabel.setText(""); + infoLabel.setText("Input new VM-name."); infoLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true)); Composite buttonComposite = new Composite(dialog, SWT.NONE); @@ -95,12 +95,12 @@ public class CloneDialog { buttonComposite.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, false)); confirmButton = new Button(buttonComposite, SWT.PUSH); - confirmButton.setText("Confirm"); + confirmButton.setText(StringResource.CONFIRM); confirmButton.setImage(ResourceRegistry.getImage(ImageName.CONFIRM)); confirmButton.setEnabled(false); cancelButton = new Button(buttonComposite, SWT.PUSH); - cancelButton.setText("Cancel"); + cancelButton.setText(StringResource.CANCEL); cancelButton.setImage(ResourceRegistry.getImage(ImageName.CANCEL)); addListener(); @@ -123,17 +123,16 @@ public class CloneDialog { } @Override public void widgetSelected(SelectionEvent event) { - MessageBox msg = new MessageBox(mainDialog.getShell(), SWT.ICON_INFORMATION); - msg.setText("INFO"); - + MessageDialog msg = new MessageDialog(); + String message = ""; try { property.getWorker().cloneVM(vmName); - msg.setMessage("Emulator cloning completed!"); + message = "Emulator cloning completed!"; } catch (VMsWorkerException e) { - msg.setMessage(e.getMessage()); + message = e.getMessage(); } - - msg.open(); + + msg.openInfoDialog(message); dialog.close(); mainDialog.refreshProperties(); @@ -156,7 +155,7 @@ public class CloneDialog { } private void checkImageName() { - if (vmName.length() == VMPropertyView.MAX_NAME_LEN) { + if (vmName.length() > VMPropertyView.MAX_NAME_LEN) { infoLabel.setText("Max length of name is 20."); confirmButton.setEnabled(false); return; @@ -174,7 +173,11 @@ public class CloneDialog { return; } - infoLabel.setText(""); + if (vmName.length() == VMPropertyView.MAX_NAME_LEN) { + infoLabel.setText("Max length of name is 20."); + } else { + infoLabel.setText("Input new VM-name."); + } if (vmName.isEmpty()) { confirmButton.setEnabled(false); } else { diff --git a/src/org/tizen/emulator/manager/ui/MainDialog.java b/src/org/tizen/emulator/manager/ui/MainDialog.java index 78657bf..e1a44e2 100644 --- a/src/org/tizen/emulator/manager/ui/MainDialog.java +++ b/src/org/tizen/emulator/manager/ui/MainDialog.java @@ -30,7 +30,10 @@ package org.tizen.emulator.manager.ui; +import java.io.IOException; import java.io.InputStream; +import java.util.Properties; +import java.util.logging.Level; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; @@ -43,19 +46,17 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.ToolBar; +import org.eclipse.swt.widgets.ToolItem; import org.tizen.emulator.manager.EmulatorManager.ManagerModeType; -import org.tizen.emulator.manager.tool.FileIO; +import org.tizen.emulator.manager.logging.EMLogger; import org.tizen.emulator.manager.tool.StringResource; import org.tizen.emulator.manager.ui.ResourceRegistry.ImageName; import org.tizen.emulator.manager.ui.detail.DetailTableView; import org.tizen.emulator.manager.ui.vmstree.VMsTree; import org.tizen.emulator.manager.vms.EmulatorVMs; import org.tizen.emulator.manager.vms.VMsProperty; -import org.tizen.emulator.manager.vms.VMsWorker; import org.tizen.emulator.manager.vms.VMsWorkerException; public class MainDialog { @@ -64,11 +65,21 @@ public class MainDialog { SashForm sashForm; ArchitectureGroup archGroup; + // ToolItems... + ToolItem aboutItem; + ToolItem refreshItem; + ToolItem resetItem; + ToolItem deleteItem; + ToolItem cloneItem; + ToolItem createImageItem; +// ToolItem modifyItem; + + + ToolItem x86ToggleItem; + ToolItem armToggleItem; + // LEFT VIEW VMsTree vmsTree; - Button refreshButton; - Button deleteButton; - Button resetButton; // RIGHT VIEW DetailTableView detailView; @@ -78,18 +89,17 @@ public class MainDialog { Button rightButton; MenuHandling handling; - + Shell shell; Image icon; public MainDialog(ManagerModeType mode) { shell = new Shell(Display.getCurrent()); - shell.setSize(700, 500); if (mode.equals(ManagerModeType.INHOUSE_MODE)) { - shell.setText("Emulator Manager (Inhouse)"); + shell.setText(StringResource.MAIN_TITLE_INHOUSE); } else { - shell.setText("Emulator Manager"); + shell.setText(StringResource.MAIN_TITLE); } shell.setLayout(new FillLayout()); @@ -105,13 +115,40 @@ public class MainDialog { mainComposite.setLayout(getNopaddedGridLayout(1, false)); { + // Architecture selection group and main SashForm... + Composite archComposite = new Composite(mainComposite, SWT.NONE); - archComposite.setLayout(getNopaddedGridLayout(1, false)); + GridLayout upperLayout = new GridLayout(2, false); + upperLayout.marginWidth = 0; + archComposite.setLayout(upperLayout); archComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + + // Top ToolBar + ToolBar leftToolBar = new ToolBar(archComposite, SWT.NONE | SWT.RIGHT); + leftToolBar.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false)); + aboutItem = new ToolItem(leftToolBar, SWT.PUSH); + ToolItem separator = new ToolItem(leftToolBar, SWT.SEPARATOR); + separator.setWidth(10); + refreshItem = new ToolItem(leftToolBar, SWT.PUSH); + separator = new ToolItem(leftToolBar, SWT.SEPARATOR); + separator.setWidth(10); +// modifyItem = new ToolItem(leftToolBar, SWT.PUSH); + resetItem = new ToolItem(leftToolBar, SWT.PUSH); + deleteItem = new ToolItem(leftToolBar, SWT.PUSH); + + cloneItem = new ToolItem(leftToolBar, SWT.PUSH); + createImageItem = new ToolItem(leftToolBar, SWT.PUSH); + + decorateLeftSideToolItems(); + + ToolBar toolBar = new ToolBar(archComposite, SWT.RIGHT); + toolBar.setLayoutData(new GridData(SWT.END, SWT.CENTER, true, false)); + x86ToggleItem = new ToolItem(toolBar, SWT.CHECK); + armToggleItem = new ToolItem(toolBar, SWT.CHECK); - archGroup = new ArchitectureGroup(this, archComposite); - archGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + decorateRightSideToolItems(); + // Main SashForm sashForm = new SashForm(mainComposite, SWT.HORIZONTAL); sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); sashForm.setLayout(new FillLayout()); @@ -123,25 +160,6 @@ public class MainDialog { vmsTree = new VMsTree(this, leftView); vmsTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - - Composite buttonComposite = new Composite(leftView, SWT.NONE); - buttonComposite.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, true, false)); - buttonComposite.setLayout(new FillLayout()); - - { - Label temp = new Label(buttonComposite, SWT.NONE); - temp.setText("TODO FIX ME"); - temp.setVisible(false); - temp = new Label(buttonComposite, SWT.NONE); - temp.setText("TODO FIX ME"); - temp.setVisible(false); - - refreshButton = new Button(buttonComposite, SWT.PUSH); - deleteButton = new Button(buttonComposite, SWT.PUSH); - resetButton = new Button(buttonComposite, SWT.PUSH); - - decorateLeftBottomButtons(); - } } // Right : detail table @@ -152,6 +170,8 @@ public class MainDialog { detailView = new DetailTableView(this); detailView.createDetailView(shell, rightView); + detailView.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true)); + Composite bottomComposite = new Composite(rightView, SWT.NONE); GridLayout bottomLayout = getNopaddedGridLayout(2, false); @@ -196,14 +216,13 @@ public class MainDialog { try { detailView.getCurrentPoperty().getWorker().launchVM(); } catch (VMsWorkerException e) { - MessageBox alert = new MessageBox(getShell(), SWT.OK); - alert.setMessage(e.getMessage()); - alert.open(); + new MessageDialog().openInfoDialog(e.getMessage()); } } else if (type.equals(StringResource.CONFIRM)) { VMsProperty pro = detailView.confirm(); if (pro != null) { // success refreshProperties(); + vmsTree.setSelectProperty(pro); openDetailView(pro); } } @@ -219,9 +238,6 @@ public class MainDialog { } handling = new MenuHandling(shell, vmsTree); - - deleteButton.setEnabled(false); - resetButton.setEnabled(false); } public void open() { @@ -232,29 +248,32 @@ public class MainDialog { } } - + public Shell getShell() { return shell; } - - public void resetVirtualMachine() { - handling.resetVirtualMachine(); + public void resetVM() { + handling.resetVirtualMachine(detailView.getCurrentPoperty()); } - public void cloneVirtualMachine() { - CloneDialog cloneDialog = new CloneDialog(this, vmsTree); + public void cloneVM() { + CloneDialog cloneDialog = new CloneDialog(this, detailView.getCurrentPoperty()); cloneDialog.open(); } // TOOD : error checking - public void deleteVirtualMachine() { - if (handling.deleteVirtualMachine()) { - closeDetailView(); + public void deleteVM() { + if (handling.deleteVirtualMachine(detailView.getCurrentPoperty())) { refreshProperties(); + closeDetailView(); } } + public void createBaseImage() { + handling.createBaseImage(detailView.getCurrentPoperty()); + } + public void refreshVMsTable() { vmsTree.refreshContents(); } @@ -274,13 +293,11 @@ public class MainDialog { public void openDetailView(VMsProperty property) { if (vmsTree.getSelectionContentCount() == 1) { - deleteButton.setEnabled(true); - resetButton.setEnabled(true); + setToolBarState(State.TRUE); } else { - deleteButton.setEnabled(false); - resetButton.setEnabled(false); + setToolBarState(State.FALSE); } - + leftButton.setText(StringResource.MODIFY); leftButton.setImage(ResourceRegistry.getImage(ImageName.MODIFY)); rightButton.setText(StringResource.LAUNCH); @@ -293,18 +310,15 @@ public class MainDialog { public void closeDetailView() { if (vmsTree.getSelectionContentCount() > 1) { - deleteButton.setEnabled(true); - resetButton.setEnabled(true); + setToolBarState(State.CLOSE_DETAIL); } else { - deleteButton.setEnabled(false); - resetButton.setEnabled(false); + setToolBarState(State.FALSE); } detailView.closeDetailView(); } public void openModifyView(VMsProperty property) { - deleteButton.setEnabled(false); - resetButton.setEnabled(false); + setToolBarState(State.FALSE); leftButton.setText(StringResource.CANCEL); leftButton.setImage(ResourceRegistry.getImage(ImageName.CANCEL)); @@ -317,8 +331,7 @@ public class MainDialog { } public void openCreateDetailView(boolean isDefault) { - deleteButton.setEnabled(false); - resetButton.setEnabled(false); + setToolBarState(State.FALSE); leftButton.setText(StringResource.CREATE); leftButton.setImage(ResourceRegistry.getImage(ImageName.CREATE)); @@ -333,8 +346,7 @@ public class MainDialog { } public void openCreateDetailView() { - deleteButton.setEnabled(false); - resetButton.setEnabled(false); + setToolBarState(State.FALSE); leftButton.setText(StringResource.CREATE); leftButton.setImage(ResourceRegistry.getImage(ImageName.CREATE)); @@ -345,8 +357,7 @@ public class MainDialog { } public void openCreateView() { - deleteButton.setEnabled(false); - resetButton.setEnabled(false); + setToolBarState(State.FALSE); leftButton.setText(StringResource.CANCEL); leftButton.setImage(ResourceRegistry.getImage(ImageName.CANCEL)); @@ -362,7 +373,31 @@ public class MainDialog { if(icon != null) icon.dispose(); } - +enum State { + FALSE, TRUE, CLOSE_DETAIL; +} + private void setToolBarState(State state) { + switch(state) { + case FALSE: + deleteItem.setEnabled(false); + resetItem.setEnabled(false); + cloneItem.setEnabled(false); + createImageItem.setEnabled(false); + break; + case TRUE: + deleteItem.setEnabled(true); + resetItem.setEnabled(true); + cloneItem.setEnabled(true); + createImageItem.setEnabled(true); + break; + case CLOSE_DETAIL: + deleteItem.setEnabled(true); + resetItem.setEnabled(true); + cloneItem.setEnabled(false); + createImageItem.setEnabled(false); + break; + } + } private GridLayout getNopaddedGridLayout(int numColumns, boolean makeColumnEqualWidth) { GridLayout layout = new GridLayout(numColumns, makeColumnEqualWidth); layout.horizontalSpacing = 0; @@ -377,15 +412,61 @@ public class MainDialog { return layout; } - public boolean isX86Selected() { - return archGroup.x86RadioButton.getSelection(); + private String getAboutDialogContents() { + String version = ""; + String time = ""; + String gitVersion = ""; + String contens = ""; + String workspace = EmulatorVMs.getInstance().getVMsBaseDirectory(); + InputStream in = this.getClass().getClassLoader().getResourceAsStream(StringResource.ABOUT_PROP_FILENAME ); + Properties properties = new Properties(); + + if(in != null) { + try { + properties.load(in); + } catch (IOException e1) { + EMLogger.getLogger().log(Level.SEVERE, e1.getMessage() + "\n"); + } + + version = properties.getProperty(StringResource.PROP_KEY_VERSION); + time = properties.getProperty(StringResource.PROP_KEY_BUILD_TIME); + gitVersion = properties.getProperty(StringResource.PROP_KEY_GIT_VERSION); + } + + if(version.isEmpty() || version.contains(StringResource.PROP_KEY_VERSION)) { + version = "Not identified"; + } + if(time.isEmpty() || time.contains(StringResource.PROP_KEY_BUILD_TIME)) { + time = "Not identified"; + } + if(gitVersion.isEmpty() || gitVersion.contains(StringResource.PROP_KEY_GIT_VERSION)) { + gitVersion = "Not identified"; + } + if(workspace.isEmpty()) { + workspace = "Not identified"; + } + + contens = "Version : TIZEN " + version + "\nBuild time : " + time + " (GMT)" + + "\nGit version : "+ gitVersion + "\nWorkspace path : " + workspace; + + return contens; } - private void decorateLeftBottomButtons() { - refreshButton.setText(StringResource.REFRESH); - refreshButton.setToolTipText("refresh list of virtual machine"); - refreshButton.setImage(ResourceRegistry.getImage(ImageName.REFRESH)); - refreshButton.addSelectionListener(new SelectionListener() { + private void decorateLeftSideToolItems() { + aboutItem.setImage(ResourceRegistry.getImage(ImageName.ABOUT)); + aboutItem.setToolTipText("About Emulator Manager"); + aboutItem.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + new MessageDialog().openInfoDialog("About Emulator Manager",getAboutDialogContents()); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) {} + }); + + refreshItem.setImage(ResourceRegistry.getImage(ImageName.REFRESH)); + refreshItem.setToolTipText("refresh list of VM"); + refreshItem.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { refreshProperties(); @@ -394,73 +475,96 @@ public class MainDialog { public void widgetDefaultSelected(SelectionEvent e) {} }); - deleteButton.setText(StringResource.DELETE); - deleteButton.setToolTipText("delete selected virtual machine"); - deleteButton.setImage(ResourceRegistry.getImage(ImageName.DELETE)); - deleteButton.addSelectionListener(new SelectionListener() { + cloneItem.setText(StringResource.CLONE); + cloneItem.setImage(ResourceRegistry.getImage(ImageName.CLONE)); + cloneItem.setToolTipText("Clone from selected VM"); + cloneItem.setEnabled(false); + cloneItem.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { - deleteVirtualMachine(); + cloneVM(); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) {} + }); + +// modifyItem.setText("Modify"); +// modifyItem.setImage(ResourceRegistry.getImage(ImageName.MODIFY)); +// modifyItem.setToolTipText("Modify selected VM"); +// modifyItem.addSelectionListener(new SelectionListener() { +// @Override +// public void widgetSelected(SelectionEvent e) { +// modifyVM(vmsTree.getSelectionItem()); +// } +// @Override +// public void widgetDefaultSelected(SelectionEvent e) { +// } +// }); + + resetItem.setText(StringResource.RESET); + resetItem.setImage(ResourceRegistry.getImage(ImageName.RESET)); + resetItem.setToolTipText("Format OS of selected VM"); + resetItem.setEnabled(false); + resetItem.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + resetVM(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); - resetButton.setText(StringResource.RESET); - resetButton.setToolTipText("format os of virtual machine"); - resetButton.setImage(ResourceRegistry.getImage(ImageName.RESET)); - resetButton.addSelectionListener(new SelectionListener() { + deleteItem.setText(StringResource.DELETE); + deleteItem.setImage(ResourceRegistry.getImage(ImageName.DELETE)); + deleteItem.setToolTipText("Delete selected VM"); + deleteItem.setEnabled(false); + deleteItem.addSelectionListener(new SelectionListener() { @Override - public void widgetDefaultSelected(SelectionEvent arg0) { + public void widgetSelected(SelectionEvent e) { + deleteVM(); } - @Override - public void widgetSelected(SelectionEvent arg0) { - resetVirtualMachine(); + public void widgetDefaultSelected(SelectionEvent e) { } - }); + + createImageItem.setText(StringResource.CREATE_IMAGE); + createImageItem.setImage(ResourceRegistry.getImage(ImageName.CREATEIMAGE)); + createImageItem.setToolTipText("Create new base image from selected VM"); + createImageItem.setEnabled(false); + createImageItem.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + createBaseImage(); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + } - - public void createBaseImage() { - MessageBox msg = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK | SWT.CANCEL); - msg.setText("Warning"); - msg.setMessage("This process may take about 30 to 60 seconds.\nAre you sure you want to continue?"); - - int response = msg.open(); - if (response != SWT.OK) { - return; - } - - VMsProperty property = vmsTree.getSelectionItem(); - FileDialog fd = new FileDialog(shell, SWT.SAVE); - fd.setText("Create 'Base Image' As"); - String[] filter = {"*."+ property.getArch().toString()}; - String[] filterName = {"Image Files(*." + property.getArch().toString() + ")"}; - fd.setFilterExtensions(filter); - fd.setFilterNames(filterName); - fd.setFileName("emulimg-" + property.getName()); - fd.setFilterPath(FileIO.getInstance().getTizenVmsPath()); - - msg = new MessageBox(shell, SWT.ICON_INFORMATION); - msg.setText("Info"); - - String path = null; - path = fd.open(); - if (path == null) { - msg.setMessage("Task has canceled"); - msg.open(); - return; - } - - VMsWorker worker = new VMsWorker(property); - try { - worker.createNewBaseImage(property, path); - msg.setMessage("Succeeded to create 'Base Image'!\nPath: " + path); - } catch (VMsWorkerException e) { - msg.setMessage(e.getMessage()); - } - msg.open(); + + private void decorateRightSideToolItems() { + x86ToggleItem.setText(StringResource.x86); + x86ToggleItem.setImage(ResourceRegistry.getImage(ImageName.X86)); + x86ToggleItem.setToolTipText("x86 Architecture"); + x86ToggleItem.setSelection(true); + x86ToggleItem.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + x86ToggleItem.setSelection(true); + refreshProperties(); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) {} + + }); + + armToggleItem.setText(StringResource.ARM); + armToggleItem.setImage(ResourceRegistry.getImage(ImageName.ARM)); + armToggleItem.setToolTipText("ARM Architecture"); + armToggleItem.setSelection(false); + armToggleItem.setEnabled(false); } } diff --git a/src/org/tizen/emulator/manager/ui/MenuHandling.java b/src/org/tizen/emulator/manager/ui/MenuHandling.java index 137d866..2dd3158 100644 --- a/src/org/tizen/emulator/manager/ui/MenuHandling.java +++ b/src/org/tizen/emulator/manager/ui/MenuHandling.java @@ -31,8 +31,9 @@ package org.tizen.emulator.manager.ui; import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.MessageBox; +import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Shell; +import org.tizen.emulator.manager.tool.FileIO; import org.tizen.emulator.manager.ui.vmstree.VMsTree; import org.tizen.emulator.manager.vms.VMsProperty; import org.tizen.emulator.manager.vms.VMsWorkerException; @@ -46,26 +47,21 @@ public class MenuHandling { this.vmsTree = vmsTree; } - public void resetVirtualMachine() { - MessageBox msg = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK | SWT.CANCEL); - msg.setText("Warning"); - msg.setMessage("This VM will be formatting.\nAre you sure you want to continue?"); - - int response = msg.open(); - + public void resetVirtualMachine(VMsProperty prop) { + MessageDialog msg = new MessageDialog(); + int response = msg.openSelectionDialog("This VM will be formatted.\nAre you sure you want to continue?"); + if (response != SWT.OK) return; - - msg = new MessageBox(shell, SWT.ICON_INFORMATION); - msg.setText("INFO"); - + VMsProperty[] properties = vmsTree.getSelectionItems(); + if (properties.length == 0) { + properties = new VMsProperty[1]; + properties[0] = prop; + } for (VMsProperty property : properties) { if(property.getWorker().isRunningNow()) { - msg.setMessage("[" + property.getName() + "] is running now...\n" + - "Reset process is canceled !"); - msg.open(); - + msg.openInfoDialog("Canceled reset process!\n" + "[" + property.getName() + "] is running now..."); return; } } @@ -74,38 +70,29 @@ public class MenuHandling { try { property.getWorker().resetVM(); } catch (VMsWorkerException e) { - msg.setMessage(" Reset [" + property.getName() + "] failed...\n" + msg.openInfoDialog(" Reset [" + property.getName() + "] failed...\n" + e.getMessage()); - msg.open(); - - break; + return; } } - msg.setMessage("Reset process completed !"); - msg.open(); + msg.openInfoDialog("Completed reset process!"); } - public boolean deleteVirtualMachine() { - MessageBox msg = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK | SWT.CANCEL); - msg.setText("INFO"); - msg.setMessage("Are you sure you want to delete selected VM?"); - - - int response = msg.open(); + public boolean deleteVirtualMachine(VMsProperty prop) { + MessageDialog msg = new MessageDialog(); + int response = msg.openSelectionDialog("Are you sure you want to delete selected VM?"); if (response != SWT.OK) return false; - - msg = new MessageBox(shell, SWT.ICON_INFORMATION); - msg.setText("INFO"); VMsProperty[] properties = vmsTree.getSelectionItems(); + if (properties.length == 0) { + properties = new VMsProperty[1]; + properties[0] = prop; + } for (VMsProperty property : properties) { if(property.getWorker().isRunningNow()) { - msg.setMessage("[" + property.getName() + "] is running now...\n" + - "Delete process is canceled !"); - msg.open(); - + msg.openInfoDialog("Canceled delete process!\n" + "[" + property.getName() + "] is running now..."); return false; } } @@ -114,17 +101,47 @@ public class MenuHandling { try { property.getWorker().deleteVM(); } catch (VMsWorkerException e) { - msg.setMessage(" Delete [" + property.getName() + "] failed...\n" + msg.openInfoDialog(" Delete [" + property.getName() + "] failed...\n" + e.getMessage()); - msg.open(); - return false; } } - - msg.setMessage("Delete process completed !"); - msg.open(); - + + msg.openInfoDialog("Completed delete process!"); + return true; } + + public void createBaseImage(VMsProperty prop) { + MessageDialog msg = new MessageDialog(); + VMsProperty property = prop; + if(prop.getWorker().isRunningNow()) { + msg.openWarningDialog("Can not 'Create Base Image' while source VM is running."); + return ; + } + + FileDialog fd = new FileDialog(shell, SWT.SAVE); + fd.setText("Create 'Base Image' As"); + String[] filter = {"*."+ property.getArch().toString()}; + String[] filterName = {"Image Files(*." + property.getArch().toString() + ")"}; + fd.setFilterExtensions(filter); + fd.setFilterNames(filterName); + fd.setFileName("emulimg-" + property.getName()); + fd.setFilterPath(FileIO.getInstance().getTizenVmsPath()); + + String path = null; + path = fd.open(); + if (path == null) { + return; + } + + String returnMSG = ""; + try { + property.getWorker().createNewBaseImage(property, path); + returnMSG = "Succeeded to create 'Base Image'!\nPath: " + path; + } catch (VMsWorkerException e) { + returnMSG =e.getMessage(); + } + msg.openInfoDialog(returnMSG); + } } diff --git a/src/org/tizen/emulator/manager/ui/MessageDialog.java b/src/org/tizen/emulator/manager/ui/MessageDialog.java new file mode 100644 index 0000000..d81ec72 --- /dev/null +++ b/src/org/tizen/emulator/manager/ui/MessageDialog.java @@ -0,0 +1,85 @@ +/* + * Emulator Manager + * + * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * MunKyu Im + * SeokYeon Hwang + * JiHye Kim + * YeongKyoon Lee + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.emulator.manager.ui; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.MessageBox; +import org.eclipse.swt.widgets.Shell; +import org.tizen.emulator.manager.EmulatorManager; + +public class MessageDialog +{ + private Shell shell; + public MessageDialog() { + this.shell = EmulatorManager.getInstance().getMainDialog().getShell(); + } + + public MessageDialog(Shell shell) { + if (shell == null) { + this.shell = new Shell(); + } else { + this.shell = shell; + } + } + + public int openInfoDialog(final String message) { + return openInfoDialog("Info", message); + } + + public int openInfoDialog(final String title, final String message) { + return openMessageDialog(title, message, SWT.OK | SWT.MODELESS | SWT.ICON_INFORMATION); + } + + public int openWarningDialog(final String message) { + return openWarningDialog("Warning", message); + } + + public int openWarningDialog(final String title, final String message) { + return openMessageDialog(title, message, SWT.OK | SWT.MODELESS | SWT.ICON_WARNING); + } + + public int openSelectionDialog(final String message) { + return openSelectionDialog("Warning", message); + } + + public int openSelectionDialog(final String title, final String message) { + return openMessageDialog(title, message, SWT.OK | SWT.CANCEL | SWT.MODELESS | SWT.ICON_WARNING); + } + + int msgResponse = 0; + public int openMessageDialog(final String title, final String message, final int style) { + MessageBox dialog = new MessageBox(shell, style); + dialog.setText(title); + dialog.setMessage(message); + msgResponse = dialog.open(); + return msgResponse; + } +} diff --git a/src/org/tizen/emulator/manager/ui/ResourceRegistry.java b/src/org/tizen/emulator/manager/ui/ResourceRegistry.java index 6f2d091..7215efe 100644 --- a/src/org/tizen/emulator/manager/ui/ResourceRegistry.java +++ b/src/org/tizen/emulator/manager/ui/ResourceRegistry.java @@ -41,7 +41,8 @@ import org.eclipse.swt.widgets.Display; public class ResourceRegistry { public enum ImageName { CANCEL("cancel"), CONFIRM("confirm"), CREATE("create"), DELETE("delete"), DETAILS("details"), - FOLDER("folder"), MODIFY("modify"), REFRESH("refresh"), RESET("reset"), LAUNCH("launch"), CLONE("clone"); + FOLDER("folder"), MODIFY("modify"), REFRESH("refresh"), RESET("reset"), LAUNCH("launch"), CREATEIMAGE("createimage"), + ABOUT("about"), CLONE("clone"), ARM("arm"), X86("x86"); String name; diff --git a/src/org/tizen/emulator/manager/ui/SelectWorkspaceDialog.java b/src/org/tizen/emulator/manager/ui/SelectWorkspaceDialog.java new file mode 100644 index 0000000..0129255 --- /dev/null +++ b/src/org/tizen/emulator/manager/ui/SelectWorkspaceDialog.java @@ -0,0 +1,226 @@ +/* + * Emulator Manager + * + * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * MunKyu Im + * SeokYeon Hwang + * JiHye Kim + * YeongKyoon Lee + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.emulator.manager.ui; + +import java.util.Properties; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.DirectoryDialog; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.tizen.emulator.manager.tool.StringResource; +import org.tizen.emulator.manager.vms.EmulatorVMs; + +public class SelectWorkspaceDialog { + private Shell dialog; + private String selectedPath = null; + private boolean showDialog = true; + private Properties prop = null; + + private Button askButton; + private Button browseButton; + private Text pathText; + + private Button cancelButton; + private Button okButton; + + private boolean isCanceled = true; + + public SelectWorkspaceDialog(Properties prop) { + this.prop = prop; + } + + public void create() { + dialog = new Shell(Display.getCurrent(), SWT.CLOSE); + dialog.setText(StringResource.SWD_TITLE); + dialog.setSize(500, 180); + GridLayout layout = new GridLayout(1, false); + layout.horizontalSpacing = 0; + layout.verticalSpacing = 0; + layout.marginBottom = 0; + layout.marginHeight = 0; + layout.marginLeft = 0; + layout.marginRight = 0; + layout.marginTop = 0; + layout.marginWidth = 0; + dialog.setLayout(layout); + + Composite labelComposite = new Composite(dialog, SWT.NONE); + labelComposite.setLayout(new FillLayout()); + labelComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); + Label label = new Label(dialog, SWT.NONE); + label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, true)); + label.setText(" Emulator Manager stores your VM list in a folder.\n" + + " Choose a folder to use for this session"); + label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); + + Label sep = new Label(dialog, SWT.SEPARATOR | SWT.HORIZONTAL); + sep.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true)); + + Composite browseComposite = new Composite(dialog, SWT.NONE); + browseComposite.setLayout(new GridLayout(2, false)); + browseComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + + + pathText = new Text(browseComposite, SWT.BORDER); + if (prop == null || prop.getProperty(StringResource.RECENT_VMS_PATH).isEmpty()) { + selectedPath = EmulatorVMs.getInstance().getVMsBaseDirectory(); + } else { + selectedPath =prop.getProperty(StringResource.RECENT_VMS_PATH); + } + pathText.setText(selectedPath); + + pathText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + + browseButton = new Button(browseComposite, SWT.PUSH); + browseButton.setText(StringResource.SWD_BROWSE); + + Composite bottomComposite = new Composite(dialog, SWT.NONE); + bottomComposite.setLayout(new GridLayout(3, false)); + bottomComposite.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, false, true)); + + askButton = new Button(bottomComposite, SWT.CHECK); + askButton.setText(StringResource.SWD_ASK_AGAIN); + + new Label(bottomComposite, SWT.NONE); + new Label(bottomComposite, SWT.NONE); + + new Label(bottomComposite, SWT.NONE); + + cancelButton = new Button(bottomComposite, SWT.PUSH); + cancelButton.setText(StringResource.CANCEL); + cancelButton.setSize(100, SWT.NONE); + cancelButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + + okButton = new Button(bottomComposite, SWT.PUSH); + okButton.setText(StringResource.OK); + okButton.setSize(100, SWT.NONE); + okButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + + addListener(); + + } + + private void addListener() { + dialog.addListener(SWT.Close, new Listener() { + @Override + public void handleEvent(Event event) { + if (isCanceled) { + showDialog = true; + selectedPath = null; + setCanceled(true); + } + } + + }); + + browseButton.addSelectionListener(new SelectionListener(){ + @Override + public void widgetSelected(SelectionEvent e) { + DirectoryDialog dd = new DirectoryDialog(dialog, SWT.OPEN); + dd.setText(StringResource.SELECT_DIRECTORY); + selectedPath = dd.open(); + if (selectedPath != null) { + pathText.setText(selectedPath); + } + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + askButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + showDialog = !askButton.getSelection(); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + + }); + + cancelButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + isCanceled = true; + dialog.close(); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + okButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + isCanceled = false; + dialog.close(); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + + }); + } + + public Shell open() { + dialog.open(); + return dialog; + } + + public String getSelectedPath() { + return selectedPath; + } + + public boolean isShowDialog() { + return showDialog; + } + + public boolean isCanceled() { + return isCanceled; + } + + public void setCanceled(boolean isCanceled) { + this.isCanceled = isCanceled; + } +} \ No newline at end of file diff --git a/src/org/tizen/emulator/manager/ui/detail/DetailTableView.java b/src/org/tizen/emulator/manager/ui/detail/DetailTableView.java index 6075160..d34618b 100644 --- a/src/org/tizen/emulator/manager/ui/detail/DetailTableView.java +++ b/src/org/tizen/emulator/manager/ui/detail/DetailTableView.java @@ -31,7 +31,6 @@ package org.tizen.emulator.manager.ui.detail; import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; @@ -67,9 +66,8 @@ public class DetailTableView { public void createDetailView(Shell shell, Composite rightView) { detailTable = new Table(rightView, SWT.BORDER); - detailTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true)); detailTable.setHeaderVisible(true); - detailTable.setLinesVisible(true); + detailTable.setLinesVisible(false); detailTable.addListener(SWT.MeasureItem, new Listener() { @Override public void handleEvent(Event event) { @@ -213,4 +211,8 @@ public class DetailTableView { public VMsProperty confirm() { return vmView.confirm(); } + + public void setLayoutData(Object data) { + detailTable.setLayoutData(data); + } } diff --git a/src/org/tizen/emulator/manager/ui/detail/VMPropertyView.java b/src/org/tizen/emulator/manager/ui/detail/VMPropertyView.java index 7b64ca3..7a8b81e 100644 --- a/src/org/tizen/emulator/manager/ui/detail/VMPropertyView.java +++ b/src/org/tizen/emulator/manager/ui/detail/VMPropertyView.java @@ -46,14 +46,15 @@ import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.DirectoryDialog; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Spinner; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableItem; import org.eclipse.swt.widgets.Text; import org.tizen.emulator.manager.EmulatorManager; import org.tizen.emulator.manager.EmulatorManager.ManagerModeType; +import org.tizen.emulator.manager.tool.CheckVirtualization; import org.tizen.emulator.manager.tool.StringResource; +import org.tizen.emulator.manager.ui.MessageDialog; import org.tizen.emulator.manager.ui.ResourceRegistry; import org.tizen.emulator.manager.ui.ResourceRegistry.ImageName; import org.tizen.emulator.manager.vms.Creator; @@ -65,7 +66,7 @@ import org.tizen.emulator.manager.vms.VMsWorkerException; enum CItem{ ImageName("Name"), ImageNameInfo(""), BaseImage("BaseImage"), Resolution("Display Resolution"), Density("Display Density"), SkinType("Front Key Type"), - SDType("SDCard"), SDPath("SDCard Path"), RAMSize("RAM Size"), + RAMSize("RAM Size"), ShareType("File Sharing"), SharePath("File Sharing Path"), HWVirtual("HW Virtualization"), TouchType("Max Touch Point"); @@ -81,7 +82,7 @@ enum CItem{ enum DItem{ ImageName("Name"), BaseImage("BaseImage"), Resolution("Display Resolution"), Density("Display Density"), SkinType("Front Key Type"), - SDType("SDCard"), SDPath("SDCard Path"), RAMSize("RAM Size"), + RAMSize("RAM Size"), ShareType("File Sharing"), SharePath("File Sharing Path"), HWVirtual("HW Virtualization"), TouchType("Max Touch Point"), Dummy(""); @@ -189,17 +190,13 @@ public class VMPropertyView { widget.itemList.get(DItem.SkinType.ordinal()).setText(1, oldValue.keyType == 1 ? StringResource.ONE_KEY_TYPE : StringResource.THREE_KEYS_TYPE); - widget.itemList.get(DItem.SDType.ordinal()).setText(1, oldValue.isSDCardSupport - ? StringResource.SUPPORTED : StringResource.NOT_SUPPORTED); - widget.itemList.get(DItem.SDPath.ordinal()).setText(1, oldValue.SDCardPathName); - widget.itemList.get(DItem.RAMSize.ordinal()).setText(1, String.valueOf(oldValue.ramSize)); widget.itemList.get(DItem.ShareType.ordinal()).setText(1,oldValue.isFileShareSupport ? StringResource.SUPPORTED : StringResource.NOT_SUPPORTED); widget.itemList.get(DItem.SharePath.ordinal()).setText(1, oldValue.fileSharePathName); - widget.itemList.get(DItem.HWVirtual.ordinal()).setText(1, oldValue.isHWVirtualization && helper.isSupportVirtualization() + widget.itemList.get(DItem.HWVirtual.ordinal()).setText(1, oldValue.isHWVirtualization && CheckVirtualization.getInstance().isSupportVirtualization() ? StringResource.SUPPORTED : StringResource.NOT_SUPPORTED); if (managerMode.equals(ManagerModeType.INHOUSE_MODE)) { @@ -222,15 +219,12 @@ public class VMPropertyView { // TODO : please !!! widget.itemList.get(CItem.SkinType.ordinal()).setText(1, StringResource.ONE_KEY_TYPE); - widget.itemList.get(CItem.SDType.ordinal()).setText(1, StringResource.NOT_SUPPORTED); - widget.itemList.get(CItem.SDPath.ordinal()).setText(1, oldValue.SDCardPathName); - widget.itemList.get(CItem.RAMSize.ordinal()).setText(1, String.valueOf(oldValue.ramSize)); widget.itemList.get(CItem.ShareType.ordinal()).setText(1, StringResource.NOT_SUPPORTED); widget.itemList.get(CItem.SharePath.ordinal()).setText(1, oldValue.fileSharePathName); - widget.itemList.get(CItem.HWVirtual.ordinal()).setText(1, oldValue.isHWVirtualization && helper.isSupportVirtualization() + widget.itemList.get(CItem.HWVirtual.ordinal()).setText(1, oldValue.isHWVirtualization && CheckVirtualization.getInstance().isSupportVirtualization() ? StringResource.SUPPORTED : StringResource.NOT_SUPPORTED); if (managerMode.equals(ManagerModeType.INHOUSE_MODE)) { @@ -245,7 +239,6 @@ public class VMPropertyView { createNameArea(table); createBaseImageArea(table); createDisplayArea(table); - createSDCardArea(table); createRAMSizeArea(table); createFileShareArea(table); createHWVirtualArea(table); @@ -261,7 +254,6 @@ public class VMPropertyView { createNameArea(table); createBaseImageArea(table); createDisplayArea(table); - createSDCardArea(table); createRAMSizeArea(table); createFileShareArea(table); createHWVirtualArea(table); @@ -293,11 +285,9 @@ public class VMPropertyView { editor = new TableEditor(table); editor.grabHorizontal = true; - editor.setEditor(widget.SDCardTypeCombo, widget.itemList.get(DItem.SDType.ordinal()), 1); editor = new TableEditor(table); editor.grabHorizontal = true; - editor.setEditor(widget.SDCardPathCombo, widget.itemList.get(DItem.SDPath.ordinal()), 1); editor = new TableEditor(table); editor.grabHorizontal = true; @@ -346,14 +336,6 @@ public class VMPropertyView { editor = new TableEditor(table); editor.grabHorizontal = true; editor.setEditor(widget.skinTypeCombo, widget.itemList.get(CItem.SkinType.ordinal()), 1); - - editor = new TableEditor(table); - editor.grabHorizontal = true; - editor.setEditor(widget.SDCardTypeCombo, widget.itemList.get(CItem.SDType.ordinal()), 1); - - editor = new TableEditor(table); - editor.grabHorizontal = true; - editor.setEditor(widget.SDCardPathCombo, widget.itemList.get(CItem.SDPath.ordinal()), 1); editor = new TableEditor(table); editor.grabHorizontal = true; @@ -405,7 +387,7 @@ public class VMPropertyView { } private void checkImageName() { - if (newValue.imageName.length() == MAX_NAME_LEN) { + if (newValue.imageName.length() > MAX_NAME_LEN) { widget.nameinfoLabel.setText("Max length is 20."); widget.confirmButton.setEnabled(false); return; @@ -424,7 +406,11 @@ public class VMPropertyView { return; } - widget.nameinfoLabel.setText(""); + if (newValue.imageName.length() == MAX_NAME_LEN) { + widget.nameinfoLabel.setText("Max length is 20."); + } else { + widget.nameinfoLabel.setText(""); + } if (newValue.imageName.isEmpty()) { widget.confirmButton.setEnabled(false); } else { @@ -492,6 +478,7 @@ public class VMPropertyView { DisplayResoultion.getInstance().findIndex(oldValue.resolution)); widget.DIPspinner = new Spinner(table, SWT.BORDER); widget.DIPspinner.setValues(oldValue.dpi, 100, 480, 0, 1, 1); + widget.DIPspinner.setTextLimit(3); if (!isCreateMode) { widget.DIPspinner.setEnabled(false); } @@ -540,7 +527,7 @@ public class VMPropertyView { */ } }); - + // TODO widget.skinTypeCombo.addSelectionListener(new SelectionListener() { @Override @@ -549,11 +536,9 @@ public class VMPropertyView { if (i == 0) {// 1key type newValue.keyType = 1; } else if (i == 1) { // 3key type - MessageBox msg = new MessageBox(table.getShell(), SWT.ICON_WARNING); - msg.setText("Warning"); - msg.setMessage("Check platform of emulator supports 3 keys(Call/Home/End)\n" - +"If platform has not support 3 keys, just change emulator skin."); - msg.open(); + MessageDialog msg = new MessageDialog(); + msg.openWarningDialog("Pleaes check wheter platform of Emulator supports 3 keys(Call/Home/End).\n" + +"If the platform does not support 3 keys, only emulator skin is changed."); newValue.keyType = 3; } if (!isCreateMode) { @@ -567,82 +552,6 @@ public class VMPropertyView { }); } - private void createSDCardArea(final Table table) { - widget.SDCardTypeCombo = helper.makeCombo(table); - helper.addComboItem(widget.SDCardTypeCombo, SupportType.getInstance().getList()); - widget.SDCardTypeCombo.select(oldValue.isSDCardSupport == true ? 0 : 1); - - widget.SDCardPathCombo = helper.makeCombo(table); - helper.addComboItem(widget.SDCardPathCombo, SDCard.getInstance().getList()); - widget.SDCardPathCombo.add(oldValue.SDCardPathName, 0); - widget.SDCardPathCombo.add("-----------------------------------------------", 1); - widget.SDCardPathCombo.add("--Select existing SDCard", SDCard.getInstance().size() + 2); - widget.SDCardPathCombo.select(0); - widget.SDCardPathCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - widget.SDCardPathCombo.setEnabled(oldValue.isSDCardSupport); - - createSDCardListener(); - } - - private void createSDCardListener() { - widget.SDCardTypeCombo.addSelectionListener(new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent e) { - int index = widget.SDCardTypeCombo.getSelectionIndex(); - if (index == 0) { // supported - newValue.isSDCardSupport = true; - widget.SDCardPathCombo.setEnabled(true); - } else if (index == 1) { // not supported - newValue.isSDCardSupport = false; - widget.SDCardPathCombo.setEnabled(false); - } - - if (!isCreateMode) { - checkModifyState(); - } - } - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - - widget.SDCardPathCombo.addSelectionListener(new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent e) { - int i = widget.SDCardPathCombo.getSelectionIndex(); - if (i == SDCard.getInstance().size() + 2) { // Select Exist SDCard - if (widget.SDImageFD == null) { - widget.SDImageFD = new FileDialog(table.getShell(), SWT.OPEN); - widget.SDImageFD.setText("Select an existing SD card"); - String[] filter = {"*.img"}; - String[] filterName = {"SD Card Image Files(*.img)"}; - widget.SDImageFD.setFilterExtensions(filter); - widget.SDImageFD.setFilterNames(filterName); - } - String path = widget.SDImageFD.open(); - if(path != null) { - newValue.SDCardPath = path; - newValue.SDCardPathName = path.substring(path.lastIndexOf(SEFARATOR) + 1, path.length()); - } - } else if (i != 0 && i != 1) { - newValue.SDCardPath = widget.SDCardPathCombo.getItem(i); - newValue.SDCardPathName = widget.SDCardPathCombo.getItem(i); - } - - widget.SDCardPathCombo.remove(0); - widget.SDCardPathCombo.add(newValue.SDCardPathName, 0); - widget.SDCardPathCombo.select(0); - - if (!isCreateMode) { - checkModifyState(); - } - } - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - } - private void createRAMSizeArea(Table table) { widget.ramSizeCombo = helper.makeCombo(table); helper.addComboItem(widget.ramSizeCombo, RamSize.getInstance().getList(), @@ -729,10 +638,10 @@ public class VMPropertyView { private void createHWVirtualArea(final Table table) { widget.HWVirtualCombo = helper.makeCombo(table); helper.addComboItem(widget.HWVirtualCombo, SupportType.getInstance().getList()); - widget.HWVirtualCombo.select(oldValue.isHWVirtualization && helper.isSupportVirtualization() + widget.HWVirtualCombo.select(oldValue.isHWVirtualization && CheckVirtualization.getInstance().isSupportVirtualization() ? 0 : 1); - if (!helper.isSupportVirtualization()) { + if (!CheckVirtualization.getInstance().isSupportVirtualization()) { widget.HWVirtualCombo.setEnabled(false); } @@ -790,23 +699,23 @@ public class VMPropertyView { public VMsProperty confirm() { VMsProperty p = null; - MessageBox msg = new MessageBox(table.getShell(), SWT.ICON_INFORMATION); - msg.setText("INFO"); + MessageDialog msg = new MessageDialog(); + String message = ""; try { if (isCreateMode) { p = Creator.create(newValue); - msg.setMessage("Succeeded to create the VM!"); + message= "Succeeded to create the VM!"; } else { property.getWorker().modifyVM(oldValue, newValue); p = property; - msg.setMessage("Succeeded to modify the VM!"); + message = "Succeeded to modify the VM!"; } } catch (VMsWorkerException e) { - msg.setMessage(e.getMessage()); + message = e.getMessage(); } - - msg.open(); + + msg.openInfoDialog(message); return p; } @@ -826,10 +735,6 @@ class VMViewWidget { public Spinner DIPspinner; public Combo skinTypeCombo; - public Combo SDCardTypeCombo; - public Combo SDCardPathCombo; - public FileDialog SDImageFD; - public Combo ramSizeCombo; public Combo shareTypeCombo; @@ -851,8 +756,6 @@ class VMViewWidget { resolutionCombo.dispose(); DIPspinner.dispose(); skinTypeCombo.dispose(); - SDCardTypeCombo.dispose(); - SDCardPathCombo.dispose(); ramSizeCombo.dispose(); shareTypeCombo.dispose(); selectShareFolderButton.dispose(); diff --git a/src/org/tizen/emulator/manager/ui/detail/VMResource.java b/src/org/tizen/emulator/manager/ui/detail/VMResource.java index 8c253c8..a325017 100644 --- a/src/org/tizen/emulator/manager/ui/detail/VMResource.java +++ b/src/org/tizen/emulator/manager/ui/detail/VMResource.java @@ -32,7 +32,7 @@ package org.tizen.emulator.manager.ui.detail; import java.util.ArrayList; -import org.tizen.emulator.manager.vms.VMCreateHelper; +import org.tizen.emulator.manager.tool.StringResource; class StringArrayResource { @@ -87,8 +87,8 @@ class SupportType extends StringArrayResource private SupportType() { - add(0, "Supported"); - add(1, "Not supported"); + add(0, StringResource.SUPPORTED); + add(1, StringResource.NOT_SUPPORTED); setDefaultIndex(1); } @@ -137,67 +137,6 @@ class DisplayResoultion extends StringArrayResource } } -class SkinPath extends StringArrayResource -{ - private static SkinPath skinPath = new SkinPath(); - public static SkinPath getInstance() { - return skinPath; - } - - private SkinPath() { - ArrayList list = new VMCreateHelper().makeSkinfolderList(); - int index = 0; - for (String s : list) { - add(index++, s); - } - } - - public int findIndex(String r) { - String[] strArray = getList(); - String s = null; - // TODO: - r = "emul_" + r; - for (int i = 0; i < strArray.length; i++) { - s = strArray[i]; - if (s.equals(r)) { - return i; - } - } - return getDefaultIndex(); - } -} - -class SDCard extends StringArrayResource -{ - private static SDCard capacity = new SDCard(); - public static SDCard getInstance() - { - return capacity; - } - - private SDCard() - { - add(0, "sdcard_256.img (256MB)"); - add(1, "sdcard_512.img (512MB)"); - add(2, "sdcard_1024.img (1024MB)"); - add(3, "sdcard_1536.img (1536MB)"); - - setDefaultIndex(1); - } - - public int findIndex(String type) { - String[] strArray = getList(); - String s = null; - for (int i = 0; i < strArray.length; i++) { - s = strArray[i]; - if (s.contains(type)) { - return i; - } - } - return getDefaultIndex(); - } -} - class RamSize extends StringArrayResource { private static RamSize size = new RamSize(); diff --git a/src/org/tizen/emulator/manager/ui/vmstree/ContextMenu.java b/src/org/tizen/emulator/manager/ui/vmstree/ContextMenu.java index ef40cef..2423c67 100644 --- a/src/org/tizen/emulator/manager/ui/vmstree/ContextMenu.java +++ b/src/org/tizen/emulator/manager/ui/vmstree/ContextMenu.java @@ -37,11 +37,11 @@ import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; -import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeItem; import org.tizen.emulator.manager.EmulatorManager; import org.tizen.emulator.manager.tool.StringResource; +import org.tizen.emulator.manager.ui.MessageDialog; import org.tizen.emulator.manager.ui.ResourceRegistry; import org.tizen.emulator.manager.ui.ResourceRegistry.ImageName; import org.tizen.emulator.manager.vms.VMsProperty; @@ -70,15 +70,14 @@ public class ContextMenu { try { property.getWorker().launchVM(); } catch (VMsWorkerException e) { - MessageBox alert = new MessageBox(EmulatorManager.getInstance().getMainDialog().getShell(), SWT.OK); - alert.setMessage(e.getMessage()); - alert.open(); + new MessageDialog().openInfoDialog(e.getMessage()); } } @Override public void widgetDefaultSelected(SelectionEvent event) { } }); + final MenuItem modifyItem = new MenuItem(treeMenu, SWT.NONE); modifyItem.setText(StringResource.MODIFY); modifyItem.setImage(ResourceRegistry.getImage(ImageName.MODIFY)); @@ -92,30 +91,33 @@ public class ContextMenu { EmulatorManager.getInstance().getMainDialog().openModifyView(property); } }); - final MenuItem deleteItem = new MenuItem(treeMenu, SWT.NONE); - deleteItem.setText(StringResource.DELETE); - deleteItem.setImage(ResourceRegistry.getImage(ImageName.DELETE)); - deleteItem.addSelectionListener(new SelectionListener() { + + new MenuItem(treeMenu, SWT.SEPARATOR); + + final MenuItem resetItem = new MenuItem(treeMenu, SWT.NONE); + resetItem.setText(StringResource.RESET); + resetItem.setImage(ResourceRegistry.getImage(ImageName.RESET)); + resetItem.addSelectionListener(new SelectionListener() { @Override public void widgetDefaultSelected(SelectionEvent arg0) { } @Override public void widgetSelected(SelectionEvent arg0) { - EmulatorManager.getInstance().getMainDialog().deleteVirtualMachine(); + EmulatorManager.getInstance().getMainDialog().resetVM(); } }); - final MenuItem resetItem = new MenuItem(treeMenu, SWT.NONE); - resetItem.setText(StringResource.RESET); - resetItem.setImage(ResourceRegistry.getImage(ImageName.RESET)); - resetItem.addSelectionListener(new SelectionListener() { + + final MenuItem deleteItem = new MenuItem(treeMenu, SWT.NONE); + deleteItem.setText(StringResource.DELETE); + deleteItem.setImage(ResourceRegistry.getImage(ImageName.DELETE)); + deleteItem.addSelectionListener(new SelectionListener() { @Override public void widgetDefaultSelected(SelectionEvent arg0) { } @Override public void widgetSelected(SelectionEvent arg0) { - EmulatorManager.getInstance().getMainDialog().resetVirtualMachine(); + EmulatorManager.getInstance().getMainDialog().deleteVM(); } - }); new MenuItem(treeMenu, SWT.SEPARATOR); @@ -130,12 +132,13 @@ public class ContextMenu { @Override public void widgetSelected(SelectionEvent arg0) { - EmulatorManager.getInstance().getMainDialog().cloneVirtualMachine(); + EmulatorManager.getInstance().getMainDialog().cloneVM(); } }); final MenuItem createImageItem = new MenuItem(treeMenu, SWT.NONE); createImageItem.setText(StringResource.CREATE_IMAGE); + createImageItem.setImage(ResourceRegistry.getImage(ImageName.CREATEIMAGE)); createImageItem.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { diff --git a/src/org/tizen/emulator/manager/ui/vmstree/RowItem.java b/src/org/tizen/emulator/manager/ui/vmstree/RowItem.java index 6f2a54a..0cd3ee2 100644 --- a/src/org/tizen/emulator/manager/ui/vmstree/RowItem.java +++ b/src/org/tizen/emulator/manager/ui/vmstree/RowItem.java @@ -63,7 +63,7 @@ class PropertyContent implements TreeContent { class CreateMarker implements TreeMarker { public CreateMarker(TreeItem item) { - item.setText("<< Create new... >> "); + item.setText("<< Create new... >>"); Font font = ResourceRegistry.getFont(SWT.BOLD); if(font == null) { diff --git a/src/org/tizen/emulator/manager/ui/vmstree/VMsTree.java b/src/org/tizen/emulator/manager/ui/vmstree/VMsTree.java index 05917b1..58d9978 100644 --- a/src/org/tizen/emulator/manager/ui/vmstree/VMsTree.java +++ b/src/org/tizen/emulator/manager/ui/vmstree/VMsTree.java @@ -41,12 +41,11 @@ import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeColumn; import org.eclipse.swt.widgets.TreeItem; -import org.tizen.emulator.manager.EmulatorManager; import org.tizen.emulator.manager.ui.MainDialog; +import org.tizen.emulator.manager.ui.MessageDialog; import org.tizen.emulator.manager.vms.EmulatorVMs; import org.tizen.emulator.manager.vms.VMsProperty; import org.tizen.emulator.manager.vms.VMsProperty.Architecture; @@ -61,7 +60,7 @@ public class VMsTree { EmulatorVMs fsImage = EmulatorVMs.getInstance(); - public VMsTree(MainDialog mainDialog, Composite parent) { + public VMsTree(final MainDialog mainDialog, Composite parent) { this.mainDialog = mainDialog; this.vmsTree = new Tree(parent, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION); @@ -79,7 +78,8 @@ public class VMsTree { } refreshContents(); - pack(); + packAll(); + packAll(); // FIXME: Need second pack avoid column becomes too narrow... why ??? contextMenu.prepare(vmsTree); Menu tableMenu = contextMenu.getMenu(); @@ -102,20 +102,20 @@ public class VMsTree { if (vmsTree.getSelection()[0].getData() instanceof CreateMarker) { if (vmsTree.getSelection()[0].getParentItem().getText().equals("Custom")) { - VMsTree.this.mainDialog.openCreateDetailView(false); + mainDialog.openCreateDetailView(false); } else { - VMsTree.this.mainDialog.openCreateDetailView(true); + mainDialog.openCreateDetailView(true); } return; } if(vmsTree.getSelection()[0].getData() instanceof TreeMarker) { - VMsTree.this.mainDialog.closeDetailView(); + mainDialog.closeDetailView(); return; } PropertyContent content = (PropertyContent)data; - VMsTree.this.mainDialog.openDetailView(content.property); + mainDialog.openDetailView(content.property); } } @@ -131,9 +131,7 @@ public class VMsTree { try { property.getWorker().launchVM(); } catch (VMsWorkerException e) { - MessageBox alert = new MessageBox(EmulatorManager.getInstance().getMainDialog().getShell(), SWT.OK); - alert.setMessage(e.getMessage()); - alert.open(); + new MessageDialog().openInfoDialog(e.getMessage()); } } }); @@ -149,13 +147,13 @@ public class VMsTree { return; } } - EmulatorManager.getInstance().getMainDialog().deleteVirtualMachine(); + mainDialog.deleteVM(); } } }); } - private void pack() { + private void packAll() { for(TreeColumn column : vmsTree.getColumns()) { column.pack(); } @@ -176,13 +174,13 @@ public class VMsTree { RowItem rowItem = null; // FIXME !! - // TODO: We insert "1.0" now... + // TODO: We insert "Tizen Larkspur" now... TreeItem tempItem = new TreeItem(vmsTree, SWT.NONE); - rowItem = new StandardVMsMarker("1.0", tempItem); + rowItem = new StandardVMsMarker("TIZEN Larkspur", tempItem); tempItem.setData(rowItem); Map itemsMap = new HashMap(); - itemsMap.put("1.0", tempItem); + itemsMap.put("TIZEN Larkspur", tempItem); TreeItem createItem = new TreeItem(tempItem, SWT.NONE); rowItem = new CreateMarker(createItem); @@ -286,4 +284,21 @@ public class VMsTree { public void setLayoutData(Object data) { vmsTree.setLayoutData(data); } -} \ No newline at end of file + + public void setSelectProperty(VMsProperty property) { + Object data; + vmsTree.deselectAll(); + for (TreeItem item : vmsTree.getItems()) { + for (TreeItem i : item.getItems()) { + data = i.getData(); + if (data instanceof TreeMarker) { + continue; + } + if (((PropertyContent)data).getProperty().getName().equals(property.getName())) { + vmsTree.select(i); + break; + } + } + } + } +} diff --git a/src/org/tizen/emulator/manager/vms/Creator.java b/src/org/tizen/emulator/manager/vms/Creator.java index 572e8f9..b4093de 100644 --- a/src/org/tizen/emulator/manager/vms/Creator.java +++ b/src/org/tizen/emulator/manager/vms/Creator.java @@ -70,7 +70,6 @@ public class Creator { createFileShare(); createDisplay(); createRam(); - createSDCard(); createHWVirtualization(); } catch(VMsCreatorException e) { @@ -166,16 +165,6 @@ public class Creator { private void createRam() {} - private void createSDCard() throws VMsCreatorException { - if (newVM.isSDCardSupport) { - try { - Modifier.modifySDCard(newVM); - } catch (VMsWorkerException e) { - throw new VMsCreatorException(e.getMessage()); - } - } - } - private void createHWVirtualization() {} private void settingProperty() { @@ -192,7 +181,7 @@ public class Creator { if (newVM.isDefaultImage) { ec.getBaseInformation().getDiskImage().setType("standard"); // TODO : get version - ec.getBaseInformation().getDiskImage().setVersion("1.0"); + ec.getBaseInformation().getDiskImage().setVersion("TIZEN Larkspur"); } else { ec.getBaseInformation().getDiskImage().setType("custom"); } @@ -234,12 +223,6 @@ public class Creator { ec.getDevice().getRAM().getSize().setUnit("MiB"); ec.getDevice().getRAM().getSize().setValue(newVM.ramSize); - ec.getDevice().setStorage(factory.createStorageType()); - ec.getDevice().getStorage().setSDCard(factory.createStorageTypeSDCard()); - if (newVM.isSDCardSupport) { - ec.getDevice().getStorage().getSDCard().setDiskImage(newVM.SDCardPath); - } - if (EmulatorManager.getInstance().getManagerMode().equals(ManagerModeType.INHOUSE_MODE)) { ec.getDevice().setTouch(factory.createTouchType()); ec.getDevice().getTouch().setMaxTouchPoint(newVM.maxTouchCount); diff --git a/src/org/tizen/emulator/manager/vms/EmulatorVMs.java b/src/org/tizen/emulator/manager/vms/EmulatorVMs.java index d3d97cb..79ac888 100644 --- a/src/org/tizen/emulator/manager/vms/EmulatorVMs.java +++ b/src/org/tizen/emulator/manager/vms/EmulatorVMs.java @@ -75,10 +75,6 @@ public class EmulatorVMs { public void setVMsBaseDirectory(String baseVMsDir) { vmsBaseDirectoryName = baseVMsDir; - - File fi = new File(vmsBaseDirectoryName); - if(!fi.exists()) - fi.mkdirs(); } public String getVMsBaseDirectory() { diff --git a/src/org/tizen/emulator/manager/vms/Launcher.java b/src/org/tizen/emulator/manager/vms/Launcher.java index e2833ec..7bc12e5 100644 --- a/src/org/tizen/emulator/manager/vms/Launcher.java +++ b/src/org/tizen/emulator/manager/vms/Launcher.java @@ -39,13 +39,15 @@ import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.MessageBox; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; import org.tizen.emulator.manager.EmulatorManager; import org.tizen.emulator.manager.EmulatorManager.ManagerModeType; import org.tizen.emulator.manager.logging.EMLogger; +import org.tizen.emulator.manager.tool.CheckVirtualization; import org.tizen.emulator.manager.tool.FileIO; import org.tizen.emulator.manager.tool.PortHelper; +import org.tizen.emulator.manager.ui.MessageDialog; import org.tizen.emulator.manager.vms.xml.TouchType; public class Launcher { @@ -60,9 +62,9 @@ public class Launcher { /* check available port number */ portNo = new PortHelper().getPortNo(); if(portNo == -1) { - MessageBox alert = new MessageBox(EmulatorManager.getInstance().getMainDialog().getShell(), SWT.OK); - alert.setMessage("Can not execute emulator.\n All available ports are in use."); - alert.open(); + MessageDialog alert = new MessageDialog(EmulatorManager.getInstance().getMainDialog().getShell()); + alert.openInfoDialog("Can not execute emulator.\n All available ports are in use."); + return false; } @@ -71,170 +73,184 @@ public class Launcher { else binary = "emulator-x86"; - if (property.getConfiguration().getUsability().isHwVirtualization() && VMCreateHelper.isSupport) { - hwVirtualization = VMCreateHelper.enable_command; + if (property.getConfiguration().getUsability().isHwVirtualization() && CheckVirtualization.getInstance().isSupportVirtualization()) { + hwVirtualization = CheckVirtualization.getInstance().getEnableCommnad(); } else { - hwVirtualization = VMCreateHelper.disable_command; + hwVirtualization = CheckVirtualization.getInstance().getDisableCommnad(); } /* make cmd to run emulator */ - try { - List cmd = new ArrayList(); - int width = property.getConfiguration().getDevice().getDisplay().getResolution().getWidth(); - int height = property.getConfiguration().getDevice().getDisplay().getResolution().getHeight(); - String skinPath = null; - if (property.getConfiguration().getDevice().getDisplay().getSkinPath() != null) { - skinPath = property.getConfiguration().getDevice().getDisplay().getSkinPath().getPath(); - if (skinPath.isEmpty()) { - skinPath = null; - } - } - String fileshare = property.getConfiguration().getUsability().getFileSharing().getPath(); - String sdcard = property.getConfiguration().getDevice().getStorage().getSDCard().getDiskImage(); - int isLinux = System.getProperty("os.name").toLowerCase().indexOf("linux"); - int isWindows = System.getProperty("os.name").toLowerCase().indexOf("linux"); - String osVersion = System.getProperty("os.version"); - boolean isFileshare = true; - if (fileshare == null) { - isFileshare = false; - } - boolean isSDcard = true; - if (sdcard == null) { - isSDcard = false; - } - FileIO fio = new FileIO(); - cmd.add(fio.getBinPath() + File.separator + binary); - cmd.add("--skin-args"); - cmd.add("width=" + width); - cmd.add("height=" + height); - if (skinPath != null) { - cmd.add("skin.path=" + skinPath); + MessageDialog msg = new MessageDialog(new Shell(Display.getCurrent())); + + List cmd = new ArrayList(); + int width = property.getConfiguration().getDevice().getDisplay().getResolution().getWidth(); + int height = property.getConfiguration().getDevice().getDisplay().getResolution().getHeight(); + String skinPath = null; + if (property.getConfiguration().getDevice().getDisplay().getSkinPath() != null) { + skinPath = property.getConfiguration().getDevice().getDisplay().getSkinPath().getPath(); + if (skinPath.isEmpty()) { + skinPath = null; } - cmd.add("--qemu-args"); - cmd.add("-drive"); - cmd.add("file=" + EmulatorVMs.getInstance().getVMsBaseDirectory() + File.separator +property.getArch().toString() + File.separator + property.getName() + File.separator +"emulimg-" + property.getName() + ".x86,if=virtio"); - cmd.add( "-boot"); - cmd.add("c"); - cmd.add("-append"); - /* is linux and use fileshare [kernel option] */ - if(isLinux > -1 && isFileshare) { - cmd.add("console=ttyS0 video=uvesafb:ywrap," + } + String fileshare = property.getConfiguration().getUsability().getFileSharing().getPath(); + int isLinux = System.getProperty("os.name").toLowerCase().indexOf("linux"); + int isWindows = System.getProperty("os.name").toLowerCase().indexOf("windows"); + String osVersion = System.getProperty("os.version"); + boolean isFileshare = true; + if (fileshare == null) { + isFileshare = false; + } + + FileIO fio = FileIO.getInstance(); + cmd.add(fio.getBinPath() + File.separator + binary); + cmd.add("--skin-args"); + cmd.add("width=" + width); + cmd.add("height=" + height); + if (skinPath != null) { + cmd.add("skin.path=" + skinPath); + } + cmd.add("--qemu-args"); + cmd.add("-drive"); + cmd.add("file=" + EmulatorVMs.getInstance().getVMsBaseDirectory() + File.separator + property.getArch().toString() + File.separator + property.getName() + File.separator +"emulimg-" + property.getName() + ".x86,if=virtio"); + cmd.add( "-boot"); + cmd.add("c"); + cmd.add("-append"); + /* is linux and use fileshare [kernel option] */ + if(isLinux > -1 && isFileshare) { + cmd.add("console=ttyS0 video=uvesafb:ywrap," + + width + + "x" + + height + + "-32@60" + + " dpi=" + property.getConfiguration().getDevice().getDisplay().getDensity().getValue() * 10 + + " ip=10.0.2.16::10.0.2.2:255.255.255.0::eth0:none 5 virtio-9p"); + } + else { + cmd.add("console=ttyS0 video=uvesafb:ywrap," + width + "x" + height + "-32@60" + " dpi=" + property.getConfiguration().getDevice().getDisplay().getDensity().getValue() * 10 - + " ip=10.0.2.16::10.0.2.2:255.255.255.0::eth0:none 5 virtio-9p"); - } - else { - cmd.add("console=ttyS0 video=uvesafb:ywrap," - + width - + "x" - + height - + "-32@60" - + " dpi=" + property.getConfiguration().getDevice().getDisplay().getDensity().getValue() * 10 - + " ip=10.0.2.16::10.0.2.2:255.255.255.0::eth0:none 5"); - } - /* is linux and use fileshare [non-kernel option] */ - if(isLinux > -1 && isFileshare) { - cmd.add("-virtfs"); - cmd.add("local,path=" + property.getConfiguration().getUsability().getFileSharing().getPath() +",security_model=none,mount_tag=fileshare"); - } + + " ip=10.0.2.16::10.0.2.2:255.255.255.0::eth0:none 5"); + } + /* is linux and use fileshare [non-kernel option] */ + if(isLinux > -1 && isFileshare) { + cmd.add("-virtfs"); + cmd.add("local,path=" + property.getConfiguration().getUsability().getFileSharing().getPath() +",security_model=none,mount_tag=fileshare"); + } - if(isSDcard) { - cmd.add("-drive"); - cmd.add("file=" + sdcard + ",if=virtio"); - } - /* is windows XP and use fileshare */ - if(isWindows > -1 && osVersion.equals("5.1") && isFileshare) { - /* delete if fileshare with the same name existed */ - List cmd2 = new ArrayList(); - cmd2.add("net"); - cmd2.add("share"); - cmd2.add("emulator-" + portNo); - cmd2.add("/delete"); - ProcessBuilder pb2 = new ProcessBuilder(cmd2); - pb2.start(); - - /* start net share */ - List cmd3 = new ArrayList(); - cmd3.add("net"); - cmd3.add("share"); - cmd3.add("emulator-" + portNo + "=" + fileshare); - ProcessBuilder pb3 = new ProcessBuilder(cmd3); - pb3.start(); - } - /* is windows 7 and use fileshare */ - else if(isWindows > -1 && osVersion.equals("6.1") && isFileshare) { + /* is windows XP and use fileshare */ + if(isWindows > -1 && osVersion.equals("5.1") && isFileshare) { /* delete if fileshare with the same name existed */ List cmd2 = new ArrayList(); cmd2.add("net"); cmd2.add("share"); cmd2.add("emulator-" + portNo); cmd2.add("/delete"); + logger.log(Level.INFO, String.format("%s\n", cmd2)); ProcessBuilder pb2 = new ProcessBuilder(cmd2); - pb2.start(); + try { + pb2.start(); + } catch (IOException e) { + msg.openWarningDialog("Failed to execute fileshare command.\n" + e.getMessage()); + } /* start net share */ List cmd3 = new ArrayList(); cmd3.add("net"); cmd3.add("share"); cmd3.add("emulator-" + portNo + "=" + fileshare); - cmd3.add("/grant:"+ System.getProperty("user.name") + ",full"); + logger.log(Level.INFO, String.format("%s\n", cmd3)); ProcessBuilder pb3 = new ProcessBuilder(cmd3); - pb3.start(); + try { + pb3.start(); + } catch (IOException e) { + msg.openWarningDialog("Failed to execute fileshare command.\n" + e.getMessage()); + } + } + /* is windows 7 and use fileshare */ + else if(isWindows > -1 && osVersion.equals("6.1") && isFileshare) { + /* delete if fileshare with the same name existed */ + List cmd2 = new ArrayList(); + cmd2.add("net"); + cmd2.add("share"); + cmd2.add("emulator-" + portNo); + cmd2.add("/delete"); + logger.log(Level.INFO, String.format("%s\n", cmd2)); + ProcessBuilder pb2 = new ProcessBuilder(cmd2); + try { + pb2.start(); + } catch (IOException e) { + msg.openWarningDialog("Failed to execute fileshare command.\n" + e.getMessage()); } - cmd.add("-serial"); - cmd.add("file:" + EmulatorVMs.getInstance().getVMsBaseDirectory() + File.separator + property.getArch().toString() + File.separator + property.getName() + File.separator + "logs" + File.separator + "emulator.klog"); - cmd.add("-m"); - cmd.add(String.valueOf(property.getConfiguration().getDevice().getRAM().getSize().getValue())); - cmd.add("-M"); - cmd.add("maru-x86-machine"); - cmd.add("-net"); - cmd.add("nic,model=virtio"); - cmd.add("-soundhw"); - cmd.add("all"); - cmd.add("-usb"); - cmd.add("-usbdevice"); - cmd.add("maru-touchscreen"); - cmd.add("-vga"); - cmd.add("maru"); - cmd.add("-bios"); - cmd.add("bios.bin"); - cmd.add("-L"); - cmd.add(fio.getBiosPath()); - cmd.add("-kernel"); - cmd.add(fio.getKernelPath() + File.separator+ "bzImage"); - cmd.add("-net"); - cmd.add("user"); - cmd.add("-rtc"); - cmd.add("base=utc"); - /* append HW virtualization option if supports */ - if (hwVirtualization != null) { - cmd.add(hwVirtualization); + /* start net share */ + List cmd3 = new ArrayList(); + cmd3.add("net"); + cmd3.add("share"); + cmd3.add("emulator-" + portNo + "=" + fileshare); + cmd3.add("/grant:"+ System.getProperty("user.name") + ",full"); + logger.log(Level.INFO, String.format("%s\n", cmd3)); + ProcessBuilder pb3 = new ProcessBuilder(cmd3); + try { + pb3.start(); + } catch (IOException e) { + msg.openWarningDialog("Failed to execute fileshare command.\n" + e.getMessage()); } + } + cmd.add("-serial"); + cmd.add("file:" + EmulatorVMs.getInstance().getVMsBaseDirectory() + File.separator + property.getArch().toString() + File.separator + property.getName() + File.separator + "logs" + File.separator + "emulator.klog"); + cmd.add("-m"); + cmd.add(String.valueOf(property.getConfiguration().getDevice().getRAM().getSize().getValue())); + cmd.add("-M"); + cmd.add("maru-x86-machine"); + cmd.add("-net"); + cmd.add("nic,model=virtio"); + cmd.add("-soundhw"); + cmd.add("all"); + cmd.add("-usb"); + cmd.add("-usbdevice"); + cmd.add("maru-touchscreen"); + cmd.add("-vga"); + cmd.add("maru"); + cmd.add("-bios"); + cmd.add("bios.bin"); + cmd.add("-L"); + cmd.add(fio.getBiosPath()); + cmd.add("-kernel"); + cmd.add(fio.getKernelPath() + File.separator+ "bzImage"); + cmd.add("-net"); + cmd.add("user"); + cmd.add("-rtc"); + cmd.add("base=utc"); + + /* append HW virtualization option if supports */ + if (hwVirtualization != null) { + cmd.add(hwVirtualization); + } - if (EmulatorManager.getInstance().getManagerMode().equals(ManagerModeType.INHOUSE_MODE)) { - TouchType touchType = property.getConfiguration().getDevice().getTouch(); - if (touchType != null) { - cmd.add("-max-touch-point"); - cmd.add("" + touchType.getMaxTouchPoint()); - } + if (EmulatorManager.getInstance().getManagerMode().equals(ManagerModeType.INHOUSE_MODE)) { + TouchType touchType = property.getConfiguration().getDevice().getTouch(); + if (touchType != null) { + cmd.add("-max-touch-point"); + cmd.add("" + touchType.getMaxTouchPoint()); } + } - /* append user added options if exists */ - String advancedOptions = property.getConfiguration().getUsability().getAdvancedOptions(); - if (advancedOptions != null) { - String[] arrOptions = advancedOptions.split(" "); - for (String option : arrOptions) { - cmd.add(option); - } + /* append user added options if exists */ + String advancedOptions = property.getConfiguration().getUsability().getAdvancedOptions(); + if (advancedOptions != null) { + String[] arrOptions = advancedOptions.split(" "); + for (String option : arrOptions) { + cmd.add(option); } - logger.log(Level.INFO, String.format("Starting Emulator Command : %s\n", cmd)); - ProcessBuilder pb = new ProcessBuilder(cmd); - pb.directory(new File(fio.getBinPath())); - + } + logger.log(Level.INFO, String.format("Starting Emulator Command : %s\n", cmd)); + ProcessBuilder pb = new ProcessBuilder(cmd); + pb.directory(new File(fio.getBinPath())); + + try { Process process = pb.start(); final InputStream in1 = new BufferedInputStream(process.getInputStream()); @@ -250,6 +266,7 @@ public class Launcher { } } }).start(); + new Thread(new Runnable() { @Override public void run() { @@ -262,9 +279,10 @@ public class Launcher { }).start(); } catch (IOException e) { - e.printStackTrace(); + msg.openWarningDialog("Failed to launch [" + property.getName() + "]\n" + e.getMessage()); return false; } + return true; } } diff --git a/src/org/tizen/emulator/manager/vms/Modifier.java b/src/org/tizen/emulator/manager/vms/Modifier.java index 04f929f..a9254e7 100644 --- a/src/org/tizen/emulator/manager/vms/Modifier.java +++ b/src/org/tizen/emulator/manager/vms/Modifier.java @@ -80,18 +80,6 @@ public class Modifier { property.getConfiguration().getDevice().getDisplay().getDensity().setValue(newVM.dpi); } - if (newVM.isSDCardSupport != oldVM.isSDCardSupport) { - if (newVM.isSDCardSupport) { - modifySDCard(newVM); - property.getConfiguration().getDevice().getStorage().getSDCard().setDiskImage(newVM.SDCardPath); - } else { - property.getConfiguration().getDevice().getStorage().getSDCard().setDiskImage(null); - } - } else if (newVM.isSDCardSupport && !newVM.SDCardPathName.equals(oldVM.SDCardPathName)) { - modifySDCard(newVM); - property.getConfiguration().getDevice().getStorage().getSDCard().setDiskImage(newVM.SDCardPath); - } - if (newVM.ramSize != oldVM.ramSize) { property.getConfiguration().getDevice().getRAM().getSize().setValue(newVM.ramSize); } @@ -124,64 +112,4 @@ public class Modifier { EmulatorVMs.getInstance().storeXML(property); } - - static void modifySDCard(VMPropertyValue newVM) throws VMsWorkerException { - if (newVM.SDCardPath.endsWith("MB)")) { // New - String sdCardName = newVM.SDCardPath.substring(0, newVM.SDCardPath.lastIndexOf(" ")); - String dataPath = FileIO.getInstance().getDataPath() + File.separator + sdCardName; - - File src = new File(dataPath); - if(!src.exists()) { - throw new VMsWorkerException("Failed to create SD card image.!\nFile does not exist :" + dataPath); - } - - File dest = new File(FileIO.getInstance().getVirtualTargetPath(newVM.imageName) + File.separator + sdCardName); - try { - dest.createNewFile(); - newVM.SDCardPath = dest.getAbsolutePath(); - } catch (IOException e) { - throw new VMsWorkerException("Failed to create new image path!"); - } - - - FileInputStream inputStream = null; - FileOutputStream outputStream = null; - FileChannel fcin = null; - FileChannel fcout = null; - try { - inputStream = new FileInputStream(src); - outputStream = new FileOutputStream(dest); - - fcin = inputStream.getChannel(); - fcout = outputStream.getChannel(); - long size = fcin.size(); - fcin.transferTo(0, size, fcout); - } catch (FileNotFoundException e) { - throw new VMsWorkerException("Failed to create SD card image!\n" + e.getMessage()); - } catch (IOException e) { - throw new VMsWorkerException("Failed to create SD card image!\n" + e.getMessage()); - }finally { - try { - if (fcout != null) - fcout.close(); - if (fcin != null) - fcin.close(); - if (outputStream != null) - outputStream.close(); - if (inputStream != null) - inputStream.close(); - } catch (IOException e) { - throw new VMsWorkerException(e.getMessage()); - } - } - } else { - if (newVM.SDCardPath == null || newVM.SDCardPath.isEmpty()) { - throw new VMsWorkerException("Select the SD card image!"); - } - - if (newVM.SDCardPath.equals("( None )")) { - throw new VMsWorkerException("Select the SD card image !"); - } - } - } } diff --git a/src/org/tizen/emulator/manager/vms/VMCreateHelper.java b/src/org/tizen/emulator/manager/vms/VMCreateHelper.java index 537b9df..c95a525 100644 --- a/src/org/tizen/emulator/manager/vms/VMCreateHelper.java +++ b/src/org/tizen/emulator/manager/vms/VMCreateHelper.java @@ -30,17 +30,12 @@ package org.tizen.emulator.manager.vms; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; - import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; -import org.tizen.emulator.manager.tool.FileIO; import org.tizen.emulator.manager.vms.VMsProperty.Architecture; public class VMCreateHelper { @@ -109,51 +104,4 @@ public class VMCreateHelper { combo.select(defaultIndex); } - - public ArrayList makeSkinfolderList() { - ArrayList list = new ArrayList(); - File skins = new File(FileIO.getInstance().getSkinPath()); - - if (skins.exists()) { - //System.out.println(skins.getAbsolutePath()); - for (File dir : skins.listFiles()) { - if (dir.isDirectory()) { - //System.out.println(dir.getName()); - list.add(dir.getName()); - } - } - } - return list; - } - - // TODO : update please !! - public static boolean isSupport = false; - public static String enable_command = ""; - public static String disable_command = null; - static { - if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1) { - File haxDev = new File("\\\\.\\HAX"); - try { - if(haxDev.createNewFile()) - isSupport = true; - } catch (IOException e) { - isSupport = false; - } - } - enable_command = "-enable-hax"; - disable_command = "-disable-hax"; - - if (System.getProperty("os.name").toLowerCase().indexOf("linux") > -1) { - if(new File("/dev/kvm").exists()) { - isSupport = true; - } - enable_command = "-enable-kvm"; - } - } - - - - public boolean isSupportVirtualization() { - return isSupport; - } } diff --git a/src/org/tizen/emulator/manager/vms/VMPropertyValue.java b/src/org/tizen/emulator/manager/vms/VMPropertyValue.java index 0052165..73beef8 100644 --- a/src/org/tizen/emulator/manager/vms/VMPropertyValue.java +++ b/src/org/tizen/emulator/manager/vms/VMPropertyValue.java @@ -54,10 +54,6 @@ public class VMPropertyValue implements Cloneable { public int keyType; public String skinPath; - public boolean isSDCardSupport; - public String SDCardPath; - public String SDCardPathName; - public int ramSize; public boolean isFileShareSupport; @@ -101,16 +97,6 @@ public class VMPropertyValue implements Cloneable { } // - SDCardPath = property.getConfiguration().getDevice().getStorage().getSDCard().getDiskImage(); - if (SDCardPath != null) { - isSDCardSupport = true; - SDCardPathName = SDCardPath.substring - (SDCardPath.lastIndexOf(File.separator) + 1, SDCardPath.length()); - } else { - SDCardPath = ""; - SDCardPathName = "( None )"; - } - fileSharePath = property.getConfiguration().getUsability().getFileSharing().getPath(); if (fileSharePath != null) { isFileShareSupport = true; @@ -148,10 +134,6 @@ public class VMPropertyValue implements Cloneable { dest.skinPath = this.skinPath; dest.keyType = this.keyType; - dest.isSDCardSupport = this.isSDCardSupport; - dest.SDCardPath = this.SDCardPath; - dest.SDCardPathName = this.SDCardPathName; - dest.ramSize = this.ramSize; dest.isFileShareSupport = this.isFileShareSupport; @@ -179,12 +161,6 @@ public class VMPropertyValue implements Cloneable { return false; if(this.keyType != dest.keyType) return false; - if(this.isSDCardSupport != dest.isSDCardSupport) { - return false; - } else { - if (!this.SDCardPath.equals(dest.SDCardPath)) - return false; - } if(this.ramSize != dest.ramSize) return false; if(this.isFileShareSupport != dest.isFileShareSupport) { @@ -224,10 +200,6 @@ public class VMPropertyValue implements Cloneable { value.keyType = 1; // - value.isSDCardSupport = false; - value.SDCardPath = ""; - value.SDCardPathName = "( None )"; - value.ramSize = 512; value.isFileShareSupport = false; diff --git a/src/org/tizen/emulator/manager/vms/VMsWorker.java b/src/org/tizen/emulator/manager/vms/VMsWorker.java index e30a47f..c8152b3 100644 --- a/src/org/tizen/emulator/manager/vms/VMsWorker.java +++ b/src/org/tizen/emulator/manager/vms/VMsWorker.java @@ -37,15 +37,19 @@ import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; +import java.util.logging.Logger; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; import org.tizen.emulator.manager.logging.EMLogger; import org.tizen.emulator.manager.tool.FileIO; +import org.tizen.emulator.manager.ui.MessageDialog; public class VMsWorker { VMsProperty property; - + public VMsWorker(VMsProperty property) { this.property = property; } @@ -141,9 +145,10 @@ public class VMsWorker { // check if the emulator instance with the same name is running now. public boolean isRunningNow() { + Logger logger = EMLogger.getLogger(); + MessageDialog msg = new MessageDialog(new Shell(Display.getCurrent())); int isLinux = System.getProperty("os.name").toLowerCase().indexOf("linux"); int isWindows = System.getProperty("os.name").toLowerCase().indexOf("windows"); - try { String line; List cmd = new ArrayList(); @@ -156,16 +161,18 @@ public class VMsWorker { cmd.add("/V"); cmd.add("/FI"); cmd.add("\"IMAGENAME eq java.exe\""); + cmd.add("/FO"); + cmd.add("CSV"); } ProcessBuilder pb = new ProcessBuilder(cmd); Process p = pb.start(); BufferedReader stdOut = new BufferedReader(new InputStreamReader(p.getInputStream())); - if(isLinux > -1) { while ((line = stdOut.readLine()) != null) { - if(line.contains(FileIO.getInstance().getVirtualTargetImagePath(property.getName()))) { - //System.out.println("exist in"+ line); + String imagePath = FileIO.getInstance().getVirtualTargetImagePath(property.getName()); + if(line.contains(imagePath)) { + logger.log(Level.INFO, line + " contains " + imagePath + "\n"); stdOut.close(); return true; } @@ -173,19 +180,23 @@ public class VMsWorker { } else if(isWindows > -1) { while ((line = stdOut.readLine()) != null) { - if(line.contains(property.getName()+ ":261")) { - //System.out.println("exist in"+ line); + String[] titleName = line.split(","); + // "split[split.length - 1]" is window title. + if(titleName[titleName.length - 1].startsWith("\"" + property.getName()+ ":261")) { + logger.log(Level.INFO, "contains " +titleName[titleName.length - 1] + "\n"); stdOut.close(); return true; } } } stdOut.close(); - //System.out.println("not exist anywhere"); + logger.log(Level.INFO, "not exist anywhere\n"); return false; - } catch (Exception err) { - err.printStackTrace(); - return true; + } catch (Exception err) { + logger.log(Level.SEVERE, err.getMessage()); + msg.openWarningDialog("Error occured while checking if the same VM .\n" + + err.getMessage()); + return false; } } } \ No newline at end of file diff --git a/xsd/em.xml b/xsd/em.xml index 33756c7..be3ba82 100644 --- a/xsd/em.xml +++ b/xsd/em.xml @@ -24,9 +24,6 @@ 0 - - - 0 diff --git a/xsd/em.xsd b/xsd/em.xsd index 08ebd0c..ab10e86 100644 --- a/xsd/em.xsd +++ b/xsd/em.xsd @@ -104,7 +104,7 @@ - @@ -148,18 +148,6 @@ - - - - - - - - - - - -- 2.7.4