2 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
4 * This file is part of the Manage Applications
5 * Written by Eunmi Son <eunmi.son@samsung.com>
8 * Janusz Kozerski <j.kozerski@samsung.com>
10 * PROPRIETARY/CONFIDENTIAL
12 * This software is the confidential and proprietary information of
13 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
14 * disclose such Confidential Information and shall use it only in
15 * accordance with the terms of the license agreement you entered
16 * into with SAMSUNG ELECTRONICS.
18 * SAMSUNG make no representations or warranties about the suitability
19 * of the software, either express or implied, including but not limited
20 * to the implied warranties of merchantability, fitness for a particular
21 * purpose, or non-infringement. SAMSUNG shall not be liable for any
22 * damages suffered by licensee as a result of using, modifying or
23 * distributing this software or its derivatives.
27 #include "certificates/certificate_util.h"
28 #include "certificates/certificates.h"
32 static char *dir_path = PATH_CERT_USER;
34 static void install_button_cb(void *data, Evas_Object *obj, void *event_info);
36 void user_cert_cb(void *data, Evas_Object *obj, void *event_info) {
39 struct ug_data *ad = (struct ug_data *) data;
40 Evas_Object *list = NULL;
42 struct ListElement *firstListElement = NULL;
43 struct ListElement *lastListElement = NULL;
44 firstListElement = initList();
45 lastListElement = firstListElement;
47 Evas_Object *toolbar = elm_toolbar_add(ad->win_main);
50 elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND);
52 elm_toolbar_item_append(toolbar, NULL, dgettext(PACKAGE, "INSTALL"), install_button_cb, ad);
53 elm_toolbar_item_append(toolbar, NULL, dgettext(PACKAGE, "UNINSTALL"), delete_cert_cb, strdup(dir_path));
55 list = elm_list_add(ad->win_main);
56 elm_list_mode_set(list, ELM_LIST_COMPRESS);
58 if (make_list(ad, list, dir_path, lastListElement, USER)) {
59 Evas_Object *no_content = elm_layout_add(ad->win_main);
60 elm_layout_theme_set(no_content, "layout", "nocontents", "text");
61 elm_object_part_text_set(no_content, "elm.text", dgettext(PACKAGE, "IDS_COM_BODY_NO_CONTENTS"));
62 evas_object_size_hint_weight_set(no_content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
63 evas_object_show(no_content);
65 Elm_Object_Item *itm = elm_naviframe_item_push(ad->navi_bar, dgettext(PACKAGE, "USER_CERTIFICATE"), NULL, NULL,
67 elm_object_item_part_content_set(itm, "controlbar", toolbar);
70 Elm_Object_Item *itm = elm_naviframe_item_push(ad->navi_bar, dgettext(PACKAGE, "USER_CERTIFICATE"), NULL, NULL,
72 elm_object_item_part_content_set(itm, "controlbar", toolbar);
74 Evas_Object *back = NULL;
75 back = elm_object_item_part_content_get(itm, "prev_btn");
76 evas_object_smart_callback_add(back, "clicked", back_cb, ad);
80 static void install_button_cb(void *data, Evas_Object *obj, void *event_info) {
81 struct ug_data *ad = (struct ug_data *) data;
83 strcpy(buf, dgettext(PACKAGE, "INSTALL_CERT_FROM_SD_QUESTION"));
84 create_yes_no_pop(ad, buf);