Update wrt-setting_0.0.10 2.0alpha master 2.0_alpha submit/master/20120920.150956
authorjihoon.chung <jihoon.chung@samsung.com>
Wed, 22 Aug 2012 14:39:18 +0000 (23:39 +0900)
committerjihoon.chung <jihoon.chung@samsung.com>
Wed, 22 Aug 2012 14:39:18 +0000 (23:39 +0900)
16 files changed:
debian/changelog
debian/control
packaging/wrt-setting.spec
webapp-common/CMakeLists.txt [changed mode: 0644->0755]
webapp-common/icons/WebApplication.png [new file with mode: 0755]
webapp-common/listview.cpp [changed mode: 0644->0755]
webapp-common/mainview.cpp [changed mode: 0644->0755]
webapp-common/mainview.h [changed mode: 0644->0755]
webapp-common/ug.cpp [changed mode: 0644->0755]
webapp-detail/CMakeLists.txt [changed mode: 0644->0755]
webapp-detail/detailview.cpp [changed mode: 0644->0755]
webapp-detail/detailview.h [changed mode: 0644->0755]
webapp-detail/mainview.cpp
webapp-detail/mainview.h
webapp-detail/permview.cpp
webapp-detail/ug.cpp [changed mode: 0644->0755]

index 5edd5a8..447cb8a 100644 (file)
@@ -1,8 +1,96 @@
+wrt-setting (0.0.10) unstable; urgency=low
+
+  * genlist style set for webapplication list menu
+
+  * Git : slp/pkgs/w/wrt-setting
+  * Tag : wrt-setting_0.0.10
+
+ -- Leerang Song <leerang.song@samsung.com>  Tue, 07 Aug 2012 17:34:00 +0900
+
+wrt-setting (0.0.9) unstable; urgency=low
+
+  * All the things related with webkit1 is deleted
+  * As UI-GADGET-1 Change, API getting pkgname change from bundle_get_val
+  * it enalbes cookie sharing menu
+
+  * Git : slp/pkgs/w/wrt-setting
+  * Tag : wrt-setting_0.0.9
+
+ -- Leerang.song  <leerang.song@samsung.com>  Mon, 06 Aug 2012 15:32:28 +0900
+
+wrt-setting (0.0.8) unstable; urgency=low
+
+  * API related UG change to Managed API
+
+  * Git : slp/pkgs/w/wrt-setting
+  * Tag : wrt-setting_0.0.8
+
+ -- Leerang Song <leerang.song@samsung.com>  Wed, 18 Jul 2012 19:20:30 +0900
+
+wrt-setting (0.0.7) unstable; urgency=low
+
+  * Compiler flags change instead of LDFLAGS
+
+  * Git : slp/pkgs/w/wrt-setting
+  * Tag : wrt-setting_0.0.7
+
+ -- Leerang Song <leerang.song@samsung.com>  Wed, 18 Jul 2012 09:42:20 +0900
+
+wrt-setting (0.0.6) unstable; urgency=low
+
+  * add linker option for deleting Debug & Symbol information
+
+  * Git : slp/pkgs/w/wrt-setting
+  * Tag : wrt-setting_0.0.6
+
+ -- Leerang Song <leerang.song@samsung.com>  Mon, 16 Jul 2012 16:58:59 +0900
+
+wrt-setting (0.0.5) unstable; urgency=low
+
+  * Fixed build error in OBS
+  * adding menu for Save login ID/PWD & clear data in detail setting UG
+  * Boilerplate is updated
+  * Remove WK1
+
+  * Git : slp/pkgs/w/wrt-setting
+  * Tag : wrt-setting_0.0.5
+
+ -- Jihoon Chung <jihoon.chung@samsung.com>  Tue, 19 Jun 2012 09:58:53 +0900
+
+wrt-setting (0.0.4) unstable; urgency=low
+
+  * Boilerplate is updated
+  * Added a license information item into More details
+  * add Web Application menu
+
+  * Git : slp/pkgs/w/wrt-setting
+  * Tag : wrt-setting_0.0.4
+
+ -- Jihoon Chung <jihoon.chung@samsung.com>  Thu, 24 May 2012 18:47:01 +0900
+
+wrt-setting (0.0.3) unstable; urgency=low
+
+  * fix build error relating with APP_TYPE_WAC10
+
+  * Git : slp/pkgs/w/wrt-setting
+  * Tag : wrt-setting_0.0.3
+
+ -- kyungeun <lke01.lee@samsung.com>  Fri, 04 May 2012 14:13:26 +0900
+
+wrt-setting (0.0.2) unstable; urgency=low
+
+  * add menu for changing webkitmode
+
+  * Git : slp/pkgs/w/wrt-setting
+  * Tag : wrt-setting_0.0.2
+
+ -- Jihoon Chung <jihoon.chung@samsung.com>  Thu, 26 Apr 2012 23:05:32 +0900
+
 wrt-setting (0.0.1) unstable; urgency=low
 
   * Initial draft
 
