Add download popup for bt tethering state 92/93792/1
authormin7.choi <min7.choi@samsung.com>
Wed, 26 Oct 2016 03:39:06 +0000 (12:39 +0900)
committermin7.choi <min7.choi@samsung.com>
Wed, 26 Oct 2016 03:39:06 +0000 (12:39 +0900)
Change-Id: I5269f0c42a73e81434b074dce719b806ae747ff2
Signed-off-by: min7.choi <min7.choi@samsung.com>
CMakeLists.txt
manifest.xml.in.mb
services/SimpleUI/NotificationPopup.cpp
services/SimpleUI/NotificationPopup.h
services/SimpleUI/SimpleUI.cpp

index 229bf5ad38a3cf6cf85b275071f6baf01224f79a..5537c0d502705b11f9325059165e53983cc419eb 100755 (executable)
@@ -91,6 +91,7 @@ if(TIZEN_BUILD)
         notification
         appsvc
         shortcut
+        capi-network-connection
     )
     endif (${PROFILE} MATCHES "mobile")
 
index 705120c542cbb5b8e2fc9521b28e666254eae83f..e9733642ec543bcd73ba9ebcd188335284bdbfd4 100755 (executable)
         <privilege>http://tizen.org/privilege/externalstorage</privilege>
         <privilege>http://tizen.org/privilege/externalstorage.appdata</privilege>
         <privilege>http://tizen.org/privilege/display</privilege>
+        <privilege>http://tizen.org/privilege/network.get</privilege>
      </privileges>
 </manifest>
\ No newline at end of file
index 7c216d1698bfd71117cc117c68680492f7f0c839..6dd984125c35d42980dddfa919ac4e0625cb68b4 100644 (file)
@@ -55,6 +55,14 @@ void NotificationPopup::show(const std::string& message, bool progressVisible)
     m_timer =  ecore_timer_add(DEFAULT_POPUP_INTERVAL, _hide_cb, this);
 }
 
+void NotificationPopup::show(const std::string& message, const std::string &message_add, bool progressVisible)
+{
+    BROWSER_LOGD("[%s,%d]", __func__, __LINE__);
+    m_message = message + message_add;
+    createLayout(progressVisible);
+    m_timer =  ecore_timer_add(DEFAULT_POPUP_INTERVAL, _hide_cb, this);
+}
+
 void NotificationPopup::dismiss()
 {
     BROWSER_LOGD("[%s,%d]", __func__, __LINE__);
index 570019b7c4815858fbe3a65ff14c49cae3b2e749..424bc4f9be68c047d2432f3c08a2d58c1b36dd5b 100644 (file)
@@ -32,6 +32,7 @@ public:
     NotificationPopup();
     static NotificationPopup *createNotificationPopup(Evas_Object *parent);
     void show(const std::string &message, bool progressVisible = true);
+    void show(const std::string &message, const std::string &message_add, bool progressVisible = true);
     void dismiss();
     static Eina_Bool _hide_cb(void *data);
 
index 99384cd40738d7310d3847de492b1621671498d4..f12e4bb1d88c7ce1287e7228e5805800424dfa2d 100755 (executable)
@@ -53,6 +53,7 @@
 #include "Tools/GeneralTools.h"
 #include "Tools/SnapshotType.h"
 #include "SettingsPrettySignalConnector.h"
+#include "net_connection.h"
 
 namespace tizen_browser{
 namespace base_ui{
@@ -1408,7 +1409,29 @@ void SimpleUI::downloadStarted(int status)
             popup->show(_("IDS_BR_HEADER_UNABLE_TO_DOWNLOAD_ABB"), false);
             break;
         case DOWNLOAD_STARTING_DOWNLOAD:
-            popup->show(_("IDS_BR_POP_STARTING_DOWNLOAD_ING"), false);
+               connection_type_e connection_type;
+               connection_h handle;
+
+               if (connection_create(&handle) < 0) {
+                       BROWSER_LOGD("Fail to create network handle");
+               }
+               if (connection_get_type(handle, &connection_type) < 0) {
+                       BROWSER_LOGD("Fail to get download type");
+                       if (connection_destroy(handle) < 0) {
+                               BROWSER_LOGD("Fail to get download type");
+                       }
+               }
+
+               if (connection_type == CONNECTION_TYPE_BT){
+                popup->show(_("IDS_BR_POP_STARTING_DOWNLOAD_ING"), _("Unable to use tethering."), false);
+               }
+               else{
+                       popup->show(_("IDS_BR_POP_STARTING_DOWNLOAD_ING"), false);
+               }
+
+               if (connection_destroy(handle) < 0) {
+                       BROWSER_LOGD("Fail to destroy network handle");
+               }
             break;
         case DOWNLOAD_SAVEDPAGES:
             popup->show(_("IDS_BR_OPT_SAVEDPAGES"), false);