diff options
Diffstat (limited to 'tizen/src/ui/menu/contextmenu.cpp')
-rw-r--r-- | tizen/src/ui/menu/contextmenu.cpp | 81 |
1 files changed, 31 insertions, 50 deletions
diff --git a/tizen/src/ui/menu/contextmenu.cpp b/tizen/src/ui/menu/contextmenu.cpp index cf60abdc21..0c0c348f9d 100644 --- a/tizen/src/ui/menu/contextmenu.cpp +++ b/tizen/src/ui/menu/contextmenu.cpp @@ -925,12 +925,12 @@ void ContextMenu::slotShell() QFileInfo sdbFileInfo(sdbPath); if (sdbFileInfo.exists() == false) { - showMsgBox(QMessageBox::Warning, MSG_SDB_NOT_EXIST + sdbPath); + parent->showMsgBox(QMessageBox::Warning, MSG_SDB_NOT_EXIST + sdbPath); return; } if (!is_sdb_daemon_initialized()) { - showMsgBox(QMessageBox::Warning, MSG_SDB_NOT_READY); + parent->showMsgBox(QMessageBox::Warning, MSG_SDB_NOT_READY); return; } @@ -941,21 +941,19 @@ void ContextMenu::slotShell() void ContextMenu::launchControlPanel(QString& command, QStringList& arguments) { - QString httpProxyAddr; - QString httpProxyPort; - const char *http_proxy_addr = get_http_proxy_addr(); - if (http_proxy_addr) { - char **proxy = g_strsplit(http_proxy_addr, ":", 2); + const char *https_proxy_addr = get_https_proxy_addr(); + if (https_proxy_addr) { + char **proxy = g_strsplit(https_proxy_addr, ":", 2); if (proxy[0] && proxy[1]) { - httpProxyAddr = "-Dhttp.proxyHost=" + QString(proxy[0]); - httpProxyPort = "-Dhttp.proxyPort=" + QString(proxy[1]); + QString httpsProxyAddr = "-Dhttps.proxyHost=" + QString(proxy[0]); + QString httpsProxyPort = "-Dhttps.proxyPort=" + QString(proxy[1]); + if (httpsProxyAddr != NULL && httpsProxyPort != NULL) { + arguments << httpsProxyAddr << httpsProxyPort; + } } g_strfreev(proxy); } - if (httpProxyAddr != NULL && httpProxyPort != NULL) { - arguments << httpProxyAddr << httpProxyPort; - } QString loggingCommand = QString("launching ecp: \"" + command + "\""); @@ -973,7 +971,7 @@ void ContextMenu::launchControlPanel(QString& command, try { QProcess::startDetached(command, arguments, workingDir); } catch (QString &error) { - showMsgBox(QMessageBox::Warning, MSG_INVALID_ECP_OPEN + error); + parent->showMsgBox(QMessageBox::Warning, MSG_INVALID_ECP_OPEN + error); return; } #else @@ -999,7 +997,7 @@ void ContextMenu::launchControlPanel(QString& command, QString error = QString::number(GetLastError()); qWarning() << qPrintable(QString("error occured during launching \ ECP: ") + error); - showMsgBox(QMessageBox::Warning, MSG_INVALID_ECP_OPEN + error); + parent->showMsgBox(QMessageBox::Warning, MSG_INVALID_ECP_OPEN + error); } CloseHandle(pinfo.hThread); @@ -1015,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()); @@ -1061,7 +1069,7 @@ void ContextMenu::slotControlPanel() command = QString::fromLocal8Bit(path); } else { // can not enter here... - showMsgBox(QMessageBox::Warning, MSG_INVALID_JAVA_PATH); + parent->showMsgBox(QMessageBox::Warning, MSG_INVALID_JAVA_PATH); return; } @@ -1088,7 +1096,7 @@ void ContextMenu::slotControlPanel() } // we can not launch ControlPanel - showMsgBox(QMessageBox::Warning, MSG_ECP_NOT_EXIST); + parent->showMsgBox(QMessageBox::Warning, MSG_ECP_NOT_EXIST); return; } @@ -1204,37 +1212,10 @@ QSignalMapper *ContextMenu::getControllerMapper() return controllerMapper; } -QMessageBox *ContextMenu::showMsgBox( - QMessageBox::Icon iconType, const QString &text, - QMessageBox::StandardButtons buttons, - QMessageBox::StandardButton defaultButton) -{ - qWarning() << text; - - QMessageBox *msgBox = new QMessageBox(iconType, - EMULATOR_TITLE, text, buttons, parent); - if (defaultButton != QMessageBox::NoButton) { - msgBox->setDefaultButton(defaultButton); - } - msgBox->setAttribute(Qt::WA_DeleteOnClose); - msgBox->show(); /* non-blocking */ - -#ifdef CONFIG_LINUX - slotOnTop(parent->getUiState()->isOnTop()); -#endif - - return msgBox; -} - ContextMenu::~ContextMenu() { qDebug("destroy menu"); - if (infoDialog) { - delete infoDialog; - infoDialog = NULL; - } - delete sdbHelper; longPressTimer->stop(); |