summaryrefslogtreecommitdiff
path: root/tizen/src/ui/menu
diff options
context:
space:
mode:
authorSeokYeon Hwang <syeon.hwang@samsung.com>2016-08-10 13:56:18 +0900
committerJinhyung Jo <jinhyung.jo@samsung.com>2016-08-10 16:31:44 +0900
commitdcb16492ef980edabe5c40493b56b057d94d5b07 (patch)
tree3d8c9b89bb800a7d6a405e88923a1ec0a0095f96 /tizen/src/ui/menu
parent736940f9a0ba4b900256e610c327962558a707af (diff)
downloadqemu-dcb16492ef980edabe5c40493b56b057d94d5b07.tar.gz
qemu-dcb16492ef980edabe5c40493b56b057d94d5b07.tar.bz2
qemu-dcb16492ef980edabe5c40493b56b057d94d5b07.zip
ecp: fix some issues during launching ECP
Hide new allocated console and enhance error reporting. Change-Id: Ife12cae1199baaf8bdb584490574562555d3df64 Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
Diffstat (limited to 'tizen/src/ui/menu')
-rw-r--r--tizen/src/ui/menu/contextmenu.cpp59
1 files changed, 31 insertions, 28 deletions
diff --git a/tizen/src/ui/menu/contextmenu.cpp b/tizen/src/ui/menu/contextmenu.cpp
index 38cf505eca..cf60abdc21 100644
--- a/tizen/src/ui/menu/contextmenu.cpp
+++ b/tizen/src/ui/menu/contextmenu.cpp
@@ -957,9 +957,7 @@ void ContextMenu::launchControlPanel(QString& command,
arguments << httpProxyAddr << httpProxyPort;
}
- QString loggingCommand = QString("staring ecp: ");
- command = QString("\"" + command + "\"");
- loggingCommand += command;
+ QString loggingCommand = QString("launching ecp: \"" + command + "\"");
QStringList wrapArguments;
for (int i = 0; i < arguments.size(); ++i) {
@@ -971,37 +969,42 @@ void ContextMenu::launchControlPanel(QString& command,
qInfo() << qPrintable(loggingCommand);
QString workingDir = QFileInfo(command).canonicalPath();
- try {
#ifndef CONFIG_WIN32
+ try {
QProcess::startDetached(command, arguments, workingDir);
-#else
- QString args = QString("\"" + command +"\"");
- for (int i = 0; i < arguments.size(); ++i) {
- args += " \"" + arguments.at(i) + "\"";
- }
- bool success = false;
-
- PROCESS_INFORMATION pinfo;
-
- STARTUPINFOW startupInfo = { sizeof( STARTUPINFO ), 0, 0, 0,
- (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT,
- (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
- success = CreateProcessW(0, (wchar_t*)args.utf16(),
- 0, 0, FALSE, CREATE_UNICODE_ENVIRONMENT | CREATE_NEW_CONSOLE, 0,
- workingDir.isEmpty() ? 0 : (wchar_t*)workingDir.utf16(),
- &startupInfo, &pinfo);
-
- if (success) {
- CloseHandle(pinfo.hThread);
- CloseHandle(pinfo.hProcess);
- }
-#endif
} catch (QString &error) {
showMsgBox(QMessageBox::Warning, MSG_INVALID_ECP_OPEN + error);
return;
}
+#else
+ QString winArguments = QString("\"" + command +"\"");
+ for (int i = 0; i < arguments.size(); ++i) {
+ winArguments += " \"" + arguments.at(i) + "\"";
+ }
+
+ PROCESS_INFORMATION pinfo;
+
+ STARTUPINFOW startupInfo = { sizeof(STARTUPINFO), 0, 0, 0,
+ (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT,
+ (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT,
+ 0, 0, 0, STARTF_USESHOWWINDOW, SW_HIDE, 0, 0, 0, 0, 0
+ };
+ bool success = CreateProcessW(0, (LPWSTR)winArguments.utf16(),
+ 0, 0, FALSE, CREATE_UNICODE_ENVIRONMENT | CREATE_NEW_CONSOLE, 0,
+ workingDir.isEmpty() ? 0 : (LPCWSTR)workingDir.utf16(),
+ &startupInfo, &pinfo);
+
+
+ if (!success) {
+ QString error = QString::number(GetLastError());
+ qWarning() << qPrintable(QString("error occured during launching \
+ ECP: ") + error);
+ showMsgBox(QMessageBox::Warning, MSG_INVALID_ECP_OPEN + error);
+ }
+
+ CloseHandle(pinfo.hThread);
+ CloseHandle(pinfo.hProcess);
+#endif
}
void ContextMenu::slotControlPanel()