menu: support skin path opening
authorGiWoong Kim <giwoong.kim@samsung.com>
Mon, 23 Nov 2015 10:53:11 +0000 (19:53 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 26 Nov 2015 06:42:20 +0000 (15:42 +0900)
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 <giwoong.kim@samsung.com>
tizen/src/ui/menu/detailedinfodialog.cpp

index 909bc56f13783e0533fe795eeb18dc15bf58b0b1..c7be28adf6eadd41640e8fbd3700bc3ebd002960 100644 (file)
@@ -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;
     }
 }