summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/settings_provider.c2
-rw-r--r--src/view_maincatalog.c15
-rw-r--r--src/view_need_pwd.c5
3 files changed, 19 insertions, 3 deletions
diff --git a/src/settings_provider.c b/src/settings_provider.c
index e28a064..b61d070 100644
--- a/src/settings_provider.c
+++ b/src/settings_provider.c
@@ -578,6 +578,8 @@ static int _get_string(const char *key, char **val)
break;
case SYSTEM_PASSCODE:
*val = vconf_get_str(KEY_CHANGE_PASSCODE);
+ if (*val == NULL)
+ r = -1;
break;
default:
break;
diff --git a/src/view_maincatalog.c b/src/view_maincatalog.c
index b2cfe58..4112ba6 100644
--- a/src/view_maincatalog.c
+++ b/src/view_maincatalog.c
@@ -45,6 +45,9 @@
#define ENABLED "enabled"
#define SIG_CLICKED "clicked"
+#define KEY_PASSCODE "settings/system/change_passcode"
+#define ITEM_CHANNEL_LOCK_ID "channel-lock"
+
enum focused_state {
FOCUS_MAIN_ITEM = 1,
FOCUS_SUB_ITEM
@@ -1096,7 +1099,7 @@ static int _draw_subitems(struct _view_data *data, const char *name)
int cnt;
Eina_Array_Iterator a;
unsigned int i;
- const char *style, *status;
+ const char *id, *passcode, *style, *status;
Eina_Array *enabled;
if (!data || !name || !data->base) {
@@ -1173,7 +1176,15 @@ static int _draw_subitems(struct _view_data *data, const char *name)
evas_object_data_set(btn, SUBITEM_DATA_ID, item);
- status = settingitem_get_status(item);
+ id = settingitem_get_id(item);
+ if (id && !strncmp(id, ITEM_CHANNEL_LOCK_ID, strlen(id))
+ && (provider_get_passcode(KEY_PASSCODE, &passcode) == -1)) {
+ /*Disable channel lock menu if passcode has not been setup yet*/
+ status = DISABLED;
+ } else {
+ status = settingitem_get_status(item);
+ }
+
if (status && !strncmp(status, DISABLED, strlen(status))) {
elm_object_disabled_set(btn, EINA_TRUE);
evas_object_freeze_events_set(btn, EINA_TRUE);
diff --git a/src/view_need_pwd.c b/src/view_need_pwd.c
index b1357ac..633bf61 100644
--- a/src/view_need_pwd.c
+++ b/src/view_need_pwd.c
@@ -221,7 +221,10 @@ static int _check_passcode(struct _chnllock_data *data)
return 0;
passcode = NULL;
- provider_get_passcode(KEY_PASSCODE, &passcode);
+ if (provider_get_passcode(KEY_PASSCODE, &passcode) == -1) {
+ _DBG("Passcode has not been setup yet");
+ return 1;
+ }
if (strncmp(data->passcode, passcode, strlen(passcode))) {
free(passcode);