Merge branch 'develop' into features/new_ui
authorminkee.lee <minkee.lee@samsung.com>
Tue, 5 Jan 2016 06:06:33 +0000 (15:06 +0900)
committerminkee.lee <minkee.lee@samsung.com>
Tue, 5 Jan 2016 06:06:41 +0000 (15:06 +0900)
Conflicts:
src/org/tizen/emulator/manager/platform/BaseImage.java
src/org/tizen/emulator/manager/ui/dialog/AboutDialog.java
src/org/tizen/emulator/manager/vms/Creator.java
src/org/tizen/emulator/manager/vms/option/LaunchConfig.java

Change-Id: I3021d3a96717209dcc9ce12bcc0e5906311e3445
Signed-off-by: minkee.lee <minkee.lee@samsung.com>
1  2 
package/changelog
package/pkginfo.manifest
src/org/tizen/emulator/manager/EmulatorManager.java
src/org/tizen/emulator/manager/platform/BaseImage.java
src/org/tizen/emulator/manager/ui/detail/item/property/BaseImageViewItem.java
src/org/tizen/emulator/manager/ui/dialog/AboutDialog.java
src/org/tizen/emulator/manager/vms/Creator.java
src/org/tizen/emulator/manager/vms/option/LaunchConfig.java

Simple merge
Simple merge
@@@ -392,10 -281,13 +393,15 @@@ public class BaseImage 
                                : "";
        }
  
