summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Kibum <kb0929.kim@samsung.com>2012-06-08 05:54:11 (GMT)
committerKim Kibum <kb0929.kim@samsung.com>2012-06-08 05:54:11 (GMT)
commita567f8701cbb30a17da78748f90c4037e579e858 (patch)
tree9fde6787eab952097dc16583caa70e9ff1dc5259
parent80695614233c7e90e9ac9d38cd816f9fbeb07d52 (diff)
downloadpwlock-a567f8701cbb30a17da78748f90c4037e579e858.zip
pwlock-a567f8701cbb30a17da78748f90c4037e579e858.tar.gz
pwlock-a567f8701cbb30a17da78748f90c4037e579e858.tar.bz2
apply FSL(Flora Software License)
-rwxr-xr-xCMakeLists.txt74
-rwxr-xr-xINSTALL33
-rwxr-xr-xLICENSE75
-rwxr-xr-xNOTICE0
-rwxr-xr-xdebian/changelog7
-rwxr-xr-xdebian/compat1
-rwxr-xr-xdebian/control17
-rw-r--r--debian/copyright0
-rwxr-xr-xdebian/org.tizen.pwlock.install.in4
-rwxr-xr-xdebian/org.tizen.pwlock.postinst21
-rwxr-xr-xdebian/rules119
-rwxr-xr-xinclude/pwlock.h133
-rwxr-xr-xinclude/tapi.h62
-rwxr-xr-xinclude/ui.h65
-rwxr-xr-xinclude/util.h119
-rwxr-xr-xorg.tizen.pwlock.desktop.in9
-rwxr-xr-xpackaging/org.tizen.pwlock.spec54
-rwxr-xr-xpo/CMakeLists.txt25
-rwxr-xr-xpo/POTFILES.in5
-rwxr-xr-xpo/de_DE.po111
-rwxr-xr-xpo/el_GR.po111
-rwxr-xr-xpo/en.po111
-rwxr-xr-xpo/es_ES.po111
-rwxr-xr-xpo/fr_FR.po111
-rwxr-xr-xpo/it_IT.po111
-rwxr-xr-xpo/ja_JP.po111
-rwxr-xr-xpo/ko_KR.po111
-rwxr-xr-xpo/nl_NL.po111
-rwxr-xr-xpo/pt_PT.po111
-rwxr-xr-xpo/pwlock.pot143
-rwxr-xr-xpo/ru_RU.po111
-rwxr-xr-xpo/tr_TR.po111
-rwxr-xr-xpo/update-po.sh60
-rwxr-xr-xpo/zh_CN.po111
-rwxr-xr-xpo/zh_HK.po111
-rwxr-xr-xpo/zh_TW.po111
-rwxr-xr-xsb-conf0
-rwxr-xr-xsrc/pwlock.c1003
-rwxr-xr-xsrc/tapi.c648
-rwxr-xr-xsrc/ui.c1585
-rwxr-xr-xsrc/util.c222
41 files changed, 6149 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755
index 0000000..3b640f3
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,74 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(pwlock C)
+
+SET(SRCS
+ ./src/pwlock.c
+ ./src/tapi.c
+ ./src/util.c
+ ./src/ui.c
+)
+
+SET(VENDOR "tizen")
+SET(PACKAGE ${PROJECT_NAME})
+SET(PKGNAME "org.${VENDOR}.${PACKAGE}")
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(BINDIR "${PREFIX}/bin")
+SET(RESDIR "${PREFIX}/res")
+SET(DATADIR "${PREFIX}/data")
+SET(LOCALEDIR "${RESDIR}/locale")
+SET(ICONDIR "${RESDIR}/icons/default/small")
+SET(EDJDIR "${RESDIR}/edje")
+SET(IMAGEDIR "${RESDIR}/images")
+
+INSTALL(DIRECTORY DESTINATION ${DATADIR})
+
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+ SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED elementary appcore-efl vconf tapi utilX ui-gadget bundle ecore-imf ecore-x eina evas ecore edje ecore-input glib-2.0 openssl aul sysman)
+
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+SET(CMAKE_C_FLAGS_RELEASE "-O2")
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF("${ARCH}" STREQUAL "arm")
+ ADD_DEFINITIONS("-DTARGET")
+ MESSAGE("add -DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
+ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
+ADD_DEFINITIONS("-DDATADIR=\"${DATADIR}\"")
+ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
+ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"")
+ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"")
+ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+
+# install desktop file & icon & bin
+CONFIGURE_FILE(${PKGNAME}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${PKGNAME}.desktop)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PKGNAME}.desktop DESTINATION /opt/share/applications)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
+
+# i18n
+ADD_SUBDIRECTORY(po)
+
diff --git a/INSTALL b/INSTALL
new file mode 100755
index 0000000..3915bad
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,33 @@
+1. make the build directory
+
+ ex)
+
+ $ mkdir build
+
+
+2. change the working directory to the build directory
+
+ ex)
+
+ $ cd build
+
+
+3. run 'cmake'
+
+ $ cmake ${SOURCE_DIR} -DCMAKE_INSTALL_PREFIX=/opt/apps/${PKGNAME}
+
+ ex)
+
+ $ cmake .. -DCMAKE_INSTALL_PREFIX=/opt/apps/${PKGNAME}
+
+ or
+
+ $ cmake ..
+
+
+4. make & make install
+
+ ex)
+
+ $ make -j 2 && make install
+
diff --git a/LICENSE b/LICENSE
new file mode 100755
index 0000000..7ccb5b5
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,75 @@
+Flora License
+
+Version 1.0, May, 2012
+
+http://www.tizenopensource.org/license
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+"Tizen Certified Platform" shall mean a software platform that complies with the standards set forth in the Compatibility Definition Document and passes the Compatibility Test Suite as defined from time to time by the Tizen Technical Steering Group and certified by the Tizen Association or its designated agent.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work solely as incorporated into a Tizen Certified Platform, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work solely as incorporated into a Tizen Certified Platform to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof pursuant to the copyright license above, in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+ 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+ 2. You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+ 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+ 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Flora License to your work
+
+To apply the Flora License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Flora License, Version 1.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.tizenopensource.org/license
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/NOTICE b/NOTICE
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/NOTICE
diff --git a/debian/changelog b/debian/changelog
new file mode 100755
index 0000000..d5c67fa
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,7 @@
+pwlock (0.2.1-1) unstable; urgency=low
+
+ * Add spec file
+ * Git: pkgs/p/pwlock
+ * Tag: pwlock_0.2.1-1
+
+ -- Mi-Ju Lee <miju52.lee@samsung.com> Tue, 20 Mar 2012 20:09:58 +0900
diff --git a/debian/compat b/debian/compat
new file mode 100755
index 0000000..7ed6ff8
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100755
index 0000000..a03648f
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,17 @@
+Source: pwlock
+Section: devel
+Priority: extra
+Maintainer: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+Build-Depends: debhelper (>= 5), libappcore-efl-dev, libelm-dev, libslp-setting-dev, libslp-tapi-dev, libslp-utilx-dev, libui-gadget-dev, dlog-dev, libbundle-dev, libecore-dev, libeina-dev, libevas-dev, libedje-dev, libaul-1-dev, libslp-sysman-dev
+Standards-Version: 3.7.2
+
+Package: org.tizen.pwlock
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: pwlock
+
+Package: org.tizen.pwlock-dbg
+Section: debug
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, org.tizen.pwlock
+Description: debug package of pwlock
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/debian/copyright
diff --git a/debian/org.tizen.pwlock.install.in b/debian/org.tizen.pwlock.install.in
new file mode 100755
index 0000000..25fb04c
--- /dev/null
+++ b/debian/org.tizen.pwlock.install.in
@@ -0,0 +1,4 @@
+@PREFIX@/bin/*
+@PREFIX@/data
+@PREFIX@/res/locale/*
+/opt/share/applications/*
diff --git a/debian/org.tizen.pwlock.postinst b/debian/org.tizen.pwlock.postinst
new file mode 100755
index 0000000..f9866ac
--- /dev/null
+++ b/debian/org.tizen.pwlock.postinst
@@ -0,0 +1,21 @@
+#!/bin/sh
+#This is pwlock postinst file
+
+GOPTION="" # Set without -g, -u options
+if [ ${USER} == "root" ]
+then
+ # 5000 is inhouse user id
+ # do not use relative path
+ chown -R 5000:5000 /opt/apps/org.tizen.pwlock/data
+
+ # Set vconf values with -g/-u options
+ GOPTION="-g 6514"
+fi
+
+#echo $GOPTION
+
+# check first boot
+vconftool $GOPTION set -t bool db/setting/pwlock_boot "1"
+#vconftool $GOPTION set -t int db/setting/phone_lock_attempts_left "5"
+#vconftool $GOPTION set -t string db/setting/phone_lock_timestamp ""
+
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..fe2571c
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,119 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+CFLAGS ?=
+LDFLAGS ?=
+PREFIX ?= /opt/apps/org.tizen.pwlock
+RESDIR ?= /opt/apps/org.tizen.pwlock/res
+DATADIR ?= /opt/apps/org.tizen.pwlock/data
+
+CFLAGS += -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+
+CFLAGS += -fPIE
+LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
+
+CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build_tmp
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+ mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && \
+ CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX="$(PREFIX)"
+
+ touch configure-stamp
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ cd $(CMAKE_BUILD_DIR) && $(MAKE)
+
+ for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+ cat $$f > $${f%.in}; \
+ sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
+ sed -i -e "s#@RESDIR@#$(RESDIR)#g" $${f%.in}; \
+ sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
+ done
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ rm -rf $(CMAKE_BUILD_DIR)
+ rm -rf debian/pwlock-dbg
+
+ for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+ rm -f $${f%.in}; \
+ done
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/wavplayer.
+ cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+ dh_install --sourcedir=debian/tmp
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ dh_strip --dbg-package=org.tizen.pwlock-dbg
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
+
diff --git a/include/pwlock.h b/include/pwlock.h
new file mode 100755
index 0000000..8723156
--- /dev/null
+++ b/include/pwlock.h
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __PWLOCK_H__
+#define __PWLOCK_H__
+
+#include <Elementary.h>
+#include <glib.h>
+#include <aul.h>
+#include <openssl/sha.h>
+#include <sysman.h>
+
+#include "tapi.h"
+
+#if !defined(PACKAGE)
+#define PACKAGE "org.tizen.pwlock"
+#endif
+
+#if !defined(LOCALEDIR)
+#define LOCALEDIR "/opt/apps/org.tizen.pwlock/res/locale"
+#endif
+
+struct appdata {
+ Evas_Object *win;
+ Evas_Object *ly;
+ Evas_Object *navi;
+ Evas_Object *bg;
+
+ int ui_type;
+ int previous_ui_type;
+ Evas_Object *ly_main;
+ Evas_Object *entry_layout;
+ Evas_Object *entry_second_layout;
+ Evas_Object *button_dial;
+ Evas_Object *button_done;
+ int state;
+ int sub_state;
+ Ecore_Idler *idler;
+
+ int first_boot;
+ int running_status;
+ int alpha_window_status;
+ int keyboard_settings_loaded;
+ int date_and_time_settings_loaded;
+ int language_settings_loaded;
+ int lock_view_loaded;
+ int lock_app_launched;
+
+ char *entry_str;
+ char *pin_str;
+ char *msg;
+ Ecore_Timer *pTimerId;
+ int sim_changed;
+ int pin_changed;
+ enum sim_stat sim_status;
+ struct tapi *t;
+ struct ui_gadget *dialer_ug;
+ struct ui_gadget *language_ug;
+ struct ui_gadget *keyboard_ug;
+ struct ui_gadget *date_ug;
+ struct ui_gadget *count_ug;
+ struct ui_gadget *current_ug;
+ int kill_ug;
+ int date_and_time_previous;
+ int cancel_setup;
+ Evas_Object *popup;
+ Evas_Object *waiting_popup;
+ int win_type;
+ int tapi_smc_sid;
+};
+
+void do_state(struct appdata *ad);
+
+enum {
+ STR_E_PW,
+ STR_E_PIN,
+ STR_E_NEW,
+ STR_R_PIN,
+ STR_E_PUK,
+ STR_I_PUN,
+ STR_I_PUK,
+ STR_A_LEFT,
+ STR_DONE,
+ STR_DIAL,
+ STR_W_PW,
+ STR_N_MAT,
+ STR_LANG,
+ STR_SET,
+ STR_CANCEL,
+ STR_ERR_SIMLANG,
+ STR_ERR_UNSUPP,
+ STR_BLOCK,
+ STR_SIM_LOCK,
+ STR_NETWORK_LOCK_NCK,
+ STR_NETWORK_LOCK_NSCK,
+ STR_NETWORK_LOCK_SPCK,
+ STR_NETWORK_LOCK_CCK,
+ STR_PW_LENGTH,
+};
+
+enum {
+ _ST_FIRST,
+ _ST_TAPI_INIT,
+ _ST_SIM,
+ _ST_SIM_PINCNF,
+ _ST_SIM_PUKCNF,
+ _ST_SIM_LOCKCNF,
+ _ST_NETWORK_LOCKCNF,
+ _ST_EXIT,
+ _ST_LANG,
+ _ST_TIME,
+ _ST_KEYBOARD,
+ _ST_MAX,
+};
+
+extern const char *strtbl[];
+void set_win_prop(struct appdata *ad, int type);
+
+#endif /* __PWLOCK_H__ */
diff --git a/include/tapi.h b/include/tapi.h
new file mode 100755
index 0000000..20d43a1
--- /dev/null
+++ b/include/tapi.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __PWLOCK_TAPI_H__
+#define __PWLOCK_TAPI_H__
+
+struct tapi;
+
+enum sim_stat {
+ SIM_ERROR = -1,
+ SIM_RETRY = 0,
+ SIM_OK,
+ SIM_EMPTY,
+ SIM_REQ_PIN,
+ SIM_REQ_PUK,
+ SIM_REQ_LOCK,
+ SIM_REQ_NCK,
+ SIM_REQ_NSCK,
+ SIM_REQ_SPCK,
+ SIM_REQ_CCK,
+ SIM_BLOCKED,
+ SIM_WAITING,
+ SIM_REQUIRED_EVENT
+};
+
+struct tapi_info {
+ enum sim_stat st;
+ int retry_cnt;
+};
+
+struct tapi *tapi_init(void (*cb) (struct tapi_info *, void *), void *data);
+void tapi_exit(struct tapi **t);
+
+int tapi_is_ready(void);
+int tapi_ready_check(void);
+
+enum sim_stat tapi_check_sim(int *changed);
+
+int tapi_verify_pins(char *code);
+int tapi_verify_puks(char *code, char *newcode);
+int tapi_verify_lock(char *code);
+int tapi_disable_net_pers(char *code, int type);
+
+void enable_net_pers();
+
+int tapi_get_language(int *v);
+
+#endif /* __PWLOCK_TAPI_H__ */
diff --git a/include/ui.h b/include/ui.h
new file mode 100755
index 0000000..dd08b6e
--- /dev/null
+++ b/include/ui.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __PWLOCK_UI_H__
+#define __PWLOCK_UI_H__
+
+#include "pwlock.h"
+
+#define PWLOCK_PASSWORD_MIN_LENGTH 4
+#define PWLOCK_PIN_PASSWORD_MAX_LENGTH 8
+#define PWLOCK_PHONE_PASSWORD_MAX_LENGTH 16
+
+enum {
+ _UI_PIN = 0,
+ _UI_PUK,
+ _UI_PUK_PIN,
+ _UI_PUK_CNF,
+ _UI_BLOCK,
+ _UI_SIM_LOCK,
+ _UI_NETWORK_LOCK_NCK,
+ _UI_NETWORK_LOCK_NSCK,
+ _UI_NETWORK_LOCK_SPCK,
+ _UI_NETWORK_LOCK_CCK,
+ _UI_LANG,
+ _UI_TIME,
+ _UI_KEYBOARD,
+ _UI_DIALER,
+};
+
+void show_pin(struct appdata *ad);
+void show_puk(struct appdata *ad);
+void show_puk_pin(struct appdata *ad);
+void show_block(struct appdata *ad);
+void show_sim_lock(struct appdata *ad);
+int show_lang(struct appdata *ad);
+int show_time(struct appdata *ad);
+int show_account(struct appdata *ad);
+int show_keyboard_setting(struct appdata *ad);
+int show_dialer(struct appdata *ad);
+
+void pwlock_destroy(struct appdata *ad);
+void load_main(struct appdata *ad, int ui_type);
+
+void show_msg(struct appdata *ad, int strid);
+void clear_entry(struct appdata *ad);
+void _show_popup(void *data, char *msg_str);
+void show_popup(struct appdata *ad, const char *mesg, Eina_Bool mode);
+void show_waiting_popup(struct appdata *ad, const char *msg_str);
+void remove_waiting_popup(struct appdata *ad);
+Eina_Bool show_puk_do(void *data);
+#endif /* __PWLOCK_UI_H__ */
diff --git a/include/util.h b/include/util.h
new file mode 100755
index 0000000..0700d02
--- /dev/null
+++ b/include/util.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __PWLOCK_UTIL_H__
+#define __PWLOCK_UTIL_H__
+
+#include<dlog.h>
+#include<Elementary.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "pwlock"
+#define LOGFILE "/tmp/pwlock.log"
+
+#define ENABLE_LOG_SYSTEM
+
+void pwlock_log_t(char *fmt, ...);
+
+#ifdef ENABLE_LOG_SYSTEM
+#define PWLOCK_ERR(fmt, arg...) LOGE("["LOG_TAG"%s:%d:E] "fmt, __FILE__, __LINE__, ##arg)
+#define PWLOCK_DBG(fmt, arg...) LOGD("["LOG_TAG"%s:%d:D] "fmt, __FILE__, __LINE__, ##arg)
+#define PWLOCK_WARN(fmt, arg...) LOGW("["LOG_TAG"%s:%d:D] "fmt, __FILE__, __LINE__, ##arg)
+#else
+#define PWLOCK_ERR(fmt, arg...)
+#define PWLOCK_DBG(fmt, arg...)
+#define PWLOCK_WARN(fmt, arg...)
+#endif
+
+#ifdef ENABLE_LOG_SYSTEM
+#define _ERR(fmt, arg...) do { PWLOCK_ERR(fmt, ##arg); pwlock_log_t("["LOG_TAG":%d:E] "fmt, __LINE__, ##arg); } while (0)
+#define _DBG(fmt, arg...) do { PWLOCK_DBG(fmt, ##arg); pwlock_log_t("["LOG_TAG":%d:D] "fmt, __LINE__, ##arg); } while (0)
+#else
+#define _ERR(...)
+#define _DBG(...)
+#endif
+
+enum {
+ IDS_COM_SK_SET = 0,
+ IDS_COM_SK_DONE,
+ IDS_COM_BODY_ENTER_PASSWORD,
+ IDS_COM_BODY_PREVIOUS,
+ IDS_COM_SK_NEXT,
+ IDS_COM_SK_OK,
+ IDS_COM_SK_CANCEL,
+
+ IDS_PWLOCK_SYSTEM_STRING_MAX,
+};
+
+enum {
+ IDS_IDLE_BODY_AUTOMATIC = IDS_PWLOCK_SYSTEM_STRING_MAX,
+ IDS_IDLE_HEADER_NETWORK_LOCK,
+ IDS_IDLE_HEADER_PHONE_LOCK,
+ IDS_IDLE_HEADER_PIN_LOCK,
+ IDS_IDLE_HEADER_PUK_LOCK,
+ IDS_IDLE_HEADER_SIM_BLOCKED,
+ IDS_IDLE_HEADER_SIM_LOCK,
+ IDS_IDLE_BODY_1_ATTEMPT_LEFT,
+ IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY,
+ IDS_IDLE_BODY_ENTER_NEW_PIN,
+ IDS_IDLE_BODY_ENTER_PIN,
+ IDS_IDLE_BODY_ENTER_PUK,
+ IDS_IDLE_BODY_INCORRECT_PIN,
+ IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN,
+ IDS_IDLE_BODY_INCORRECT_PUK,
+ IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED,
+ IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY,
+ IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY,
+ IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG,
+ IDS_IDLE_BODY_PD_ATTEMPTS_LEFT,
+ IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY,
+ IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER,
+ IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE,
+ IDS_IDLE_BODY_WRONG_PASSWORD,
+ IDS_IDLE_BUTTON_CANCEL,
+ IDS_IDLE_BUTTON_DIALER,
+ IDS_IDLE_HEADER_DISPLAY_LANGUAGE,
+ IDS_IDLE_BODY_DO_YOU_WANT_TO_SKIP_SETUPWIZARD,
+ IDS_IDLE_BODY_PASSWORD_EMPTY,
+ IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED,
+ IDS_IDLE_BODY_NEW_PIN,
+ IDS_IDLE_BODY_PIN,
+ IDS_IDLE_BODY_PUK,
+ IDS_IDLE_POP_PIN_BLOCKED,
+ IDS_IDLE_POP_PIN_UNBLOCKED,
+ IDS_IDLE_BODY_CONFIRM_NEW_PIN,
+ IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT,
+ IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT,
+ IDS_IDLE_BODY_PD_TO_PD_DIGITS_OR_LETTERS_REQUIRED,
+ IDS_IDLE_POP_PASSWORDS_NOT_MATCH,
+ IDS_IDLE_POP_PIN_CHANGED,
+ IDS_IDLE_POP_SIM_CARD_ERROR,
+ IDS_IDLE_BODY_TRY_LATER,
+ IDS_IDLE_BODY_INPUT_PASSWORD_AFTER_THIRTYSECONDS,
+ IDS_IDLE_BODY_CHECKING_SIM_STATUS,
+
+ IDS_PWLOCK_APP_STRING_MAX,
+};
+
+char *pwlock_get_string(int id);
+Evas_Object *create_win(const char *name);
+Evas_Object *load_edj(Evas_Object * parent, const char *file,
+ const char *group);
+#endif /* __PWLOCK_UTIL_H__ */
diff --git a/org.tizen.pwlock.desktop.in b/org.tizen.pwlock.desktop.in
new file mode 100755
index 0000000..fe6fc63
--- /dev/null
+++ b/org.tizen.pwlock.desktop.in
@@ -0,0 +1,9 @@
+Name=@PROJECT_NAME@
+Exec=@BINDIR@/@PROJECT_NAME@
+Type=Application
+Nodisplay=True
+
+X-TIZEN-TaskManage=False
+X-TIZEN-Multiple=False
+X-TIZEN-Removable=False
+
diff --git a/packaging/org.tizen.pwlock.spec b/packaging/org.tizen.pwlock.spec
new file mode 100755
index 0000000..c0d806f
--- /dev/null
+++ b/packaging/org.tizen.pwlock.spec
@@ -0,0 +1,54 @@
+%define PREFIX /opt/apps/org.tizen.pwlock
+
+Name: org.tizen.pwlock
+Summary: Password Lock application
+Version: 0.2.1
+Release: 1
+Group: User Experience
+License: Flora Software License
+Source0: %{name}-%{version}.tar.gz
+
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(ui-gadget)
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(appcore-efl)
+BuildRequires: pkgconfig(tapi)
+BuildRequires: pkgconfig(utilX)
+BuildRequires: pkgconfig(openssl)
+BuildRequires: pkgconfig(aul)
+BuildRequires: pkgconfig(sysman)
+BuildRequires: gettext-tools
+BuildRequires: cmake
+BuildRequires: edje-tools
+Requires(post): /usr/bin/vconftool
+
+%description
+Password lock application.
+
+%prep
+%setup -q
+
+%build
+LDFLAGS+="-Wl,--rpath=%{PREFIX}/lib -Wl,--as-needed";export LDFLAGS
+cmake . -DCMAKE_INSTALL_PREFIX=%{PREFIX}
+make
+
+%install
+%make_install
+
+%find_lang pwlock
+
+%post
+GOPTION="-g 6514"
+vconftool $GOPTION set -t bool db/setting/pwlock_boot "1"
+chown -R 5000:5000 /opt/apps/org.tizen.pwlock/data
+
+#%files -f %{name}.lang
+%files
+%defattr(-,root,root,-)
+%dir /opt/apps/org.tizen.pwlock/data
+/opt/share/applications/org.tizen.pwlock.desktop
+/opt/apps/org.tizen.pwlock/bin/pwlock
+/opt/apps/org.tizen.pwlock/res/locale/*/LC_MESSAGES/pwlock.mo
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100755
index 0000000..2defb36
--- /dev/null
+++ b/po/CMakeLists.txt
@@ -0,0 +1,25 @@
+# for i18n
+
+#SET(POFILES de.po en_US.po fr.po ja.po nl.po pt.po ru.po zh_CN.po zh_TW.po el.po es.po it.po ko.po tk.po zh_HK.po)
+SET(POFILES de_DE.po el_GR.po en.po es_ES.po fr_FR.po it_IT.po ja_JP.po ko_KR.po nl_NL.po pt_PT.po ru_RU.po tr_TR.po zh_CN.po zh_HK.po zh_TW.po)
+
+SET(MSGFMT "/usr/bin/msgfmt")
+
+FOREACH(pofile ${POFILES})
+ SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile})
+ MESSAGE("PO: ${pofile}")
+ GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE)
+ GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE)
+ SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${moFile}
+ COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
+ DEPENDS ${absPofile}
+ )
+ INSTALL(FILES ${moFile}
+ DESTINATION ${LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo)
+ SET(moFiles ${moFiles} ${moFile})
+ENDFOREACH(pofile)
+
+MESSAGE(".mo files: ${moFiles}")
+ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100755
index 0000000..e6581b0
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,5 @@
+# List of source files containing translatable strings.
+#pwlock.c
+#ui.c
+#langs.c
+pwlock-string.c
diff --git a/po/de_DE.po b/po/de_DE.po
new file mode 100755
index 0000000..df48002
--- /dev/null
+++ b/po/de_DE.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "Neue PIN bestätigen"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "Passwort leer"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "%d bis %d Stellen sind erforderlich"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "Falsche PIN. Noch 1 Versuch"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr "Falsche PIN. Noch %d Versuche"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr "Neue PIN"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "PIN"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "PUK"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "PIN gesperrt"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "PIN entsperrt"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "Abbr."
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "Automatisch"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "Netzsperre"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "Telefonsperre"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "PIN-Sperre"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "PUK-Sperre"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "SIM gesperrt"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "SIM-Sperre"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "Noch 1 Versuch"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Unternehmenspersonalisierung aktiviert. Steuertaste eingeben"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "Neue PIN eingeben"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "PIN eingeben"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "PUK eingeben"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "Falsche PIN"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "Ungültige PIN.\nErneut versuchen"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "Falscher PUK"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "Sprache nicht unterstützt"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Netzwerkpersonalisierung aktiviert. Steuertaste eingeben"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Netzwerk Teil-Personalisierung aktiviert. Steuertaste eingeben"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "Das Passwort muss 4 Stellen lang sein"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "%d Versuche übrig"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Dienstanbieterpersonalisierung aktiviert. Steuertaste eingeben"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "SIM nicht verfügbar. Wenden Sie sich an Ihren Dienstanbieter"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "SIM-Kartensprache kann nicht gelesen werden"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "Falsches Passwort"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "Wählen"
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "Anzeigesprache"
+
diff --git a/po/el_GR.po b/po/el_GR.po
new file mode 100755
index 0000000..632625d
--- /dev/null
+++ b/po/el_GR.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "Επιβεβαίωση νέου ΡΙΝ"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "Δεν έχει οριστεί κωδικός πρόσβασης"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "Απαιτούνται %d έως %d ψηφία"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "Λάθος PIN. Απομένει 1 προσπάθεια"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr " Λάθος PIN. Απομένουν %d προσπάθειες"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr "Νέο PIN"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "PIN"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "PUK"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "Εμπλοκή ΡΙΝ"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "Απεμπλοκή ΡΙΝ"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "Ακύρωση"
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "Αυτόματα"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "Κλείδωμα δικτύου"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "Κλείδωμα τηλεφώνου"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "Κλείδωμα PIN"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "Κλείδωμα PUK"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "Η κάρτα SIM είναι μπλοκαρισμένη"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "Κλείδωμα SIM"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "Απομένει 1 προσπάθεια"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Εταιρική εξατομίκευση ενεργή. Εισαγάγετε πλήκτρο ελέγχου"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "Εισάγετε νέο PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "Εισαγωγή PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "Εισαγωγή PUK"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "Λάθος PIN"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "Εσφαλμένο ΡΙΝ.\nΠαρακαλώ προσπαθήστε ξανά"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "Λάθος PUK"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "Η γλώσσα δεν υποστηρίζεται"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Εξατομίκευση δικτύου ενεργή. Εισαγάγετε πλήκτρο ελέγχου"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Εξατομίκευση υποσυνόλου δικτύου ενεργή. Εισαγάγετε πλήκτρο ελέγχου"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "Ο κωδικός πρόσβασης πρέπει να είναι τετραψήφιος"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "%d προσπάθειες απομένουν"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Εξατομίκευση παροχέα υπηρεσιών ενεργή. Εισαγάγετε πλήκτρο ελέγχου"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "Μη διαθέσιμη κάρτα SIM. Επικοινωνήστε με τον παροχέα υπηρεσιών"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "Δεν είναι δυνατή η ανάγνωση της γλώσσας της κάρτας SIM"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "Λάθος κωδικός"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "Επ. κλήσ."
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "Γλώσσα εμφάνισης"
+
diff --git a/po/en.po b/po/en.po
new file mode 100755
index 0000000..bc087e4
--- /dev/null
+++ b/po/en.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "Confirm new PIN"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "Password empty"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "%d to %d digits required"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "Incorrect PIN. 1 attempt left"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr "Incorrect PIN. %d attempts left"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr "New PIN"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "PIN"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "PUK"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "PIN blocked"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "PIN unblocked"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "Cancel"
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "Automatic"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "Network lock"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "Phone lock"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "PIN lock"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "PUK lock"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "SIM blocked"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "SIM lock"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "1 attempt left"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Corporate personalisation on. Enter control key"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "Enter new PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "Enter PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "Enter PUK"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "Incorrect PIN"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "Incorrect PIN. Try again"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "Incorrect PUK"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "Language not supported"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Network personalisation on. Enter control key"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Network subset personalisation on. Enter control key"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "Password must be 4 digits long"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "%d attempts left"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Service provider personalisation on. Enter control key"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "SIM card not available. Contact your service provider"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "Unable to read SIM card language"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "Wrong password"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "Dialer"
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "Display language"
+
diff --git a/po/es_ES.po b/po/es_ES.po
new file mode 100755
index 0000000..a69008e
--- /dev/null
+++ b/po/es_ES.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "Confirmar PIN nuevo"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "Contraseña vacía"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "Se necesitan de %d a %d dígitos"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "PIN incorrecto. Queda un intento"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr "PIN incorrecto. Quedan %d intentos"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr "Nuevo PIN"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "PIN"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "PUK"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "PIN bloqueado"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "PIN desbloqueado"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "Cancelar"
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "Automático"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "Bloqueo red"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "Bloqueo del teléfono"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "Bloqueo de PIN"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "Bloqueo de PUK"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "SIM bloqueada"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "Bloqueo de SIM"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "Último intento"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personalización corporativa activada. Pulse tecla Control"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "Introducir PIN nuevo"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "Introducir PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "Introducir PUK"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "PIN incorrecto"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "PIN incorrecto. Vuelva a intentarlo"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "PUK incorrecto"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "Idioma no admitido"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personalización de red activada. Pulse tecla Control"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personalización de subconjunto de red activada. Pulse tecla Control"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "La contraseña debe tener 4 dígitos de longitud"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "Quedan %d intentos"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personalización de proveedor de servicios activada. Pulse tecla Control"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "Tarjeta SIM no disponible. Póngase en contacto con el proveedor de servicios"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "No se puede leer idioma de tarjeta SIM"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "Contraseña incorrecta"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "Marcador"
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "Idioma para mostrar"
+
diff --git a/po/fr_FR.po b/po/fr_FR.po
new file mode 100755
index 0000000..d24bf42
--- /dev/null
+++ b/po/fr_FR.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "Confirmer nouveau code PIN"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "Mot de passe vide"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "%d à %d chiffres requis"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "PIN incorrect 1 essai restant"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr "PIN incorrect. %d essais restants"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr "Nouveau code PIN"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "Code PIN"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "Code PUK"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "Code PIN bloqué"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "Code PIN débloqué"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "Annuler"
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "Automatique"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "Code blocage réseau"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "Verrouillage téléphone"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "Verrouillage PIN"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "Verrouillage PUK"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "Carte SIM bloquée"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "Verrouillage SIM"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "1 essai restant"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personnalisation entreprise activée. Appuyez sur Contrôle"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "Saisir le nouveau code PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "Saisir le code PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "Saisir le code PUK"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "Code PIN incorrect"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "Code PIN incorrect\nRéessayez"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "Code PUK incorrect"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "Langue non prise en charge"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personnalisation réseau activée. Appuyez sur Contrôle"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personnalisation sous-réseau activée. Appuyez sur Contrôle"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "Le mot de passe doit comporter 4 chiffres"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "%d essais restants"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personnalisation fournisseur d'accès activée. Appuyez sur Contrôle"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "Carte SIM non disponible. Contactez votre opérateur"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "Impossible de lire la langue de la carte SIM"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "Mot de passe incorrect"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "Clavier"
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "Langue d'affichage"
+
diff --git a/po/it_IT.po b/po/it_IT.po
new file mode 100755
index 0000000..fc053f3
--- /dev/null
+++ b/po/it_IT.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "Conferma nuovo PIN"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "Password vuota"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "Sono richieste cifre da %d a %d"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "PIN errato. 1 tentativo rimasto"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr "PIN errato. %d tentativi rimasti"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr "Nuovo PIN"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "PIN"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "PUK"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "PIN bloccato"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "PIN sbloccato"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "Annulla"
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "Automatica"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "Blocco rete"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "Blocco telefono"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "Blocco PIN"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "Blocco PUK"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "SIM bloccata"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "Blocco SIM"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "1 tentativo rimasto"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personalizzazione aziendale attiva. Immettere il tasto di controllo"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "Inserisci nuovo PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "Inserisci PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "Inserisci PUK"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "PIN errato"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "PIN errato.\nRiprovare"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "PUK errato"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "Lingua non supportata"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personalizzazione di rete attiva. Immettere il tasto di controllo"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personalizzazione del sottoinsieme di rete attiva. Immettere il tasto di controllo"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "La password deve contenere 4 cifre"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "%d tentativi possibili"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personalizzazione del fornitore di servizi attiva. Immettere il tasto di controllo"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "Scheda SIM non disponibile, contattare il fornitore di servizi"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "Impossibile leggere la lingua della scheda SIM"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "Password errata"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "Componi"
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "Lingua display"
+
diff --git a/po/ja_JP.po b/po/ja_JP.po
new file mode 100755
index 0000000..4fb280f
--- /dev/null
+++ b/po/ja_JP.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "新しい​PIN​を​確認​"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "パスワードを入力"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "%d​~​%d桁​が​必要"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "PIN​が​間違って​います。​残り​の​試行​回数​は​1回​です"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr "間違った​PIN​です。​残りの​試行​回数​:%d"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr "新しいPIN"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "PIN"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "PUK"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "PIN​が​ブロック​されました"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "PINが​ブロック​解除​されました"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "キャンセル"
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "自動"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "ネットワーク​ロック"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "端末ロック"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "PIN​認証"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "PUK​認証"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "SIM​が​ブロック​されました"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "SIM​​ロック"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "残りの​試行回​数は​1回です"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "コーポレート​パーソナライゼーション​が​On​です。​コントロール​キーを​入力​して​ください"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "新しい​PIN​を​入力"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "PIN​を​入力"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "PUK​を​入力"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "PINが​間違って​います"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "PINが​間違って​います。もう一度​やり直して​ください"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "PUK​が​間違って​います"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "対応​して​いない​言語です"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "ネットワーク​パーソナライゼーション​が​On​です。​コントロール​キー​を​入力​して​ください"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "ネットワーク​サブセット​パーソナライゼーション​が​On​です。​コントロール​キー​を​入力​して​ください"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "パスワードは​4桁の​数字で​なければなりません"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "残りの​試行​回数​:%d"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "サービスプロバイダー​パーソナライゼーション​が​On​です。​コントロール​キー​を​入力​して​ください"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "SIMカード​を​使用​できません。​サービスプロバイダー​に​ご連絡​ください"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "SIM​カード​の​言語​を​読み込め​ません"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "不正な​パスワード"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "アイドル状態"
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "言語​表示"
+
diff --git a/po/ko_KR.po b/po/ko_KR.po
new file mode 100755
index 0000000..24f9fc6
--- /dev/null
+++ b/po/ko_KR.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "새 PIN 확인"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "비밀번호를 입력하세요"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "%d~%d자리를 입력하세요"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "PIN이 바르지 않습니다. 재입력 기회가 1회 남았습니다"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr "PIN이 바르지 않습니다. 재입력 기회가 %d번 남았습니다"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr "새 PIN"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "PIN"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "PUK"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "PIN이 잠겼습니다"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "PIN 잠금이 해제되었습니다"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "취소"
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "자동"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "네트워크 잠금"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "휴대폰 잠금"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "PIN 잠금"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "PUK 잠금"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "SIM이 잠겼습니다"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "SIM 잠금"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "재입력 기회가 1번 남았습니다"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "법인 잠금이 실행되어 있습니다. 제어키를 입력하세요"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "새 PIN을 입력하세요"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "PIN을 입력하세요"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "PUK을 입력하세요"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "PIN이 바르지 않습니다"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "PIN이 바르지 않습니다. 다시 입력하세요"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "PUK이 바르지 않습니다"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "지원되지 않는 언어입니다"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "네트워크 잠금이 실행되어 있습니다. 제어키를 입력하세요"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "네트워크 서브셋 잠금이 실행되어 있습니다. 제어키를 입력하세요"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "비밀번호는 4자리보다 길어야 합니다"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "재입력 기회가 %d회 남았습니다"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "서비스 사업자 잠금이 실행되어 있습니다. 제어키를 입력하세요"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "SIM 카드를 사용할 수 없습니다. 서비스 사업자에게 문의하세요"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "SIM 카드 언어를 읽을 수 없습니다"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "비밀번호가 바르지 않습니다"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "다이얼"
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "언어 선택"
+
diff --git a/po/nl_NL.po b/po/nl_NL.po
new file mode 100755
index 0000000..7c04e4c
--- /dev/null
+++ b/po/nl_NL.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "Bevestig nieuwe PIN"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "Wachtwoord leeg"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "%d tot %d cijfers vereist"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "Onjuiste PIN. 1 poging over"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr "Onjuiste PIN. %d pogingen over"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr "Nieuwe PIN"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "Geef PIN-code in"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "PUK"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "PIN geblokkeerd"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "PIN gedeblokkeerd"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "Annuleer"
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "Automatisch"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "Netwerkblokkering"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "Telefoonblokkering"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "PIN-blokkering"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "PUK-blokkering"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "SIM geblokkeerd"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "SIM-blokkering"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "1 poging over"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Bedrijfsaanpassing ingeschakeld. Druk op Ctrl"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "Geef nieuwe PIN in"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "Geef PIN in"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "Geef PUK-code in"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "Onjuiste PIN"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "PIN onjuist.\nProbeer het opnieuw"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "Onjuiste PUK"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "Taal niet ondersteund"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Netwerkaanpassing ingeschakeld. Druk op Ctrl"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Aanpassing netwerksubset ingeschakeld. Druk op Ctrl"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "Wachtwoord moet uit 4 cijfers bestaan"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "%d pogingen over"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Aanpassing serviceprovider ingeschakeld. Druk op Ctrl"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "SIM-kaart niet beschikbaar. Neem contact op met de serviceprovider"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "Kan taal van SIM-kaart niet lezen"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "Wachtwoord onjuist"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "Kiezer"
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "Display taal"
+
diff --git a/po/pt_PT.po b/po/pt_PT.po
new file mode 100755
index 0000000..128cd4a
--- /dev/null
+++ b/po/pt_PT.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "Confirmar novo PIN"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "Palavra-passe vazia"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "São necessários %d a %d dígitos"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "PIN incorrecto. Resta 1 tentativa"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr "PIN incorrecto. Restam %d tentativas"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr "Novo PIN"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "PIN"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "PUK"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "PIN bloqueado"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "PIN desbloqueado"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "Cancelar"
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "Automático"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "Bloqueio de rede efectuado"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "Bloqueio do telefone"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "Protecção por PIN"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "Bloqueio do PUK"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "SIM bloqueado"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "Bloqueio do SIM"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "Resta 1 tentativa"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personalização empresarial activada. Prima a tecla de controlo"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "Introduzir novo PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "Introduzir PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "Introduzir PUK"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "PIN incorrecto"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "PIN incorrecto.\nTente novamente"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "PUK incorrecto"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "Idioma não suportado"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personalização de rede activada. Prima a tecla de controlo"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personalização de subconjunto de rede activada. Prima a tecla de controlo"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "A palavra-passe deve ter 4 dígitos"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "%d tentativas restantes"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Personalização do fornecedor de serviços activada. Prima a tecla de controlo"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "Cartão SIM indisponível. Contacte o fornecedor de serviços"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "Impossível ler idioma do cartão SIM"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "Palavra-passe incorrecta"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "Marcador"
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "Idioma de apresentação"
+
diff --git a/po/pwlock.pot b/po/pwlock.pot
new file mode 100755
index 0000000..2d9c7e9
--- /dev/null
+++ b/po/pwlock.pot
@@ -0,0 +1,143 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-19 19:56+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: pwlock.c:81
+msgid "Enter password"
+msgstr ""
+
+#: pwlock.c:82
+msgid "Enter PIN"
+msgstr ""
+
+#: pwlock.c:83
+msgid "Enter New PIN"
+msgstr ""
+
+#: pwlock.c:84
+msgid "Retype PIN"
+msgstr ""
+
+#: pwlock.c:85
+msgid "Enter PUK"
+msgstr ""
+
+#: pwlock.c:86
+msgid "Incorrect PIN"
+msgstr ""
+
+#: pwlock.c:87
+msgid "Incorrect PUK"
+msgstr ""
+
+#: pwlock.c:88
+#, c-format
+msgid "%d attempt(s) left"
+msgstr ""
+
+#: pwlock.c:89
+msgid "Done"
+msgstr ""
+
+#: pwlock.c:90
+msgid "Dialer"
+msgstr ""
+
+#: pwlock.c:91
+msgid "Wrong password"
+msgstr ""
+
+#: pwlock.c:92
+msgid "PIN code not matched"
+msgstr ""
+
+#: pwlock.c:93
+msgid "Display language"
+msgstr ""
+
+#: pwlock.c:94
+msgid "Set"
+msgstr ""
+
+#: pwlock.c:95
+msgid "Cancel"
+msgstr ""
+
+#: pwlock.c:96
+msgid "Get SIM language failed"
+msgstr ""
+
+#: pwlock.c:97
+#, c-format
+msgid "Unsupported language: %s"
+msgstr ""
+
+#: pwlock.c:98
+msgid "SIM unavailable. Please contact your service provider."
+msgstr ""
+
+#: pwlock.c:99
+msgid "Enter SIM password"
+msgstr ""
+
+#: pwlock.c:100
+msgid "Network Personalisation is on. Please enter the control key"
+msgstr ""
+
+#: pwlock.c:101
+msgid "Network Subset Personalisation is on. Please enter the control key"
+msgstr ""
+
+#: pwlock.c:102
+msgid "Service Provider Personalisation is on. Please enter the control key"
+msgstr ""
+
+#: pwlock.c:103
+msgid "Coporate Personalisation is on. Please enter the control key"
+msgstr ""
+
+#: pwlock.c:104
+msgid "Password must be 4 digits long"
+msgstr ""
+
+#: ui.c:46
+msgid "Phone lock"
+msgstr ""
+
+#: ui.c:47
+msgid "PIN lock"
+msgstr ""
+
+#: ui.c:48 ui.c:49 ui.c:50
+msgid "PUK lock"
+msgstr ""
+
+#: ui.c:51
+msgid "Phone blocked"
+msgstr ""
+
+#: ui.c:52
+msgid "SIM lock"
+msgstr ""
+
+#: ui.c:53 ui.c:54 ui.c:55 ui.c:56
+msgid "Network lock"
+msgstr ""
+
+#: langs.c:20
+msgid "Automatic"
+msgstr ""
diff --git a/po/ru_RU.po b/po/ru_RU.po
new file mode 100755
index 0000000..625326c
--- /dev/null
+++ b/po/ru_RU.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "Подтвердите новый PIN"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "Пароль пустой"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "Требуется от %d до %d цифр"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "Неправильный PIN-код. Осталась 1 попытка"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr "Неправильный PIN-код. Осталось попыток: %d"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr "Новый PIN-код"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "PIN"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "PUK"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "PIN заблокирован"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "PIN разблокирован"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "Отмена"
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "Автоматически"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "Блокировка сети"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "Блокировка телефона"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "Проверка PIN"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "Блокировка PUK"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "SIM-карта заблокирована"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "Блокировка SIM"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "Осталась 1 попытка"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Включена корпоративная настройка. Введите контрольный ключ"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "Введите новый PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "Введите PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "Введите PUК"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "Неверный PIN"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "Неправильный PIN.\nПовторите попытку"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "Неправильный PUK"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "Язык не поддерживается"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Включена личная настройка сети. Введите контрольный ключ"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Включена личная настройка подсети. Введите контрольный ключ"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "Пароль должен состоять из 4 цифр"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "Осталось попыток: %d"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Включена личная настройка поставщика услуг. Введите контрольный ключ"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "SIM-карта недоступна. Обратитесь к поставщику услуг"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "Не удалось прочитать язык SIM-карты"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "Неправильный пароль"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "Набор"
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "Язык"
+
diff --git a/po/tr_TR.po b/po/tr_TR.po
new file mode 100755
index 0000000..6751e5f
--- /dev/null
+++ b/po/tr_TR.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "Yeni PIN kodunu onaylayın"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "Parola boş"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "%d ila %d hane gerekli"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "Hatalı PIN. 1 deneme hakkı kaldı"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr "Hatalı PIN. %d deneme hakkı kaldı"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr " Yeni PIN"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "PIN"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "PUK"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "PIN bloke edildi"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "PIN kilidi kaldırıldı"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "İptal"
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "Otomatik"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "Şebeke kilidi"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "Telefon kilidi"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "PIN kilidi"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "PUK kilidi"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "SIM bloke edildi"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "SIM kilidi"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "1 deneme hakkı kaldı"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Şirket kişiselleştirme açık. Kontrol kodunu girin"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "Yeni PIN kodunu girin"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "PIN'i girin"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "PUK kodunu girin"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "Yanlış PIN"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "Hatalı PIN.\nLütfen tekrar deneyin"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "Yanlış PUK"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "Dil desteklenmiyor"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Ağ kişiselleştirme açık. Kontrol kodunu girin"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Ağ altkümesi kişiselleştirme açık. Kontrol kodunu girin"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "Şifre 4 basamaklı olmalıdır"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "%d deneme kaldı"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "Servis sağlayıcı kişiselleştirme açık. Kontrol kodunu girin"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "SIM kartı kullanılamıyor. Servis sağlayıcınıza başvurun"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "SIM kartı dili okunamıyor"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "Yanlış şifre"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "Arayıcı"
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "Ekran dili"
+
diff --git a/po/update-po.sh b/po/update-po.sh
new file mode 100755
index 0000000..a0a91fb
--- /dev/null
+++ b/po/update-po.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+PACKAGE=pwlock
+SRCROOT=..
+POTFILES=POTFILES.in
+
+#ALL_LINGUAS= am az be ca cs da de el en_CA en_GB es et fi fr hr hu it ja ko lv mk ml ms nb ne nl pa pl pt pt_BR ru rw sk sl sr sr@Latn sv ta tr uk vi zh_CN zh_TW
+ALL_LINGUAS="en_US en_GB ja ko zh_CN"
+
+XGETTEXT=/usr/bin/xgettext
+MSGMERGE=/usr/bin/msgmerge
+
+echo -n "Make ${PACKAGE}.pot "
+if [ ! -e $POTFILES ] ; then
+ echo "$POTFILES not found"
+ exit 1
+fi
+
+$XGETTEXT --default-domain=${PACKAGE} --directory=${SRCROOT} \
+ --add-comments --keyword=_ --keyword=N_ --files-from=$POTFILES
+if [ $? -ne 0 ]; then
+ echo "xgettext error"
+ exit 1
+fi
+
+if [ ! -f ${PACKAGE}.po ]; then
+ echo "No such file: ${PACKAGE}.po"
+ exit 1
+fi
+
+rm -f ${PACKAGE}.pot && mv ${PACKAGE}.po ${PACKAGE}.pot
+echo "done"
+
+for LANG in $ALL_LINGUAS; do
+ echo "$LANG : "
+
+ if [ ! -e $LANG.po ] ; then
+ sed 's/CHARSET/UTF-8/g' ${PACKAGE}.pot > ${LANG}.po
+ echo "${LANG}.po created"
+ else
+ if $MSGMERGE ${LANG}.po ${PACKAGE}.pot -o ${LANG}.new.po ; then
+ if cmp ${LANG}.po ${LANG}.new.po > /dev/null 2>&1; then
+ rm -f ${LANG}.new.po
+ else
+ if mv -f ${LANG}.new.po ${LANG}.po; then
+ echo ""
+ else
+ echo "msgmerge for $LANG.po failed: cannot move $LANG.new.po to $LANG.po" 1>&2
+ rm -f ${LANG}.new.po
+ exit 1
+ fi
+ fi
+ else
+ echo "msgmerge for $LANG failed!"
+ rm -f ${LANG}.new.po
+ fi
+ fi
+ echo ""
+done
+
diff --git a/po/zh_CN.po b/po/zh_CN.po
new file mode 100755
index 0000000..7e48c58
--- /dev/null
+++ b/po/zh_CN.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "确认新 PIN"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "密码为空"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "需要 %d 到 %d 位数"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "PIN 不正确。 剩余 1 次机会"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr "PIN 不正确。 还有 %d 次机会"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr "新PIN码"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "PIN 码"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "PUK"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "PIN 码锁定"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "PIN 码解锁"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "取消"
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "自动"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "网络锁"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "手机锁"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "PIN码锁"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "PUK 锁"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "SIM 卡已锁定"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "SIM卡锁"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "还能尝试 1 次"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "企业个人化启动。请输入控制密钥"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "输入新 PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "输入PIN码"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "输入 PUK码"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "错误的 PIN 码"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "PIN 不正确。 请重试"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "错误的 PUK 码"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "不支持语言"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "网络个人化启动。请输入控制密钥"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "网络子集个人化启动。请输入控制密钥"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "密码必须是 4 位数"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "还有 %d 次机会"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "服务提供商个人化启动。请输入控制密钥"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "SIM卡不可用。请联系服务提供商"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "无法读取SIM卡语言"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "密码不符"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "拨号盘"
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "显示语言"
+
diff --git a/po/zh_HK.po b/po/zh_HK.po
new file mode 100755
index 0000000..db989f0
--- /dev/null
+++ b/po/zh_HK.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "確認新 PIN 碼"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "密碼空白"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "需要 %d 到 %d 位數"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "PIN 碼不正確。剩餘 1 次機會"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr "PIN 碼不正確。剩餘 %d 次機會"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr "新 PIN 碼"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "PIN 碼"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "PUK 碼"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "PIN 碼已封鎖"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "PIN 碼已解鎖"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "取消"
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "自動"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "網絡鎖"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "手機鎖"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "PIN 碼鎖"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "PUK 碼鎖"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "SIM 卡已封鎖"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "SIM 卡鎖"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "剩餘1次機會"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "公司個人化已開。輸入控制密碼"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "輸入新 PIN 碼"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "輸入 PIN 碼"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "輸入PUK碼"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "PIN 碼不正確"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "PIN 碼不正確。請重試"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "PUK 碼錯誤"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "語言不支援"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "網絡個人化已開。輸入控制密碼"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "網絡子集個人化已開。輸入控制密碼"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "密碼必須是 4 位數"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "剩餘 %d 次機會"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "服務供應商個人化已開。輸入控制密碼"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "SIM 卡不可用。請聯絡服務供應商"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "無法讀取 SIM 卡語言"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "密碼錯誤"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "撥出螢幕"
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "顯示語言"
+
diff --git a/po/zh_TW.po b/po/zh_TW.po
new file mode 100755
index 0000000..d4a544a
--- /dev/null
+++ b/po/zh_TW.po
@@ -0,0 +1,111 @@
+msgid "IDS_IDLE_BODY_CONFIRM_NEW_PIN"
+msgstr "確認新的 PIN"
+
+msgid "IDS_IDLE_BODY_PASSWORD_EMPTY"
+msgstr "密碼為空"
+
+msgid "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED"
+msgstr "需要 %d 到 %d 位數"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT"
+msgstr "PIN 不正確。還剩 1 次嘗試機會"
+
+msgid "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT"
+msgstr "PIN 不正確。剩餘 %d 次嘗試機會"
+
+msgid "IDS_IDLE_BODY_NEW_PIN"
+msgstr "新 PIN"
+
+msgid "IDS_IDLE_BODY_PIN"
+msgstr "PIN"
+
+msgid "IDS_IDLE_BODY_PUK"
+msgstr "PUK"
+
+msgid "IDS_IDLE_POP_PIN_BLOCKED"
+msgstr "PIN 已封鎖"
+
+msgid "IDS_IDLE_POP_PIN_UNBLOCKED"
+msgstr "未封鎖 PIN"
+
+msgid "IDS_IDLE_BUTTON_CANCEL"
+msgstr "取消"
+
+msgid "IDS_IDLE_BODY_AUTOMATIC"
+msgstr "自動"
+
+msgid "IDS_IDLE_HEADER_NETWORK_LOCK"
+msgstr "網路鎖定"
+
+msgid "IDS_IDLE_HEADER_PHONE_LOCK"
+msgstr "手機鎖"
+
+msgid "IDS_IDLE_HEADER_PIN_LOCK"
+msgstr "PIN 鎖"
+
+msgid "IDS_IDLE_HEADER_PUK_LOCK"
+msgstr "PUK 鎖"
+
+msgid "IDS_IDLE_HEADER_SIM_BLOCKED"
+msgstr "SIM 卡已封鎖"
+
+msgid "IDS_IDLE_HEADER_SIM_LOCK"
+msgstr "SIM 卡鎖"
+
+msgid "IDS_IDLE_BODY_1_ATTEMPT_LEFT"
+msgstr "剩下一次機會"
+
+msgid "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "開啟企業個性化,請輸入控制碼"
+
+msgid "IDS_IDLE_BODY_ENTER_NEW_PIN"
+msgstr "輸入新的 PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PIN"
+msgstr "輸入 PIN"
+
+msgid "IDS_IDLE_BODY_ENTER_PUK"
+msgstr "輸入 PUK"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN"
+msgstr "PIN 不正確"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN"
+msgstr "PIN 不正確。請重試"
+
+msgid "IDS_IDLE_BODY_INCORRECT_PUK"
+msgstr "PUK 不正確"
+
+msgid "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED"
+msgstr "不支持的語言"
+
+msgid "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "開啟網路個性化,請輸入控制碼"
+
+msgid "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "開啟網路子遮照個性化,請輸入控制碼"
+
+msgid "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG"
+msgstr "密碼長度必須是 4 位數字"
+
+msgid "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT"
+msgstr "剩餘 %d 次嘗試機會"
+
+msgid "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY"
+msgstr "開啟系統服務商個性化,請輸入控制碼"
+
+msgid "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER"
+msgstr "SIM卡無法使用。請與您的系統服務商聯絡"
+
+msgid "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE"
+msgstr "無法讀取SIM卡語言"
+
+msgid "IDS_IDLE_BODY_WRONG_PASSWORD"
+msgstr "密碼錯誤"
+
+msgid "IDS_IDLE_BUTTON_DIALER"
+msgstr "撥號程式"
+
+msgid "IDS_IDLE_HEADER_DISPLAY_LANGUAGE"
+msgstr "顯示語言"
+
diff --git a/sb-conf b/sb-conf
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/sb-conf
diff --git a/src/pwlock.c b/src/pwlock.c
new file mode 100755
index 0000000..3f6bddd
--- /dev/null
+++ b/src/pwlock.c
@@ -0,0 +1,1003 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <stdio.h>
+#include <appcore-efl.h>
+#include <Ecore_X.h>
+#include <ITapiSim.h>
+
+#include <vconf.h>
+#include <utilX.h>
+#include <ui-gadget.h>
+
+#include "pwlock.h"
+#include "util.h"
+#include "ui.h"
+
+#define _ST_START _ST_FIRST
+#define HOME_KEY KEY_SELECT
+#define BACK_KEY KEY_END
+
+#define PWLOCK_FIRST_BOOT "db/setting/pwlock_boot"
+#define MENUSCREEN_PKG_NAME "db/menuscreen/pkgname"
+#define LIVE_MAGAZINE_START "memory/startapps/sequence"
+#define TIMEZONE_CITY_NAME "db/setting/cityname_id"
+#define TIMEZONE_INFO_PATH "/usr/share/zoneinfo/"
+#define TIMEZONE_INFO_FILE TIMEZONE_INFO_PATH"zone.tab"
+
+#define MODEM_ARM "/boot/moden.bin"
+#define MODEM_X86 "/usr/bin/vmodem_x86"
+
+struct state {
+ int (*_do) (struct appdata * ad);
+};
+
+static int do_ST_FIRST(struct appdata *ad);
+static int do_ST_TAPI_INIT(struct appdata *ad);
+static int do_ST_SIM(struct appdata *ad);
+static int do_ST_SIM_PINCNF(struct appdata *ad);
+static int do_ST_SIM_PUKCNF(struct appdata *ad);
+static int do_ST_SIM_LOCKCNF(struct appdata *ad);
+static int do_ST_NETWORK_LOCKCNF(struct appdata *ad);
+static int do_ST_EXIT(struct appdata *ad);
+static int do_ST_LANG(struct appdata *ad);
+static int do_ST_TIME(struct appdata *ad);
+static int do_ST_KEYBOARD(struct appdata *ad);
+static void set_pwlock_unlock_state(struct appdata *ad);
+static void set_pwlock_lock_state(struct appdata *ad);
+static Eina_Bool timer_do(void *data);
+static void set_default_timezone(void *data);
+
+static struct state states[_ST_MAX] = {
+ {do_ST_FIRST,},
+ {do_ST_TAPI_INIT,},
+ {do_ST_SIM,},
+ {do_ST_SIM_PINCNF,},
+ {do_ST_SIM_PUKCNF,},
+ {do_ST_SIM_LOCKCNF,},
+ {do_ST_NETWORK_LOCKCNF,},
+ {do_ST_EXIT,},
+ {do_ST_LANG,},
+ {do_ST_TIME,},
+ {do_ST_KEYBOARD,},
+};
+
+static inline void trans(struct appdata *ad, int state)
+{
+ _DBG("trans state %d --> state %d", ad->state, state);
+ ad->state = state;
+
+}
+
+static void set_default_timezone(void *data)
+{
+ struct appdata *ad = (struct appdata *)data;
+ char *city_name = NULL;
+ FILE *fp = NULL;
+ char tmp[256] = { 0 };
+ char buf1[256] = { 0 };
+ char buf2[256] = { 0 };
+ char buf3[256] = { 0 };
+ char timezone_path[256] = { 0 };
+ _DBG("%s", __func__);
+
+ if (ad == NULL) {
+ return;
+ }
+
+ city_name = vconf_get_str(TIMEZONE_CITY_NAME);
+ _DBG("city_name = %s", city_name);
+
+ fp = fopen(TIMEZONE_INFO_FILE, "r");
+
+ while (fp != NULL && fgets(tmp, sizeof(tmp), fp) != NULL) {
+ if (strstr(tmp, city_name)) {
+ sscanf(tmp, "%s\t%s\t%s", buf1, buf2, buf3);
+ snprintf(timezone_path, 256, TIMEZONE_INFO_PATH "%s",
+ buf3);
+ }
+ }
+
+ if (fp != NULL) {
+ fclose(fp);
+ }
+ if (city_name != NULL) {
+ free(city_name);
+ city_name = NULL;
+ }
+ _DBG("timezone_path = %s", timezone_path);
+ sysman_set_timezone(timezone_path);
+}
+
+static void _sim_retry(struct appdata *ad, int retry)
+{
+ char buf[256];
+ int len = -1;
+
+ _DBG("%s", __func__);
+
+ if (retry == 0) {
+ trans(ad, _ST_SIM);
+ do_state(ad);
+ return;
+ }
+
+ if (retry == 1) {
+ len =
+ g_strlcpy(buf,
+ pwlock_get_string(IDS_IDLE_BODY_1_ATTEMPT_LEFT),
+ sizeof(buf));
+ if (len >= sizeof(buf)) {
+ return;
+ }
+ } else {
+ len =
+ snprintf(buf, sizeof(buf),
+ pwlock_get_string(IDS_IDLE_BODY_PD_ATTEMPTS_LEFT),
+ retry);
+ if (len == -1) {
+ return;
+ } else if (len > 0) {
+ buf[len] = '\0';
+ }
+ }
+
+ show_popup(ad, buf, EINA_TRUE);
+ clear_entry(ad);
+
+ if (ad->state == _ST_SIM_PUKCNF) {
+ ecore_timer_add(3, show_puk_do, ad);
+ }
+}
+
+static void _sim_retry_no_cnt(struct appdata *ad)
+{
+ _DBG("%s", __func__);
+
+ show_msg(ad, IDS_IDLE_BODY_WRONG_PASSWORD);
+
+ clear_entry(ad);
+}
+
+static void _tapi_cb(struct tapi_info *i, struct appdata *ad)
+{
+ _DBG("%s, i->st:%d", __func__, i->st);
+
+ switch (i->st) {
+ case SIM_REQUIRED_EVENT:
+ if ((ad->sim_status != 0) && (ad->sim_status == SIM_WAITING)) {
+ trans(ad, _ST_SIM);
+ do_state(ad);
+ }
+ break;
+ case SIM_OK:
+ trans(ad, _ST_SIM);
+ do_state(ad);
+ break;
+ case SIM_RETRY:
+ _sim_retry(ad, i->retry_cnt);
+ break;
+ case SIM_ERROR:
+ _ERR("SIM check error");
+ trans(ad, _ST_EXIT);
+ show_msg(ad, IDS_IDLE_POP_SIM_CARD_ERROR);
+ ecore_timer_add(3, timer_do, ad);
+ break;
+ case SIM_REQ_PIN:
+ if (ad->state == _ST_SIM_PINCNF) {
+ _sim_retry(ad, i->retry_cnt);
+ } else {
+ trans(ad, _ST_SIM);
+ do_state(ad);
+ }
+ break;
+ case SIM_REQ_PUK:
+ if (ad->state == _ST_SIM_PUKCNF) {
+ _sim_retry(ad, i->retry_cnt);
+ } else {
+ show_msg(ad, IDS_IDLE_BODY_INCORRECT_PIN);
+ ecore_timer_add(3, show_puk_do, ad);
+ }
+ break;
+ case SIM_REQ_LOCK:
+ _sim_retry_no_cnt(ad);
+ break;
+ case SIM_REQ_NCK:
+ clear_entry(ad);
+ ad->sub_state = TAPI_SIM_PERS_NET;
+ trans(ad, _ST_NETWORK_LOCKCNF);
+ do_state(ad);
+ break;
+ case SIM_REQ_NSCK:
+ clear_entry(ad);
+ ad->sub_state = TAPI_SIM_PERS_NS;
+ trans(ad, _ST_NETWORK_LOCKCNF);
+ do_state(ad);
+ break;
+ case SIM_REQ_SPCK:
+ clear_entry(ad);
+ ad->sub_state = TAPI_SIM_PERS_SP;
+ trans(ad, _ST_NETWORK_LOCKCNF);
+ do_state(ad);
+ break;
+ case SIM_REQ_CCK:
+ clear_entry(ad);
+ ad->sub_state = TAPI_SIM_PERS_CP;
+ trans(ad, _ST_NETWORK_LOCKCNF);
+ do_state(ad);
+ break;
+
+ default:
+ break;
+ }
+}
+
+static void tapi_cb(struct tapi_info *i, void *data)
+{
+ struct appdata *ad = data;
+
+ _DBG("%s, ad->state:%d", __func__, ad->state);
+
+ _tapi_cb(i, ad);
+
+ return;
+}
+
+static int do_ST_FIRST(struct appdata *ad)
+{
+ int r = 0;
+ int first = 0;
+
+ _DBG("%s", __func__);
+
+ r = vconf_get_bool(PWLOCK_FIRST_BOOT, &first);
+ _DBG("vconf get %s, result:%d, get_value:%d", PWLOCK_FIRST_BOOT, r,
+ first);
+ if ((r == 0 && first == 0) || (ad->running_status > 0)) {
+ _DBG("Not first booting time");
+ ad->first_boot = 0;
+ trans(ad, _ST_TAPI_INIT);
+ } else {
+ _DBG("First booting time");
+ vconf_set_bool(PWLOCK_FIRST_BOOT, 0);
+ ad->first_boot = 1;
+ trans(ad, _ST_LANG);
+ set_default_timezone(ad);
+ }
+ vconf_set_int(LIVE_MAGAZINE_START, 1);
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool timer_do(void *data)
+{
+ do_state(data);
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void set_pwlock_unlock_state(struct appdata *ad)
+{
+ if (ad->running_status > 0)
+ vconf_set_int(VCONFKEY_PWLOCK_STATE,
+ VCONFKEY_PWLOCK_RUNNING_UNLOCK);
+ else
+ vconf_set_int(VCONFKEY_PWLOCK_STATE,
+ VCONFKEY_PWLOCK_BOOTING_UNLOCK);
+}
+
+static void set_pwlock_lock_state(struct appdata *ad)
+{
+ if (ad->running_status > 0)
+ vconf_set_int(VCONFKEY_PWLOCK_STATE,
+ VCONFKEY_PWLOCK_RUNNING_LOCK);
+ else
+ vconf_set_int(VCONFKEY_PWLOCK_STATE,
+ VCONFKEY_PWLOCK_BOOTING_LOCK);
+}
+
+static void vconf_call_state_changed_cb(keynode_t * node, void *data)
+{
+ int api_ret = 0;
+ int vconf_val = 0;
+ struct appdata *ad = data;
+
+ _DBG("%s", __func__);
+
+ api_ret = vconf_get_int(VCONFKEY_CALL_STATE, &vconf_val);
+ if (api_ret != 0) {
+ _DBG("fail to get vconf key %s value", VCONFKEY_CALL_STATE);
+ } else {
+ if (vconf_val == VCONFKEY_CALL_OFF) {
+ _DBG("call off state..");
+ set_win_prop(ad, ECORE_X_WINDOW_TYPE_NOTIFICATION);
+ } else {
+ _DBG("call on state..");
+ set_win_prop(ad, ECORE_X_WINDOW_TYPE_NORMAL);
+ }
+ }
+ return;
+}
+
+static void register_vconf_call_state_changed(struct appdata *ad)
+{
+ _DBG("%s", __func__);
+ if (vconf_notify_key_changed
+ (VCONFKEY_CALL_STATE, vconf_call_state_changed_cb, ad) != 0) {
+ _DBG("Fail to register");
+ }
+}
+
+void vconf_tapi_ready_changed_cb(keynode_t * node, void *data)
+{
+ int api_ret = 0;
+ int vconf_val = 0;
+ struct appdata *ad = data;
+
+ _DBG("vconf_tapi_ready_changed_cb..!!");
+
+ api_ret = vconf_get_int(VCONFKEY_TELEPHONY_TAPI_STATE, &vconf_val);
+ if (api_ret != 0) {
+ _DBG("fail to get vconf key value");
+ } else {
+ if (vconf_val == VCONFKEY_TELEPHONY_TAPI_STATE_NONE) {
+ _DBG("TAPI is not ready");
+ } else {
+ _DBG("TAPI is ready");
+ if (ad->pTimerId != NULL) {
+ if (ecore_timer_del(ad->pTimerId) == NULL) {
+ _DBG("FAIL to stop timer with pTimerId[%x]", (int)ad->pTimerId);
+ } else {
+ _DBG("SUCCESS to stop timer with pTimerId[%x]", (int)ad->pTimerId);
+ }
+ }
+ trans(ad, _ST_SIM);
+ do_state(ad);
+ }
+ }
+ return;
+}
+
+void register_vconf_tapi_ready_changed(struct appdata *ad)
+{
+ _DBG("%s", __func__);
+ if (vconf_notify_key_changed
+ (VCONFKEY_TELEPHONY_TAPI_STATE, vconf_tapi_ready_changed_cb,
+ ad) != 0) {
+ _DBG("Fail to register");
+ }
+}
+
+Eina_Bool vconf_tapi_ready_expire_cb(void *pData)
+{
+ int api_ret = 0;
+ int vconf_val = 0;
+ struct appdata *ad = pData;
+
+ _DBG("vconf_tapi_ready_expire_cb..!!");
+
+ api_ret = vconf_get_int(VCONFKEY_TELEPHONY_TAPI_STATE, &vconf_val);
+ if (api_ret != 0) {
+ _DBG("fail to get vconf key value");
+ } else {
+ if (vconf_val == VCONFKEY_TELEPHONY_TAPI_STATE_NONE) {
+ _DBG("TAPI is not ready, pwlock exit");
+ trans(ad, _ST_EXIT);
+ do_state(ad);
+ } else {
+ _DBG("TAPI is ready");
+ trans(ad, _ST_SIM);
+ do_state(ad);
+ }
+ }
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static int do_ST_TAPI_INIT(struct appdata *ad)
+{
+ int r;
+ FILE *fd1;
+ FILE *fd2;
+
+ _DBG("%s", __func__);
+
+ fd1 = fopen(MODEM_ARM, "r");
+ if (fd1 == NULL) {
+ _DBG("no modem in target..!!");
+ fd2 = fopen(MODEM_X86, "r");
+ if (fd2 == NULL) {
+ _DBG("no modem in x86..!!");
+ if (ad->running_status == 0 && ad->first_boot
+ && ad->cancel_setup == 0) {
+ trans(ad, _ST_TIME);
+ } else {
+ trans(ad, _ST_EXIT);
+ }
+ return ECORE_CALLBACK_RENEW;
+ } else {
+ fclose(fd2);
+ }
+ } else {
+ fclose(fd1);
+ }
+
+ _DBG("there is modem..!!");
+
+ ad->t = tapi_init(tapi_cb, ad);
+ if (ad->t == NULL) {
+ _ERR("TAPI init error");
+ trans(ad, _ST_EXIT);
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ r = tapi_ready_check();
+ _DBG("tapi_ready_check : %d", r);
+
+ if (r == 0) {
+ ad->pTimerId =
+ ecore_timer_add(20, vconf_tapi_ready_expire_cb, ad);
+ register_vconf_tapi_ready_changed(ad);
+ r = ECORE_CALLBACK_CANCEL;
+ } else {
+ trans(ad, _ST_SIM);
+ r = ECORE_CALLBACK_RENEW;
+ }
+
+ return r;
+}
+
+static int do_ST_SIM(struct appdata *ad)
+{
+ int r;
+ int changed = 0;
+
+ _DBG("%s", __func__);
+
+ set_pwlock_unlock_state(ad);
+ set_pwlock_lock_state(ad);
+ ad->sim_status = tapi_check_sim(&changed);
+ ad->sim_changed = changed;
+ _DBG("ad->sim_status=%d, ad->sim_changed=%d, ad->first_boot=%d",
+ ad->sim_status, changed, ad->first_boot);
+ switch (ad->sim_status) {
+ case SIM_REQ_PIN:
+ pwlock_destroy(ad);
+ show_pin(ad);
+ trans(ad, _ST_SIM_PINCNF);
+ r = ECORE_CALLBACK_CANCEL;
+ break;
+ case SIM_REQ_PUK:
+ show_puk(ad);
+ trans(ad, _ST_SIM_PUKCNF);
+ r = ECORE_CALLBACK_CANCEL;
+ break;
+ case SIM_REQ_LOCK:
+ _DBG("ad->sim_status = %d", ad->sim_status);
+ if (ad->pin_changed == 1) {
+ r = ECORE_CALLBACK_CANCEL;
+ show_msg(ad, IDS_IDLE_POP_PIN_CHANGED);
+ } else {
+ show_sim_lock(ad);
+ }
+ trans(ad, _ST_SIM_LOCKCNF);
+ r = ECORE_CALLBACK_CANCEL;
+ break;
+ case SIM_REQ_NCK:
+ _DBG("ad->sim_status = %d", ad->sim_status);
+ if (ad->pin_changed == 1) {
+ show_msg(ad, IDS_IDLE_POP_PIN_CHANGED);
+ } else {
+ show_sim_lock(ad);
+ }
+ ad->sub_state = TAPI_SIM_PERS_NET;
+ trans(ad, _ST_NETWORK_LOCKCNF);
+ r = ECORE_CALLBACK_CANCEL;
+ break;
+ case SIM_REQ_NSCK:
+ _DBG("ad->sim_status = %d", ad->sim_status);
+ if (ad->pin_changed == 1) {
+ show_msg(ad, IDS_IDLE_POP_PIN_CHANGED);
+ } else {
+ show_sim_lock(ad);
+ }
+ ad->sub_state = TAPI_SIM_PERS_NS;
+ trans(ad, _ST_NETWORK_LOCKCNF);
+ r = ECORE_CALLBACK_CANCEL;
+ break;
+ case SIM_REQ_SPCK:
+ _DBG("ad->sim_status = %d", ad->sim_status);
+ if (ad->pin_changed == 1) {
+ show_msg(ad, IDS_IDLE_POP_PIN_CHANGED);
+ } else {
+ show_sim_lock(ad);
+ }
+ ad->sub_state = TAPI_SIM_PERS_SP;
+ trans(ad, _ST_NETWORK_LOCKCNF);
+ r = ECORE_CALLBACK_CANCEL;
+ break;
+ case SIM_REQ_CCK:
+ _DBG("ad->sim_status = %d", ad->sim_status);
+ if (ad->pin_changed == 1) {
+ show_msg(ad, IDS_IDLE_POP_PIN_CHANGED);
+ } else {
+ show_sim_lock(ad);
+ }
+ ad->sub_state = TAPI_SIM_PERS_CP;
+ trans(ad, _ST_NETWORK_LOCKCNF);
+ r = ECORE_CALLBACK_CANCEL;
+ break;
+ case SIM_OK:
+ if (ad->running_status == 0 && ad->first_boot && ad->cancel_setup == 0) {
+ trans(ad, _ST_TIME);
+ } else if (ad->running_status == 0 && ad->first_boot == 0 && changed) {
+ trans(ad, _ST_LANG);
+ } else {
+ trans(ad, _ST_EXIT);
+ }
+ if (ad->pin_changed == 1) {
+ r = ECORE_CALLBACK_CANCEL;
+ show_msg(ad, IDS_IDLE_POP_PIN_CHANGED);
+ ecore_timer_add(3, timer_do, ad);
+ ad->pin_changed = 0;
+ } else {
+ r = ECORE_CALLBACK_RENEW;
+ }
+
+ break;
+ case SIM_WAITING:
+ r = ECORE_CALLBACK_CANCEL;
+ break;
+ case SIM_BLOCKED:
+ show_block(ad);
+ r = ECORE_CALLBACK_CANCEL;
+ break;
+ case SIM_RETRY:
+ ecore_timer_add(0.2, timer_do, ad);
+ r = ECORE_CALLBACK_CANCEL;
+ break;
+ case SIM_EMPTY:
+ if (ad->running_status == 0 && ad->first_boot
+ && ad->cancel_setup == 0) {
+ trans(ad, _ST_TIME);
+ } else {
+ trans(ad, _ST_EXIT);
+ }
+ r = ECORE_CALLBACK_RENEW;
+ break;
+ default:
+ _ERR("Unexpected sim state: %d", ad->sim_status);
+ trans(ad, _ST_EXIT);
+ r = ECORE_CALLBACK_RENEW;
+ break;
+ }
+ return r;
+}
+
+static int do_ST_SIM_PINCNF(struct appdata *ad)
+{
+ int r;
+
+ _DBG("%s", __func__);
+
+ if (!ad->entry_str) {
+ _ERR("entry string is empty");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ r = tapi_verify_pins(ad->entry_str);
+ if (r == -1) {
+ _ERR("verify pin error");
+ trans(ad, _ST_EXIT);
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static int do_ST_SIM_PUKCNF(struct appdata *ad)
+{
+ int r;
+
+ _DBG("%s", __func__);
+
+ ad->pin_changed = 1;
+
+ if (!ad->entry_str || !ad->pin_str) {
+ _ERR("entry string is empty");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ r = tapi_verify_puks(ad->entry_str, ad->pin_str);
+ if (r == -1) {
+ _ERR("verify puk error");
+ trans(ad, _ST_EXIT);
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static int do_ST_SIM_LOCKCNF(struct appdata *ad)
+{
+ int r;
+
+ _DBG("%s", __func__);
+
+ if (!ad->entry_str) {
+ _ERR("entry string is empty");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ r = tapi_verify_lock(ad->entry_str);
+ if (r == -1) {
+ _ERR("verify pin error");
+ trans(ad, _ST_EXIT);
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static int do_ST_NETWORK_LOCKCNF(struct appdata *ad)
+{
+ int r;
+
+ _DBG("%s", __func__);
+
+ if (!ad->entry_str) {
+ _ERR("entry string is empty");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ r = tapi_disable_net_pers(ad->entry_str, ad->sub_state);
+ if (r == -1) {
+ _ERR("Disable network personalization failed");
+ trans(ad, _ST_EXIT);
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static int do_ST_EXIT(struct appdata *ad)
+{
+ int r;
+ int locked;
+
+ _DBG("%s", __func__);
+
+ locked = 0;
+ r = vconf_get_int(LIVE_MAGAZINE_START, &locked);
+ _DBG("r = %d locked = %d", r, locked);
+ if ((r != 0) || (locked == 0)) {
+ _DBG("set %s to true", LIVE_MAGAZINE_START);
+ vconf_set_int(LIVE_MAGAZINE_START, 1);
+ }
+ elm_exit();
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static int do_ST_LANG(struct appdata *ad)
+{
+ _DBG("%s", __func__);
+
+ if (show_lang(ad))
+ return ECORE_CALLBACK_CANCEL;
+ else
+ return ECORE_CALLBACK_RENEW;
+}
+
+static int do_ST_TIME(struct appdata *ad)
+{
+ _DBG("%s", __func__);
+
+ if (show_time(ad))
+ return ECORE_CALLBACK_CANCEL;
+ else
+ return ECORE_CALLBACK_RENEW;
+}
+
+static int do_ST_KEYBOARD(struct appdata *ad)
+{
+ _DBG("%s", __func__);
+
+ if (show_keyboard_setting(ad))
+ return ECORE_CALLBACK_CANCEL;
+ else
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool _do_state(void *data)
+{
+ int r;
+ struct appdata *ad = data;
+
+ _DBG("%s, ad->state:%d", __func__, ad->state);
+
+ if (ad->state < _ST_START || ad->state >= _ST_MAX) {
+ _ERR("Unknown state: %d", ad->state);
+ trans(ad, _ST_EXIT);
+ r = ECORE_CALLBACK_RENEW;
+ } else
+ r = states[ad->state]._do(ad);
+
+ if (r == ECORE_CALLBACK_CANCEL)
+ ad->idler = NULL;
+
+ return r;
+}
+
+void do_state(struct appdata *ad)
+{
+ _DBG("%s", __func__);
+ if (ad->idler == NULL)
+ ad->idler = ecore_idler_add(_do_state, ad);
+}
+
+void set_win_prop(struct appdata *ad, int type)
+{
+ Ecore_X_Window w;
+
+ w = elm_win_xwindow_get(ad->win);
+
+ if (type == ECORE_X_WINDOW_TYPE_NORMAL) {
+ ecore_x_netwm_window_type_set(w, ECORE_X_WINDOW_TYPE_NORMAL);
+ ad->win_type = ECORE_X_WINDOW_TYPE_NORMAL;
+ } else if (type == ECORE_X_WINDOW_TYPE_NOTIFICATION) {
+ ecore_x_netwm_window_type_set(w,
+ ECORE_X_WINDOW_TYPE_NOTIFICATION);
+ utilx_set_system_notification_level(ecore_x_display_get(), w,
+ UTILX_NOTIFICATION_LEVEL_LOW);
+ ad->win_type = ECORE_X_WINDOW_TYPE_NOTIFICATION;
+ }
+}
+
+static void set_key_grab(Evas_Object * win)
+{
+ Ecore_X_Window w;
+
+ w = elm_win_xwindow_get(win);
+
+ utilx_grab_key(ecore_x_display_get(), w, KEY_SELECT, EXCLUSIVE_GRAB);
+ utilx_grab_key(ecore_x_display_get(), w, KEY_CAMERA, TOP_POSITION_GRAB);
+}
+
+static void pwlock_focus_out_cb(void *data, Evas_Object * obj, void *event_info)
+{
+ int pid = 0;
+ char buf[128];
+ Ecore_X_Window x_win_focused;
+ struct appdata *ad = data;
+
+ _DBG("%s", __func__);
+
+ x_win_focused = ecore_x_window_focus_get();
+ ecore_x_netwm_pid_get(x_win_focused, &pid);
+ if (aul_app_get_pkgname_bypid(pid, buf, sizeof(buf)) < 0) {
+ _DBG("no such pkg by pid %d\n", pid);
+ } else {
+ char *pkg_str;
+ _DBG("created pkgname = %s, pid = %d\n", buf, pid);
+ pkg_str = vconf_get_str(MENUSCREEN_PKG_NAME);
+ if ((pkg_str != NULL)
+ && !strncmp(pkg_str, buf, strlen(pkg_str))) {
+ _DBG("%s is on the pwlock.!!\n", pkg_str);
+ elm_win_raise(ad->win);
+ free(pkg_str);
+ pkg_str = NULL;
+ } else
+ if (!strncmp("org.tizen.live-magazine", buf, strlen(buf)))
+ {
+ _DBG("%s is on the pwlock.!!\n", buf);
+ elm_win_raise(ad->win);
+ }
+ }
+
+}
+
+static int _batt_cb(void *data)
+{
+ _ERR("System battry goes low");
+ return 0;
+}
+
+static Eina_Bool app_hardkey_up_cb(void *data, int type, void *event)
+{
+ struct appdata *ad = (struct appdata *)data;
+ Ecore_X_Window x_win;
+ Ecore_X_Window x_win_focused;
+ int val = -1;
+
+ if (!ad) {
+ return 0;
+ }
+
+ x_win = elm_win_xwindow_get(ad->win);
+ x_win_focused = ecore_x_window_focus_get();
+ _DBG(" x_win = %x and x_win_focused = %x\n", x_win, x_win_focused);
+
+ if (x_win != x_win_focused) {
+ return 0;
+ }
+
+ Ecore_Event_Key *pKeyEvent = (Ecore_Event_Key *) event;
+
+ _DBG("[%s]Key up : %s\n", __func__, pKeyEvent->keyname);
+ if ((!strcmp(pKeyEvent->keyname, HOME_KEY)) && (ad->state > _ST_EXIT)) {
+ _DBG("ad->ui_type=%d", ad->ui_type);
+ switch (ad->ui_type) {
+ case _UI_LANG:
+ case _UI_TIME:
+ case _UI_KEYBOARD:
+ {
+ if (vconf_get_int
+ (VCONFKEY_IDLE_LOCK_STATE, &val) < 0) {
+ _DBG("Cannot get VCONFKEY_IDLE_LOCK_STATE");
+ return 0;
+ }
+ if (val == VCONFKEY_IDLE_UNLOCK) {
+ _DBG("unlocked..!!");
+ show_popup(ad,
+ pwlock_get_string
+ (IDS_IDLE_BODY_DO_YOU_WANT_TO_SKIP_SETUPWIZARD),
+ EINA_FALSE);
+ }
+ }
+ break;
+ default:
+ return 0;
+ }
+ } else if (!strcmp(pKeyEvent->keyname, BACK_KEY)) {
+ _DBG("[%s] %d ad->ui_type: %d", __func__, __LINE__,
+ ad->ui_type);
+ switch (ad->ui_type) {
+ case _UI_DIALER:
+ ug_send_key_event(UG_KEY_EVENT_END);
+ ad->ui_type = ad->previous_ui_type;
+ break;
+ }
+ }
+ return 0;
+}
+
+static int app_create(void *data)
+{
+ struct appdata *ad = data;
+
+ _DBG("%s", __func__);
+
+ ad->win = create_win(PACKAGE);
+ if (ad->win == NULL) {
+ _ERR("Create win error");
+ return -1;
+ }
+ ecore_imf_init();
+ set_key_grab(ad->win);
+ register_vconf_call_state_changed(ad);
+ set_win_prop(ad, ECORE_X_WINDOW_TYPE_NOTIFICATION);
+ evas_object_smart_callback_add(ad->win, "focus,out",
+ pwlock_focus_out_cb, ad);
+ appcore_set_i18n(PACKAGE, LOCALEDIR);
+ appcore_set_event_callback(APPCORE_EVENT_LOW_BATTERY, _batt_cb, ad);
+ ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, app_hardkey_up_cb, ad);
+
+ if (ad->navi) {
+ evas_object_del(ad->navi);
+ ad->navi = NULL;
+ if (ad->ly_main) {
+ evas_object_del(ad->ly_main);
+ ad->ly_main = NULL;
+ }
+ if (ad->entry_layout) {
+ evas_object_del(ad->entry_layout);
+ ad->entry_layout = NULL;
+ }
+ if (ad->entry_second_layout) {
+ evas_object_del(ad->entry_second_layout);
+ ad->entry_second_layout = NULL;
+ }
+
+ }
+
+ ad->state = _ST_FIRST;
+ do_state(ad);
+
+ return 0;
+}
+
+static int app_terminate(void *data)
+{
+ struct appdata *ad = data;
+
+ _DBG("\n ===============> %s\n", __func__);
+
+ set_pwlock_unlock_state(ad);
+
+ if (ad->t)
+ tapi_exit(&ad->t);
+
+ if (ad->win) {
+ utilx_ungrab_key(ecore_x_display_get(),
+ elm_win_xwindow_get(ad->win), KEY_SELECT);
+ utilx_ungrab_key(ecore_x_display_get(),
+ elm_win_xwindow_get(ad->win), KEY_CAMERA);
+ evas_object_del(ad->win);
+ }
+ if (ad->navi) {
+ evas_object_del(ad->navi);
+ ad->navi = NULL;
+ }
+ if (ad->ly_main) {
+ evas_object_del(ad->ly_main);
+ ad->ly_main = NULL;
+ }
+ if (ad->entry_layout) {
+ evas_object_del(ad->entry_layout);
+ ad->entry_layout = NULL;
+ }
+ if (ad->entry_second_layout) {
+ evas_object_del(ad->entry_second_layout);
+ ad->entry_second_layout = NULL;
+ }
+ if (ad->bg) {
+ evas_object_del(ad->bg);
+ ad->bg = NULL;
+ }
+ if (ad->idler) {
+ ecore_idler_del(ad->idler);
+ ad->idler = NULL;
+ }
+ remove_waiting_popup(ad);
+ ecore_imf_shutdown();
+ return 0;
+}
+
+static int app_reset(bundle * b, void *data)
+{
+ struct appdata *ad = data;
+
+ _DBG("%s", __func__);
+
+ if (ad->win)
+ elm_win_activate(ad->win);
+
+ return 0;
+}
+
+int main(int argc, char *argv[])
+{
+ struct appdata ad;
+ struct appcore_ops ops = {
+ .create = app_create,
+ .terminate = app_terminate,
+ .reset = app_reset,
+ };
+
+ memset(&ad, 0x0, sizeof(struct appdata));
+
+ _DBG("\n\n========= pwlock is started..!! ===========\n");
+
+ if (argc > 1) {
+ _DBG("argv[1]:%s ", argv[1]);
+ ad.running_status = atoi(argv[1]);
+ } else {
+ ad.running_status = 0;
+ system("chmod 666 " LOGFILE);
+ }
+
+ ops.data = &ad;
+
+ return appcore_efl_main(PACKAGE, &argc, &argv, &ops);
+}
diff --git a/src/tapi.c b/src/tapi.c
new file mode 100755
index 0000000..232052a
--- /dev/null
+++ b/src/tapi.c
@@ -0,0 +1,648 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <stdio.h>
+
+#include <TapiEvent.h>
+#include <ITapiSim.h>
+#include <TapiCommon.h>
+#include <vconf.h>
+
+#include "util.h"
+#include "tapi.h"
+
+#ifndef PACKAGE_NAME
+#define PACKAGE_NAME "org.tizen.pwlock"
+#endif
+
+enum {
+ _L_UNSPEC = -1,
+ _L_AUTO,
+ _L_EN,
+ _L_DE,
+ _L_NL,
+ _L_ES,
+ _L_PT,
+ _L_EL,
+ _L_IT,
+ _L_FR,
+ _L_TR,
+ _L_KO,
+ _L_MAX,
+};
+
+static int _LP_L[] = {
+ TAPI_SIM_LP_GERMAN, _L_UNSPEC,
+ TAPI_SIM_LP_ENGLISH, _L_EN,
+ TAPI_SIM_LP_ITALIAN, _L_UNSPEC,
+ TAPI_SIM_LP_FRENCH, _L_UNSPEC,
+ TAPI_SIM_LP_SPANISH, _L_UNSPEC,
+ TAPI_SIM_LP_DUTCH, _L_UNSPEC,
+ TAPI_SIM_LP_SWEDISH, _L_UNSPEC,
+ TAPI_SIM_LP_DANISH, _L_UNSPEC,
+ TAPI_SIM_LP_PORTUGUESE, _L_UNSPEC,
+ TAPI_SIM_LP_FINNISH, _L_UNSPEC,
+ TAPI_SIM_LP_NORWEGIAN, _L_UNSPEC,
+ TAPI_SIM_LP_GREEK, _L_UNSPEC,
+ TAPI_SIM_LP_TURKISH, _L_UNSPEC,
+ TAPI_SIM_LP_HUNGARIAN, _L_UNSPEC,
+ TAPI_SIM_LP_POLISH, _L_UNSPEC,
+};
+
+struct tapi {
+ struct tapi_event *evt;
+ int evt_sz;
+
+ void *cb_data;
+ void (*cb) (struct tapi_info *, void *);
+};
+
+struct tapi_event {
+ unsigned int sid;
+ int event;
+};
+
+static struct tapi_event tapi_events[] = {
+ {-1, TAPI_EVENT_POWER_SERVICE_READY_IND,},
+ {-1, TAPI_EVENT_SIM_VERIFY_SEC_CNF,},
+ {-1, TAPI_EVENT_SIM_VERIFY_PUK_CNF,},
+ {-1, TAPI_EVENT_SIM_STATUS_IND,},
+ {-1, TAPI_EVENT_SIM_DISABLE_PERS_CNF,},
+};
+
+static void do_sim_status(const TelTapiEvent_t * evt, void *data)
+{
+ struct tapi *t = data;
+ struct tapi_info ti;
+
+ _DBG("Sim status: 0x%x", evt->Status);
+
+ memset(&ti, 0, sizeof(ti));
+
+ switch (evt->Status) {
+ case TAPI_SIM_STATUS_SIM_PIN_REQUIRED:
+ case TAPI_SIM_STATUS_SIM_PUK_REQUIRED:
+ case TAPI_SIM_STATUS_SIM_NCK_REQUIRED:
+ case TAPI_SIM_STATUS_SIM_NSCK_REQUIRED:
+ case TAPI_SIM_STATUS_SIM_SPCK_REQUIRED:
+ case TAPI_SIM_STATUS_SIM_CCK_REQUIRED:
+ case TAPI_SIM_STATUS_SIM_LOCK_REQUIRED:
+ ti.st = SIM_REQUIRED_EVENT;
+ break;
+ case TAPI_SIM_STATUS_CARD_ERROR:
+ ti.st = SIM_ERROR;
+ break;
+ default:
+ ti.st = SIM_OK;
+ break;
+ }
+
+ if (evt->Status == TAPI_SIM_STATUS_SIM_INITIALIZING
+ && (*(TelSimCardType_t *) evt->pData != 0))
+ _DBG("Card type: %d", *(TelSimCardType_t *) evt->pData);
+
+ if (t->cb)
+ t->cb(&ti, t->cb_data);
+
+}
+
+static void do_sim_verify(const TelTapiEvent_t * evt, void *data)
+{
+ struct tapi *t = data;
+ struct tapi_info ti;
+ TelSimSecResult_t *res = (TelSimSecResult_t *) evt->pData;
+
+ _DBG("Sim verify sec: 0x%x", evt->Status);
+
+ memset(&ti, 0, sizeof(ti));
+
+ switch (evt->Status) {
+ case TAPI_SIM_OPERATION_TIMEOUT:
+ _DBG("\tTimeout");
+ ti.st = SIM_ERROR;
+ break;
+ case TAPI_SIM_PIN_OPERATION_SUCCESS:
+ _DBG("\tType: %d", res->type);
+ ti.st = SIM_OK;
+ break;
+ case TAPI_SIM_PIN_REQUIRED:
+ _DBG("\tType: %d", res->type);
+ _DBG("\tRetry: %d", res->retry_count);
+ ti.st = SIM_REQ_PIN;
+ ti.retry_cnt = res->retry_count;
+ break;
+ case TAPI_SIM_PUK_REQUIRED:
+ _DBG("\tType: %d", res->type);
+ _DBG("\tRetry: %d", res->retry_count);
+ ti.st = SIM_REQ_PUK;
+ ti.retry_cnt = res->retry_count;
+ break;
+ case TAPI_SIM_LOCK_REQUIRED:
+ _DBG("\tType: %d", res->type);
+ _DBG("\tRetry: %d", res->retry_count);
+ ti.st = SIM_REQ_LOCK;
+ ti.retry_cnt = res->retry_count;
+ break;
+ case TAPI_SIM_NCK_REQUIRED:
+ _DBG("\tType: %d", res->type);
+ _DBG("\tRetry: %d", res->retry_count);
+ ti.st = SIM_REQ_NCK;
+ break;
+ case TAPI_SIM_NSCK_REQUIRED:
+ _DBG("\tType: %d", res->type);
+ _DBG("\tRetry: %d", res->retry_count);
+ ti.st = SIM_REQ_NSCK;
+ break;
+ case TAPI_SIM_SPCK_REQUIRED:
+ _DBG("\tType: %d", res->type);
+ _DBG("\tRetry: %d", res->retry_count);
+ ti.st = SIM_REQ_SPCK;
+ break;
+ case TAPI_SIM_CCK_REQUIRED:
+ _DBG("\tType: %d", res->type);
+ _DBG("\tRetry: %d", res->retry_count);
+ ti.st = SIM_REQ_CCK;
+ break;
+ default:
+ _DBG("\tType: %d", res->type);
+ _DBG("\tRetry: %d", res->retry_count);
+ if (res->type == TAPI_SIM_PTYPE_SIM)
+ ti.st = SIM_REQ_LOCK;
+ else
+ ti.st = SIM_RETRY;
+ ti.retry_cnt = res->retry_count;
+ break;
+ }
+
+ _DBG("tapi_cb ti.st: %d", ti.st);
+
+ if (t->cb)
+ t->cb(&ti, t->cb_data);
+}
+
+static void do_sim_disable_pers(const TelTapiEvent_t * evt, void *data)
+{
+ struct tapi *t = data;
+ struct tapi_info ti;
+ TelSimSecResult_t *res = (TelSimSecResult_t *) evt->pData;
+
+ _DBG("Sim disable PERS: 0x%x", evt->Status);
+
+ memset(&ti, 0, sizeof(ti));
+ switch (evt->Status) {
+ case TAPI_SIM_OPERATION_TIMEOUT:
+ _DBG("\tTimeout");
+ ti.st = SIM_ERROR;
+ break;
+ case TAPI_SIM_PIN_OPERATION_SUCCESS:
+ _DBG("\tType: %d", res->type);
+ ti.st = SIM_OK;
+ break;
+ case TAPI_SIM_NCK_REQUIRED:
+ _DBG("\tType: %d", res->type);
+ _DBG("\tRetry: %d", res->retry_count);
+ ti.st = SIM_REQ_NCK;
+ break;
+ case TAPI_SIM_NSCK_REQUIRED:
+ _DBG("\tType: %d", res->type);
+ _DBG("\tRetry: %d", res->retry_count);
+ ti.st = SIM_REQ_NSCK;
+ break;
+ case TAPI_SIM_SPCK_REQUIRED:
+ _DBG("\tType: %d", res->type);
+ _DBG("\tRetry: %d", res->retry_count);
+ ti.st = SIM_REQ_SPCK;
+ break;
+ case TAPI_SIM_CCK_REQUIRED:
+ _DBG("\tType: %d", res->type);
+ _DBG("\tRetry: %d", res->retry_count);
+ ti.st = SIM_REQ_CCK;
+ break;
+ default:
+ _DBG("\tType: %d", res->type);
+ _DBG("\tRetry: %d", res->retry_count);
+ ti.st = SIM_REQ_LOCK;
+ break;
+
+ }
+
+ if (t->cb)
+ t->cb(&ti, t->cb_data);
+}
+
+static void event_sim(const TelTapiEvent_t * evt, void *data)
+{
+ _DBG("TAPI EventType: %d", evt->EventType);
+
+ switch (evt->EventType) {
+ case TAPI_EVENT_SIM_STATUS_IND:
+ do_sim_status(evt, data);
+ break;
+ case TAPI_EVENT_SIM_VERIFY_SEC_CNF:
+ case TAPI_EVENT_SIM_VERIFY_PUK_CNF:
+ do_sim_verify(evt, data);
+ break;
+ case TAPI_EVENT_SIM_DISABLE_PERS_CNF:
+ do_sim_disable_pers(evt, data);
+ break;
+ default:
+ _ERR("TAPI unhandle type: %d", evt->EventType);
+ break;
+ }
+}
+
+static int event_cb(const TelTapiEvent_t * evt, void *data)
+{
+ _DBG("TAPI EventClass: %d", evt->EventClass);
+
+ switch (evt->EventClass) {
+ case TAPI_EVENT_CLASS_SIM:
+ event_sim(evt, data);
+ break;
+ default:
+ _ERR("TAPI unregister event received: %d", evt->EventClass);
+ break;
+ }
+ return 0;
+}
+
+static int _register_events(struct tapi *t)
+{
+ int r;
+ int i;
+ unsigned int sid;
+
+ if (t == NULL)
+ return -1;
+
+ for (i = 0; i < t->evt_sz; i++) {
+ r = tel_register_event(t->evt[i].event, &sid, event_cb, t);
+ _DBG("TAPI register event : %d", t->evt[i].event);
+ if (r != TAPI_API_SUCCESS) {
+ _ERR("TAPI register event %d return %d",
+ t->evt[i].event, r);
+ return -1;
+ }
+ t->evt[i].sid = sid;
+ }
+
+ return 0;
+}
+
+static void _unregister_events(struct tapi *t)
+{
+ int r;
+ int i;
+
+ if (t == NULL)
+ return;
+
+ for (i = 0; i < t->evt_sz; i++) {
+ if (t->evt[i].sid == -1)
+ continue;
+
+ r = tel_deregister_event(t->evt[i].sid);
+ if (r == TAPI_API_SUCCESS)
+ t->evt[i].sid = -1;
+ else
+ _ERR("TAPI unregister sid %d return %d", t->evt[i].sid,
+ r);
+ }
+}
+
+static enum sim_stat check_sim(TelSimCardStatus_t stat)
+{
+ enum sim_stat r;
+ switch (stat) {
+ case TAPI_SIM_STATUS_CARD_NOT_PRESENT:
+ case TAPI_SIM_STATUS_CARD_REMOVED:
+ r = SIM_EMPTY;
+ break;
+ case TAPI_SIM_STATUS_SIM_INITIALIZING:
+ r = SIM_WAITING;
+ break;
+ case TAPI_SIM_STATUS_SIM_INIT_COMPLETED:
+ r = SIM_OK;
+ break;
+ case TAPI_SIM_STATUS_SIM_PIN_REQUIRED:
+ r = SIM_REQ_PIN;
+ break;
+ case TAPI_SIM_STATUS_SIM_PUK_REQUIRED:
+ r = SIM_REQ_PUK;
+ break;
+ case TAPI_SIM_STATUS_CARD_BLOCKED:
+ r = SIM_BLOCKED;
+ break;
+ case TAPI_SIM_STATUS_SIM_LOCK_REQUIRED:
+ r = SIM_REQ_LOCK;
+ break;
+ case TAPI_SIM_STATUS_SIM_NCK_REQUIRED:
+ r = SIM_REQ_NCK;
+ break;
+ case TAPI_SIM_STATUS_SIM_NSCK_REQUIRED:
+ r = SIM_REQ_NSCK;
+ break;
+ case TAPI_SIM_STATUS_SIM_SPCK_REQUIRED:
+ r = SIM_REQ_SPCK;
+ break;
+ case TAPI_SIM_STATUS_SIM_CCK_REQUIRED:
+ r = SIM_REQ_CCK;
+ break;
+ case 0xff:
+ r = SIM_RETRY;
+ break;
+ case TAPI_SIM_STATUS_CARD_ERROR:
+ default:
+ r = SIM_ERROR;
+ break;
+ }
+ return r;
+}
+
+enum sim_stat tapi_check_sim(int *changed)
+{
+ TapiResult_t r = TAPI_API_SUCCESS;
+ int card_changed = 0;
+ enum sim_stat res = -1;
+ TelSimCardStatus_t st = 0x00;
+
+ _DBG("Enum size: %d", sizeof(st));
+ r = tel_get_sim_init_info(&st, &card_changed);
+
+ _DBG("Get sim status return %d", r);
+ if (r == TAPI_API_SUCCESS) {
+ *changed = card_changed;
+ _DBG("Get tapi sim status: 0x%x card changed: %d", st,
+ *changed);
+ }
+
+ switch (r) {
+ case TAPI_API_SERVICE_NOT_READY:
+ res = SIM_RETRY;
+ break;
+ case TAPI_API_SUCCESS:
+ res = check_sim(st);
+ break;
+ default:
+ res = SIM_ERROR;
+ break;
+ }
+
+ return res;
+}
+
+int tapi_is_ready(void)
+{
+ int r;
+ int ready;
+
+ r = tel_check_service_ready(&ready);
+ if (r != TAPI_API_SUCCESS) {
+ _ERR("TAPI check ready error %d", r);
+ return 0;
+ }
+ _DBG("Tapi ready status: %d", ready);
+ return ready;
+}
+
+int tapi_ready_check(void)
+{
+ int api_ret = 0;
+ int vconf_val = 0;
+
+ _DBG("%s", __func__);
+
+ api_ret = vconf_get_int(VCONFKEY_TELEPHONY_TAPI_STATE, &vconf_val);
+ if (api_ret != 0) {
+ _DBG("fail to get vconf key value. this means telephony does not start");
+ } else {
+ if (vconf_val == VCONFKEY_TELEPHONY_TAPI_STATE_NONE) {
+ _DBG("TAPI is not ready");
+ } else {
+ _DBG("TAPI is ready");
+ }
+ }
+ return vconf_val;
+}
+
+static int verify_pins(char *code, int type)
+{
+ int r;
+ int req_id;
+ TelSimSecPw_t pin;
+
+ memset(&pin, 0, sizeof(pin));
+ pin.type = type;
+ pin.pw_len = strlen(code);
+ pin.pw = (unsigned char *)code;
+
+ r = tel_verifiy_sim_pins(&pin, &req_id);
+ if (r != TAPI_API_SUCCESS) {
+ _ERR("TAPI verify pins error %d", r);
+ return -1;
+ }
+
+ return 0;
+}
+
+int tapi_verify_pins(char *code)
+{
+ if (code == NULL || code[0] == '\0')
+ return -1;
+
+ return verify_pins(code, TAPI_SIM_PTYPE_PIN1);
+}
+
+int tapi_verify_lock(char *code)
+{
+ if (code == NULL || code[0] == '\0')
+ return -1;
+
+ return verify_pins(code, TAPI_SIM_PTYPE_SIM);
+}
+
+int tapi_verify_puks(char *code, char *newcode)
+{
+ int r;
+ int req_id;
+ TelSimSecPw_t puk, pin;
+
+ if (code == NULL || code[0] == '\0'
+ || newcode == NULL || newcode[0] == '\0')
+ return -1;
+
+ memset(&puk, 0, sizeof(puk));
+ puk.type = TAPI_SIM_PTYPE_PUK1;
+ puk.pw_len = strlen(code);
+ puk.pw = (unsigned char *)code;
+
+ memset(&pin, 0, sizeof(pin));
+ pin.type = TAPI_SIM_PTYPE_PIN1;
+ pin.pw_len = strlen(newcode);
+ pin.pw = (unsigned char *)newcode;
+
+ r = tel_verify_sim_puks(&puk, &pin, &req_id);
+ if (r != TAPI_API_SUCCESS)
+ return -1;
+
+ return 0;
+}
+
+int tapi_disable_net_pers(char *code, int type)
+{
+
+ if (code == NULL || code[0] == '\0')
+ return -1;
+ int request_id = 0;
+ int err_code = TAPI_API_SUCCESS;
+
+ TelSimPersPw_t lock_pers = { 0, };
+ lock_pers.type = type;
+ lock_pers.pw_len = strlen(code);
+ lock_pers.pw = (unsigned char *)code;
+
+ err_code = tel_disable_sim_personalization(&lock_pers, &request_id);
+
+ if (err_code != TAPI_API_SUCCESS) {
+ _ERR("TAPI API FAIL: Error Code [0x%x]", err_code);
+ return -1;
+ }
+ return 0;
+}
+
+struct tapi *tapi_init(void (*cb) (struct tapi_info *, void *), void *data)
+{
+ int r;
+ struct tapi *t;
+
+ if (cb == NULL)
+ return NULL;
+
+ r = tel_init();
+ if (r != TAPI_API_SUCCESS) {
+ _ERR("TAPI init error: %d", r);
+ return NULL;
+ }
+ _DBG("TAPI init");
+
+ t = calloc(1, sizeof(struct tapi));
+ if (t == NULL) {
+ _ERR("TAPI alloc data error");
+ goto err;
+ }
+ t->evt = tapi_events;
+ t->evt_sz = sizeof(tapi_events) / sizeof(tapi_events[0]);
+ t->cb = cb;
+ t->cb_data = data;
+
+ r = _register_events(t);
+ if (r == -1) {
+ _ERR("TAPI register events error");
+ goto err;
+ }
+
+ r = tel_register_app_name(PACKAGE_NAME);
+ if (r != TAPI_API_SUCCESS) {
+ _ERR("TAPI register name error");
+ goto err;
+ }
+
+ return t;
+ err:
+ if (t) {
+ _unregister_events(t);
+ free(t);
+ }
+ tel_deinit();
+
+ return NULL;
+}
+
+void tapi_exit(struct tapi **t)
+{
+ if (t == NULL || *t == NULL)
+ return;
+
+ _unregister_events(*t);
+ free(*t);
+ *t = NULL;
+
+ tel_deinit();
+}
+
+static int get_lang(int v)
+{
+ int i;
+
+ for (i = 0; i < sizeof(_LP_L) / sizeof(_LP_L[0]); i = i + 2) {
+ if (_LP_L[i] == v)
+ return _LP_L[i + 1];
+ }
+
+ return _L_UNSPEC;
+}
+
+int tapi_get_language(int *lang)
+{
+ int i;
+ int r;
+ int v = _L_UNSPEC;
+ TelSimLanguageInfo_t l;
+
+ r = tel_get_sim_language(&l);
+ if (r != TAPI_API_SUCCESS) {
+ r = -1;
+ _ERR("TAPI get sim language");
+ } else
+ r = 0;
+
+ for (i = 0; i < l.LpCount; i++) {
+ _DBG("TAPI sim lang: %d", l.Lp[i]);
+ v = get_lang(l.Lp[i]);
+ if (v != _L_UNSPEC)
+ break;
+ }
+
+ if (v == _L_UNSPEC) {
+ _ERR("TAPI unknown language code");
+ r = -1;
+ } else
+ *lang = v;
+
+ return r;
+}
+
+void enable_net_pers()
+{
+ _DBG("Lock Personalisation MCC+MNC 5");
+ int request_id = 0;
+ int err_code = TAPI_API_SUCCESS;
+ unsigned char *temp = NULL;
+
+ TelSimPersPw_t lock_pers = { 0, };
+ lock_pers.type = TAPI_SIM_PERS_NET;
+ lock_pers.pw_len = 8;
+ temp = (unsigned char *)malloc(8 + 1);
+
+ if (NULL == temp) {
+ return;
+ }
+ lock_pers.pw = temp;
+ memcpy(lock_pers.pw, "12345678", 8);
+
+ err_code = tel_enable_sim_personalization(&lock_pers, &request_id);
+}
diff --git a/src/ui.c b/src/ui.c
new file mode 100755
index 0000000..67e1bb0
--- /dev/null
+++ b/src/ui.c
@@ -0,0 +1,1585 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <appcore-efl.h>
+#include <Ecore_X.h>
+#include <ui-gadget.h>
+#include <vconf.h>
+#include <bundle.h>
+
+#include "pwlock.h"
+#include "util.h"
+#include "tapi.h"
+#include "ui.h"
+
+#define ENTRY_MAX 35
+
+static Elm_Gen_Item_Class itc_label1, itc_entry1, itc_label2, itc_entry2;
+static void _ug_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv);
+static void _ug_destroy_cb(struct ui_gadget *ug, void *priv);
+static Evas_Object *_create_bg(Evas_Object * win);
+static void _destroy_previous_ugs(void *data);
+static void _focused_cb(void *data, Evas_Object * obj, void *event_info);
+static void _unfocused_cb(void *data, Evas_Object * obj, void *event_info);
+static void _eraser_clicked_cb(void *data, Evas_Object * obj,
+ const char *emission, const char *source);
+static Evas_Object *_create_editfield(Evas_Object * parent);
+static Evas_Object *_editfield_entry_get(Evas_Object * parent);
+
+static int _ug_destroy = 0;
+static Elm_Object_Item *item[2] = { 0, };
+
+static int _header_idx[] = {
+ _UI_PIN, IDS_IDLE_HEADER_PIN_LOCK,
+ _UI_PUK, IDS_IDLE_HEADER_PUK_LOCK,
+ _UI_PUK_PIN, IDS_IDLE_HEADER_PUK_LOCK,
+ _UI_PUK_CNF, IDS_IDLE_HEADER_PUK_LOCK,
+ _UI_BLOCK, IDS_IDLE_HEADER_SIM_BLOCKED,
+ _UI_SIM_LOCK, IDS_IDLE_HEADER_SIM_LOCK,
+ _UI_NETWORK_LOCK_NCK, IDS_IDLE_HEADER_NETWORK_LOCK,
+ _UI_NETWORK_LOCK_NSCK, IDS_IDLE_HEADER_NETWORK_LOCK,
+ _UI_NETWORK_LOCK_SPCK, IDS_IDLE_HEADER_NETWORK_LOCK,
+ _UI_NETWORK_LOCK_CCK, IDS_IDLE_HEADER_NETWORK_LOCK,
+};
+
+static int _tit_idx[] = {
+ _UI_PIN, STR_E_PIN, IDS_IDLE_BODY_ENTER_PIN,
+ _UI_PUK, STR_E_PUK, IDS_IDLE_BODY_ENTER_PUK,
+ _UI_PUK_PIN, STR_E_NEW, IDS_IDLE_BODY_ENTER_NEW_PIN,
+ _UI_PUK_CNF, STR_R_PIN, IDS_IDLE_BODY_ENTER_PIN,
+ _UI_BLOCK, STR_BLOCK,
+ IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER,
+ _UI_SIM_LOCK, STR_SIM_LOCK, IDS_COM_BODY_ENTER_PASSWORD,
+ _UI_NETWORK_LOCK_NCK, STR_NETWORK_LOCK_NCK,
+ IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY,
+ _UI_NETWORK_LOCK_NSCK, STR_NETWORK_LOCK_NSCK,
+ IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY,
+ _UI_NETWORK_LOCK_SPCK, STR_NETWORK_LOCK_SPCK,
+ IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY,
+ _UI_NETWORK_LOCK_CCK, STR_NETWORK_LOCK_CCK,
+ IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY,
+ _UI_LANG, STR_LANG, IDS_IDLE_HEADER_DISPLAY_LANGUAGE,
+};
+
+static char *_get_header(int ui_type)
+{
+ int i;
+ char *r = "";
+
+ for (i = 0; i < sizeof(_header_idx) / sizeof(_header_idx[0]); i = i + 2) {
+ if (ui_type == _header_idx[i]) {
+ r = pwlock_get_string(_header_idx[i + 1]);
+ break;
+ }
+ }
+
+ return r;
+}
+
+static char *_get_tip(int ui_type)
+{
+ int i;
+ char *r = "";
+ if (sizeof(_tit_idx[0]) != 0) {
+ for (i = 0; i < sizeof(_tit_idx) / sizeof(_tit_idx[0]);
+ i = i + 3) {
+ if (ui_type == _tit_idx[i]) {
+ r = pwlock_get_string(_tit_idx[i + 2]);
+ break;
+ }
+ }
+ }
+
+ return r;
+}
+
+static Evas_Object *_create_bg(Evas_Object * win)
+{
+ Evas_Object *bg = elm_bg_add(win);
+ evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, bg);
+ evas_object_show(bg);
+ return bg;
+}
+
+static Evas_Object *_layout_add(Evas_Object * parent)
+{
+ Evas_Object *ly;
+
+ ly = elm_layout_add(parent);
+ if (!ly) {
+ _ERR("UI layout add error");
+ return NULL;
+ }
+
+ elm_layout_theme_set(ly, "layout", "application", "default");
+
+ evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_show(ly);
+
+ return ly;
+}
+
+static Evas_Object *_create_layout(struct appdata *ad)
+{
+ Evas_Object *ly;
+
+ ly = _layout_add(ad->win);
+ elm_win_resize_object_add(ad->win, ly);
+ elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
+
+ return ly;
+}
+
+static void init_ui(struct appdata *ad)
+{
+ Evas_Object *eo;
+ Evas_Object *bg;
+
+ ad->bg = _create_bg(ad->win);
+
+ ad->ly = _create_layout(ad);
+ if (!ad->ly)
+ return;
+
+ eo = elm_naviframe_add(ad->ly);
+ if (!eo) {
+ _ERR("UI navi add error");
+ return;
+ }
+
+ elm_object_part_content_set(ad->ly, "elm.swallow.content", eo);
+ evas_object_show(eo);
+ ad->navi = eo;
+
+ bg = evas_object_rectangle_add(evas_object_evas_get(ad->win));
+ evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_color_set(bg, 0, 0, 0, 255);
+ elm_win_resize_object_add(ad->win, bg);
+}
+
+void show_msg(struct appdata *ad, int strid)
+{
+ int max = 0;
+ char *msg = NULL;
+ char *str = NULL;
+
+ if (ad->msg) {
+ free(ad->msg);
+ ad->msg = NULL;
+ }
+ if (strid == IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED) {
+
+ max = PWLOCK_PIN_PASSWORD_MAX_LENGTH;
+ str = pwlock_get_string(IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED);
+ Eina_Strbuf *temp_str_buf = eina_strbuf_new();
+ eina_strbuf_append_printf(temp_str_buf,
+ str, PWLOCK_PASSWORD_MIN_LENGTH, max);
+ msg = eina_strbuf_string_steal(temp_str_buf);
+ eina_strbuf_free(temp_str_buf);
+ } else {
+ msg = pwlock_get_string(strid);
+ }
+ if (msg == NULL || msg[0] == '\0')
+ return;
+
+ ad->msg = strdup(msg);
+
+ if (!ad->ly_main)
+ return;
+ remove_waiting_popup(ad);
+ show_popup(ad, msg, EINA_TRUE);
+}
+
+static inline const char *_entry_get(Evas_Object * e)
+{
+ const char *s = NULL;
+
+ if (e)
+ s = elm_entry_entry_get(_editfield_entry_get(e));
+
+ return s;
+}
+
+static void _set_str(char **s, const char *str)
+{
+ if (s == NULL)
+ return;
+
+ if (*s)
+ free(*s);
+
+ if (str && str[0] != '\0')
+ *s = strdup(str);
+ else
+ *s = NULL;
+}
+
+static void do_UI_PUK_CNF(struct appdata *ad)
+{
+ const char *s = NULL;
+
+ _DBG("%s", __func__);
+ s = _entry_get(ad->entry_layout);
+
+ if (s && ad->pin_str && !strcmp(ad->pin_str, s)) {
+ do_state(ad);
+ return;
+ }
+
+ _set_str(&ad->pin_str, NULL);
+ show_msg(ad, IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN);
+
+ load_main(ad, _UI_PUK_PIN);
+}
+
+static int _check_input_string(int view_type, const char *entry_str)
+{
+
+ int lenstr = 0;
+ _DBG("_check_input_string: %s", entry_str);
+
+ if (entry_str == NULL)
+ return IDS_IDLE_BODY_PASSWORD_EMPTY;
+
+ lenstr = strlen(entry_str);
+ int max_len = 0;
+ max_len = PWLOCK_PIN_PASSWORD_MAX_LENGTH;
+ _DBG("_check_input_string length: %d,max_len=%d,PWLOCK_PASSWORD_MIN_LENGTH=%d", lenstr, max_len, PWLOCK_PASSWORD_MIN_LENGTH);
+
+ if (lenstr < PWLOCK_PASSWORD_MIN_LENGTH || lenstr > max_len) {
+ return IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED;
+ }
+ return 0;
+}
+
+static void response_cb(void *data, Evas_Object * obj, void *event_info)
+{
+ struct appdata *ad;
+ ad = (struct appdata *)data;
+
+ _DBG("response callback=%d\n", (int)event_info);
+
+ if (((int)event_info != 5) && (obj != NULL)) {
+ evas_object_del(obj);
+ }
+}
+
+static void _block_clicked_cb(void *data, Evas_Object * obj, void *event_info)
+{
+ if (obj) {
+ evas_object_del(obj);
+ obj = NULL;
+ }
+}
+
+void _show_popup(void *data, char *msg_str)
+{
+ Evas_Object *popup;
+ Evas_Object *button;
+ struct appdata *ad;
+ ad = (struct appdata *)data;
+ Ecore_X_Window x_win;
+
+ ecore_imf_context_input_panel_hide(elm_entry_imf_context_get
+ (_editfield_entry_get
+ (ad->entry_layout)));
+ popup = elm_popup_add(ad->win);
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+
+ x_win = elm_win_xwindow_get(ad->win);
+ ecore_x_netwm_window_type_set(x_win, ECORE_X_WINDOW_TYPE_DIALOG);
+
+ evas_object_smart_callback_add(popup, "block,clicked",
+ _block_clicked_cb, NULL);
+
+ elm_popup_timeout_set(popup, 3);
+ elm_object_text_set(popup, msg_str);
+ elm_object_part_text_set(popup, "title", "Information");
+ button = elm_button_add(popup);
+ elm_object_text_set(button, pwlock_get_string(IDS_COM_SK_OK));
+ elm_object_part_content_set(popup, "button1", button);
+ evas_object_smart_callback_add(button, "clicked", response_cb, popup);
+ evas_object_show(popup);
+}
+
+static void _imf_context_input_panel_hide(void *data)
+{
+ struct appdata *ad = data;
+ Ecore_IMF_Context *imf_context = NULL;
+ Ecore_IMF_Context *imf_context_second = NULL;
+ imf_context =
+ elm_entry_imf_context_get(_editfield_entry_get(ad->entry_layout));
+ if (imf_context)
+ ecore_imf_context_input_panel_hide(imf_context);
+
+ imf_context_second =
+ elm_entry_imf_context_get(_editfield_entry_get
+ (ad->entry_second_layout));
+ if (imf_context_second)
+ ecore_imf_context_input_panel_hide(imf_context_second);
+}
+
+static void _done_button_changed(void *data, Evas_Object * obj, void *e)
+{
+ struct appdata *ad = data;
+
+ int length =
+ strlen(elm_entry_entry_get(_editfield_entry_get(ad->entry_layout)));
+
+ if (length == 0) {
+ elm_object_item_disabled_set(item[1], EINA_TRUE);
+ elm_object_disabled_set(ad->button_done, EINA_TRUE);
+ } else {
+ elm_object_item_disabled_set(item[1], EINA_FALSE);
+ elm_object_disabled_set(ad->button_done, EINA_FALSE);
+ }
+ if (elm_object_focus_get(ad->entry_layout)) {
+ if (elm_entry_is_empty(_editfield_entry_get(ad->entry_layout))) {
+ elm_object_signal_emit(ad->entry_layout,
+ "elm,state,eraser,hide", "elm");
+ } else {
+ elm_object_signal_emit(ad->entry_layout,
+ "elm,state,eraser,show", "elm");
+ }
+ }
+}
+
+static void _done_cb(void *data, Evas_Object * obj, void *e)
+{
+ struct appdata *ad = data;
+ int ret = -1;
+ ad->lock_view_loaded = 1;
+ _DBG("Done clicked ui_type: %d", ad->ui_type);
+ _imf_context_input_panel_hide(ad);
+
+ switch (ad->ui_type) {
+ case _UI_PIN:
+ case _UI_SIM_LOCK:
+ show_waiting_popup(ad,
+ pwlock_get_string
+ (IDS_IDLE_BODY_CHECKING_SIM_STATUS));
+ _set_str(&ad->entry_str, _entry_get(ad->entry_layout));
+ _DBG("entry string: [%s]", ad->entry_str);
+ ret = _check_input_string(ad->ui_type, ad->entry_str);
+ if (ret == 0) {
+ do_state(ad);
+ } else {
+ remove_waiting_popup(ad);
+ show_msg(ad, ret);
+ clear_entry(ad);
+ }
+ break;
+ case _UI_PUK:
+ _set_str(&ad->entry_str, _entry_get(ad->entry_layout));
+ _DBG("entry string: [%s]", ad->entry_str);
+ ret = _check_input_string(ad->ui_type, ad->entry_str);
+ if (ret == 0) {
+ pwlock_destroy(ad);
+ show_puk_pin(ad);
+ } else {
+ remove_waiting_popup(ad);
+ show_msg(ad, ret);
+ clear_entry(ad);
+ }
+ break;
+ case _UI_PUK_PIN:
+ show_waiting_popup(ad,
+ pwlock_get_string
+ (IDS_IDLE_BODY_CHECKING_SIM_STATUS));
+ _set_str(&ad->pin_str, _entry_get(ad->entry_layout));
+ _DBG("entry string: [%s]", ad->pin_str);
+ ret = _check_input_string(ad->ui_type, ad->pin_str);
+ if (ret == 0) {
+ if (0 ==
+ strcmp(_entry_get(ad->entry_layout),
+ _entry_get(ad->entry_second_layout))) {
+ do_UI_PUK_CNF(ad);
+ } else {
+ remove_waiting_popup(ad);
+ show_msg(ad, IDS_IDLE_POP_PASSWORDS_NOT_MATCH);
+ clear_entry(ad);
+ }
+ } else {
+ remove_waiting_popup(ad);
+ show_msg(ad, ret);
+ clear_entry(ad);
+ }
+ break;
+ case _UI_PUK_CNF:
+ show_waiting_popup(ad,
+ pwlock_get_string
+ (IDS_IDLE_BODY_CHECKING_SIM_STATUS));
+ ret =
+ _check_input_string(ad->ui_type,
+ _entry_get(ad->entry_layout));
+ if (ret == 0) {
+ do_UI_PUK_CNF(ad);
+ } else {
+ remove_waiting_popup(ad);
+ show_msg(ad, ret);
+ clear_entry(ad);
+ }
+ break;
+ case _UI_NETWORK_LOCK_NCK:
+ case _UI_NETWORK_LOCK_NSCK:
+ case _UI_NETWORK_LOCK_SPCK:
+ case _UI_NETWORK_LOCK_CCK:
+ _set_str(&ad->entry_str, _entry_get(ad->entry_layout));
+ _DBG("entry string: [%s]", ad->entry_str);
+ ret = _check_input_string(ad->ui_type, ad->entry_str);
+ if (ret == 0) {
+ do_state(ad);
+ } else {
+ remove_waiting_popup(ad);
+ clear_entry(ad);
+ show_msg(ad, ret);
+ }
+ break;
+ }
+ _DBG("Exit _done_cb");
+}
+
+static void _dial_cb(void *data, Evas_Object * obj, void *e)
+{
+ _DBG("%s,%d", __func__, __LINE__);
+ struct appdata *ad = data;
+
+ elm_object_item_disabled_set(item[0], EINA_TRUE);
+ elm_object_disabled_set(ad->button_dial, EINA_TRUE);
+ ad->previous_ui_type = ad->ui_type;
+ ad->ui_type = _UI_DIALER;
+ _imf_context_input_panel_hide(ad);
+ show_dialer(ad);
+}
+
+static void _pp_rsp_ok_cb(void *data, Evas_Object * e, void *ei)
+{
+ int i = (int)ei;
+ struct appdata *ad = (struct appdata *)data;
+
+ _DBG("popup rsp: %d\n", i);
+
+ if (NULL == ad) {
+ return;
+ }
+
+ if (ad->popup) {
+ evas_object_del(ad->popup);
+ ad->popup = NULL;
+ }
+
+ ad->cancel_setup = 1;
+ if (ad->current_ug) {
+ ug_destroy(ad->current_ug);
+ if ((ad->ui_type == _UI_LANG)
+ || (ad->ui_type == _UI_KEYBOARD)) {
+ if (ad->first_boot) {
+ if (ad->date_and_time_settings_loaded)
+ ad->state = _ST_EXIT;
+ else
+ ad->state = _ST_TAPI_INIT;
+ } else {
+ ad->state = _ST_EXIT;
+ }
+ } else {
+ ad->state = _ST_EXIT;
+ }
+ do_state(ad);
+ }
+
+ if (ad->sim_status == SIM_REQ_LOCK || ad->sim_status == SIM_REQ_NCK
+ || ad->sim_status == SIM_REQ_NSCK || ad->sim_status == SIM_REQ_SPCK
+ || ad->sim_status == SIM_REQ_CCK) {
+ if (ad->pin_changed == 1) {
+ show_sim_lock(ad);
+ ad->pin_changed = 0;
+ }
+ }
+ if (ad->ui_type == _UI_LANG || ad->ui_type == _UI_TIME || ad->ui_type == _UI_KEYBOARD || ad->ui_type == _UI_DIALER) {
+ return;
+ }
+ if (ad->entry_layout) {
+ evas_object_show(_editfield_entry_get(ad->entry_layout));
+ elm_object_focus_set(_editfield_entry_get(ad->entry_layout),
+ EINA_TRUE);
+ }
+ if (ad->msg) {
+ free(ad->msg);
+ ad->msg = NULL;
+ }
+}
+
+static void _pp_rsp_cancel_cb(void *data, Evas_Object * e, void *ei)
+{
+ int i = (int)ei;
+ struct appdata *ad = (struct appdata *)data;
+
+ _DBG("popup rsp: %d\n", i);
+
+ if (NULL == ad) {
+ return;
+ }
+
+ if (ad->popup) {
+ evas_object_del(ad->popup);
+ ad->popup = NULL;
+ }
+
+ ad->cancel_setup = 0;
+ if (ad->sim_status == SIM_REQ_LOCK || ad->sim_status == SIM_REQ_NCK
+ || ad->sim_status == SIM_REQ_NSCK || ad->sim_status == SIM_REQ_SPCK
+ || ad->sim_status == SIM_REQ_CCK) {
+ if (ad->pin_changed == 1) {
+ show_sim_lock(ad);
+ ad->pin_changed = 0;
+ }
+ }
+ if (ad->ui_type == _UI_LANG || ad->ui_type == _UI_TIME || ad->ui_type == _UI_KEYBOARD || ad->ui_type == _UI_DIALER) {
+ return;
+ }
+ if (ad->entry_layout) {
+ evas_object_show(_editfield_entry_get(ad->entry_layout));
+ elm_object_focus_set(_editfield_entry_get(ad->entry_layout),
+ EINA_TRUE);
+ }
+ if (ad->msg) {
+ free(ad->msg);
+ ad->msg = NULL;
+ }
+}
+
+static void _destroy_previous_ugs(void *data)
+{
+ struct appdata *ad = (struct appdata *)data;
+ if (!ad) {
+ return;
+ }
+
+ _DBG("%s,%d", __func__, __LINE__);
+
+ switch (ad->ui_type) {
+ case _UI_LANG:
+ if (ad->keyboard_ug) {
+ ug_destroy(ad->keyboard_ug);
+ ad->keyboard_ug = NULL;
+ }
+ if (ad->date_ug) {
+ ug_destroy(ad->date_ug);
+ ad->date_ug = NULL;
+ }
+ break;
+ case _UI_TIME:
+ if (ad->keyboard_ug) {
+ ug_destroy(ad->keyboard_ug);
+ ad->keyboard_ug = NULL;
+ }
+ if (ad->language_ug) {
+ ug_destroy(ad->language_ug);
+ ad->language_ug = NULL;
+ }
+ break;
+ case _UI_KEYBOARD:
+ if (ad->date_ug) {
+ ug_destroy(ad->date_ug);
+ ad->date_ug = NULL;
+ }
+ if (ad->language_ug) {
+ ug_destroy(ad->language_ug);
+ ad->language_ug = NULL;
+ }
+ break;
+ default:
+ if (ad->date_ug) {
+ ug_destroy(ad->date_ug);
+ ad->date_ug = NULL;
+ }
+ if (ad->language_ug) {
+ ug_destroy(ad->language_ug);
+ ad->language_ug = NULL;
+ }
+ if (ad->keyboard_ug) {
+ ug_destroy(ad->keyboard_ug);
+ ad->keyboard_ug = NULL;
+ }
+ break;
+ }
+
+ _DBG("%s,%d", __func__, __LINE__);
+
+ if (((ad->sim_changed == 1) && (ad->ui_type == _UI_LANG))
+ || (ad->ui_type == _UI_TIME)) {
+ _DBG("%s,%d", __func__, __LINE__);
+ pwlock_destroy(ad);
+ }
+}
+
+static Evas_Object *_create_conformant(Evas_Object * parent)
+{
+ Evas_Object *conform;
+ elm_win_conformant_set(parent, 1);
+ conform = elm_conformant_add(parent);
+ elm_object_style_set(conform, "internal_layout");
+ evas_object_show(conform);
+
+ return conform;
+}
+
+static void _focused_cb(void *data, Evas_Object * obj, void *event_info)
+{
+ if (!elm_entry_is_empty(obj)) {
+ elm_object_signal_emit(data, "elm,state,eraser,show", "elm");
+ }
+ elm_object_signal_emit(data, "elm,state,guidetext,hide", "elm");
+}
+
+static void _unfocused_cb(void *data, Evas_Object * obj, void *event_info)
+{
+ if (elm_entry_is_empty(obj)) {
+ elm_object_signal_emit(data, "elm,state,guidetext,show", "elm");
+ }
+ elm_object_signal_emit(data, "elm,state,eraser,hide", "elm");
+}
+
+static void _eraser_clicked_cb(void *data, Evas_Object * obj,
+ const char *emission, const char *source)
+{
+ elm_entry_entry_set(data, "");
+}
+
+static Evas_Object *_create_editfield(Evas_Object * parent)
+{
+ Evas_Object *layout = NULL;
+ Evas_Object *entry = NULL;
+ static Elm_Entry_Filter_Limit_Size limit_filter_data;
+
+ limit_filter_data.max_char_count = PWLOCK_PIN_PASSWORD_MAX_LENGTH;
+ limit_filter_data.max_byte_count = 0;
+
+ layout = elm_layout_add(parent);
+ elm_layout_theme_set(layout, "layout", "editfield", "default");
+
+ entry = elm_entry_add(parent);
+ elm_entry_scrollable_set(entry, EINA_TRUE);
+ elm_entry_single_line_set(entry, EINA_TRUE);
+ elm_entry_password_set(entry, EINA_TRUE);
+ elm_object_focus_set(entry, EINA_TRUE);
+ elm_entry_input_panel_layout_set(entry,
+ ELM_INPUT_PANEL_LAYOUT_NUMBERONLY);
+ elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size,
+ &limit_filter_data);
+ evas_object_show(entry);
+ elm_object_focus_set(entry, EINA_TRUE);
+ evas_object_smart_callback_add(entry, "focused", _focused_cb, layout);
+ evas_object_smart_callback_add(entry, "unfocused", _unfocused_cb,
+ layout);
+
+ elm_object_part_content_set(layout, "elm.swallow.content", entry);
+ elm_object_part_text_set(layout, "elm.guidetext", "");
+ elm_object_signal_callback_add(layout, "elm,eraser,clicked", "elm",
+ _eraser_clicked_cb, entry);
+
+ return layout;
+}
+
+static Evas_Object *_editfield_entry_get(Evas_Object * parent)
+{
+ Evas_Object *entry = NULL;
+
+ entry = elm_object_part_content_get(parent, "elm.swallow.content");
+
+ return entry;
+}
+
+static void _entry_changed_cb(void *data, Evas_Object * obj, void *event_info)
+{
+ if (elm_object_focus_get(data)) {
+ if (elm_entry_is_empty(obj)) {
+ elm_object_signal_emit(data, "elm,state,eraser,hide",
+ "elm");
+ } else {
+ elm_object_signal_emit(data, "elm,state,eraser,show",
+ "elm");
+ }
+ }
+}
+
+static char *_gl_label_get_title1(void *data, Evas_Object * obj,
+ const char *part)
+{
+ struct appdata *ad = (struct appdata *)data;
+ char buf[50] = { 0, };
+
+ if (!ad || !part) {
+ return NULL;
+ }
+ if (!strcmp(part, "elm.text")) {
+ snprintf(buf, sizeof(buf), "%s", _get_tip(ad->ui_type));
+ return strdup(buf);
+ }
+ return NULL;
+}
+
+static Evas_Object *_gl_icon_get1(void *data, Evas_Object * obj,
+ const char *part)
+{
+ Evas_Object *layout = NULL;
+
+ struct appdata *ad = (struct appdata *)data;
+
+ if (!ad || !part) {
+ return NULL;
+ }
+
+ if (!strcmp(part, "elm.icon")) {
+ layout = _create_editfield(obj);
+ evas_object_smart_callback_add(_editfield_entry_get(layout),
+ "changed", _done_button_changed,
+ ad);
+
+ ad->entry_layout = layout;
+
+ return layout;
+
+ }
+ return NULL;
+}
+
+static char *_gl_label_get_title2(void *data, Evas_Object * obj,
+ const char *part)
+{
+ struct appdata *ad = (struct appdata *)data;
+ char buf[50] = { 0, };
+
+ if (!ad || !part) {
+ return NULL;
+ }
+ if (!strcmp(part, "elm.text")) {
+ snprintf(buf, sizeof(buf), "%s", _get_tip(ad->ui_type + 1));
+ return strdup(buf);
+ }
+ return NULL;
+}
+
+static Evas_Object *_gl_icon_get2(void *data, Evas_Object * obj,
+ const char *part)
+{
+ Evas_Object *layout = NULL;
+
+ struct appdata *ad = (struct appdata *)data;
+
+ if (!ad || !part) {
+ return NULL;
+ }
+ if (!strcmp(part, "elm.icon")) {
+ layout = _create_editfield(obj);
+ evas_object_smart_callback_add(_editfield_entry_get(layout),
+ "changed", _entry_changed_cb,
+ layout);
+
+ ad->entry_second_layout = layout;
+
+ return layout;
+
+ }
+ return NULL;
+}
+
+static void _list_set_styles()
+{
+ itc_label1.item_style = "dialogue/title";
+ itc_label1.func.text_get = _gl_label_get_title1;
+ itc_label1.func.content_get = NULL;
+ itc_label1.func.state_get = NULL;
+ itc_label1.func.del = NULL;
+
+ itc_entry1.item_style = "dialogue/1icon";
+ itc_entry1.func.text_get = NULL;
+ itc_entry1.func.content_get = _gl_icon_get1;
+ itc_entry1.func.state_get = NULL;
+ itc_entry1.func.del = NULL;
+
+ itc_label2.item_style = "dialogue/title";
+ itc_label2.func.text_get = _gl_label_get_title2;
+ itc_label2.func.content_get = NULL;
+ itc_label2.func.state_get = NULL;
+ itc_label2.func.del = NULL;
+
+ itc_entry2.item_style = "dialogue/1icon";
+ itc_entry2.func.text_get = NULL;
+ itc_entry2.func.content_get = _gl_icon_get2;
+ itc_entry2.func.state_get = NULL;
+ itc_entry2.func.del = NULL;
+}
+
+void load_main(struct appdata *ad, int ui_type)
+{
+ Evas_Object *ly = NULL;
+ Evas_Object *bt_done = NULL;
+ Evas_Object *bt_dial = NULL;
+ Evas_Object *null_image = NULL;
+ Evas_Object *genlist = NULL;
+ Evas_Object *controlbar = NULL;
+ Elm_Object_Item *genlist_item = NULL;
+ Elm_Object_Item *navi_it = NULL;
+
+ _DBG("%s", __func__);
+
+ ly = _create_conformant(ad->win);
+
+ genlist = elm_genlist_add(ad->navi);
+ _list_set_styles();
+ genlist_item =
+ elm_genlist_item_append(genlist, &itc_label1, (void *)ad, NULL,
+ ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ elm_genlist_item_select_mode_set(genlist_item, EINA_TRUE);
+
+ genlist_item =
+ elm_genlist_item_append(genlist, &itc_entry1, (void *)ad, NULL,
+ ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ elm_genlist_item_select_mode_set(genlist_item, EINA_TRUE);
+
+ if (_UI_PUK_PIN == ui_type) {
+ genlist_item =
+ elm_genlist_item_append(genlist, &itc_label2, (void *)ad,
+ NULL, ELM_GENLIST_ITEM_NONE, NULL,
+ NULL);
+ elm_genlist_item_select_mode_set(genlist_item, EINA_TRUE);
+
+ genlist_item =
+ elm_genlist_item_append(genlist, &itc_entry2, (void *)ad,
+ NULL, ELM_GENLIST_ITEM_NONE, NULL,
+ NULL);
+ elm_genlist_item_select_mode_set(genlist_item, EINA_TRUE);
+ }
+ evas_object_show(genlist);
+ elm_object_content_set(ly, genlist);
+
+ _DBG("load_main ad->ui_type = %d", ad->ui_type);
+
+ controlbar = elm_toolbar_add(ad->navi);
+ if (controlbar == NULL)
+ return;
+
+ elm_toolbar_shrink_mode_set(controlbar, ELM_TOOLBAR_SHRINK_EXPAND);
+
+ bt_dial = elm_button_add(controlbar);
+ elm_object_style_set(bt_dial, "naviframe_control/default");
+ evas_object_size_hint_weight_set(bt_dial, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bt_dial, EVAS_HINT_FILL, 0.5);
+
+ elm_object_text_set(bt_dial, pwlock_get_string(IDS_IDLE_BUTTON_DIALER));
+ evas_object_smart_callback_add(bt_dial, "clicked", _dial_cb, ad);
+ ad->button_dial = bt_dial;
+ evas_object_show(bt_dial);
+
+ bt_done = elm_button_add(controlbar);
+ elm_object_style_set(bt_done, "naviframe_control/default");
+ evas_object_size_hint_weight_set(bt_done, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bt_done, EVAS_HINT_FILL, 0.5);
+
+ elm_object_text_set(bt_done, pwlock_get_string(IDS_COM_SK_DONE));
+ evas_object_smart_callback_add(bt_done, "clicked", _done_cb, ad);
+ ad->button_done = bt_done;
+ evas_object_show(bt_done);
+
+ item[0] = elm_toolbar_item_append(controlbar, NULL, NULL, NULL, NULL);
+ elm_object_item_part_content_set(item[0], "object", bt_dial);
+ item[1] = elm_toolbar_item_append(controlbar, NULL, NULL, NULL, NULL);
+ elm_object_item_part_content_set(item[1], "object", bt_done);
+ elm_object_item_disabled_set(item[1], EINA_TRUE);
+ elm_object_disabled_set(bt_done, EINA_TRUE);
+ null_image = elm_icon_add(ad->navi);
+ elm_icon_file_set(null_image, NULL, NULL);
+ evas_object_show(null_image);
+
+ ad->ly_main = ly;
+ navi_it =
+ elm_naviframe_item_push(ad->navi, _get_header(ui_type), null_image,
+ NULL, ad->ly_main, NULL);
+ elm_object_item_part_content_set(navi_it, "optionheader", controlbar);
+ elm_object_item_signal_emit(navi_it,
+ "elm,state,controlbar,instant_close", "");
+
+ ad->ui_type = ui_type;
+ remove_waiting_popup(ad);
+}
+
+void show_pin(struct appdata *ad)
+{
+ _DBG("%s", __func__);
+
+ if (!ad->navi)
+ init_ui(ad);
+
+ if (!ad->ly_main)
+ load_main(ad, _UI_PIN);
+
+ evas_object_show(ad->win);
+}
+
+void show_puk(struct appdata *ad)
+{
+ _DBG("%s", __func__);
+
+ if (!ad->navi)
+ init_ui(ad);
+
+ load_main(ad, _UI_PUK);
+
+ evas_object_show(ad->win);
+}
+
+void show_puk_pin(struct appdata *ad)
+{
+ _DBG("%s", __func__);
+
+ if (!ad->navi)
+ init_ui(ad);
+
+ load_main(ad, _UI_PUK_PIN);
+
+ evas_object_show(ad->win);
+}
+
+void show_sim_lock(struct appdata *ad)
+{
+ _DBG("%s", __func__);
+
+ int st = ad->sim_status;
+ if (!ad->navi) {
+ init_ui(ad);
+ }
+ switch (st) {
+ case SIM_REQ_LOCK:
+ load_main(ad, _UI_SIM_LOCK);
+ break;
+ case SIM_REQ_NCK:
+ load_main(ad, _UI_NETWORK_LOCK_NCK);
+ break;
+ case SIM_REQ_NSCK:
+ load_main(ad, _UI_NETWORK_LOCK_NSCK);
+ break;
+ case SIM_REQ_SPCK:
+ load_main(ad, _UI_NETWORK_LOCK_SPCK);
+ break;
+ case SIM_REQ_CCK:
+ load_main(ad, _UI_NETWORK_LOCK_CCK);
+ break;
+ default:
+ load_main(ad, _UI_SIM_LOCK);
+ break;
+ }
+
+ evas_object_show(ad->win);
+}
+
+void show_block(struct appdata *ad)
+{
+ Evas_Object *ly = NULL;
+ Evas_Object *bt_dial = NULL;
+ Evas_Object *el = NULL;
+ Evas_Object *bg = NULL;
+ char buf[1024] = { 0, };
+
+ _DBG("%s", __func__);
+
+ if (!ad->navi)
+ init_ui(ad);
+
+ ly = _layout_add(ad->navi);
+ bg = ad->bg;
+ elm_object_style_set(bg, "group_list");
+ el = elm_label_add(ad->navi);
+
+ snprintf(buf, sizeof(buf), "%s%s%s",
+ "<font_size=19 font=SLP:style=Light style=shadow shadow_color=#000000bf color=#ffffffff align=center>",
+ pwlock_get_string
+ (IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER),
+ "</>");
+ elm_object_text_set(el, buf);
+ elm_object_part_content_set(ly, "elm.swallow.content", el);
+ evas_object_show(el);
+
+ bt_dial = elm_button_add(ad->navi);
+ elm_object_text_set(bt_dial, pwlock_get_string(IDS_IDLE_BUTTON_DIALER));
+ evas_object_smart_callback_add(bt_dial, "clicked", _dial_cb, ad);
+ evas_object_show(bt_dial);
+
+ ad->ly_main = ly;
+ elm_naviframe_item_push(ad->navi, _get_header(_UI_BLOCK),
+ bt_dial, NULL, ad->ly_main, NULL);
+ ad->ui_type = _UI_BLOCK;
+ evas_object_show(ad->win);
+ remove_waiting_popup(ad);
+}
+
+void pwlock_destroy(struct appdata *ad)
+{
+ _DBG("%s", __func__);
+
+ if (!ad->navi)
+ return;
+ _DBG("%s %d", __func__, __LINE__);
+
+ elm_naviframe_item_pop(ad->navi);
+ if (ad->navi) {
+ evas_object_del(ad->navi);
+ ad->navi = NULL;
+ }
+ if (ad->ly_main) {
+ evas_object_del(ad->ly_main);
+ ad->ly_main = NULL;
+ }
+ if (ad->entry_layout) {
+ evas_object_del(ad->entry_layout);
+ ad->entry_layout = NULL;
+ }
+ if (ad->entry_second_layout) {
+ evas_object_del(ad->entry_second_layout);
+ ad->entry_second_layout = NULL;
+ }
+ if (ad->bg) {
+ evas_object_del(ad->bg);
+ ad->bg = NULL;
+ }
+ remove_waiting_popup(ad);
+}
+
+void clear_entry(struct appdata *ad)
+{
+ if (ad->entry_layout) {
+ elm_object_part_text_set(ad->entry_layout, "elm.guidetext", "");
+ elm_entry_entry_set(_editfield_entry_get(ad->entry_layout), "");
+ }
+ if (ad->entry_second_layout) {
+ elm_object_part_text_set(ad->entry_second_layout,
+ "elm.guidetext", "");
+ elm_entry_entry_set(_editfield_entry_get
+ (ad->entry_second_layout), "");
+ }
+}
+
+static void _ug_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv)
+{
+ struct appdata *ad = (struct appdata *)priv;
+ Evas_Object *base;
+ _DBG("%s begin", __func__);
+ if (!ug || !priv)
+ return;
+
+ base = (Evas_Object *) ug_get_layout(ug);
+ if (!base) {
+ _DBG("base layout null!\n");
+ return;
+ }
+
+ _DBG("%s,%d", __func__, __LINE__);
+ switch (mode) {
+ case UG_MODE_FULLVIEW:
+ evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(ug_get_window(), base);
+ if (_UI_LANG == ad->ui_type) {
+ if ((ad->language_settings_loaded == 0)
+ || (ad->sim_changed == 1
+ && ad->lock_view_loaded == 0)) {
+ ug_disable_effect(ug);
+ }
+ }
+ evas_object_show(base);
+ break;
+ default:
+ break;
+ }
+ if (_UI_LANG == ad->ui_type) {
+ ad->language_settings_loaded = 1;
+ }
+ _destroy_previous_ugs(ad);
+ _DBG("%s end", __func__);
+
+}
+
+static void _ug_result_cb(struct ui_gadget *ug, bundle * result, void *priv)
+{
+ _DBG("function=%s", __func__);
+ struct appdata *ad = NULL;
+
+ if (!ug || !priv || !result) {
+ return;
+ }
+ char *retv = NULL;
+ ad = (struct appdata *)priv;
+ _DBG("ad->state=%d", ad->state);
+
+ switch (ad->state) {
+ case _ST_LANG:
+ {
+ retv = (char *)bundle_get_val(result, "updateType");
+ if (retv)
+ _DBG("_ST_LANG updateType = %s", retv);
+ retv = (char *)bundle_get_val(result, "ON_OFF_TEXT");
+ if (retv)
+ _DBG("_ST_LANG ON_OFF_TEXT = %s", retv);
+ retv = (char *)bundle_get_val(result, "result");
+ if (retv)
+ _DBG("_ST_LANG language result = %s", retv);
+ char *path = (char *)vconf_get_str(VCONFKEY_LANGSET);
+ if (path) {
+ _DBG("VCONFKEY_LANGSET value = %s", path);
+ setenv("LANG", path, 1);
+ setenv("LC_ALL", path, 1);
+ setenv("LANGUAGE", path, 1);
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+ free(path);
+ path = NULL;
+ }
+ }
+ break;
+ case _ST_KEYBOARD:
+ {
+ retv = (char *)bundle_get_val(result, "name");
+ if (retv)
+ _DBG("_ST_KEYBOARD name = %s", retv);
+ retv = (char *)bundle_get_val(result, "description");
+ if (retv && !strcmp(retv, "previous clicked")) {
+ _DBG("_ST_KEYBOARD description = %s", retv);
+ ad->kill_ug = 1;
+ } else {
+ ad->kill_ug = 0;
+ }
+ }
+ break;
+ case _ST_TIME:
+ {
+ retv = (char *)bundle_get_val(result, "result");
+ if (retv)
+ _DBG("_ST_TIME name = %s", retv);
+ if (retv && !strcmp(retv, "lbutton_click")) {
+ ad->kill_ug = 1;
+ } else if (retv && !strcmp(retv, "rbutton_click")) {
+ ad->kill_ug = 0;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (!retv) {
+ _DBG("retv = %s", retv);
+ _ug_destroy = 1;
+ }
+}
+
+static void _ug_destroy_cb(struct ui_gadget *ug, void *priv)
+{
+ _DBG("%s, %d begin", __func__, __LINE__);
+ struct appdata *ad = NULL;
+ if (1 == _ug_destroy) {
+ _ug_destroy = 0;
+ return;
+ }
+ if (priv) {
+ ad = (struct appdata *)priv;
+ }
+ if (ad == NULL)
+ return;
+
+ _DBG("%s, %d ad->state: %d", __func__, __LINE__, ad->state);
+ switch (ad->state) {
+ case _ST_LANG:
+ {
+ if (ad->first_boot) {
+ _DBG("FIRST BOOT!");
+ if (ad->keyboard_settings_loaded) {
+ ad->state = _ST_KEYBOARD;
+ do_state(ad);
+ } else {
+ ad->state = _ST_KEYBOARD;
+ do_state(ad);
+ show_waiting_popup(ad, NULL);
+ return;
+ }
+ } else {
+ _DBG("NOT FIRST BOOT, SIM CHANGED?");
+ if (ad->running_status == 0
+ && ad->sim_changed == 1) {
+ ad->state = _ST_KEYBOARD;
+ do_state(ad);
+ show_waiting_popup(ad, NULL);
+ return;
+ } else {
+ ad->state = _ST_EXIT;
+ do_state(ad);
+ }
+ }
+ }
+ break;
+ case _ST_TIME:
+ {
+ if (ad->kill_ug) {
+ ad->state = _ST_KEYBOARD;
+ ad->date_and_time_previous = 1;
+ show_waiting_popup(ad, NULL);
+ do_state(ad);
+ ad->kill_ug = 0;
+ return;
+ } else {
+ if (ad->sim_status == SIM_EMPTY) {
+ ad->state = _ST_EXIT;
+ } else {
+ ad->state = _ST_EXIT;
+ }
+ }
+ do_state(ad);
+ }
+ break;
+ case _ST_KEYBOARD:
+ {
+ if (ad->kill_ug) {
+ ad->state = _ST_LANG;
+ do_state(ad);
+ ad->kill_ug = 0;
+ } else {
+ if (ad->first_boot) {
+ if (ad->date_and_time_settings_loaded) {
+ ad->state = _ST_TIME;
+ do_state(ad);
+ ad->kill_ug = 0;
+ } else {
+ ad->state = _ST_TAPI_INIT;
+ do_state(ad);
+ show_waiting_popup(ad,
+ pwlock_get_string
+ (IDS_IDLE_BODY_CHECKING_SIM_STATUS));
+ ad->kill_ug = 0;
+ return;
+ }
+ } else {
+ ad->state = _ST_TIME;
+ do_state(ad);
+ ad->kill_ug = 0;
+ }
+ }
+ }
+ break;
+ default:
+ {
+ if (ad->win)
+ evas_object_show(ad->win);
+ }
+ break;
+ }
+ if (ug) {
+ if (ad->ui_type == _UI_DIALER) {
+ ad->ui_type = ad->previous_ui_type;
+ ug_destroy(ug);
+ ug = NULL;
+
+ elm_object_item_disabled_set(item[0], EINA_FALSE);
+ elm_object_disabled_set(ad->button_dial, EINA_FALSE);
+ if (_UI_PIN == ad->ui_type || _UI_PUK == ad->ui_type ||
+ _UI_PUK_PIN == ad->ui_type
+ || _UI_SIM_LOCK == ad->ui_type) {
+ if (ad->entry_layout) {
+ evas_object_show(_editfield_entry_get
+ (ad->entry_layout));
+ elm_object_focus_set
+ (_editfield_entry_get
+ (ad->entry_layout), EINA_TRUE);
+ }
+ }
+ } else {
+ ug_destroy(ug);
+ ug = NULL;
+ }
+ }
+}
+
+int show_lang(struct appdata *ad)
+{
+ _DBG("%s", __func__);
+ ad->ui_type = _UI_LANG;
+ bundle *b = bundle_create();
+ UG_INIT_EFL(ad->win, UG_OPT_INDICATOR_ENABLE);
+ struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
+
+ if (cbs == NULL) {
+ bundle_free(b);
+ return 0;
+ }
+ cbs->layout_cb = _ug_layout_cb;
+ cbs->result_cb = _ug_result_cb;
+ cbs->destroy_cb = _ug_destroy_cb;
+ cbs->priv = (void *)ad;
+ if (!b) {
+ free(cbs);
+ return 0;
+ }
+ bundle_add(b, "caller", "pwlock");
+ bundle_add(b, "viewtype", "language");
+ bundle_add(b, "rbutton", pwlock_get_string(IDS_COM_SK_NEXT));
+
+ ad->language_ug =
+ ug_create(NULL, "setting-phone-efl", UG_MODE_FULLVIEW, b, cbs);
+ bundle_free(b);
+ free(cbs);
+ if (!ad->language_ug) {
+ _DBG("Get phone ug failed.");
+ ad->state = _ST_KEYBOARD;
+ return 0;
+ }
+ ad->current_ug = ad->language_ug;
+ evas_object_show(ad->win);
+ return 1;
+}
+
+int show_time(struct appdata *ad)
+{
+ _DBG("%s,%d", __func__, __LINE__);
+ if (!ad)
+ return 0;
+ ad->ui_type = _UI_TIME;
+ ad->date_and_time_settings_loaded = 1;
+ bundle *b = bundle_create();
+ UG_INIT_EFL(ad->win, UG_OPT_INDICATOR_ENABLE);
+ struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
+ if (cbs == NULL) {
+ bundle_free(b);
+ return 0;
+ }
+ cbs->layout_cb = _ug_layout_cb;
+ cbs->result_cb = _ug_result_cb;
+ cbs->destroy_cb = _ug_destroy_cb;
+ cbs->priv = (void *)ad;
+ if (!b) {
+ free(cbs);
+ return 0;
+ }
+ bundle_add(b, "caller", "pwlock");
+ bundle_add(b, "lbutton", pwlock_get_string(IDS_COM_BODY_PREVIOUS));
+ bundle_add(b, "rbutton", pwlock_get_string(IDS_COM_SK_DONE));
+ ad->date_ug =
+ ug_create(NULL, "setting-time-efl", UG_MODE_FULLVIEW, b, cbs);
+ bundle_free(b);
+ free(cbs);
+ if (!ad->date_ug) {
+ _DBG("Get time ug failed.");
+ ad->state = _ST_EXIT;
+ return 0;
+ }
+ ad->current_ug = ad->date_ug;
+ evas_object_show(ad->win);
+ return 1;
+}
+
+int show_keyboard_setting(struct appdata *ad)
+{
+ _DBG("%s,%d", __func__, __LINE__);
+ if (!ad)
+ return 0;
+ ad->ui_type = _UI_KEYBOARD;
+ ad->keyboard_settings_loaded = 1;
+ bundle *b = bundle_create();
+ UG_INIT_EFL(ad->win, UG_OPT_INDICATOR_ENABLE);
+ struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
+ if (cbs == NULL) {
+ bundle_free(b);
+ return 0;
+ }
+ cbs->layout_cb = _ug_layout_cb;
+ cbs->result_cb = _ug_result_cb;
+ cbs->destroy_cb = _ug_destroy_cb;
+ cbs->priv = (void *)ad;
+ if (!b) {
+ free(cbs);
+ return 0;
+ }
+
+ bundle_add(b, "navi_btn_left",
+ pwlock_get_string(IDS_COM_BODY_PREVIOUS));
+ bundle_add(b, "navi_btn_right", pwlock_get_string(IDS_COM_SK_NEXT));
+
+ ad->keyboard_ug =
+ ug_create(NULL, "keyboard-setting-wizard-efl", UG_MODE_FULLVIEW, b,
+ cbs);
+
+ bundle_free(b);
+ free(cbs);
+ if (!ad->keyboard_ug) {
+ _DBG("Get keyboard setting ug failed\n");
+ ad->state = _ST_TIME;
+ return 0;
+ }
+ ad->current_ug = ad->keyboard_ug;
+ evas_object_show(ad->win);
+ return 1;
+}
+
+int show_dialer(struct appdata *ad)
+{
+ _DBG("%s,%d", __func__, __LINE__);
+ if (!ad)
+ return 0;
+ ad->ui_type = _UI_DIALER;
+
+ bundle *b;
+ b = bundle_create();
+ UG_INIT_EFL(ad->win, UG_OPT_INDICATOR_ENABLE);
+ struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
+ if (cbs == NULL) {
+ bundle_free(b);
+ return 0;
+ }
+ cbs->layout_cb = _ug_layout_cb;
+ cbs->result_cb = NULL;
+ cbs->destroy_cb = _ug_destroy_cb;
+ cbs->priv = (void *)ad;
+
+ if (!b) {
+ free(cbs);
+ return 0;
+ }
+
+ bundle_add(b, "emergency_dialer", "emergency");
+ ad->dialer_ug = ug_create(NULL, "dialer-efl", UG_MODE_FULLVIEW, b, cbs);
+ bundle_free(b);
+ free(cbs);
+ if (!ad->dialer_ug) {
+ _DBG("dialer ug failed\n");
+ return 0;
+ }
+ ad->current_ug = ad->dialer_ug;
+ evas_object_show(ad->win);
+ return 1;
+}
+
+void show_popup(struct appdata *ad, const char *mesg, Eina_Bool mode)
+{
+ if (!ad) {
+ return;
+ }
+ Evas_Object *pp;
+ Evas_Object *button1;
+ Evas_Object *button2;
+ ad->previous_ui_type = ad->ui_type;
+
+ if (ad->popup) {
+ evas_object_del(ad->popup);
+ ad->popup = NULL;
+ }
+ ecore_imf_context_input_panel_hide(elm_entry_imf_context_get
+ (_editfield_entry_get
+ (ad->entry_layout)));
+ pp = elm_popup_add(ad->win);
+ ad->popup = pp;
+ evas_object_size_hint_weight_set(pp, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_object_text_set(pp, mesg);
+ if (EINA_TRUE == mode) {
+ elm_popup_timeout_set(pp, 3);
+ } else {
+ button1 = elm_button_add(pp);
+ elm_object_text_set(button1, pwlock_get_string(IDS_COM_SK_OK));
+ elm_object_part_content_set(pp, "button1", button1);
+ evas_object_smart_callback_add(button1, "clicked", _pp_rsp_ok_cb,
+ ad);
+
+ button2 = elm_button_add(pp);
+ elm_object_text_set(button2, pwlock_get_string(IDS_COM_SK_CANCEL));
+ elm_object_part_content_set(pp, "button2", button2);
+ evas_object_smart_callback_add(button2, "clicked", _pp_rsp_cancel_cb,
+ ad);
+ }
+ remove_waiting_popup(ad);
+ evas_object_show(pp);
+}
+
+void show_waiting_popup(struct appdata *ad, const char *msg_str)
+{
+ if (!ad) {
+ return;
+ }
+ Evas_Object *popup = NULL;
+ Evas_Object *progressbar = NULL;
+ Evas_Object *box = NULL;
+ Evas_Object *label = NULL;
+
+ remove_waiting_popup(ad);
+
+ popup = elm_popup_add(ad->win);
+ ad->waiting_popup = popup;
+ box = elm_box_add(popup);
+ if (msg_str != NULL) {
+ label = elm_label_add(popup);
+ elm_object_style_set(label, "popup_description/default");
+ elm_label_line_wrap_set(label, EINA_TRUE);
+ elm_object_text_set(label, msg_str);
+ evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(label, EVAS_HINT_FILL,
+ EVAS_HINT_FILL);
+ evas_object_show(label);
+ elm_box_pack_end(box, label);
+ }
+
+ progressbar = elm_progressbar_add(popup);
+ elm_object_style_set(progressbar, "pending_list");
+ elm_progressbar_pulse(progressbar, EINA_TRUE);
+ evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL,
+ EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_progressbar_pulse(progressbar, EINA_TRUE);
+ evas_object_show(progressbar);
+ elm_box_pack_end(box, progressbar);
+ evas_object_show(box);
+ elm_object_content_set(popup, box);
+ evas_object_show(popup);
+
+}
+
+void remove_waiting_popup(struct appdata *ad)
+{
+ if (!ad) {
+ return;
+ }
+ if (ad->waiting_popup) {
+ evas_object_del(ad->waiting_popup);
+ ad->waiting_popup = NULL;
+ }
+}
+
+Eina_Bool show_puk_do(void *data)
+{
+ _DBG("%s, %d begin", __func__, __LINE__);
+ struct appdata *ad = (struct appdata *)data;
+
+ show_puk(ad);
+ ad->state = _ST_SIM_PUKCNF;
+
+ return ECORE_CALLBACK_CANCEL;
+}
diff --git a/src/util.c b/src/util.c
new file mode 100755
index 0000000..0845235
--- /dev/null
+++ b/src/util.c
@@ -0,0 +1,222 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <appcore-common.h>
+#include <Ecore_X.h>
+#include <Elementary.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <poll.h>
+#include <stdio.h>
+#include <libintl.h>
+#include <glib.h>
+
+#include "util.h"
+
+#define LINEMAX 256
+#define MAXFILELEN 1048576
+
+#define PHLOCK_SOCK_PREFIX "/tmp/phlock"
+#define PHLOCK_SOCK_MAXBUFF 65535
+
+const char *sys_str_table[] = {
+ "IDS_COM_SK_SET",
+ "IDS_COM_SK_DONE",
+ "IDS_COM_BODY_ENTER_PASSWORD",
+ "IDS_COM_BODY_PREVIOUS",
+ "IDS_COM_SK_NEXT",
+ "IDS_COM_SK_OK",
+ "IDS_COM_SK_CANCEL",
+};
+
+const char *app_str_table[] = {
+ "IDS_IDLE_BODY_AUTOMATIC",
+ "IDS_IDLE_HEADER_NETWORK_LOCK",
+ "IDS_IDLE_HEADER_PHONE_LOCK",
+ "IDS_IDLE_HEADER_PIN_LOCK",
+ "IDS_IDLE_HEADER_PUK_LOCK",
+ "IDS_IDLE_HEADER_SIM_BLOCKED",
+ "IDS_IDLE_HEADER_SIM_LOCK",
+ "IDS_IDLE_BODY_1_ATTEMPT_LEFT",
+ "IDS_IDLE_BODY_CORPORATE_PERSONALISATION_ON_ENTER_CONTROL_KEY",
+ "IDS_IDLE_BODY_ENTER_NEW_PIN",
+ "IDS_IDLE_BODY_ENTER_PIN",
+ "IDS_IDLE_BODY_ENTER_PUK",
+ "IDS_IDLE_BODY_INCORRECT_PIN",
+ "IDS_IDLE_BODY_INCORRECT_PIN_TRY_AGAIN",
+ "IDS_IDLE_BODY_INCORRECT_PUK",
+ "IDS_IDLE_BODY_LANGUAGE_NOT_SUPPORTED",
+ "IDS_IDLE_BODY_NETWORK_PERSONALISATION_ON_ENTER_CONTROL_KEY",
+ "IDS_IDLE_BODY_NETWORK_SUBSET_PERSONALISATION_ON_ENTER_CONTROL_KEY",
+ "IDS_IDLE_BODY_PASSWORD_MUST_BE_4_DIGITS_LONG",
+ "IDS_IDLE_BODY_PD_ATTEMPTS_LEFT",
+ "IDS_IDLE_BODY_SERVICE_PROVIDER_PERSONALISATION_ON_ENTER_CONTROL_KEY",
+ "IDS_IDLE_BODY_SIM_CARD_NOT_AVAILABLE_CONTACT_YOUR_SERVICE_PROVIDER",
+ "IDS_IDLE_BODY_UNABLE_TO_READ_SIM_CARD_LANGUAGE",
+ "IDS_IDLE_BODY_WRONG_PASSWORD",
+ "IDS_IDLE_BUTTON_CANCEL",
+ "IDS_IDLE_BUTTON_DIALER",
+ "IDS_IDLE_HEADER_DISPLAY_LANGUAGE",
+ "Do you want to skip Setup Wizard?",
+ "IDS_IDLE_BODY_PASSWORD_EMPTY",
+ "IDS_IDLE_BODY_PD_TO_PD_DIGITS_REQUIRED",
+ "IDS_IDLE_BODY_NEW_PIN",
+ "IDS_IDLE_BODY_PIN",
+ "IDS_IDLE_BODY_PUK",
+ "IDS_IDLE_POP_PIN_BLOCKED",
+ "IDS_IDLE_POP_PIN_UNBLOCKED",
+ "IDS_IDLE_BODY_CONFIRM_NEW_PIN",
+ "IDS_IDLE_POP_INCORRECT_PIN_1_ATTEMPT_LEFT",
+ "IDS_IDLE_POP_INCORRECT_PIN_PD_ATTEMPTS_LEFT",
+ "%d to %d digits or letters required",
+ "Passwords do not match",
+ "PIN code has been changed",
+ "SIM card error",
+ "%d s left,please try later!",
+ "Please input password again after 30 seconds.",
+ "Checking SIM..."
+};
+
+void pwlock_log_t(char *fmt, ...)
+{
+ va_list ap;
+ FILE *fd = 0;
+ char buf[LINEMAX] = { 0, };
+ char debugString[LINEMAX] = { 0, };
+
+ va_start(ap, fmt);
+ vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+ int fileLen = 0;
+ struct tm local_t;
+ time_t current_time = 0;
+ bzero((char *)&debugString, LINEMAX);
+ time(&current_time);
+ gmtime_r(&current_time, &local_t);
+ int len = snprintf(debugString, sizeof(debugString),
+ "[%d-%02d-%02d, %02d:%02d:%02d]: ",
+ local_t.tm_year + 1900, local_t.tm_mon + 1,
+ local_t.tm_mday, local_t.tm_hour, local_t.tm_min,
+ local_t.tm_sec);
+ if (len == -1) {
+ return;
+ } else {
+ debugString[len] = '\0';
+ }
+ len = g_strlcat(debugString, buf, LINEMAX);
+ if (len >= LINEMAX) {
+ return;
+ } else {
+ debugString[len] = '\n';
+ }
+ if ((fd = fopen(LOGFILE, "at+")) == NULL) {
+ PWLOCK_ERR("File fopen fail for writing Pwlock information");
+ } else {
+ int pid = -1;
+ if (fwrite(debugString, strlen(debugString), 1, fd) < 1) {
+ PWLOCK_ERR
+ ("File fwrite fail for writing Pwlock information");
+ fclose(fd);
+ if ((pid = fork()) < 0) {
+ } else if (pid == 0) {
+ execl("/bin/rm", "rm", "-f", LOGFILE,
+ (char *)0);
+ }
+ } else {
+ fseek(fd, 0l, SEEK_END);
+ fileLen = ftell(fd);
+ if (fileLen > MAXFILELEN) {
+ fclose(fd);
+ if ((pid = fork()) < 0) {
+ return;
+ } else if (pid == 0) {
+ execl("/bin/rm", "rm", "-f", LOGFILE,
+ (char *)0);
+ }
+ } else
+ fclose(fd);
+ }
+ }
+}
+
+static void win_del(void *data, Evas_Object * obj, void *event)
+{
+ elm_exit();
+}
+
+Evas_Object *create_win(const char *name)
+{
+ Evas_Object *eo;
+ int w, h;
+
+ eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
+ if (eo) {
+ elm_win_title_set(eo, name);
+ elm_win_borderless_set(eo, EINA_TRUE);
+ evas_object_smart_callback_add(eo, "delete,request",
+ win_del, NULL);
+ ecore_x_window_size_get(ecore_x_window_root_first_get(),
+ &w, &h);
+ evas_object_resize(eo, w, h);
+ }
+
+ return eo;
+}
+
+Evas_Object *load_edj(Evas_Object * parent, const char *file, const char *group)
+{
+ Evas_Object *eo;
+ int r;
+
+ eo = elm_layout_add(parent);
+ if (eo) {
+ r = elm_layout_file_set(eo, file, group);
+ if (!r) {
+ evas_object_del(eo);
+ return NULL;
+ }
+
+ evas_object_size_hint_weight_set(eo,
+ EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ }
+
+ return eo;
+}
+
+char *pwlock_get_string(int id)
+{
+ _DBG("get string id : %d\n", id);
+
+ char *str = NULL;
+
+ if (id < IDS_PWLOCK_SYSTEM_STRING_MAX) {
+ str = dgettext("sys_string", sys_str_table[id]);
+ } else {
+ str =
+ dgettext("pwlock",
+ app_str_table[id - IDS_PWLOCK_SYSTEM_STRING_MAX]);
+ }
+
+ _DBG("get string : %s\n", str);
+
+ return str;
+}