From: GiWoong Kim Date: Mon, 23 Nov 2015 10:53:11 +0000 (+0900) Subject: menu: support skin path opening X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~149 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=180786d39e0051f3dac1a71638b2eefd3b749ad6;p=sdk%2Femulator%2Fqemu.git menu: support skin path opening At Detailed Info dialog, Emulator opens skin path in the appropriate browser for user's desktop environment if the Skin Name item is double- clicked. Change-Id: Ia4c43b1571831874e80a97fd31bd15407d261022 Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/ui/menu/detailedinfodialog.cpp b/tizen/src/ui/menu/detailedinfodialog.cpp index 909bc56f13..c7be28adf6 100644 --- a/tizen/src/ui/menu/detailedinfodialog.cpp +++ b/tizen/src/ui/menu/detailedinfodialog.cpp @@ -385,36 +385,61 @@ void DetailedInfoDialog::slotCellOpen(int nRow, int nCol) QTableWidgetItem *item = vmInfoTable->item(nRow, 0); qDebug() << item->text() << "item was double clicked"; + QString path = ""; + if (item->text().compare(DETAILED_INFO_HDS_PATH) == 0 || item->text().compare(DETAILED_INFO_EMUL_LOG_FILE) == 0 || item->text().compare(DETAILED_INFO_KERNEL_LOG_FILE) == 0 || item->text().compare(DETAILED_INFO_DRIVE_IMAGE_FILE) == 0 || item->text().compare(DETAILED_INFO_SWAP_IMAGE_FILE) == 0 || item->text().compare(DETAILED_INFO_KERNEL_FILE) == 0) { + qDebug("open the specified path"); + /* get path item */ item = vmInfoTable->item(nRow, nCol); if (item->text().compare(GENERIC_TEXT_NONE) == 0 || item->text().isEmpty() == true) { /* ignore this event */ + qWarning("specified path is empty"); + return; + } + + path = item->text(); + } else if (item->text().compare(DETAILED_INFO_SKIN_NAME) == 0) { + qDebug("open the skin path"); + + /* skin name item */ + if (win->getUiInfo()->getSkinPath().isEmpty() == true) { + /* ignore this event */ + qWarning("specified skin path is empty"); return; } + + path = win->getUiInfo()->getSkinPath(); } else { /* ignore this event */ + qDebug("do nothing"); return; } - QFileInfo pathInfo(item->text()); + QFileInfo pathInfo(path); if (pathInfo.isDir() == true) { /* directory path */ - QDesktopServices::openUrl( - QUrl("file:///" + item->text(), QUrl::TolerantMode)); + if (QDesktopServices::openUrl( + QUrl("file:///" + path, QUrl::TolerantMode)) == false) { + qWarning() << "cannot open the path:" + path; + return; + } } else if (pathInfo.isFile() == true) { /* file path */ - QDesktopServices::openUrl( - QUrl("file:///" + pathInfo.absolutePath(), QUrl::TolerantMode)); + if (QDesktopServices::openUrl( + QUrl("file:///" + pathInfo.absolutePath(), QUrl::TolerantMode)) == false) { + qWarning() << "cannot open the file:" + pathInfo.absolutePath(); + return; + } } else { - qWarning() << "invalid path info:" << item->text(); + qWarning() << "invalid path info:" << path; } }