+       private Architecture findCpuTypeFromPath() {
+               String ext = FilePathResources.getFileExtention(this.path);
+               return Architecture.getType(ext);
+       }
        private void settingImagePath(File path) throws IOException {
                for (File f : path.listFiles()) {
 +                      // TODO: find first .x86 file.
 +                      // if there are .x86 file more then two ??
                        if (f.isFile() && f.getName().endsWith(getCpu().toLowerCase())) {
                                this.path = f.getCanonicalPath();
                                this.pathName = f.getName();
@@@ -32,9 -32,7 +32,10 @@@ package org.tizen.emulator.manager.ui.d
  import org.eclipse.swt.SWT;
  import org.eclipse.swt.events.SelectionEvent;
  import org.eclipse.swt.events.SelectionListener;
+ import org.eclipse.swt.graphics.Point;
 +import org.eclipse.swt.layout.FormAttachment;
 +import org.eclipse.swt.layout.FormData;
 +import org.eclipse.swt.layout.FormLayout;
  import org.eclipse.swt.layout.GridData;
  import org.eclipse.swt.layout.GridLayout;
  import org.eclipse.swt.widgets.Button;
@@@ -43,12 -41,10 +44,13 @@@ import org.eclipse.swt.widgets.Display
  import org.eclipse.swt.widgets.Label;
  import org.eclipse.swt.widgets.Link;
  import org.eclipse.swt.widgets.Shell;
 +import org.eclipse.swt.widgets.Text;
  import org.tizen.emulator.manager.EmulatorManager;
  import org.tizen.emulator.manager.logging.EMLogger;
 +import org.tizen.emulator.manager.platform.ProfileList;
 +import org.tizen.emulator.manager.plugin.EMPlugin;
  import org.tizen.emulator.manager.resources.FilePathResources;
+ import org.tizen.emulator.manager.resources.FontResources;
  import org.tizen.emulator.manager.resources.ImageResources;
  import org.tizen.emulator.manager.resources.StringResources;
  import org.tizen.emulator.manager.tool.About;
@@@ -196,22 -190,9 +205,27 @@@ public class AboutDialog 
                        }
                });
  
 +              Text plugin = new Text(textComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
 +              plugin.setEditable(false);
 +              String list = "";
 +              for (EMPlugin p : ProfileList.getPluginList()) {
 +                      if (!list.isEmpty()) {
 +                              list = list + StringResources.NEW_LINE;
 +                      }
 +                      list = list + p.getPlatformName() + ": " + p.getPackageVersion();
 +              }
 +              plugin.setText(list);
 +              data = new FormData();
 +              data.top = new FormAttachment(visit, spacing);
 +              data.left = new FormAttachment(0, spacing);
 +              data.width = 240;
 +              data.height = 40;
 +              plugin.setLayoutData(data);
++
+               visit.setFont(FontResources.ABOUT_TEXT.getFont());
+               workspace.setFont(FontResources.ABOUT_TEXT.getFont());
+               contents.setFont(FontResources.ABOUT_TEXT.getFont());
++              plugin.setFont(FontResources.ABOUT_TEXT.getFont());
        }
  
        private static GridLayout getGridLayout(int numColumns, boolean makeColumnEqualWidth) {
@@@ -269,9 -271,127 +269,10 @@@ public class Creator 
        private void createUsability() {}
  
        private void settingProperty() {
 -              ObjectFactory factory = EmulatorVMList.getInstance().getObjectFactory();
 -              EmulatorConfiguration ec = property.getConfiguration();
 -              ec.setBaseInformation(factory.createBaseInformationType());
 -              ec.setUsability(factory.createUsabilityType());
 -              ec.setDevice(factory.createDeviceType());
 -
 -              ec.getBaseInformation().setName(newVM.vmsName);
 -              ec.getBaseInformation().setArchitecture(newVM.baseImage.getCpu());
 -              ec.getBaseInformation().setPlatform(newVM.baseImage.getPlatformName());
 -
 -              ec.getBaseInformation().setDiskImage(factory.createBaseInformationTypeDiskImage());
 -              if (newVM.baseImage.isStandard()) {
 -                      ec.getBaseInformation().getDiskImage().setType("standard"); //$NON-NLS-1$
 -              } else {
 -                      ec.getBaseInformation().getDiskImage().setType("custom"); //$NON-NLS-1$
 -              }
 -
 -              if (newVM.baseImage.getVersion() != null) {
 -                      ec.getBaseInformation().getDiskImage().setVersion(newVM.baseImage.getVersion());
 -              } else {
 -                      ec.getBaseInformation().getDiskImage().setVersion("Standard"); //$NON-NLS-1$
 -              }
 -              if (newVM.baseImage.getName() != null) {
 -                      ec.getBaseInformation().getDiskImage().setBase(newVM.baseImage.getName());
 -              }
 -
 -              //
 -              ec.getBaseInformation().getDiskImage().setProfile(newVM.baseImage.getProfile());
 -              ec.getBaseInformation().getDiskImage().setBaseDiskImage(factory.createDiskImageFormatType());
 -              ec.getBaseInformation().getDiskImage().setCurrentDiskImage(factory.createDiskImageFormatType());
 -              // TODO :
 -              ec.getBaseInformation().getDiskImage().getBaseDiskImage().setFormat("qcow2"); //$NON-NLS-1$
 -              ec.getBaseInformation().getDiskImage().getBaseDiskImage().setValue(newVM.baseImagePath);
 -
 -              if (newVM.baseImage.isStandard() && !newVM.baseImage.getBinaryVersion().isEmpty()) {
 -                      ec.getBaseInformation().getDiskImage().getBaseDiskImage().setVersion(newVM.baseImage.getBinaryVersion());
 -              }
 -              ec.getBaseInformation().getDiskImage().getCurrentDiskImage().setFormat("qcow2"); //$NON-NLS-1$
 -              //ec.getBaseInformation().getDiskImage().getCurrentDiskImage().setValue(
 -              //              folder.getAbsolutePath() + File.separator + "emulimg-" +  newVM.imageName + "." + Architecture.x86.toString());
 -              ec.getBaseInformation().getDiskImage().getCurrentDiskImage().setValue(customPath);
 -
 -              if (swapPath != null) {
 -                      ec.getBaseInformation().getDiskImage().setSwapDiskImage(factory.createDiskImageFormatType());
 -                      ec.getBaseInformation().getDiskImage().getSwapDiskImage().setFormat("qcow2"); //$NON-NLS-1$
 -                      ec.getBaseInformation().getDiskImage().getSwapDiskImage().setValue(swapPath);
 -              }
 -
 -              ec.getUsability().setLogging(factory.createUsabilityTypeLogging());
 -              ec.getUsability().getLogging().setLevel("NONE"); //$NON-NLS-1$
 -              ec.getUsability().setHwVirtualization(newVM.isHWVirtualization);
 -                                                      /*&& CheckVirtualization.getInstance().isSupportVirtualization());*/
 -              ec.getUsability().setHwGLAcceleration(newVM.isGLAcceleration);
 -              ec.getUsability().setSupportSuspend(newVM.isSupportSuspend);
 -
 -              ec.getUsability().setFileSharing(factory.createUsabilityTypeFileSharing());
 -              if (!newVM.fileSharePath.isEmpty()) {
 -                      ec.getUsability().getFileSharing().setPath(newVM.fileSharePath);
 -              }
 -
 -              ec.getDevice().setDisplay(factory.createDisplayType());
 -              ec.getDevice().getDisplay().setResolution(factory.createDisplayTypeResolution());
 -              ec.getDevice().getDisplay().getResolution().setWidth(newVM.resolution.getResolution().getWidth());
 -              ec.getDevice().getDisplay().getResolution().setHeight(newVM.resolution.getResolution().getHeight());
 -
 -              ec.getDevice().getDisplay().setDensity(factory.createDisplayTypeDensity());
 -              ec.getDevice().getDisplay().getDensity().setUnit("dpi"); //$NON-NLS-1$
 -              ec.getDevice().getDisplay().getDensity().setValue(newVM.dpi);
 -
 -              ec.getDevice().getDisplay().setSkinPath(factory.createDisplayTypeSkinPath());
 -              if (newVM.skin != null) {
 -                      ec.getDevice().getDisplay().getSkinPath().setPath(newVM.skin.getPath());
 -              } else if (newVM.skinPath != null) {
 -                      ec.getDevice().getDisplay().getSkinPath().setPath(newVM.skinPath);
 -              }
 -              ////// CPU //////
 -              ec.getDevice().setCPU(factory.createCpuType());
 -              ec.getDevice().getCPU().setValue(factory.createCpuTypeValue());
 -              ec.getDevice().getCPU().getValue().setUnit("cpu"); //$NON-NLS-1$
 -              if (newVM.cpu == 0) {
 -                      int max = CPU.getMaxCpuNum();
 -                      newVM.cpu = max > 4 ? 4 : max;
 -              }
 -              ec.getDevice().getCPU().getValue().setValue(newVM.cpu);
 -
 -
 -              ec.getDevice().setRAM(factory.createRamType());
 -              ec.getDevice().getRAM().setSize(factory.createRamTypeSize());
 -              ec.getDevice().getRAM().getSize().setUnit("MiB"); //$NON-NLS-1$
 -              ec.getDevice().getRAM().getSize().setValue(newVM.ramSize);
 -
 -              if (newVM.maxTouchCount >= 0) {
 -                      ec.getDevice().setTouch(factory.createTouchType());
 -                      ec.getDevice().getTouch().setMaxTouchPoint(newVM.maxTouchCount);
 -              }
 -
 -              if (newVM.addOptions != null) {
 -                      ec.getUsability().setAdvancedOptions(newVM.addOptions);
 -              }
 -
 -              if(newVM.ociOptions != null) {
 -              //////OCI DEVICE//////
 -                      ec.setOci(factory.createOciType());
 -                      ec.getOci().setOciOptions(newVM.ociOptions);
 -              }
 -
 -              // extended option
 -              if (newVM.extendedOptions != null) {
 -                      ec.getExtendedOption().addAll(newVM.extendedOptions);
 -              }
 -
 -              // advanced option
 -              if (newVM.advancedOptionList.size() > 0) {
 -                      if (ec.getAdvancedOption() == null) {
 -                              ec.setAdvancedOption(factory.createAdvancedOptionType());
 -                      } else {
 -                              ec.getAdvancedOption().getOption().clear();
 -                      }
 -                      ec.getAdvancedOption().getOption().addAll(newVM.advancedOptionList);
 -              }
 +              newVM.childImagePath = customPath;
 +              newVM.swapImagePath = swapPath;
 +              property.settingConfiguration();
        }
  
        public static VMProperty create(VMPropertyValue newVM) throws VMWorkerException {
@@@ -157,9 -154,21 +154,22 @@@ public class LaunchConfig 
                        bw.newLine();
                        String comment = null;
                        String var = null;
-                       for (OPTION_KEY optionKey : OPTION_KEY.values()) {
-                               String key = optionKey.toString();
-                               if ( (comment = varComment.get(key)) != null) {
++
+                       for (OPTION_KEY key : OPTION_KEY.values()) {
+                               if ( (comment = varComment.get(key.toString())) != null) {
+                                       bw.write(comment);
+                                       bw.newLine();
+                               }
+                               if ((var = variables.get(key.toString())) != null) {
+                                       bw.write(key.toString() + "=" + var); //$NON-NLS-1$
+                                       bw.newLine();
+                                       // delete key from variables map
+                                       variables.remove(key.toString());
+                               }
+                       }
+                       // write additional variables
+                       for (String key : variables.keySet()) {
+                               if ((comment = varComment.get(key)) != null) {
                                        bw.write(comment);
                                        bw.newLine();
                                }