Handle 'mouse-event' attribute differently according to configuration of web-provider...
authorYunchan Cho <yunchan.cho@samsung.com>
Mon, 22 Apr 2013 05:26:03 +0000 (14:26 +0900)
committerYunchan Cho <yunchan.cho@samsung.com>
Mon, 22 Apr 2013 07:44:43 +0000 (16:44 +0900)
[Issue#] N/A
[Problem] For general appwidgets, value of 'mouse-event' isn't unconditionally indicated as false to its webapp's manifest(xml)
[Cause] wrt-installer didn't distinguish general appwidgets and commericalized appwidgets.
[Solution] For only commercialized appwidget, wrt-installer adds value of 'mouse-event' as 'true' to its manifest(xml),
           if value of 'mouse-event' is 'true' on its webapp's config.xml.
[SCMRequest] First, livebox.web-provider-1.10 must be merged to obs server.

Change-Id: Ia1d50746eb1245ee4c279eb68132a69a758e6fb2

src/jobs/widget_install/task_database.cpp
src/jobs/widget_install/task_manifest_file.cpp

index 329b618..bf49632 100644 (file)
@@ -323,10 +323,19 @@ void TaskDatabase::StepLiveboxDBInsert()
         } else {
             autoLaunch = 0;
         }
+        LogInfo("livebox auto-launch: " << autoLaunch);
+
+        int mouseEvent;
+        if ((**it).m_boxInfo.m_boxMouseEvent == L"true") {
+            mouseEvent = 1;
+        } else {
+            mouseEvent = 0;
+        }
+        LogInfo("livebox mouse-event: " << mouseEvent);
 
         int ret =
             web_provider_livebox_insert_box_info(
-                boxId.c_str(), tizenId.c_str(), boxType.c_str(), autoLaunch);
+                boxId.c_str(), tizenId.c_str(), boxType.c_str(), autoLaunch, mouseEvent);
 
         if (ret < 0) {
             LogDebug("failed to set type of livebox: " << boxId);
index 0abe0f1..18ddf7e 100644 (file)
@@ -33,6 +33,8 @@
 #include <widget_install/job_widget_install.h>
 #include <widget_install/widget_install_errors.h>
 #include <widget_install/widget_install_context.h>
+#include <web_provider_livebox_info.h>
+#include <web_provider_plugin_info.h>
 #include <dpl/wrt-dao-ro/global_config.h>
 #include <dpl/log/log.h>
 #include <dpl/file_input.h>
@@ -1024,13 +1026,28 @@ void TaskManifestFile::setLiveBoxInfo(Manifest& manifest)
             }
 
             if (ConfigInfo->m_boxInfo.m_boxMouseEvent == L"true") {
-                box.boxMouseEvent = ConfigInfo->m_boxInfo.m_boxMouseEvent;
+                std::string boxType;
+                if (ConfigInfo->m_type == L"") {
+                    // in case of default livebox
+                    boxType = web_provider_livebox_get_default_type();
+                } else {
+                    boxType = DPL::ToUTF8String(ConfigInfo->m_type);
+                }
+
+                int box_scrollable =
+                    web_provider_plugin_get_box_scrollable(boxType.c_str());
+
+                if (box_scrollable) {
+                    box.boxMouseEvent = L"true";
+                } else {
+                    box.boxMouseEvent = L"false";
+                }
             } else {
                 box.boxMouseEvent = L"false";
             }
 
             if (ConfigInfo->m_boxInfo.m_boxTouchEffect == L"true") {
-                box.boxTouchEffect = ConfigInfo->m_boxInfo.m_boxTouchEffect;
+                box.boxTouchEffect = L"true";
             } else {
                 box.boxTouchEffect= L"false";
             }