ecp-launch: launch .app file in mac os x
authorMinkee Lee <minkee.lee@samsung.com>
Mon, 12 Sep 2016 10:57:09 +0000 (19:57 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 20 Sep 2016 13:06:24 +0000 (22:06 +0900)
In mac os x, launch ecp using 'open' command like following

  # open emulator-control-panel.app --args [params ...]

Change-Id: I9dbf1246decd5ef01272cce18a8841b103e311b1
Signed-off-by: Minkee Lee <minkee.lee@samsung.com>
tizen/src/ui/menu/contextmenu.cpp

index 4d0cd4c..264847c 100644 (file)
@@ -1013,18 +1013,28 @@ void ContextMenu::slotControlPanel()
     QStringList arguments;
 
     // check for new ECP
-#ifndef CONFIG_WIN32
-    QString newCommand = QDir(QCoreApplication::applicationDirPath() +
+#if defined(CONFIG_WIN32)
+    QString ecpCommand = QDir(QCoreApplication::applicationDirPath() +
+            QDir::separator() + SDK_EMULATOR_TOOLS_BIN_PATH +
+            SDK_ECP_FILE + ".cmd").absolutePath();
+#elif defined(CONFIG_LINUX)
+    QString ecpCommand = QDir(QCoreApplication::applicationDirPath() +
             QDir::separator() + SDK_EMULATOR_TOOLS_BIN_PATH +
             SDK_ECP_FILE).absolutePath();
 #else
-    QString newCommand = QDir(QCoreApplication::applicationDirPath() +
+    QString ecpCommand = QDir(QCoreApplication::applicationDirPath() +
             QDir::separator() + SDK_EMULATOR_TOOLS_BIN_PATH +
-            SDK_ECP_FILE + ".cmd").absolutePath();
+            SDK_ECP_FILE + ".app").absolutePath();
+#endif
+    if (QFileInfo(ecpCommand).exists()) {
+#if defined(CONFIG_DARWIN)
+        // In mac os x, launch .app using "open" command
+        // ex : open emulator-control-panel.app --args vm_name=... platform_version=...
+        command = "open";
+        arguments << ecpCommand << "--args";
+#else
+        command = ecpCommand;
 #endif
-    if (QFileInfo(newCommand).exists()) {
-        command = newCommand;
-
         QString vmNameOpt = "vm_name=" + parent->getUiInfo()->getVmName();
         QString platformVersionOpt = "platform_version=" +
             QString::fromLocal8Bit(get_platform_version());