From 9d4610a7ec9a6e3cd3ca89accbe57a9409593d50 Mon Sep 17 00:00:00 2001 From: Minkee Lee Date: Mon, 12 Sep 2016 19:57:09 +0900 Subject: [PATCH] ecp-launch: launch .app file in mac os x 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 --- tizen/src/ui/menu/contextmenu.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tizen/src/ui/menu/contextmenu.cpp b/tizen/src/ui/menu/contextmenu.cpp index 4d0cd4c346..264847c4e3 100644 --- a/tizen/src/ui/menu/contextmenu.cpp +++ b/tizen/src/ui/menu/contextmenu.cpp @@ -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()); -- 2.34.1