TizenRefApp-9000 "Can't view this type of file on Gear" popup missing 81/142781/1 submit/tizen/20170808.104656
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Mon, 7 Aug 2017 08:26:07 +0000 (11:26 +0300)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Mon, 7 Aug 2017 08:26:07 +0000 (11:26 +0300)
Change-Id: I04406ccafe19a6a95ffda3b5c19faacc01ec152b
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
src/Conversation/Controller/inc/ConvListItem.h
src/Conversation/Controller/src/ConvListItem.cpp

index 9b0b22b87513279ad13b662eb2003520a2a4a4ca..da5c3e02834f966403c2e585324e6d2653b89b41 100644 (file)
@@ -62,6 +62,7 @@ namespace Msg {
                        void updateViewStatus();
                        void prepareContent(const MsgConversationItem &item);
                        void launchImageViewer(const BubbleImageEntity &image);
+                       bool launchViewer(const std::list<std::string> &fileList, unsigned index = 0);
 
                        // Popups:
                        void showMobileDataOffPopup();
index 7c513db3be5e603c9b9110e0867a7c391ab9dc13..a8ece54823ab2c9de02c71a84148fa5101d6396d 100644 (file)
@@ -152,6 +152,14 @@ void ConvListItem::prepareContent(const MsgConversationItem &item)
        m_BubbleEntityList = m_BubbleEntityFactory.create(item);
 }
 
+bool ConvListItem::launchViewer(const std::list<std::string> &fileList, unsigned index)
+{
+       bool res = m_FileViewer.launchWithCopy(fileList, index);
+       if (!res)
+               ToastPopup::toast("Can't view this type of file on Gear"); // TODO: localization
+       return res;
+}
+
 void ConvListItem::launchImageViewer(const BubbleImageEntity &image)
 {
        std::list<std::string> allFiles;
@@ -168,7 +176,7 @@ void ConvListItem::launchImageViewer(const BubbleImageEntity &image)
                        }
                }
        }
-       m_FileViewer.launchWithCopy(allFiles, index);
+       launchViewer(allFiles, index);
 }
 
 void ConvListItem::onCancelButtonClicked(Popup &popup)
@@ -226,7 +234,7 @@ void ConvListItem::onAction(BubbleViewItem &item)
                        std::string filePath = item.getEntity().getFilePath();
                        if (!filePath.empty()) {
                                setActionEventFlag();
-                               m_FileViewer.launchWithCopy({filePath});
+                               launchViewer({filePath});
                        }
                }
        }