+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
* 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)
{
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;
addDefInfo();
addViewModes();
addAuthorInfo();
+ if (!GlobalSettings::TestModeEnabled())
+ addLicense();
+ addSaveLoginInfo();
+ addClearData();
resetBase(scr);
return scr;
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();
DetailView::~DetailView(void)
{
+ if (m_licenseInfo)
+ delete m_licenseInfo;
}
} /* WebAppDetailSetting */