-  * Git : pkgs/w/wrt-setting
-  * Tag : wrt_setting_0.0.1
+  * Git : slp/pkgs/w/wrt-setting
+  * Tag : wrt-setting_0.0.1
 
  -- Wonguk Jeong <wonguk.jeong@samsung.com>  Fri, 16 Mar 2012 14:27:00 +0900
index 821b8dc..bbf9912 100644 (file)
@@ -2,7 +2,7 @@ Source: wrt-setting
 Section: devel
 Priority: extra
 Maintainer: Kyungeun Lee <lke01.lee@samsung.com>, Wonguk Jeong <wonguk.jeong@samsung.com>
-Build-Depends: debhelper (>= 5), libelm-dev, libecore-dev, libeina-dev, libui-gadget-dev, wrt-commons-dev (>= 0.2.25), wrt-security-dev (>=0.0.16)
+Build-Depends: debhelper (>= 5), libelm-dev, libelm-webview-dev, libecore-dev, libeina-dev, libui-gadget-dev, wrt-commons-dev (>= 0.2.25), wrt-security-dev (>=0.0.16)
 Standards-Version: 3.9.2
 
 Package: wrt-setting
index fe3dbef..edce92e 100644 (file)
@@ -1,5 +1,5 @@
 Name: wrt-setting
-Version: 0.0.1
+Version: 0.0.10
 Release: 1
 Summary: WRT Setting UI Gadgets
 Group:   Development/Libraries
@@ -10,7 +10,7 @@ BuildRequires: edje-bin
 BuildRequires: cmake
 BuildRequires: pkgconfig(elementary)
 BuildRequires: pkgconfig(ecore)
-BuildRequires: pkgconfig(ui-gadget)
+BuildRequires: pkgconfig(ui-gadget-1)
 BuildRequires: pkgconfig(dpl-wrt-dao-ro)
 BuildRequires: pkgconfig(dpl-wrt-dao-rw)
 BuildRequires: pkgconfig(ace)
old mode 100644 (file)
new mode 100755 (executable)
index 839f46d..8c00be9
@@ -23,7 +23,7 @@ SET(EDJDIR "${UG_INSTALL_PREFIX}/ug/res/edje/${TARGET_UG_LIB}")
 PKG_CHECK_MODULES(UG_WEB_APP_COMMON_DEPS
     ecore
     elementary
-    ui-gadget
+    ui-gadget-1
     dpl-efl
     dpl-wrt-dao-rw
     dpl-wrt-dao-ro
diff --git a/webapp-common/icons/WebApplication.png b/webapp-common/icons/WebApplication.png
new file mode 100755 (executable)
index 0000000..ca51b7b
Binary files /dev/null and b/webapp-common/icons/WebApplication.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 1f23bd7..daaa02e
 #include "listview.h"
 #include "icons.h"
 
+
+#define LOG_TAG "WRT-SETTING"
+#include <dlog.h>
+
 namespace WebAppCommonSetting {
 
 char *ListView::getWacTitle(void */*data*/,
@@ -78,7 +82,7 @@ Evas_Object *ListView::getOnOffIcon(void *data,
     chk = elm_check_add(obj);
     if (!chk)
         return NULL;
-    evas_object_propagate_events_set(chk, EINA_FALSE);
+    evas_object_propagate_events_set(chk, EINA_TRUE);
     elm_object_style_set(chk, "on&off");
     val = onOffData->m_getOnOffVal();
     elm_check_state_set(chk, static_cast<Eina_Bool>(val));
@@ -363,7 +367,8 @@ void ListView::onCookieSharingPopupOk(void *data,
     listView = onOffData->m_listView;
     Assert(onOffData && listView);
 
-    /* TODO: Cookie Sharing On */
+    WrtDB::GlobalDAO::SetCookieSharingMode(TRUE);
+
     elm_check_state_set(onOffData->m_chk, EINA_TRUE);
     listView->hidePopup();
 }
@@ -379,6 +384,7 @@ void ListView::onCookieSharingPopupCancel(void *data,
     listView = onOffData->m_listView;
     Assert(onOffData && listView);
 
+    WrtDB::GlobalDAO::SetCookieSharingMode(FALSE);
     elm_check_state_set(onOffData->m_chk, EINA_FALSE);
     listView->hidePopup();
 }
@@ -395,10 +401,7 @@ void ListView::onCookieSharingChanged(void *data,
     listView = onOffData->m_listView;
     Assert(onOffData && onOffData->m_chk && listView);
 
-    /* TODO: get cookie sharing val
-    state = 
-    */
-    state = true;
+    state = elm_check_state_get(onOffData->m_chk);
 
     if (!state) {
         if (!listView->showPopup("Do you really want to share cookies "
@@ -408,9 +411,9 @@ void ListView::onCookieSharingChanged(void *data,
                                   static_cast<void *>(onOffData)))
             return;
     } else {
-        /* TODO: cookie sharing off */
+       WrtDB::GlobalDAO::SetCookieSharingMode(FALSE);
+       elm_check_state_set(onOffData->m_chk, FALSE);
     }
-    elm_check_state_set(onOffData->m_chk, !state);
 }
 
 void ListView::onUntrustedAppApprovalPopupOk(void *data,
@@ -668,8 +671,8 @@ void ListView::onWhiteListViewUnload(void *data)
 
 bool ListView::getCookieSharingVal(void)
 {
-    /* TODO: get Cookie Sharing*/
-    return false;
+   LOGD("%s",  __FUNCTION__);
+   return WrtDB::GlobalDAOReadOnly::GetCookieSharingMode();
 }
 
 bool ListView::getUntrustedAppApprovalVal(void)
@@ -919,6 +922,7 @@ bool ListView::loadView(void)
         evas_object_del(conform);
         return false;
     }
+    elm_object_style_set(gl, "dialogue");
     elm_object_content_set(conform, gl);
     resetBase(conform);
 
@@ -927,6 +931,10 @@ bool ListView::loadView(void)
                  "Share cookies between web apps",
                  getCookieSharingVal,
                  onCookieSharingChanged);
+
+//These menus are currently being discussed.
+//so later to be merged
+#if 0
     addOnOffItem(gl,
                  "Untrusted applications",
                  "Allow untrusted applications",
@@ -941,6 +949,7 @@ bool ListView::loadView(void)
                  getDevModeVal,
                  onDevModeChanged);
     addComplianceModeItem(gl);
+#endif
     pushToNaviFrame();
 
     return true;
old mode 100644 (file)
new mode 100755 (executable)
index 3c8b30a..2e0cbde
@@ -98,7 +98,7 @@ del_ly:
     return false;
 }
 
-MainView::MainView(struct ui_gadget *ug) :
+MainView::MainView(ui_gadget_h ug) :
     m_ug(ug)
 {
     Assert(ug);
old mode 100644 (file)
new mode 100755 (executable)
index 8cfad16..2ead090
@@ -29,18 +29,18 @@ namespace WebAppCommonSetting {
 
 class MainView : public View
 {
-    struct ui_gadget *m_ug;
+    ui_gadget_h m_ug;
     DPL::ScopedPtr<ListView> m_list;
 
     static void onListViewUnload(void *data);
     Evas_Object *createContent(Evas_Object *parent);
 
   public:
-    MainView(struct ui_gadget *ug);
+    MainView(ui_gadget_h ug);
     ~MainView(void);
 
     bool loadView(void);
-    struct ui_gadget *getUG(void) { return m_ug; }
+    ui_gadget_h getUG(void) { return m_ug; }
 };
 
 } /* WebAppCommonSetting */
old mode 100644 (file)
new mode 100755 (executable)
index fec2f25..a4d5d28
@@ -31,9 +31,9 @@ struct priv {
     WebAppCommonSetting::MainView *mainView;
 };
 
-static void *onCreate(struct ui_gadget *ug,
+static void *onCreate(ui_gadget_h ug,
                       enum ug_mode /*mode*/,
-                      bundle */*data*/,
+                      service_h /*service*/,
                       void *user_data)
 {
     struct priv *priv;
@@ -51,8 +51,8 @@ static void *onCreate(struct ui_gadget *ug,
     }
 }
 
-static void onDestroy(struct ui_gadget */*ug*/,
-                      bundle */*data*/,
+static void onDestroy(ui_gadget_h /*ug*/,
+                      service_h /*service*/,
                       void *user_data)
 {
     struct priv *priv;
old mode 100644 (file)
new mode 100755 (executable)
index ea35217..f807a72
@@ -18,16 +18,25 @@ SET(TARGET_UG_LIB "ug-webapp-detail-efl")
 SET(TARGET_UG_EDJ "web-app.edj")
 SET(UGDIR "${UG_INSTALL_PREFIX}/ug/lib")
 SET(EDJDIR "${UG_INSTALL_PREFIX}/ug/res/edje/${TARGET_UG_LIB}")
-SET(CMAKE_CXX_FLAGS "-std=c++0x")
+
+# Compiler flags
+SET(CMAKE_BUILD_TYPE           "Release")
+SET(CMAKE_C_FLAGS_PROFILING    "-O0 -g -pg")
+SET(CMAKE_CXX_FLAGS_PROFILING  "-O0 -std=c++0x -g -pg")
+SET(CMAKE_C_FLAGS_DEBUG        "-O0 -g")
+SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -std=c++0x -g")
+SET(CMAKE_C_FLAGS_RELEASE      "-O2 -g")
+SET(CMAKE_CXX_FLAGS_RELEASE    "-O2 -std=c++0x -g")
 
 PKG_CHECK_MODULES(UG_WEB_APP_DETAIL_DEPS
     ecore
     elementary
-    ui-gadget
+    ui-gadget-1
     dpl-efl
     ace
     ace-dao-rw
     dpl-wrt-dao-rw
+    dpl-utils-efl
     REQUIRED)
 
 SET(UG_SOURCES
old mode 100644 (file)
new mode 100755 (executable)
index cbc437b..0d2c3dd
   * limitations under the License.
   */
 
+#include <sstream>
 #include <Elementary.h>
 
 #include <dpl/wrt-dao-rw/widget_dao.h>
 #include <dpl/foreach.h>
 #include <dpl/assert.h>
+#include <dpl/utils/wrt_global_settings.h>
+
+#include <ui-gadget.h>
 
 #include "detailview.h"
 #include "util.h"
 
 namespace WebAppDetailSetting {
+namespace {
+const int MAX_PATH_LENGTH  = 255;
+const int ERROR_READ_LINK = -1;
+// need to move widget_config.h
+const char* const WRT_LAUNCHER = "wrt-launcher";
+const char* const WRT_LAUNCHER_WK_MODE_CHANGE_OPTION = "-w";
+}
 
 void DetailView::getLocalizedInfo(void)
 {
@@ -168,6 +179,379 @@ void DetailView::addAuthorInfo(void)
                 DPL::ToUTF8String((*homepage)).c_str());
 }
 
+void DetailView::addSaveLoginInfo()
+{
+    Assert(m_bx);
+
+    Evas_Object *ly = elm_layout_add(m_bx);
+    if (!ly)
+        return;
+    elm_layout_theme_set(ly, "layout", "dialogue", "1text.1icon");
+    evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, 0.0);
+    evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, 0.0);
+    elm_object_part_text_set(ly, "elm.text", "Auto save ID/password");
+
+    check_login = elm_check_add(ly);
+    if (!check_login) {
+        evas_object_del(ly);
+        return;
+    }
+
+    elm_object_style_set(check_login, "on&off");
+    evas_object_propagate_events_set(check_login, EINA_FALSE);
+    elm_object_part_content_set(ly, "elm.icon", check_login);
+
+    evas_object_event_callback_add(ly,
+            EVAS_CALLBACK_MOUSE_DOWN,
+            _mouse_down,
+            NULL);
+    evas_object_event_callback_add(ly,
+            EVAS_CALLBACK_MOUSE_MOVE,
+            _mouse_move,
+            NULL);
+    evas_object_event_callback_add(ly,
+            EVAS_CALLBACK_MOUSE_UP,
+            _mouse_up_save_login_info,
+            this);
+
+    evas_object_show(ly);
+    elm_box_pack_end(m_bx, ly);
+}
+
+void DetailView::addClearData()
+{
+    Assert(m_bx);
+
+    Evas_Object *ly = elm_layout_add(m_bx);
+    if (!ly)
+        return;
+    elm_layout_theme_set(ly, "layout", "dialogue", "1text");
+    elm_object_text_set(ly, "Clear Data");
+    evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+    evas_object_event_callback_add(ly,
+            EVAS_CALLBACK_MOUSE_DOWN,
+            _mouse_down,
+            NULL);
+    evas_object_event_callback_add(ly,
+            EVAS_CALLBACK_MOUSE_MOVE,
+            _mouse_move,
+            NULL);
+    evas_object_event_callback_add(ly,
+            EVAS_CALLBACK_MOUSE_UP,
+            _mouse_up_clear_data,
+            this);
+
+    evas_object_show(ly);
+    elm_box_pack_end(m_bx, ly);
+
+}
+
+void DetailView::addSeperator()
+{
+    Evas_Object *ly;
+
+    Assert(m_bx);
+
+    ly = elm_layout_add(m_bx);
+    if (!ly)
+        return;
+    elm_layout_theme_set(ly, "layout", "dialogue", "separator/hd33/with_line");
+
+    evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, 0.0);
+    evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, 0.0);
+    evas_object_show(ly);
+    elm_box_pack_end(m_bx, ly);
+}
+
+void DetailView::addLicense(void)
+{
+    DPL::OptionalString license;
+    DPL::OptionalString href;
+
+    std::string strLicense;
+    std::string strHref;
+
+    std::string lrepdf = "\xE2\x80\xAA\xE2\x80\xAC";
+    std::string rlepdf = "\xE2\x80\xAB\xE2\x80\xAC";
+    std::string lropdf = "\xE2\x80\xAD\xE2\x80\xAC";
+    std::string rlopdf = "\xE2\x80\xAE\xE2\x80\xAC";
+
+    Evas_Object* layout;
+
+    Assert(m_dao);
+
+    license = m_localizedInfo.license;
+    if (!license.IsNull())
+        strLicense = DPL::ToUTF8String((*license));
+
+    href = m_localizedInfo.licenseHref;
+    if (!href.IsNull())
+        strHref = DPL::ToUTF8String((*href));
+
+    m_licenseInfo = new LicenseInfo();
+    if (!m_licenseInfo)
+        return;
+
+    if (!strLicense.empty() &&
+        strLicense.compare(lrepdf) != 0 &&
+        strLicense.compare(rlepdf) != 0 &&
+        strLicense.compare(lropdf) != 0 &&
+        strLicense.compare(rlopdf) != 0) {
+        m_licenseInfo->license = strLicense;
+    }
+
+    if (!strHref.empty()) {
+        m_licenseInfo->href = strHref;
+    }
+
+    addSeperator();
+
+    layout = elm_layout_add(m_bx);
+    if (!layout)
+        return;
+    elm_layout_theme_set(layout, "layout", "dialogue", "1text");
+    evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 0.0);
+    evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, 0.0);
+    elm_object_part_text_set(layout, "elm.text", "License Information");
+
+    if (m_licenseInfo->license.empty() && m_licenseInfo->href.empty()) {
+        elm_object_signal_emit(layout, "elm,state,disabled", "elm");
+    } else {
+        m_licenseInfo->evasObj = layout;
+
+    evas_object_event_callback_add(layout,
+            EVAS_CALLBACK_MOUSE_DOWN,
+            _mouse_down,
+            NULL);
+    evas_object_event_callback_add(layout,
+            EVAS_CALLBACK_MOUSE_MOVE,
+            _mouse_move,
+            NULL);
+    evas_object_event_callback_add(layout,
+            EVAS_CALLBACK_MOUSE_UP,
+            _mouse_up_license,
+            m_licenseInfo);
+    }
+
+    elm_box_pack_end(m_bx, layout);
+    evas_object_show(layout);
+}
+
+void DetailView::clearDataCallback(void *data,
+        Evas_Object *obj,
+        void* event_info )
+{
+    //TODO : implementation here.
+    Evas_Object *popup = static_cast<Evas_Object *>(data);
+    evas_object_del(popup);
+}
+
+void DetailView::viewlicenseCallback(void *data,
+       Evas_Object *obj,
+       void *event_info)
+{
+    //TODO : implementation here.
+    Evas_Object *popup = static_cast<Evas_Object *>(data);
+    evas_object_del(popup);
+}
+
+void DetailView::closeCallback(void *data,
+        Evas_Object *obj,
+        void *event_info)
+{
+    evas_object_del(static_cast<Evas_Object *>(data));
+}
+
+void DetailView::_mouse_down(void *data,
+        Evas *e,
+        Evas_Object *obj,
+        void *event_info)
+{
+    elm_object_signal_emit(obj, "elm,state,selected", "elm");
+}
+
+void DetailView::_mouse_move(void *data,
+        Evas *e,
+        Evas_Object *obj,
+        void *event_info)
+{
+    Evas_Event_Mouse_Move *event;
+    Evas_Coord ox, oy, ow, oh;
+
+    event = static_cast<Evas_Event_Mouse_Move*>(event_info);
+    if (!event)
+        return;
+
+    evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
+
+    if (event->cur.canvas.x < ox || (ox + ow) < event->cur.canvas.x ||
+        event->cur.canvas.y < oy || (oy + oh) < event->cur.canvas.y) {
+        elm_object_signal_emit(obj, "elm,state,unselected", "elm");
+    }
+
+}
+
+void DetailView::_mouse_up_license(void *data,
+        Evas *e,
+        Evas_Object *obj,
+        void* event_info)
+{
+    Evas_Event_Mouse_Up *event;
+    Evas_Object *win;
+    Evas_Object *popup;
+    Evas_Object *box;
+    Evas_Object *web;
+    Evas_Object *btn;
+    Evas_Object *l_button;
+    Evas_Object *r_button;
+    LicenseInfo *licenseInfo;
+    Evas_Coord ox, oy, ow, oh;
+    std::string label;
+
+    licenseInfo = static_cast<LicenseInfo *>(data);
+    if (!licenseInfo)
+        return;
+
+    event = static_cast<Evas_Event_Mouse_Up*>(event_info);
+    if (!event)
+        return;
+
+    evas_object_geometry_get(licenseInfo->evasObj, &ox, &oy, &ow, &oh);
+    if (event->output.x < ox || (ox + ow) < event->canvas.x ||
+        event->output.y < oy || (oy + oh) < event->canvas.y) {
+        return;
+    }
+    elm_object_signal_emit(licenseInfo->evasObj, "elm,state,unselected", "elm");
+
+    win = static_cast<Evas_Object *>(ug_get_window());
+    if (!win)
+        return;
+
+    popup = elm_popup_add(win);
+    if (!popup)
+        return;
+
+    evas_object_size_hint_align_set(popup, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    elm_object_part_text_set(popup, "title,text", "License Information");
+
+    label += licenseInfo->license.c_str();
+    if (!licenseInfo->href.empty()) {
+        if (!label.empty())
+            label += "<br>";
+        label += "More license, see <br>";
+        label += licenseInfo->href.c_str();
+    }
+    elm_object_part_text_set(popup, "default", label.c_str());
+    evas_object_show(popup);
+
+    l_button = elm_button_add(popup);
+    if (!l_button) {
+        evas_object_del(popup);
+        return;
+    }
+
+    evas_object_size_hint_align_set(l_button, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    evas_object_size_hint_weight_set(l_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    elm_object_text_set(l_button, "YES");
+    elm_object_part_content_set(popup, "button1", l_button);
+    evas_object_smart_callback_add(l_button,
+            "clicked",
+            viewlicenseCallback,
+            (void *)popup);
+    evas_object_show(r_button);
+
+    r_button = elm_button_add(popup);
+    if (!r_button) {
+        evas_object_del(popup);
+        return;
+    }
+
+    evas_object_size_hint_align_set(r_button, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    evas_object_size_hint_weight_set(r_button, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    elm_object_text_set(r_button, "NO");
+    elm_object_part_content_set(popup, "button2", r_button);
+    evas_object_smart_callback_add(r_button,
+            "clicked",
+            closeCallback,
+            (void *)popup);
+    evas_object_show(l_button);
+}
+
+void DetailView::_mouse_up_save_login_info(void *data,
+        Evas */*e*/,
+        Evas_Object *obj,
+        void *event_info)
+{
+    Assert(obj && data && event_info);
+
+    Evas_Event_Mouse_Up *event;
+    Evas_Coord ox, oy, ow, oh;
+
+    event = static_cast<Evas_Event_Mouse_Up*>(event_info);
+    evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
+
+    if (event->output.x < ox || (ox + ow) < event->output.x ||
+        event->output.y < oy || (oy + oh) < event->output.y) {
+        return;
+    }
+
+    DetailView *This = static_cast<DetailView *>(data);
+    elm_check_state_set(This->check_login, !elm_check_state_get(This->check_login));
+    elm_object_signal_emit(obj, "elm,state,unselected", "elm");
+}
+
+void DetailView::_mouse_up_clear_data(void *data,
+       Evas */*e*/,
+       Evas_Object *obj,
+       void *event_info)
+{
+    Evas_Event_Mouse_Up *event;
+    Evas_Coord ox, oy, ow, oh;
+    Evas_Object *popup;
+    Evas_Object *l_button;
+    Evas_Object *r_button;
+
+    event = static_cast<Evas_Event_Mouse_Up *>(event_info);
+    if (!event)
+        return;
+
+    evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
+
+    if (event->output.x < ox || (ox + ow) < event->output.x ||
+            event->output.y < oy || (oy + oh) < event->output.y) {
+        return;
+    }
+
+    DetailView *This = static_cast<DetailView *>(data);
+
+    Assert(This->m_bx);
+    elm_object_signal_emit(obj, "elm,state,unselected", "elm");
+
+    popup = elm_popup_add(This->m_bx);
+    if(!popup)
+       return;
+    evas_object_size_hint_align_set(popup, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    elm_object_part_text_set(popup, "default", "Do you want to clear data?");
+
+    l_button = elm_button_add(popup);
+    elm_object_text_set(l_button, "YES");
+    evas_object_smart_callback_add(l_button, "clicked", clearDataCallback, (void*)popup);
+    elm_object_part_content_set(popup, "button1", l_button);
+    evas_object_show(l_button);
+
+    r_button = elm_button_add(popup);
+    elm_object_text_set(r_button, "NO");
+    evas_object_smart_callback_add(r_button, "clicked", closeCallback, (void*)popup);
+    elm_object_part_content_set(popup, "button2", r_button);
+    evas_object_show(r_button);
+
+    evas_object_show(popup);
+}
+
 Evas_Object *DetailView::loadView(void)
 {
     Evas_Object *scr;
@@ -195,6 +579,10 @@ Evas_Object *DetailView::loadView(void)
         addDefInfo();
         addViewModes();
         addAuthorInfo();
+        if (!GlobalSettings::TestModeEnabled())
+            addLicense();
+        addSaveLoginInfo();
+        addClearData();
         resetBase(scr);
 
         return scr;
@@ -207,7 +595,8 @@ Evas_Object *DetailView::loadView(void)
 DetailView::DetailView(Evas_Object *parent, int appID) :
     m_parent(parent),
     m_bx(NULL),
-    m_appID(appID)
+    m_appID(appID),
+    m_licenseInfo(NULL)
 {
     Assert(parent);
     m_dao.Reset();
@@ -215,6 +604,8 @@ DetailView::DetailView(Evas_Object *parent, int appID) :
 
 DetailView::~DetailView(void)
 {
+    if (m_licenseInfo)
+        delete m_licenseInfo;
 }
 
 } /* WebAppDetailSetting */
old mode 100644 (file)
new mode 100755 (executable)
index 5607231..3b25957
 
 namespace WebAppDetailSetting {
 
+typedef struct {
+    std::string license;
+    std::string href;
+    Evas_Object* evasObj;
+} LicenseInfo;
+
 class DetailView : public View
 {
+    enum WebkitVersion {
+        WEBKIT_VERSION_WK1,
+        WEBKIT_VERSION_WK2,
+        WEBKIT_VERSION_UNKNOWN
+    };
+
     Evas_Object *m_parent;
     Evas_Object *m_bx;
+    Evas_Object *check_webkit;
+    Evas_Object *check_login;
+
     DPL::ScopedPtr<WrtDB::WidgetDAO> m_dao;
     WrtDB::WidgetLocalizedInfo m_localizedInfo;
     int m_appID;
+    LicenseInfo *m_licenseInfo;
 
     void getLocalizedInfo(void);
 
     void addField(const char *title);
     void addField(const char *title, const char *str);
-
     void addDefInfo(void);
     void addViewModes(void);
     void addAuthorInfo(void);
+    void addLicense(void);
+    void addSaveLoginInfo();
+    void addClearData();
+    void addSeperator();
+
+    static void clearDataCallback(void *data,
+            Evas_Object *obj,
+            void* event_info );
+    static void viewlicenseCallback(void *data,
+            Evas_Object *obj,
+            void *event_info);
+    static void closeCallback(void* data,
+            Evas_Object* obj,
+            void* event_info);
+
+    static void _mouse_down(void *data,
+            Evas *e,
+            Evas_Object *obj,
+            void* event_info);
+    static void _mouse_move(void *data,
+            Evas *e,
+            Evas_Object *obj,
+            void* event_info);
+    static void _mouse_up_license(void *data,
+            Evas *e,
+            Evas_Object *obj,
+            void* event_info);
+    static void _mouse_up_save_login_info(void *data,
+            Evas *e,
+            Evas_Object *obj,
+            void *event_info);
+    static void _mouse_up_clear_data(void *data,
+            Evas *e,
+            Evas_Object *obj,
+            void *event_info);
 
   public:
     DetailView(Evas_Object *parent, int appID);
index ec3bb0e..5890c55 100644 (file)
@@ -181,7 +181,7 @@ del_ly:
     return NULL;
 }
 
-MainView::MainView(struct ui_gadget *ug, int appId) :
+MainView::MainView(ui_gadget_h ug, int appId) :
     m_ug(ug),
     m_appID(appId),
     m_subCtnt(NULL),
index d2ea43d..050789e 100644 (file)
@@ -28,7 +28,7 @@ namespace WebAppDetailSetting {
 
 class MainView : public View
 {
-    struct ui_gadget *m_ug;
+    ui_gadget_h m_ug;
     int m_appID;
     Evas_Object *m_subCtnt;
     DPL::ScopedPtr<DetailView> m_detail;
@@ -47,11 +47,11 @@ class MainView : public View
     Evas_Object *createToolBar(Evas_Object *parent);
 
   public:
-    MainView(struct ui_gadget *ug, int appId);
+    MainView(ui_gadget_h ug, int appId);
     ~MainView(void);
 
     Evas_Object *loadView(void);
-    struct ui_gadget *getUG(void) { return m_ug; }
+    ui_gadget_h getUG(void) { return m_ug; }
     Evas_Object *getSubCtnt(void) { return m_subCtnt; }
     Elm_Object_Item *getSegCtrlDetail(void) { return m_segCtrlDetail; }
     Elm_Object_Item *getSegCtrlPerm(void) { return m_segCtrlPerm; }
index 4d11031..9c6538a 100644 (file)
@@ -397,7 +397,6 @@ void PermView::addFeatureList(Evas_Object *gl)
 
     addFeatureTitle(gl);
     switch (m_appType) {
-    case WrtDB::APP_TYPE_WAC10:
     case WrtDB::APP_TYPE_WAC20:
         for (it = m_featureMap.begin(); it != m_featureMap.end(); it++)
             addFeatureWithPerm(gl, it->first);
@@ -510,7 +509,6 @@ Evas_Object *PermView::loadView(void)
         features = m_dao->getFeaturesList();
         m_appType = m_dao->getWidgetType().appType;
         switch (m_appType) {
-        case WrtDB::APP_TYPE_WAC10:
         case WrtDB::APP_TYPE_WAC20:
             m_featureMap = WacFeature::getFeatureMap(features, m_appID);
             break;
old mode 100644 (file)
new mode 100755 (executable)
index 1e7f40b..f092d97
@@ -34,19 +34,19 @@ struct priv {
     WebAppDetailSetting::MainView *mainView;
 };
 
-static void *onCreate(struct ui_gadget *ug,
+static void *onCreate(ui_gadget_h ug,
                       enum ug_mode /*mode*/,
-                      bundle *data,
+                      service_h service,
                       void *user_data)
 {
     struct priv *priv;
     int appID;
-    const char *pkgname;
+    char *pkgname = NULL;
 
     Assert(ug && user_data);
     priv = static_cast<struct priv *>(user_data);
 
-    pkgname = bundle_get_val(data, "pkg_name");
+    service_get_extra_data(service, "pkg_name", &pkgname);
     if (!pkgname)
         return NULL;
 
@@ -63,8 +63,8 @@ static void *onCreate(struct ui_gadget *ug,
     }
 }
 
-static void onDestroy(struct ui_gadget */*ug*/,
-                      bundle */*data*/,
+static void onDestroy(ui_gadget_h /*ug*/,
+                      service_h /*service*/,
                       void *user_data)
 {
     struct priv *priv;