CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-SET(ENGINE_SOURCES
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/WlanManager/EngineManager/connman-request.c
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/WlanManager/EngineManager/connman-response.c
-# ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/WlanManager/EngineManager/connman-profile-manager.c
+SET(ENGINE_SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/WlanManager/EngineManager/connman-request.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/WlanManager/EngineManager/connman-response.c
)
-SET(ENGINE_INCLUDES
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/WlanManager/EngineManager/include) #connman
+SET(ENGINE_INCLUDES
+ ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/WlanManager/EngineManager/include)
-SET(ENGINE_PKGCONFIGS
- capi-network-wifi
- network)
+SET(ENGINE_PKGCONFIGS
+ capi-network-wifi
+ network)
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED
- ecore
- ecore-imf
- ecore-input
- appcore-efl
- elementary
- glib-2.0
- utilX
- ui-gadget-1
- x11
- sensor
- syspopup
- syspopup-caller
+pkg_check_modules(pkgs REQUIRED
+ ecore
+ ecore-imf
+ ecore-input
+ appcore-efl
+ elementary
+ glib-2.0
+ utilX
+ ui-gadget-1
+ x11
+ sensor
+ syspopup
+ syspopup-caller
#engine pkgconfigs
- ${ENGINE_PKGCONFIGS})
+ ${ENGINE_PKGCONFIGS})
INCLUDE_DIRECTORIES(
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/ui-gadget/include
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/ui-gadget/viewers-layout/include
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/wifi-syspopup/include
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/wifi-syspopup/viewer-popups/include
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/Common/include
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/WlanManager/wlan-manager/include
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/WlanManager/profile-manager/include
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/gestureManager/include
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/appcoreWrapper/include
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/messageDispatcher/include
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/ug-caller/include
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/i18nManager/include
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/LogManager/include
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/settingWrapper/include
- ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/mobileAPManager/include
-
+ ${CMAKE_CURRENT_SOURCE_DIR}/sources/ui-gadget/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/sources/ui-gadget/viewers-layout/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/sources/wifi-syspopup/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/sources/wifi-syspopup/viewer-popups/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/Common/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/WlanManager/WlanManager/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/WlanManager/EngineManager/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/appcoreWrapper/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/sources/libraries/i18nManager/include
#engine includes
- ${ENGINE_INCLUDES})
+ ${ENGINE_INCLUDES})
ADD_SUBDIRECTORY(po)
ADD_SUBDIRECTORY(sources/ui-gadget)
ADD_SUBDIRECTORY(sources/wifi-syspopup)
-
--- /dev/null
+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.
+wifi-efl-ug (0.5.2-1) precise; urgency=low
+
+ * Update for SR
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.2-1
+
+ -- sunil85.kim <isurit@sunil85.kim> Thu, 14 Mar 2013 15:59:00 +0900
+
+wifi-efl-ug (0.5.1-60) precise; urgency=low
+
+ * Set the filter for proxy address
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-60
+
+ -- sunil85.kim <isurit@sunil85.kim> Fri, 08 Mar 2013 14:01:50 +0900
+
+wifi-efl-ug (0.5.1-59) precise; urgency=low
+
+ * Disable the header item when pressed in activating / deactivating state
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-59
+
+ -- sunil85.kim <isurit@sunil85.kim> Fri, 08 Mar 2013 12:14:50 +0900
+
+wifi-efl-ug (0.5.1-58) precise; urgency=low
+
+ * Wi-Fi device state change not handled in Wi-Fi UG
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-58
+
+ -- sunil85.kim <isurit@sunil85.kim> Fri, 08 Mar 2013 11:20:48 +0900
+
+wifi-efl-ug (0.5.1-57) precise; urgency=low
+
+ * SMACK rule updated
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-57
+
+ -- sunil85.kim <isurit@sunil85.kim> Fri, 08 Mar 2013 11:12:44 +0900
+
+wifi-efl-ug (0.5.1-56) precise; urgency=low
+
+ * While we are connected to any WiFi network, front under highlight is blue
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-56
+
+ -- sunil85.kim <isurit@sunil85.kim> Fri, 08 Mar 2013 09:22:05 +0900
+
+wifi-efl-ug (0.5.1-55) precise; urgency=low
+
+ * Fix width adjustment in syspopup during screen rotation
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-55
+
+ -- sunil85.kim <isurit@sunil85.kim> Thu, 07 Mar 2013 11:48:26 +0900
+
+wifi-efl-ug (0.5.1-54) precise; urgency=low
+
+ * Add safe checks with error logging macro
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-54
+
+ -- sunil85.kim <isurit@sunil85.kim> Thu, 07 Mar 2013 11:36:55 +0900
+
+wifi-efl-ug (0.5.1-53) precise; urgency=low
+
+ * Avoid callback duplicates for EAP field entries to fix navi title issue
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-53
+
+ -- sunil85.kim <isurit@sunil85.kim> Thu, 07 Mar 2013 11:07:58 +0900
+
+wifi-efl-ug (0.5.1-52) precise; urgency=low
+
+ * Add safe check to avoid dereferencing NULL pointer
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-52
+
+ -- sunil85.kim <isurit@sunil85.kim> Thu, 07 Mar 2013 09:48:48 +0900
+
+wifi-efl-ug (0.5.1-51) precise; urgency=low
+
+ * Update image files for signal icons
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-51
+
+ -- sunil85.kim <isurit@sunil85.kim> Wed, 06 Mar 2013 20:14:41 +0900
+
+wifi-efl-ug (0.5.1-50) precise; urgency=low
+
+ * Fix ug crash when clicked power on/off item
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-50
+
+ -- sunil85.kim <isurit@sunil85.kim> Wed, 06 Mar 2013 20:02:57 +0900
+
+wifi-efl-ug (0.5.1-49) precise; urgency=low
+
+ * Apply changable icon in ap list whether item is highlight or not
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-49
+
+ -- sunil85.kim <isurit@sunil85.kim> Wed, 06 Mar 2013 19:46:52 +0900
+
+wifi-efl-ug (0.5.1-48) precise; urgency=low
+
+ * SMACK rules updated
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-48
+
+ -- sunil85.kim <isurit@sunil85.kim> Wed, 06 Mar 2013 19:05:07 +0900
+
+wifi-efl-ug (0.5.1-47) precise; urgency=low
+
+ * Fix UI lockup issue related to back button in EAP connect screen
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-47
+
+ -- sunil85.kim <isurit@sunil85.kim> Wed, 06 Mar 2013 15:56:28 +0900
+
+wifi-efl-ug (0.5.1-46) precise; urgency=low
+
+ * Show QS popup after pwlock is unlocked during boot
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-46
+
+ -- sunil85.kim <isurit@sunil85.kim> Wed, 06 Mar 2013 15:46:51 +0900
+
+wifi-efl-ug (0.5.1-45) precise; urgency=low
+
+ * Make "connecting..." text only on receiving the connecting state change indi
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-45
+
+ -- sunil85.kim <isurit@sunil85.kim> Wed, 06 Mar 2013 15:30:59 +0900
+
+wifi-efl-ug (0.5.1-44) precise; urgency=low
+
+ * Update 'Find hidden network' option as a button and not genlist item
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-44
+
+ -- sunil85.kim <isurit@sunil85.kim> Wed, 06 Mar 2013 15:09:53 +0900
+
+wifi-efl-ug (0.5.1-43) precise; urgency=low
+
+ * Handle the specific scan responses properly
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-43
+
+ -- sunil85.kim <isurit@sunil85.kim> Wed, 06 Mar 2013 12:06:29 +0900
+
+wifi-efl-ug (0.5.1-42) precise; urgency=low
+
+ * Apply screen reader feature
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-42
+
+ -- sunil85.kim <isurit@sunil85.kim> Tue, 05 Mar 2013 20:15:07 +0900
+
+wifi-efl-ug (0.5.1-41) precise; urgency=low
+
+ * First draft of Wi-Fi alternative connection support
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-41
+
+ -- sunil85.kim <isurit@sunil85.kim> Tue, 05 Mar 2013 14:09:23 +0900
+
+wifi-efl-ug (0.5.1-40) precise; urgency=low
+
+ * First draft of Wi-Fi alternative connection support
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-40
+
+ -- sunil85.kim <isurit@sunil85.kim> Tue, 05 Mar 2013 12:24:56 +0900
+
+wifi-efl-ug (0.5.1-39) precise; urgency=low
+
+ * Fit the modification of libnet-client
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-39
+
+ -- sunil85.kim <isurit@sunil85.kim> Mon, 04 Mar 2013 19:33:06 +0900
+
+wifi-efl-ug (0.5.1-38) precise; urgency=low
+
+ * Fix UT Bug
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-38
+
+ -- sunil85.kim <isurit@sunil85.kim> Mon, 04 Mar 2013 16:24:54 +0900
+
+wifi-efl-ug (0.5.1-37) precise; urgency=low
+
+ * Apply Naviframe Title Slide Mode
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-37
+
+ -- sunil85.kim <isurit@sunil85.kim> Mon, 04 Mar 2013 15:18:24 +0900
+
+wifi-efl-ug (0.5.1-36) precise; urgency=low
+
+ * modify domain name in manifest file
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-36
+
+ -- sunil85.kim <isurit@sunil85.kim> Thu, 28 Feb 2013 10:39:06 +0900
+
+wifi-efl-ug (0.5.1-35) precise; urgency=low
+
+ * Wi-Fi lists might be better to be updated at maximum delayed
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-35
+
+ -- sunil85.kim <isurit@sunil85.kim> Tue, 26 Feb 2013 17:33:51 +0900
+
+wifi-efl-ug (0.5.1-34) precise; urgency=low
+
+ * Modify guide text of password field in EAP detail view
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-34
+
+ -- sunil85.kim <isurit@sunil85.kim> Tue, 26 Feb 2013 15:05:38 +0900
+
+wifi-efl-ug (0.5.1-33) precise; urgency=low
+
+ * [N_SE-25618]Fix window resize bug
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-33
+
+ -- sunil85.kim <isurit@sunil85.kim> Fri, 22 Feb 2013 10:52:39 +0900
+
+wifi-efl-ug (0.5.1-32) precise; urgency=low
+
+ * Destroy Wi-Fi popup when lockscreen shown
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.1-32
+
+ -- sunil85.kim <isurit@sunil85.kim> Thu, 14 Feb 2013 17:26:47 +0900
+
wifi-efl-ug (0.5.1-31) precise; urgency=low
* [N_SE-3422] Bug fix
<manifest>
+ <define>
+ <domain name="net.wifi-qs"/>
+ </define>
+ <assign>
+ <filesystem path="/usr/share/license/net.wifi-qs" label="_"/>
+ <filesystem path="/usr/share/packages/net.wifi-qs.xml" label="_"/>
+ <filesystem path="/usr/share/process-info/wifi-qs.ini" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_00.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_01.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_02.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_03.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_lock_00.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_lock_01.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_lock_02.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_lock_03.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_00_press.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_01_press.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_02_press.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_03_press.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_lock_00_press.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_lock_01_press.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_lock_02_press.png" label="_"/>
+ <filesystem path="/usr/share/icon/37_wifi_icon_lock_03_press.png" label="_"/>
+ <filesystem path="/usr/share/icon/Q02_Notification__wifi_in_range.png" label="_"/>
+ <filesystem path="/usr/share/locale/ar/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/az/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/bg/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/ca/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/cs/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/da/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/de_DE/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/el_GR/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/en/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/en_PH/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/en_US/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/es_ES/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/es_MX/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/et/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/eu/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/fi/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/fr_CA/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/fr_FR/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/ga/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/gl/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/hi/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/hr/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/hu/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/hy/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/is/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/it_IT/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/ja_JP/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/ka/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/kk/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/ko_KR/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/lt/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/lv/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/mk/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/nb/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/nl_NL/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/pl/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/pt_BR/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/pt_PT/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/ro/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/ru_RU/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/sk/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/sl/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/sr/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/sv/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/tr_TR/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/uk/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/uz/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/zh_CN/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/zh_HK/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/zh_SG/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ <filesystem path="/usr/share/locale/zh_TW/LC_MESSAGES/wifi-qs.mo" label="_"/>
+ </assign>
<request>
- <domain name="_"/>
+ <domain name="net.wifi-qs"/>
</request>
</manifest>
--- /dev/null
+e17 net.wifi-qs w
+net.wifi-qs xorg w
+net.wifi-qs isf rwx
+net.wifi-qs dbus rwx
+net.wifi-qs ail::db rw
+net.wifi-qs mdm-server w
+net.wifi-qs csc-manager x
+net.wifi-qs sound_server rw
+net.wifi-qs pulseaudio rwxat
+net.wifi-qs syspopup::db rw
+net.wifi-qs system::vconf rwxat
+net.wifi-qs system::media rwxat
+net.wifi-qs system::share rwxat
+net.wifi-qs device::app_logging w
+net.wifi-qs system::homedir rwxat
+net.wifi-qs sys-assert::core rwxat
+net.wifi-qs system::use_internet r
+com.samsung.app-tray net.wifi-qs rx
+com.samsung.quickpanel net.wifi-qs rwx
Name: wifi-efl-ug
Summary: Wi-Fi UI Gadget
-Version: 0.5.1_31
+Version: 0.5.2_1
Release: 1
Group: App/Network
License: Flora License
%install
%make_install
+mkdir -p %{buildroot}%{_sysconfdir}/smack/accesses2.d/
+cp -v net.wifi-qs.rule %{buildroot}%{_sysconfdir}/smack/accesses2.d/
+cp -v wifi-efl-ug.include %{buildroot}%{_sysconfdir}/smack/accesses2.d/
+
#License
mkdir -p %{buildroot}%{_datadir}/license
cp LICENSE.Flora %{buildroot}%{_datadir}/license/wifi-efl-ug
%{PREFIX}/res/images/wifi-efl-UG/*.png
%{PREFIX}/res/locale/*/LC_MESSAGES/*.mo
%{_datadir}/license/wifi-efl-ug
+%{_sysconfdir}/smack/accesses2.d/wifi-efl-ug.include
%files -n net.wifi-qs
%manifest net.wifi-qs.manifest
%{_datadir}/icon/*.png
%{_datadir}/locale/*/LC_MESSAGES/*.mo
%{_datadir}/license/net.wifi-qs
+%{_sysconfdir}/smack/accesses2.d/net.wifi-qs.rule
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}
+ OUTPUT ${moFile}
+ COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
+ DEPENDS ${absPofile}
)
# install for UG
INSTALL(FILES ${moFile}
- DESTINATION /usr/ug/res/locale/${lang}/LC_MESSAGES RENAME ${WIFI_UG_PROJECT_NAME}.mo)
+ DESTINATION /usr/ug/res/locale/${lang}/LC_MESSAGES RENAME ${WIFI_UG_PROJECT_NAME}.mo)
# install for QS
INSTALL(FILES ${moFile}
- DESTINATION /usr/share/locale/${lang}/LC_MESSAGES RENAME ${WIFI_QS_PROJECT_NAME}.mo)
+ DESTINATION /usr/share/locale/${lang}/LC_MESSAGES RENAME ${WIFI_QS_PROJECT_NAME}.mo)
SET(moFiles ${moFiles} ${moFile})
ENDFOREACH(pofile)
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "إخطار عند العثور على شبكة Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(بدون تغيير)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Wi-Fi şəbəkəsi tapılanda xəbər verin"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(dəyişdirilməmiş)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Уведомяване, когато е намерена Wi-Fi мрежа"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(непроменено)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Notificar quan es trobi una xarxa Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(no s'ha modificat)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Upozornit při nalezení sítě Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(nezměněno)"
+
msgstr "Statisk IP"
msgid "IDS_WIFI_POP_ACTIVATING_WI_FI_ING"
-msgstr "Aktiverer Wi-Fi..."
+msgstr "Aktiverer Wi-Fi ..."
msgid "IDS_WIFI_SK_FORGET"
msgstr "Glem"
msgstr "Skjult netværk"
msgid "IDS_WIFI_POP_DEACTIVATING_WI_FI_ING"
-msgstr "Deaktiverer Wi-Fi..."
+msgstr "Deaktiverer Wi-Fi ..."
msgid "IDS_WIFI_POP_SEARCHING_ING"
msgstr "Søger ..."
msgstr "WEP"
msgid "IDS_ST_POP_DEACTIVATING_ING"
-msgstr "Deaktiverer..."
+msgstr "Deaktiverer ..."
msgid "IDS_WIFI_BODY_CONFIGURATION_NO_SECURITY"
msgstr "Ingen sikkerhed"
msgstr "Tryk på WPS på dit Wi-Fi-adgangspunkt inden for 2 minutter"
msgid "IDS_WIFI_BUTTON_CANCEL"
-msgstr "Annuller"
+msgstr "Annullér"
msgid "IDS_WIFI_BODY_SSID"
msgstr "SSID"
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Giv mig besked, når der er fundet et Wi-Fi-netværk"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(uændret)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Benachrichtigen, wenn WLAN-Netzwerk gefunden wurde"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(unverändert)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Να ειδοποιούμαι, όταν εντοπίζεται δίκτυο Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(χωρίς αλλαγές)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Notify when Wi-Fi network is found"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(unchanged)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Notify when Wi-Fi network is found"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(unchanged)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Notify when Wi-Fi network is found"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(unchanged)"
+
msgstr "Activando Wi-Fi..."
msgid "IDS_WIFI_SK_FORGET"
-msgstr "Cancelar"
+msgstr "Olvidar"
msgid "IDS_WIFI_BODY_IP_ADDRESS"
msgstr "Dirección IP"
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Notificar cuando se encuentre una red Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(sin modificar)"
+
msgid "IDS_WIFI_HEADER_ENTER_PASSWORD"
msgstr "Introducir contraseña"
-msgid "IDS_WIFI_POP_ENTER_PS_AGAIN_KOR"
-msgstr "Introducir %s nuevamente"
+msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
+msgstr "Notificar cuando no se encuentra una red Wi-Fi"
+
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(sin modificar)"
+++ /dev/null
-msgid "IDS_WIFI_BODY_CONNECTED"
-msgstr "Conectado"
-
-msgid "IDS_WIFI_BODY_CONNECTING_ING"
-msgstr "Conectando..."
-
-msgid "IDS_WIFI_BODY_STATIC_IP"
-msgstr "IP estática"
-
-msgid "IDS_WIFI_POP_ACTIVATING_WI_FI_ING"
-msgstr "Activando Wi-Fi..."
-
-msgid "IDS_WIFI_SK_FORGET"
-msgstr "Olvidar"
-
-msgid "IDS_WIFI_BODY_IP_ADDRESS"
-msgstr "Dirección IP"
-
-msgid "IDS_WIFI_BODY_SUBNET_MASK"
-msgstr "Máscara de subred"
-
-msgid "IDS_WIFI_BODY_DNS_1"
-msgstr "DNS 1"
-
-msgid "IDS_WIFI_BODY_DNS_2"
-msgstr "DNS 2"
-
-msgid "IDS_ST_BODY_NETWORK_NOTIFICATION"
-msgstr "Notificación de red"
-
-msgid "IDS_WIFI_POP_OPEN"
-msgstr "Abierta"
-
-msgid "IDS_ST_BODY_SECURED_ABB_M_WIFI_AP_SUMMARY"
-msgstr "Protegida"
-
-msgid "IDS_WIFI_BODY_MAC_ADDRESS"
-msgstr "Dirección MAC"
-
-msgid "IDS_WIFI_BODY_PROXY_PORT"
-msgstr "Puerto proxy"
-
-msgid "IDS_ST_BODY_EXCELLENT"
-msgstr "Excelente"
-
-msgid "IDS_ST_BODY_GOOD_M_STRENGTH"
-msgstr "Buena"
-
-msgid "IDS_ST_BODY_SCAN"
-msgstr "Buscar"
-
-msgid "IDS_ST_BODY_WI_FI_NETWORKS"
-msgstr "Redes Wi-Fi"
-
-msgid "IDS_WIFI_BODY_DISCONNECTING_ING"
-msgstr "Desconectando..."
-
-msgid "IDS_WIFI_BODY_DYNAMIC_IP"
-msgstr "IP dinámica"
-
-msgid "IDS_WIFI_BODY_NO_APS"
-msgstr "No hay AP"
-
-msgid "IDS_WIFI_BODY_SECURITY_TYPE"
-msgstr "Tipo de seguridad"
-
-msgid "IDS_WIFI_HEADER_HIDDEN_NETWORK"
-msgstr "Red oculta"
-
-msgid "IDS_WIFI_POP_DEACTIVATING_WI_FI_ING"
-msgstr "Desactivando Wi-Fi..."
-
-msgid "IDS_WIFI_POP_SEARCHING_ING"
-msgstr "Buscando..."
-
-msgid "IDS_WIFI_POP_SELECT_NETWORK"
-msgstr "Seleccionar red"
-
-msgid "IDS_WIFI_BODY_EAP_METHOD"
-msgstr "Método EAP"
-
-msgid "IDS_WIFI_BODY_EAP"
-msgstr "EAP"
-
-msgid "IDS_WIFI_BODY_GATEWAY_ADDRESS"
-msgstr "Dirección de puerta de enlace"
-
-msgid "IDS_WIFI_BODY_ENTER_PASSWORD"
-msgstr "Introducir contraseña"
-
-msgid "IDS_WIFI_BODY_CA_CERTIFICATE"
-msgstr "Certificado de CA"
-
-msgid "IDS_WIFI_BODY_UNSPECIFIED"
-msgstr "Sin especificar"
-
-msgid "IDS_WIFI_BODY_USER_CERTIFICATE_ABB"
-msgstr "Certific usuario"
-
-msgid "IDS_WIFI_BODY_IDENTITY"
-msgstr "Identidad"
-
-msgid "IDS_WIFI_BODY_ANONYMOUS_IDENTITY"
-msgstr "Identidad anónima"
-
-msgid "IDS_WIFI_BODY_ENTER_IDENTITY"
-msgstr "Ingresar identidad"
-
-msgid "IDS_WIFI_BODY_ENTER_ANONYMOUS_IDENTITY"
-msgstr "Ingresar identidad anónima"
-
-msgid "IDS_CST_BODY_INPUT_PASSWORD"
-msgstr "Introducir contraseña"
-
-msgid "IDS_ST_BODY_SHOW_PASSWORD"
-msgstr "Mostrar contraseña"
-
-msgid "IDS_WIFI_HEADER_PROXY_ADDRESS"
-msgstr "Dirección de PROXY"
-
-msgid "IDS_WIFI_BODY_SIGNAL_STRENGTH"
-msgstr "Intensidad de la señal"
-
-msgid "IDS_WIFI_BODY_GATEWAY"
-msgstr "Puerta de enlace"
-
-msgid "IDS_WIFI_BODY_SECURITYTYPE_WEP"
-msgstr "WEP"
-
-msgid "IDS_ST_POP_DEACTIVATING_ING"
-msgstr "Desactivando…"
-
-msgid "IDS_WIFI_BODY_CONFIGURATION_NO_SECURITY"
-msgstr "Sin seguridad"
-
-msgid "IDS_WIFI_HEADER_SELECT_NETWORK"
-msgstr "Seleccionar red"
-
-msgid "IDS_WIFI_BODY_WEAK_M_STRENGTH"
-msgstr "Débil"
-
-msgid "IDS_ST_BODY_WPS_AVAILABLE"
-msgstr "WPS disponible"
-
-msgid "IDS_ST_BODY_OBTAINING_IP_ADDRESS_ING"
-msgstr "Obteniendo dirección IP..."
-
-msgid "IDS_WIFI_BODY_CHANNEL"
-msgstr "Canal"
-
-msgid "IDS_ST_BODY_NOTIFY_ME_WHEN_AN_OPEN_NETWORK_IS_AVAILABLE"
-msgstr "Notificar cuando esté disponible una red abierta"
-
-msgid "IDS_ST_BODY_ADD_WI_FI_NETWORK"
-msgstr "Añadir red Wi-Fi"
-
-msgid "IDS_ST_BODY_NETWORK_SSID"
-msgstr "Red SSID"
-
-msgid "IDS_WIFI_POP_AUTOMATIC_CONNECTION_NETWORK_WILL_DISABLED_CONTINUE_Q_MSG"
-msgstr "La conexión automática a esta red se desactivará. ¿Continuar?"
-
-msgid "IDS_COM_BODY_PHASE_2_AUTHENTICATION"
-msgstr "Autenticación de fase de 2"
-
-msgid "IDS_WIFI_BODY_CONNECT"
-msgstr "Conectar"
-
-msgid "IDS_WIFI_POP_PRESS_WPS_ON_YOUR_WI_FI_ACCESS_POINT_WITHIN_PD_MINUTES"
-msgstr "Pulse WPS de su punto de acceso Wi-Fi en %d minutos"
-
-msgid "IDS_WIFI_BODY_UNKNOWN"
-msgstr "Desconocido"
-
-msgid "IDS_WIFI_BODY_ENTER_SSID"
-msgstr "Introducir SSID"
-
-msgid "IDS_WIFI_HEADER_PASSWORD"
-msgstr "Contraseña"
-
-msgid "IDS_WIFI_BODY_PROVISIONING"
-msgstr "Aprovisionamiento"
-
-msgid "IDS_WIFI_BODY_WPS_BUTTON_CONNECTION"
-msgstr "Conexión del botón de WPS"
-
-msgid "IDS_WIFI_OPT_FIND_HIDDEN_NETWORK"
-msgstr "Buscar red oculta"
-
-msgid "IDS_ST_BODY_PRESS_WPS_ON_YOUR_WI_FI_ACCESS_POINT_WITHIN_2_MINUTES"
-msgstr "Presione WPS en el punto de acceso Wi-Fi en 2 minutos"
-
-msgid "IDS_WIFI_BUTTON_CANCEL"
-msgstr "Cancelar"
-
-msgid "IDS_WIFI_BODY_SSID"
-msgstr "SSID"
-
-msgid "IDS_WIFI_BODY_ENTER_YOUR_IDENTITY"
-msgstr "Ingresar su identidad"
-
-msgid "IDS_WIFI_HEADER_ENTER_PASSWORD"
-msgstr "Introducir contraseña"
-
-msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
-msgstr "Notificar cuando no se encuentra una red Wi-Fi"
-
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Teavita, kui Wi-Fi võrk on leitud"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(muutmata)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Jakinarazi Wi-Fi sarea aurkitzen denean"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(aldatugabea)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Ilmoita, kun Wi-Fi-verkko löytyy"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(muuttumaton)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "M'avertir lorsqu'un réseau Wifi est détecté"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(aucune modification)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "M'avertir lorsqu'un réseau Wi-Fi est détecté"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(aucune modification)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Cuir in iúl dom ar aimsiú líonra Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(neamhathraithe)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Notificar cando se atope unha rede Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(sen cambiar)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Wi-Fi नेटवर्क के प्राप्त होने पर सूचित करें"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(बदला नहीं)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Obavijesti kad je Wi-Fi mreža pronađena"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(nepromijenjeno)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Értesítsen, ha Wi-Fi hálózatot talál"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(nem módosult)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Ծանուցել, երբ Wi-Fi ցանց է գտնվում"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(անփոփոխ)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Tilkynna þegar Wi-Fi net finnst"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(óbreytt)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Notifica al rilevamento della rete Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(invariato)"
+
msgstr "接続中..."
msgid "IDS_WIFI_BODY_STATIC_IP"
-msgstr "静的IP"
+msgstr "静的IP"
msgid "IDS_WIFI_POP_ACTIVATING_WI_FI_ING"
-msgstr "Wi-Fiを起動中..."
+msgstr "Wi-Fiを起動中..."
msgid "IDS_WIFI_SK_FORGET"
msgstr "切断"
msgid "IDS_WIFI_BODY_IP_ADDRESS"
-msgstr "IPアドレス"
+msgstr "IPアドレス"
msgid "IDS_WIFI_BODY_SUBNET_MASK"
-msgstr "サブネットマスク"
+msgstr "サブネットマスク"
msgid "IDS_WIFI_BODY_DNS_1"
msgstr "DNS 1"
msgstr "DNS 2"
msgid "IDS_ST_BODY_NETWORK_NOTIFICATION"
-msgstr "ネットワーク通知"
+msgstr "ネットワーク通知"
msgid "IDS_WIFI_POP_OPEN"
msgstr "オープン"
msgstr "セキュリティ保護"
msgid "IDS_WIFI_BODY_MAC_ADDRESS"
-msgstr "MACアドレス"
+msgstr "MACアドレス"
msgid "IDS_WIFI_BODY_PROXY_PORT"
-msgstr "プロキシポート"
+msgstr "プロキシポート"
msgid "IDS_ST_BODY_EXCELLENT"
-msgstr "とても良い"
+msgstr "とても良い"
msgid "IDS_ST_BODY_GOOD_M_STRENGTH"
-msgstr "強"
+msgstr "強い"
msgid "IDS_ST_BODY_SCAN"
msgstr "スキャン"
msgid "IDS_ST_BODY_WI_FI_NETWORKS"
-msgstr "Wi-Fiネットワーク"
+msgstr "Wi-Fiネットワーク"
msgid "IDS_WIFI_BODY_DISCONNECTING_ING"
msgstr "切断中..."
msgstr "ダイナミックIP"
msgid "IDS_WIFI_BODY_NO_APS"
-msgstr "APsがありません。"
+msgstr "APsがありません。"
msgid "IDS_WIFI_BODY_SECURITY_TYPE"
msgstr "セキュリティタイプ"
msgid "IDS_WIFI_HEADER_HIDDEN_NETWORK"
-msgstr "非表示ネットワーク"
+msgstr "非表示ネットワーク"
msgid "IDS_WIFI_POP_DEACTIVATING_WI_FI_ING"
-msgstr "Wi-Fiを無効にしています..."
+msgstr "Wi-Fiを無効にしています..."
msgid "IDS_WIFI_POP_SEARCHING_ING"
msgstr "検索中..."
msgid "IDS_WIFI_POP_SELECT_NETWORK"
-msgstr "ネットワークを選択"
+msgstr "ネットワークを選択"
msgid "IDS_WIFI_BODY_EAP_METHOD"
-msgstr "EAP方法"
+msgstr "EAP方法"
msgid "IDS_WIFI_BODY_EAP"
msgstr "EAP"
msgid "IDS_WIFI_BODY_GATEWAY_ADDRESS"
-msgstr "ゲートウェイアドレス"
+msgstr "ゲートウェイアドレス"
msgid "IDS_WIFI_BODY_ENTER_PASSWORD"
-msgstr "パスワードを入力"
+msgstr "パスワードを入力"
msgid "IDS_WIFI_BODY_CA_CERTIFICATE"
-msgstr "CA証明書"
+msgstr "CA証明書"
msgid "IDS_WIFI_BODY_UNSPECIFIED"
msgstr "設定なし"
msgid "IDS_WIFI_BODY_USER_CERTIFICATE_ABB"
-msgstr "ユーザー証明書"
+msgstr "ユーザー証明書"
msgid "IDS_WIFI_BODY_IDENTITY"
msgstr "ID"
msgid "IDS_WIFI_BODY_ANONYMOUS_IDENTITY"
-msgstr "匿名ID"
+msgstr "匿名ID"
msgid "IDS_WIFI_BODY_ENTER_IDENTITY"
-msgstr "IDを入力"
+msgstr "IDを入力"
msgid "IDS_WIFI_BODY_ENTER_ANONYMOUS_IDENTITY"
-msgstr "匿名IDを入力"
+msgstr "匿名IDを入力"
msgid "IDS_CST_BODY_INPUT_PASSWORD"
-msgstr "パスワードを入力"
+msgstr "パスワードを入力"
msgid "IDS_ST_BODY_SHOW_PASSWORD"
-msgstr "パスワードを表示"
+msgstr "パスワードを表示"
msgid "IDS_WIFI_HEADER_PROXY_ADDRESS"
-msgstr "プロキシアドレス"
+msgstr "プロキシアドレス"
msgid "IDS_WIFI_BODY_SIGNAL_STRENGTH"
-msgstr "電波強度"
+msgstr "電波強度"
msgid "IDS_WIFI_BODY_GATEWAY"
msgstr "ゲートウェイ"
msgstr "WEP"
msgid "IDS_ST_POP_DEACTIVATING_ING"
-msgstr "解除中..."
+msgstr "解除中..."
msgid "IDS_WIFI_BODY_CONFIGURATION_NO_SECURITY"
msgstr "セキュリティ保護なし"
msgid "IDS_WIFI_HEADER_SELECT_NETWORK"
-msgstr "ネットワークを選択"
+msgstr "ネットワークを選択"
msgid "IDS_WIFI_BODY_WEAK_M_STRENGTH"
msgstr "弱い"
msgstr "チャンネル"
msgid "IDS_ST_BODY_NOTIFY_ME_WHEN_AN_OPEN_NETWORK_IS_AVAILABLE"
-msgstr "オープンネットワークが利用できる時に通知"
+msgstr "オープンネットワークが利用可能な時に通知"
msgid "IDS_ST_BODY_ADD_WI_FI_NETWORK"
msgstr "Wi-Fiネットワークを追加"
msgstr "ネットワークSSID"
msgid "IDS_WIFI_POP_AUTOMATIC_CONNECTION_NETWORK_WILL_DISABLED_CONTINUE_Q_MSG"
-msgstr "このネットワークへの自動接続を無効にします。続行しますか?"
+msgstr "このネットワークへの自動接続を無効にします。続行しますか?"
msgid "IDS_COM_BODY_PHASE_2_AUTHENTICATION"
-msgstr "フェーズ2認証"
+msgstr "フェーズ2認証"
msgid "IDS_WIFI_BODY_CONNECT"
msgstr "接続"
msgid "IDS_WIFI_POP_PRESS_WPS_ON_YOUR_WI_FI_ACCESS_POINT_WITHIN_PD_MINUTES"
-msgstr "%d分以内にWi-FiアクセスポイントのWPSボタンを押してください。"
+msgstr "%d分以内にWi-FiアクセスポイントのWPSボタンを押してください。"
msgid "IDS_WIFI_BODY_UNKNOWN"
msgstr "不明"
msgid "IDS_WIFI_BODY_ENTER_SSID"
-msgstr "SSIDを入力"
+msgstr "SSIDを入力"
msgid "IDS_WIFI_HEADER_PASSWORD"
msgstr "パスワード"
msgstr "プロビジョニング"
msgid "IDS_WIFI_BODY_WPS_BUTTON_CONNECTION"
-msgstr "WPSボタン接続"
+msgstr "WPSボタン接続"
msgid "IDS_WIFI_OPT_FIND_HIDDEN_NETWORK"
msgstr "非表示ネットワークを検索"
msgstr "SSID"
msgid "IDS_WIFI_BODY_ENTER_YOUR_IDENTITY"
-msgstr "あなたのIDを入力"
+msgstr "あなたのIDを入力"
msgid "IDS_WIFI_HEADER_ENTER_PASSWORD"
-msgstr "パスワードを入力"
+msgstr "パスワードを入力"
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
-msgstr "Wi-Fiネットワークを検出すると通知"
+msgstr "Wi-Fiネットワークを検出すると通知"
+
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(未変更)"
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "შეტყობინება მოვიდეს, როდესაც მოიძებნება Wi-Fi ქსელი"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(შეუცვლელი)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Wi-Fi желісі табылғанда хабарлау"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(өзгертілген)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Wi-Fi 네트워크가 검색되면 알려줍니다"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(변경 없음)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Pranešti aptikus „Wi-Fi“ tinklą"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(nepakeista)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Paziņot, kad ir atrasts Wi-Fi tīkls"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(bez izmaiņām)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Извести ме кога ќе се најде Wi-Fi мрежа"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(непроменето)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Varsle når Wi-Fi-nettverk blir funnet"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(uendret)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Melden wanneer een Wi-Fi-netwerk is gevonden"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(ongewijzigd)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Powiadamiaj o znalezieniu sieci Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(bez zmian)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Notifique quando uma rede Wi-Fi é encontrada"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(inalterado)"
+
msgstr "Bom"
msgid "IDS_ST_BODY_SCAN"
-msgstr "Procurar dispositivos"
+msgstr "Pesquisar"
msgid "IDS_ST_BODY_WI_FI_NETWORKS"
msgstr "Redes Wi-Fi"
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Notificar quando for encontrada rede Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(inalterado)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Notificare la găsirea reţelei Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(neschimbat)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Уведомлять об обнаружении сети Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(без изменений)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Oznámiť, keď sa nájde sieť Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(bez zmeny)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Obvestilo, ko je najdeno omrežje Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(nespremenjeno)"
+
msgstr "Obaveštenje putem mreže"
msgid "IDS_WIFI_POP_OPEN"
-msgstr "Otvori"
+msgstr "Otvorena"
msgid "IDS_ST_BODY_SECURED_ABB_M_WIFI_AP_SUMMARY"
msgstr "Obezbeđeno"
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Obavesti me kada se pronađe Wi-Fi mreža"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(nepromenjeno)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Meddela mig när ett Wi-Fi-nätverk hittats"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(ej ändrad)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Wi-Fi ağı bulunduğunda bildir"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(değiştirilmemiş)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Сповіщати в разі знаходження мережі Wi-Fi"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(незмінний)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "Wi-Fi tarmoq topilganda, menga yordam berilsin"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(o‘zgartirilmagan)"
+
msgstr "正在取消Wi-Fi..."
msgid "IDS_WIFI_POP_SEARCHING_ING"
-msgstr "正在搜索"
+msgstr "正在搜索..."
msgid "IDS_WIFI_POP_SELECT_NETWORK"
msgstr "选择网络"
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "当找到 Wi-Fi 网络时通知"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(未更改)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "當找到 Wi-Fi 網絡時通知"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(未更改)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "当找到WLAN网络时通知"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(未更改)"
+
msgid "IDS_WIFI_BODY_NOTIFY_WHEN_WI_FI_NETWORK_IS_FOUND"
msgstr "找到 Wi-Fi 網路時通知"
+msgid "IDS_ST_BODY_HUNCHANGED"
+msgstr "(未更改)"
+
+++ /dev/null
-/*
-* Wi-Fi UG
-*
-* 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 "common.h"
-#include "common_datamodel.h"
-
-
-struct view_datamodel_basic_info {
- char *profile_name; /* Profile name */
- char *ap_name; /* AP name */
- wlan_security_mode_type_t security_mode; /* Security mode */
- unsigned int signal_strength; /* Signal strength */
- unsigned int channel_freq; /* channel frequency */
- boolean is_favourite; /* Favourite */
- char wps_support;
-};
-
-struct view_datamodel_ip_info {
- char *profile_name; /* Profile name */
- net_ip_config_type_t ip_and_dns_type;
- char* proxy_addr;
- char* ip;
- char* subnet;
- char* gateway;
- char* dns1;
- char* dns2;
-
- char* MAC_address; /* MAC address */
-};
-
-struct view_datamodel_eap_info {
- char *profile_name; /* Profile name */
- char *ap_name; /* AP name */
- wlan_eap_type_t eap_method; /* EAP method */
- int eap_provision; /* Provisioning */
- wlan_eap_auth_type_t auth_type; /* EAP phase 2 Authentication */
- char *user_id; /* User id */
- char *anonymous_id; /* Anonymous id */
- char *ca_cert; /* CA certificate */
- char *user_cert; /* User certificate */
- char *pswd;
-};
-
-static void view_detail_datamodel_init_default_profile(net_profile_info_t *profile_info)
-{
- if (profile_info) {
- wlan_eap_info_t *eap_sec_info = &(profile_info->ProfileInfo.Wlan.security_info.authentication.eap);
- eap_sec_info->eap_type = WLAN_SEC_EAP_TYPE_PEAP;
- eap_sec_info->eap_auth = WLAN_SEC_EAP_AUTH_NONE;
- }
- return;
-}
-
-view_datamodel_basic_info_t *view_basic_detail_datamodel_create(const char *profile_name)
-{
- __COMMON_FUNC_ENTER__;
- view_datamodel_basic_info_t *data_object = NULL;
- net_profile_info_t *profile_info = g_malloc0(sizeof(net_profile_info_t));
- assertm_if(NULL == profile_name, "NULL!!");
- view_detail_datamodel_init_default_profile(profile_info);
- if (!connman_profile_manager_profile_info_get(profile_name, profile_info)) {
- ERROR_LOG(UG_NAME_ERR, "Fatal Could not get the profile info!!!");
- g_free(profile_info);
- return NULL;
- }
-
- data_object = g_malloc0(sizeof(view_datamodel_basic_info_t));
- assertm_if(NULL == data_object, "NULL!!");
-
- data_object->profile_name = g_strdup(profile_name);
- data_object->channel_freq = profile_info->ProfileInfo.Wlan.frequency;
- data_object->ap_name = g_strdup(profile_info->ProfileInfo.Wlan.essid);
- data_object->signal_strength = profile_info->ProfileInfo.Wlan.Strength;
- data_object->security_mode = profile_info->ProfileInfo.Wlan.security_info.sec_mode;
- data_object->is_favourite = profile_info->Favourite;
- data_object->wps_support = profile_info->ProfileInfo.Wlan.security_info.wps_support;
-
- INFO_LOG(UG_NAME_NORMAL, "Profile name : %s", data_object->profile_name);
- INFO_LOG(UG_NAME_NORMAL, "ap name : %s", data_object->ap_name);
- INFO_LOG(UG_NAME_NORMAL, "Signal strength : %u", data_object->signal_strength);
- INFO_LOG(UG_NAME_NORMAL, "Security mode : %u", data_object->security_mode);
- INFO_LOG(UG_NAME_NORMAL, "Channel Freq : %u", data_object->channel_freq);
- INFO_LOG(UG_NAME_NORMAL, "WPS Support : %d", data_object->wps_support);
-
- g_free(profile_info);
- profile_info = NULL;
-
- __COMMON_FUNC_EXIT__;
-
- return data_object;
-}
-
-view_datamodel_ip_info_t *view_detail_datamodel_ip_info_create(const char *profile_name)
-{
- __COMMON_FUNC_ENTER__;
- view_datamodel_ip_info_t *data_object = NULL;
- net_profile_info_t *profile_info = g_malloc0(sizeof(net_profile_info_t));
- assertm_if(NULL == profile_name, "NULL!!");
- view_detail_datamodel_init_default_profile(profile_info);
- if (!connman_profile_manager_profile_info_get(profile_name, profile_info)) {
- ERROR_LOG(UG_NAME_ERR, "Fatal Could not get the profile info!!!");
- /* Lets continue and create a default data object */
- }
-
- data_object = g_malloc0(sizeof(view_datamodel_ip_info_t));
- assertm_if(NULL == data_object, "NULL!!");
-
- data_object->profile_name = g_strdup(profile_name);
- data_object->ip_and_dns_type = profile_info->ProfileInfo.Wlan.net_info.IpConfigType;
- if (strlen(profile_info->ProfileInfo.Wlan.net_info.ProxyAddr) <= 0) {
- data_object->proxy_addr = NULL;
- } else {
- data_object->proxy_addr = g_strdup(profile_info->ProfileInfo.Wlan.net_info.ProxyAddr);
- }
-
- data_object->ip = g_strdup(inet_ntoa(profile_info->ProfileInfo.Wlan.net_info.IpAddr.Data.Ipv4));
- data_object->subnet = g_strdup(inet_ntoa(profile_info->ProfileInfo.Wlan.net_info.SubnetMask.Data.Ipv4));
- data_object->gateway = g_strdup(inet_ntoa(profile_info->ProfileInfo.Wlan.net_info.GatewayAddr.Data.Ipv4));
- data_object->dns1 = g_strdup(inet_ntoa(profile_info->ProfileInfo.Wlan.net_info.DnsAddr[0].Data.Ipv4));
- data_object->dns2 = g_strdup(inet_ntoa(profile_info->ProfileInfo.Wlan.net_info.DnsAddr[1].Data.Ipv4));
- data_object->MAC_address = g_strdup(profile_info->ProfileInfo.Wlan.bssid);
-
- INFO_LOG(UG_NAME_NORMAL, "Profile name : %s", data_object->profile_name);
- INFO_LOG(UG_NAME_NORMAL, "ip_and_dns_type : %d", data_object->ip_and_dns_type);
- INFO_LOG(UG_NAME_NORMAL, "ip : %s", data_object->ip);
- INFO_LOG(UG_NAME_NORMAL, "subnet : %s", data_object->subnet);
- INFO_LOG(UG_NAME_NORMAL, "gateway : %s", data_object->gateway);
- INFO_LOG(UG_NAME_NORMAL, "dns1 : %s", data_object->dns1);
- INFO_LOG(UG_NAME_NORMAL, "dns2 : %s", data_object->dns2);
- if (data_object->proxy_addr)
- INFO_LOG(UG_NAME_NORMAL, "proxy addr : %s", data_object->proxy_addr);
- INFO_LOG(UG_NAME_NORMAL, "MAC addr : %s", data_object->MAC_address);
-
- g_free(profile_info);
- profile_info = NULL;
-
- __COMMON_FUNC_EXIT__;
-
- return data_object;
-}
-
-view_datamodel_eap_info_t *view_detail_datamodel_eap_info_create(const char *profile_name)
-{
- __COMMON_FUNC_ENTER__;
- view_datamodel_eap_info_t *data_object = NULL;
- net_profile_info_t *profile_info = g_malloc0(sizeof(net_profile_info_t));
- assertm_if(NULL == profile_name, "NULL!!");
- view_detail_datamodel_init_default_profile(profile_info);
- if (!connman_profile_manager_profile_info_get(profile_name, profile_info)) {
- ERROR_LOG(UG_NAME_ERR, "Fatal Could not get the profile info!!!");
- /* Lets continue and create a default data object */
- }
-
- /* The EAP info data object would be created only if the device is remembered / connected */
- data_object = g_malloc0(sizeof(view_datamodel_eap_info_t));
- assertm_if(NULL == data_object, "NULL!!");
-
- data_object->profile_name = g_strdup(profile_name);
- data_object->ap_name = g_strdup(profile_info->ProfileInfo.Wlan.essid);
-
- /* If the device is connected / remembered only then create and fill the eap_details structure */
- wlan_eap_info_t *eap_sec_info = &(profile_info->ProfileInfo.Wlan.security_info.authentication.eap);
- data_object->eap_method = eap_sec_info->eap_type;
- data_object->eap_provision = 0; /* This is not yet supported by libnet. So setting it to 0. */
- data_object->auth_type = eap_sec_info->eap_auth;
-
- if (strlen(eap_sec_info->username))
- data_object->user_id = g_strdup(eap_sec_info->username);
-
- data_object->anonymous_id = NULL; /* This is not yet supported by libnet. So setting it to NULL. */
-
- if (strlen(eap_sec_info->password))
- data_object->pswd = g_strdup(eap_sec_info->password);
-
- if (strlen(eap_sec_info->ca_cert_filename))
- data_object->ca_cert = g_strdup(eap_sec_info->ca_cert_filename);
-
- if (strlen(eap_sec_info->client_cert_filename))
- data_object->user_cert = g_strdup(eap_sec_info->client_cert_filename);
-
- INFO_LOG(UG_NAME_NORMAL, "Profile name : %s", data_object->profile_name);
- INFO_LOG(UG_NAME_NORMAL, "EAP method : %u", data_object->eap_method);
- INFO_LOG(UG_NAME_NORMAL, "Provisioning : %u", data_object->eap_provision);
- INFO_LOG(UG_NAME_NORMAL, "Auth type : %u", data_object->auth_type);
- INFO_LOG(UG_NAME_NORMAL, "Id : %s", data_object->user_id);
- INFO_LOG(UG_NAME_NORMAL, "Anonymous id : %s", data_object->anonymous_id);
- INFO_LOG(UG_NAME_NORMAL, "Password : %s", data_object->pswd );
- INFO_LOG(UG_NAME_NORMAL, "CA certificate : %s", data_object->ca_cert);
- INFO_LOG(UG_NAME_NORMAL, "User certificate : %s", data_object->user_cert);
-
- g_free(profile_info);
- profile_info = NULL;
-
- __COMMON_FUNC_EXIT__;
-
- return data_object;
-}
-
-void view_basic_detail_datamodel_destroy(view_datamodel_basic_info_t *data_object)
-{
- __COMMON_FUNC_ENTER__;
-
- assertm_if(NULL == data_object, "NULL!!");
-
- g_free(data_object->profile_name);
- g_free(data_object->ap_name);
- g_free(data_object);
- data_object = NULL;
-
- __COMMON_FUNC_EXIT__;
-
- return;
-}
-
-void view_detail_datamodel_ip_info_destroy(view_datamodel_ip_info_t *data_object)
-{
- __COMMON_FUNC_ENTER__;
-
- assertm_if(NULL == data_object, "NULL!!");
-
- g_free(data_object->profile_name);
- g_free(data_object->proxy_addr);
- g_free(data_object->ip);
- g_free(data_object->subnet);
- g_free(data_object->gateway);
- g_free(data_object->dns1);
- g_free(data_object->dns2);
- g_free(data_object->MAC_address);
- g_free(data_object);
- data_object = NULL;
-
- __COMMON_FUNC_EXIT__;
-
- return;
-}
-
-void view_detail_datamodel_eap_info_destroy(view_datamodel_eap_info_t *data_object)
-{
- __COMMON_FUNC_ENTER__;
-
- assertm_if(NULL == data_object, "NULL!!");
-
- g_free(data_object->profile_name);
- g_free(data_object->ap_name);
- g_free(data_object->user_id);
- g_free(data_object->anonymous_id);
- g_free(data_object->pswd);
- g_free(data_object->ca_cert);
- g_free(data_object->user_cert);
- g_free(data_object);
- data_object = NULL;
-
- __COMMON_FUNC_EXIT__;
-
- return;
-}
-
-boolean view_detail_datamodel_save_ip_info_if_modified(const view_datamodel_ip_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
-
- boolean changed = FALSE;
- net_profile_info_t *profile_info = g_malloc0(sizeof(net_profile_info_t));
- assertm_if(NULL == profile_info, "NULL!!");
- view_detail_datamodel_init_default_profile(profile_info);
- if (!connman_profile_manager_profile_info_get(data_object->profile_name, profile_info)) {
- ERROR_LOG(UG_NAME_ERR, "Fatal Could not get the profile info!!!");
- g_free(profile_info);
- return FALSE;
- }
-
- if (data_object->ip_and_dns_type != profile_info->ProfileInfo.Wlan.net_info.IpConfigType) {
- profile_info->ProfileInfo.Wlan.net_info.IpConfigType = data_object->ip_and_dns_type;
- changed = TRUE;
- }
-
- if (data_object->proxy_addr == NULL) {
- if (profile_info->ProfileInfo.Wlan.net_info.ProxyMethod != NET_PROXY_TYPE_DIRECT) {
- profile_info->ProfileInfo.Wlan.net_info.ProxyMethod = NET_PROXY_TYPE_DIRECT;
- changed = TRUE;
- }
- } else if (g_strcmp0(data_object->proxy_addr, profile_info->ProfileInfo.Wlan.net_info.ProxyAddr) != 0) {
- profile_info->ProfileInfo.Wlan.net_info.ProxyMethod = NET_PROXY_TYPE_MANUAL;
- g_strlcpy(profile_info->ProfileInfo.Wlan.net_info.ProxyAddr, data_object->proxy_addr, WLAN_PROXY_LEN_MAX);
- changed = TRUE;
- }
-
- if (data_object->ip_and_dns_type == NET_IP_CONFIG_TYPE_STATIC) {
- char *temp_str = NULL;
-
- temp_str = inet_ntoa(profile_info->ProfileInfo.Wlan.net_info.IpAddr.Data.Ipv4);
- if (g_strcmp0(data_object->ip, temp_str) != 0) {
- INFO_LOG(UG_NAME_NORMAL, "IP : %s", temp_str);
-
- if (inet_aton(data_object->ip, &(profile_info->ProfileInfo.Wlan.net_info.IpAddr.Data.Ipv4)) == 0) {
- INFO_LOG(UG_NAME_NORMAL, "Failed inet_aton");
-
- return FALSE;
- }
-
- changed = TRUE;
- }
-
- temp_str = inet_ntoa(profile_info->ProfileInfo.Wlan.net_info.SubnetMask.Data.Ipv4);
- if (g_strcmp0(data_object->subnet, temp_str) != 0) {
- INFO_LOG(UG_NAME_NORMAL, "Subnet : %s", temp_str);
-
- if (inet_aton(data_object->subnet, &(profile_info->ProfileInfo.Wlan.net_info.SubnetMask.Data.Ipv4)) == 0) {
- INFO_LOG(UG_NAME_NORMAL, "Failed inet_aton");
-
- return FALSE;
- }
-
- changed = TRUE;
- }
-
- temp_str = inet_ntoa(profile_info->ProfileInfo.Wlan.net_info.GatewayAddr.Data.Ipv4);
- if (g_strcmp0(data_object->gateway, temp_str) != 0) {
- INFO_LOG(UG_NAME_NORMAL, "Gateway : %s", temp_str);
-
- if (inet_aton(data_object->gateway, &(profile_info->ProfileInfo.Wlan.net_info.GatewayAddr.Data.Ipv4)) == 0) {
- INFO_LOG(UG_NAME_NORMAL, "Failed inet_aton");
-
- return FALSE;
- }
-
- changed = TRUE;
- }
-
- temp_str = inet_ntoa(profile_info->ProfileInfo.Wlan.net_info.DnsAddr[0].Data.Ipv4);
- if (g_strcmp0(data_object->dns1, temp_str) != 0) {
- INFO_LOG(UG_NAME_NORMAL, "DNS1 : %s", temp_str);
-
- if (inet_aton(data_object->dns1, &(profile_info->ProfileInfo.Wlan.net_info.DnsAddr[0].Data.Ipv4)) == 0) {
- INFO_LOG(UG_NAME_NORMAL, "Failed inet_aton");
-
- return FALSE;
- }
-
- profile_info->ProfileInfo.Wlan.net_info.DnsCount = 1;
- changed = TRUE;
- }
-
- temp_str = inet_ntoa(profile_info->ProfileInfo.Wlan.net_info.DnsAddr[1].Data.Ipv4);
- if (g_strcmp0(data_object->dns2, temp_str) != 0) {
- INFO_LOG(UG_NAME_NORMAL, "DNS2 : %s", temp_str);
-
- if (inet_aton(data_object->dns2, &(profile_info->ProfileInfo.Wlan.net_info.DnsAddr[1].Data.Ipv4)) == 0) {
- INFO_LOG(UG_NAME_NORMAL, "Failed inet_aton");
-
- return FALSE;
- }
-
- profile_info->ProfileInfo.Wlan.net_info.DnsCount = 2;
- changed = TRUE;
- }
-
- INFO_LOG(UG_NAME_NORMAL, "DNS count : %d", profile_info->ProfileInfo.Wlan.net_info.DnsCount);
- }
-
- if (changed == TRUE)
- wlan_manager_profile_modify_by_device_info(profile_info);
-
- g_free(profile_info);
-
- return changed;
-}
-
-boolean view_detail_datamodel_save_eap_info_if_modified(const view_datamodel_eap_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
-
- boolean changed = FALSE;
- net_profile_info_t *profile_info = g_malloc0(sizeof(net_profile_info_t));
- assertm_if(NULL == profile_info, "NULL!!");
- view_detail_datamodel_init_default_profile(profile_info);
- if (!connman_profile_manager_profile_info_get(data_object->profile_name, profile_info)) {
- ERROR_LOG(UG_NAME_ERR, "Fatal Could not get the profile info!!!");
- g_free(profile_info);
- return FALSE;
- }
-
- wlan_eap_info_t *eap_sec_info = &(profile_info->ProfileInfo.Wlan.security_info.authentication.eap);
- if (data_object->eap_method != eap_sec_info->eap_type) {
- eap_sec_info->eap_type = data_object->eap_method;
- changed = TRUE;
- }
-
- if (data_object->auth_type != eap_sec_info->eap_auth) {
- eap_sec_info->eap_auth = data_object->auth_type;
- changed = TRUE;
- }
-
- if (g_strcmp0(data_object->user_id, eap_sec_info->username)) {
- g_strlcpy(eap_sec_info->username, data_object->user_id, NETPM_WLAN_USERNAME_LEN);
- changed = TRUE;
- }
-
- if (g_strcmp0(data_object->pswd, eap_sec_info->password)) {
- g_strlcpy(eap_sec_info->password, data_object->pswd, NETPM_WLAN_PASSWORD_LEN);
- changed = TRUE;
- }
-
- if (changed) {
- INFO_LOG(UG_NAME_NORMAL, "EAP type : %d", eap_sec_info->eap_type);
- INFO_LOG(UG_NAME_NORMAL, "EAP auth : %d", eap_sec_info->eap_auth);
- INFO_LOG(UG_NAME_NORMAL, "User name : %s", eap_sec_info->username);
- INFO_LOG(UG_NAME_NORMAL, "Password : %s", eap_sec_info->password);
-
- wlan_manager_profile_modify_by_device_info(profile_info);
- }
-
- g_free(profile_info);
-
- return changed;
-}
-
-int view_detail_datamodel_ip_and_dns_type_set(view_datamodel_ip_info_t *data_object, const IP_TYPES type)
-{
- assertm_if(NULL == data_object, "NULL!!");
- data_object->ip_and_dns_type = type;
- return TRUE;
-}
-
-int view_detail_datamodel_proxy_address_set(view_datamodel_ip_info_t *data_object, const char* proxy)
-{
- assertm_if(NULL == data_object, "NULL!!");
-
- g_free(data_object->proxy_addr);
- if(proxy)
- data_object->proxy_addr = g_strdup(proxy);
- else
- data_object->proxy_addr = NULL;
-
- return TRUE;
-}
-
-int view_detail_datamodel_static_ip_address_set(view_datamodel_ip_info_t *data_object, const char* addr)
-{
- assertm_if(NULL == data_object, "NULL!!");
- if(NULL != addr) {
- DEBUG_LOG(UG_NAME_NORMAL, "* set as [%s]", addr);
- g_free(data_object->ip);
- data_object->ip = g_strdup(addr);
- }
- return TRUE;
-}
-
-int view_detail_datamodel_static_gateway_address_set(view_datamodel_ip_info_t *data_object, const char* addr)
-{
- assertm_if(NULL == data_object, "NULL!!");
- if(NULL != addr) {
- g_free(data_object->gateway);
- data_object->gateway = g_strdup(addr);
- }
- return TRUE;
-}
-
-int view_detail_datamodel_static_subnet_mask_set(view_datamodel_ip_info_t *data_object, const char* addr)
-{
- assertm_if(NULL == data_object, "NULL!!");
- if(NULL != addr) {
- g_free(data_object->subnet);
- data_object->subnet = g_strdup(addr);
- }
- return TRUE;
-}
-
-int view_detail_datamodel_static_dns1_address_set(view_datamodel_ip_info_t *data_object, const char* addr)
-{
- assertm_if(NULL == data_object, "NULL!!");
- if(NULL != addr) {
- g_free(data_object->dns1);
- data_object->dns1 = g_strdup(addr);
- }
- return TRUE;
-}
-
-int view_detail_datamodel_static_dns2_address_set(view_datamodel_ip_info_t *data_object, const char* addr)
-{
- assertm_if(NULL == data_object, "NULL!!");
- if (NULL != addr) {
- g_free(data_object->dns2);
- data_object->dns2 = g_strdup(addr);
- }
- return TRUE;
-}
-
-int view_detail_datamodel_eap_ap_name_set(view_datamodel_eap_info_t *data_object, const char *ssid)
-{
- assertm_if(NULL == data_object, "NULL!!");
- g_free(data_object->ap_name);
- data_object->ap_name = g_strdup(ssid);
- return TRUE;
-}
-
-int view_detail_datamodel_eap_method_set(view_datamodel_eap_info_t *data_object, const wlan_eap_type_t eap_method)
-{
- assertm_if(NULL == data_object, "NULL!!");
- data_object->eap_method = eap_method;
- return TRUE;
-}
-
-int view_detail_datamodel_eap_provision_set(view_datamodel_eap_info_t *data_object, const int provision)
-{
- assertm_if(NULL == data_object, "NULL!!");
- data_object->eap_provision = provision;
- return TRUE;
-}
-
-int view_detail_datamodel_eap_auth_set(view_datamodel_eap_info_t *data_object, const wlan_eap_auth_type_t auth_type)
-{
- assertm_if(NULL == data_object, "NULL!!");
- data_object->auth_type = auth_type;
- return TRUE;
-}
-
-int view_detail_datamodel_eap_user_id_set(view_datamodel_eap_info_t *data_object, const char* user_id)
-{
- assertm_if(NULL == data_object, "NULL!!");
- g_free(data_object->user_id);
- data_object->user_id = g_strdup(user_id);
- return TRUE;
-}
-
-int view_detail_datamodel_eap_anonymous_id_set(view_datamodel_eap_info_t *data_object, const char* anonymous_id)
-{
- assertm_if(NULL == data_object, "NULL!!");
- g_free(data_object->anonymous_id);
- data_object->anonymous_id = g_strdup(anonymous_id);
- return TRUE;
-}
-
-int view_detail_datamodel_eap_pswd_set(view_datamodel_eap_info_t *data_object, const char* pswd)
-{
- assertm_if(NULL == data_object, "NULL!!");
- g_free(data_object->pswd);
- data_object->pswd = g_strdup(pswd);
- return TRUE;
-}
-
-int view_detail_datamodel_eap_ca_cert_set(view_datamodel_eap_info_t *data_object, const char* ca_cert)
-{
- assertm_if(NULL == data_object, "NULL!!");
- g_free(data_object->ca_cert);
- data_object->ca_cert = g_strdup(ca_cert);
- return TRUE;
-}
-
-int view_detail_datamodel_eap_user_cert_set(view_datamodel_eap_info_t *data_object, const char* user_cert)
-{
- assertm_if(NULL == data_object, "NULL!!");
- g_free(data_object->user_cert);
- data_object->user_cert = g_strdup(user_cert);
- return TRUE;
-}
-
-IP_TYPES view_detail_datamodel_ip_and_dns_type_get(view_datamodel_ip_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return data_object->ip_and_dns_type;
-}
-
-char *view_detail_datamodel_static_ip_address_get(view_datamodel_ip_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return g_strdup(data_object->ip);
-}
-
-char *view_detail_datamodel_static_gateway_address_get(view_datamodel_ip_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return g_strdup(data_object->gateway);
-}
-
-char *view_detail_datamodel_static_subnet_mask_get(view_datamodel_ip_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return g_strdup(data_object->subnet);
-}
-
-char *view_detail_datamodel_static_dns1_address_get(view_datamodel_ip_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return g_strdup(data_object->dns1);
-}
-
-char *view_detail_datamodel_static_dns2_address_get(view_datamodel_ip_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return g_strdup(data_object->dns2);
-}
-
-char* view_detail_datamodel_proxy_address_get(view_datamodel_ip_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- if (data_object->proxy_addr)
- return g_strdup(data_object->proxy_addr);
- else
- return NULL;
-}
-
-char* view_detail_datamodel_MAC_addr_get(view_datamodel_ip_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- char* ret = g_strdup(data_object->MAC_address);
- return ret;
-}
-#if 0
-int view_detail_datamodel_channel_freq_get(view_datamodel_ip_info_t *data_object)
-{
- view_detail_datamodel_t *data_object = (view_detail_datamodel_t *)mvc_object;
- assertm_if(NULL == data_object, "NULL!!");
- switch (data_object->channel_freq) {
- default:
- case 2412:
- return 1;
- case 2417:
- return 2;
- case 2422:
- return 3;
- case 2427:
- return 4;
- case 2432:
- return 5;
- case 2437:
- return 6;
- case 2442:
- return 7;
- case 2447:
- return 8;
- case 2452:
- return 9;
- case 2457:
- return 10;
- case 2462:
- return 11;
- }
- return 0;
-}
-#endif
-
-wlan_eap_type_t view_detail_datamodel_eap_method_get(view_datamodel_eap_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return data_object->eap_method;
-}
-
-int view_detail_datamodel_eap_provision_get(view_datamodel_eap_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return data_object->eap_provision;
-}
-
-wlan_eap_auth_type_t view_detail_datamodel_eap_auth_get(view_datamodel_eap_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return data_object->auth_type;
-}
-
-char *view_detail_datamodel_user_id_get(view_datamodel_eap_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return g_strdup(data_object->user_id);
-}
-
-char *view_detail_datamodel_anonymous_id_get(view_datamodel_eap_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return g_strdup(data_object->anonymous_id);
-}
-
-char *view_detail_datamodel_pswd_get(view_datamodel_eap_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return g_strdup(data_object->pswd);
-}
-
-char *view_detail_datamodel_ca_cert_get(view_datamodel_eap_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return g_strdup(data_object->ca_cert);
-}
-
-char *view_detail_datamodel_user_cert_get(view_datamodel_eap_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return g_strdup(data_object->user_cert);
-}
-
-char *view_detail_datamodel_eap_ap_name_get(view_datamodel_eap_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return g_strdup(data_object->ap_name);
-}
-
-char *view_detail_datamodel_basic_info_profile_name_get(view_datamodel_basic_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return g_strdup(data_object->profile_name);
-}
-
-char *view_detail_datamodel_ap_name_get(view_datamodel_basic_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return g_strdup(data_object->ap_name);
-}
-
-unsigned int view_detail_datamodel_sig_strength_get(view_datamodel_basic_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return data_object->signal_strength;
-}
-
-unsigned int view_detail_datamodel_sec_mode_get(view_datamodel_basic_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return data_object->security_mode;
-}
-
-char view_detail_datamodel_wps_support_get(view_datamodel_basic_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return data_object->wps_support;
-}
-
-boolean view_detail_datamodel_is_favourite_get(view_datamodel_basic_info_t *data_object)
-{
- assertm_if(NULL == data_object, "NULL!!");
- return data_object->is_favourite;
-}
ip_info_list_t *ip_info_list;
Evas_Object* navi_frame;
- int visible_area_width;
- int visible_area_height;
+ int key_status;
};
static void _gl_eap_provision_sel(void *data, Evas_Object *obj, void *event_info);
static void _gl_eap_auth_sel(void *data, Evas_Object *obj, void *event_info);
-static void _create_and_update_list_items_based_on_rules(eap_type_t new_type, common_eap_connect_data_t *eap_data);
-static void _delete_eap_entry_items(common_eap_connect_data_t *eap_data);
+static void _create_and_update_list_items_based_on_rules(eap_type_t new_type, eap_connect_data_t *eap_data);
+static void _delete_eap_entry_items(eap_connect_data_t *eap_data);
static eap_type_t __common_eap_connect_popup_get_eap_type(wifi_ap_h ap);
static eap_auth_t __common_eap_connect_popup_get_auth_type(wifi_ap_h ap);
static wifi_eap_type_e __common_eap_connect_popup_get_wlan_eap_type(eap_type_t eap_type);
static void _gl_eap_type_sel(void *data, Evas_Object *obj, void *event_info)
{
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *) data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *) data;
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
Eina_Bool expanded = EINA_FALSE;
if (item)
static void _gl_eap_type_sub_sel(void *data, Evas_Object *obj, void *event_info)
{
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *) data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *) data;
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
Elm_Object_Item *parent_item = elm_genlist_item_parent_get(item);
static void _gl_eap_provision_sel(void *data, Evas_Object *obj, void *event_info)
{
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *) data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *) data;
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
Eina_Bool expanded = EINA_FALSE;
if (item)
static void _gl_eap_auth_sel(void *data, Evas_Object *obj, void *event_info)
{
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *) data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *) data;
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
Eina_Bool expanded = EINA_FALSE;
if (item)
static void _gl_eap_auth_sub_sel(void *data, Evas_Object *obj, void *event_info)
{
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *) data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *) data;
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
Elm_Object_Item *parent_item = elm_genlist_item_parent_get(item);
eap_auth_t selected_item_index = elm_genlist_item_index_get(item) - elm_genlist_item_index_get(parent_item) - 1;
static char *_gl_eap_type_text_get(void *data, Evas_Object *obj, const char *part)
{
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *)data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
eap_type_t sel_sub_item_id = __common_eap_connect_popup_get_eap_type(eap_data->ap);
DEBUG_LOG(UG_NAME_NORMAL, "current selected subitem = %d", sel_sub_item_id);
static char *_gl_eap_subtext_get(void *data, Evas_Object *obj, const char *part)
{
wlan_eap_type_t eap_type = (wlan_eap_type_t)elm_radio_state_value_get(data);
- if (!strcmp(part, "elm.text")) {
+
+ if (!strcmp(part, "elm.text"))
return g_strdup(list_eap_type[eap_type].name);
- }
return NULL;
}
static Evas_Object *_gl_eap_content_get(void *data, Evas_Object *obj, const char *part)
{
- if (!strcmp(part, "elm.icon") || !strcmp(part, "elm.swallow.icon")) {
+ if (!strcmp(part, "elm.icon") || !strcmp(part, "elm.swallow.icon"))
return data;
- }
return NULL;
}
static void _gl_eap_type_sub_menu_item_del(void *data, Evas_Object *obj)
{
evas_object_unref(data);
+ return;
}
static char *_gl_eap_provision_text_get(void *data, Evas_Object *obj, const char *part)
{
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *)data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
int sel_sub_item_id = 0;
/* TODO: Fetch the EAP provision. No CAPI available now. */
static void _gl_eap_provision_sub_menu_item_del(void *data, Evas_Object *obj)
{
evas_object_unref(data);
+ return;
}
static char *_gl_eap_auth_text_get(void *data, Evas_Object *obj, const char *part)
{
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *)data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
eap_auth_t sel_sub_item_id = __common_eap_connect_popup_get_auth_type(eap_data->ap);
if (!strcmp(part, "elm.text.1")) {
return g_strdup(list_eap_auth[sel_sub_item_id].name);
static void _gl_eap_auth_sub_menu_item_del(void *data, Evas_Object *obj)
{
evas_object_unref(data);
+ return;
}
static char *_gl_eap_ca_cert_text_get(void *data, Evas_Object *obj, const char *part)
{
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *)data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
if (!strcmp(part, "elm.text.2")) {
return g_strdup(sc(eap_data->str_pkg_name, I18N_TYPE_Ca_Certificate));
} else if (!strcmp(part, "elm.text.1")) {
static char *_gl_eap_user_cert_text_get(void *data, Evas_Object *obj, const char *part)
{
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *)data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
if (!strcmp(part, "elm.text.2")) {
return g_strdup(sc(eap_data->str_pkg_name, I18N_TYPE_User_Certificate));
} else if (!strcmp(part, "elm.text.1")) {
if (entry_info) {
g_free(entry_info->entry_txt);
entry_info->entry_txt = NULL;
-
char *entry_text = elm_entry_markup_to_utf8(elm_entry_entry_get(obj));
if (entry_text != NULL && entry_text[0] != '\0')
memset(&digits_filter_data, 0, sizeof(Elm_Entry_Filter_Accept_Set));
digits_filter_data.accepted = accepted;
elm_entry_markup_filter_append(entry, elm_entry_filter_accept_set, &digits_filter_data);
+ elm_entry_context_menu_disabled_set(entry, EINA_TRUE);
Ecore_IMF_Context *imf_ctxt = elm_entry_imf_context_get(entry);
- if (imf_ctxt) {
- ecore_imf_context_input_panel_event_callback_add(imf_ctxt, ECORE_IMF_INPUT_PANEL_STATE_EVENT, entry_info->input_panel_cb, entry_info->input_panel_cb_data);
+ if (imf_ctxt && entry_info->input_panel_cb) {
+ ecore_imf_context_input_panel_event_callback_add(imf_ctxt,
+ ECORE_IMF_INPUT_PANEL_STATE_EVENT,
+ entry_info->input_panel_cb,
+ entry_info->input_panel_cb_data);
DEBUG_LOG(UG_NAME_NORMAL, "set the imf ctxt cbs");
}
static void _gl_exp(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *radio;
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *)data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
Elm_Object_Item *sub_item = NULL;
Evas_Object *gl = elm_object_item_widget_get(item);
return;
}
- evas_object_focus_set(gl, EINA_TRUE);
+ common_utils_edit_box_focus_set(eap_data->eap_id_item, EINA_FALSE);
+ common_utils_edit_box_focus_set(eap_data->eap_anonyid_item, EINA_FALSE);
+ common_utils_edit_box_focus_set(eap_data->eap_pw_item, EINA_FALSE);
+ ip_info_close_all_keypads(eap_data->ip_info_list);
int i = 0;
eap_type_t eap_type;
g_eap_entry_itc.func.content_get = _gl_eap_entry_item_content_get;
g_eap_entry_itc.func.state_get = NULL;
g_eap_entry_itc.func.del = _gl_eap_entry_item_del;
+
+ return;
}
static void __common_eap_connect_imf_ctxt_evnt_cb(void *data, Ecore_IMF_Context *ctx, int value)
DEBUG_LOG(UG_NAME_NORMAL, "Key pad is now close");
elm_object_item_signal_emit(data, "elm,state,sip,hidden", "");
}
+ return;
}
-static void __common_eap_connect_imf_ctxt_evnt_resize_cb(void *data, Ecore_IMF_Context *ctx, int value)
+static void __common_eap_connect_im_ctxt_evnt_resize_cb(void *data, Ecore_IMF_Context *ctx, int value)
{
__COMMON_FUNC_ENTER__;
if (!data)
return;
- if (value == ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW)
- return;
+ int rotate_angle = common_utils_get_rotate_angle(APPCORE_RM_UNKNOWN);
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *)data;
- Evas_Object *box = elm_object_content_get(eap_data->popup);
+ eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
+ eap_data->key_status = value;
- __common_popup_size_get(ctx, &eap_data->visible_area_width, &eap_data->visible_area_height);
- evas_object_size_hint_min_set(box, eap_data->visible_area_width * elm_config_scale_get(),
- eap_data->visible_area_height * elm_config_scale_get());
+ eap_view_rotate_popup(eap_data, rotate_angle);
__COMMON_FUNC_EXIT__;
+ return;
}
-static void __common_eap_view_set_imf_ctxt_evnt_cb(common_eap_connect_data_t *eap_data)
+static void __common_eap_popup_set_imf_ctxt_evnt_cb(eap_connect_data_t *eap_data)
{
if (!eap_data)
return;
- Elm_Object_Item *navi_it = elm_naviframe_top_item_get(eap_data->navi_frame);
-
- if (!navi_it)
- return;
-
if (eap_data->eap_id_item)
- common_utils_set_edit_box_imf_panel_evnt_cb(eap_data->eap_id_item, __common_eap_connect_imf_ctxt_evnt_cb, navi_it);
+ common_utils_set_edit_box_imf_panel_evnt_cb(eap_data->eap_id_item, __common_eap_connect_im_ctxt_evnt_resize_cb, eap_data);
if (eap_data->eap_anonyid_item)
- common_utils_set_edit_box_imf_panel_evnt_cb(eap_data->eap_anonyid_item, __common_eap_connect_imf_ctxt_evnt_cb, navi_it);
+ common_utils_set_edit_box_imf_panel_evnt_cb(eap_data->eap_anonyid_item, __common_eap_connect_im_ctxt_evnt_resize_cb, eap_data);
if (eap_data->eap_pw_item)
- common_utils_set_edit_box_imf_panel_evnt_cb(eap_data->eap_pw_item, __common_eap_connect_imf_ctxt_evnt_cb, navi_it);
+ common_utils_set_edit_box_imf_panel_evnt_cb(eap_data->eap_pw_item, __common_eap_connect_im_ctxt_evnt_resize_cb, eap_data);
+
+ return;
}
-static void __common_eap_popup_set_imf_ctxt_evnt_cb(common_eap_connect_data_t *eap_data)
+static void __common_eap_view_set_imf_ctxt_evnt_cb(eap_connect_data_t *eap_data)
{
if (!eap_data)
return;
+ Elm_Object_Item *navi_it = elm_naviframe_top_item_get(eap_data->navi_frame);
+ if (!navi_it)
+ return;
if (eap_data->eap_id_item)
- common_utils_set_edit_box_imf_panel_evnt_cb(eap_data->eap_id_item, __common_eap_connect_imf_ctxt_evnt_resize_cb, eap_data);
+ common_utils_set_edit_box_imf_panel_evnt_cb(eap_data->eap_id_item, __common_eap_connect_imf_ctxt_evnt_cb, navi_it);
if (eap_data->eap_anonyid_item)
- common_utils_set_edit_box_imf_panel_evnt_cb(eap_data->eap_anonyid_item, __common_eap_connect_imf_ctxt_evnt_resize_cb, eap_data);
+ common_utils_set_edit_box_imf_panel_evnt_cb(eap_data->eap_anonyid_item, __common_eap_connect_imf_ctxt_evnt_cb, navi_it);
if (eap_data->eap_pw_item)
- common_utils_set_edit_box_imf_panel_evnt_cb(eap_data->eap_pw_item, __common_eap_connect_imf_ctxt_evnt_resize_cb, eap_data);
+ common_utils_set_edit_box_imf_panel_evnt_cb(eap_data->eap_pw_item, __common_eap_connect_imf_ctxt_evnt_cb, navi_it);
+
+ return;
}
/*
* This creates EAP type, Auth type, CA certificate, User certificate, User Id, Anonymous Id and Password items.
*/
-
-static void _create_and_update_list_items_based_on_rules(eap_type_t new_type, common_eap_connect_data_t *eap_data)
+static void _create_and_update_list_items_based_on_rules(eap_type_t new_type, eap_connect_data_t *eap_data)
{
__COMMON_FUNC_ENTER__;
Evas_Object* view_list = eap_data->genlist;
if (eap_data->popup) { /* Popup */
__common_eap_popup_set_imf_ctxt_evnt_cb(eap_data);
- } else { /* View */
+ } else { /* View */
__common_eap_view_set_imf_ctxt_evnt_cb(eap_data);
}
}
__COMMON_FUNC_EXIT__;
+ return;
}
-void _delete_eap_entry_items(common_eap_connect_data_t *eap_data)
+void _delete_eap_entry_items(eap_connect_data_t *eap_data)
{
__COMMON_FUNC_ENTER__;
elm_object_item_del(eap_data->eap_auth_item);
elm_object_item_del(eap_data->eap_pw_item);
eap_data->eap_pw_item = NULL;
__COMMON_FUNC_EXIT__;
+ return;
}
static Evas_Object* _create_list(Evas_Object* parent, void *data)
__COMMON_FUNC_ENTER__;
assertm_if(NULL == parent, "NULL!!");
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *)data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
const char* parent_view_name = evas_object_name_get(parent);
Evas_Object* view_list = NULL;
return view_list;
}
-static void __common_eap_connect_cleanup(common_eap_connect_data_t *eap_data)
+static void __eap_view_title_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
- if (eap_data != NULL) {
- ip_info_remove(eap_data->ip_info_list);
- eap_data->ip_info_list = NULL;
- evas_object_del(eap_data->genlist);
- wifi_ap_destroy(eap_data->ap);
- eap_data->ap = NULL;
- evas_object_del(radio_main);
- radio_main = NULL;
- if (NULL == eap_data->navi_frame) {
- evas_object_del(eap_data->popup);
- /* Lets enable the scan updates */
- wlan_manager_enable_scan_result_update();
- }
- g_free(eap_data);
+ Evas_Object *label;
+ Elm_Object_Item *navi_it = event_info;
+
+ if (navi_it == NULL)
+ return;
+
+ label = elm_object_item_part_content_get(navi_it, "elm.swallow.title");
+ if (label == NULL)
+ return;
+
+ elm_label_slide_go(label);
+}
+
+static void __common_eap_connect_cleanup(eap_connect_data_t *eap_data)
+{
+ if (eap_data == NULL)
+ return;
+ ip_info_remove(eap_data->ip_info_list);
+ eap_data->ip_info_list = NULL;
+
+ evas_object_del(eap_data->genlist);
+
+ wifi_ap_destroy(eap_data->ap);
+ eap_data->ap = NULL;
+
+ evas_object_del(radio_main);
+ radio_main = NULL;
+
+ if (eap_data->navi_frame) {
+ evas_object_smart_callback_del(eap_data->navi_frame, "title,clicked",
+ __eap_view_title_clicked_cb);
+
+ elm_naviframe_item_pop(eap_data->navi_frame);
+ } else {
+ evas_object_hide(eap_data->popup);
+ evas_object_del(eap_data->popup);
}
+
+ wlan_manager_enable_scan_result_update();
}
-static void __common_eap_connect_destroy(void *data, Evas_Object *obj, void *event_info)
+static void __common_eap_connect_destroy(void *data, Evas_Object *obj,
+ void *event_info)
{
- __COMMON_FUNC_ENTER__;
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *) data;
- __common_eap_connect_cleanup(eap_data);
- __COMMON_FUNC_EXIT__;
+ __common_eap_connect_cleanup((eap_connect_data_t *)data);
}
-static void __common_eap_connect_done_cb(void *data, Evas_Object *obj, void *event_info)
+static void __common_eap_connect_done_cb(void *data, Evas_Object *obj,
+ void *event_info)
{
__COMMON_FUNC_ENTER__;
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *)data;
- if(eap_data->eap_done_ok == TRUE) {
- return;
- }
- eap_data->eap_done_ok = TRUE;
+ char *str_id = NULL;
+ char *str_pw = NULL;
+ wifi_eap_type_e eap_type;
- char* str_id = NULL;
- char* str_pw = NULL;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
- wifi_eap_type_e eap_type;
+ if (eap_data->eap_done_ok == TRUE)
+ return;
+
+ eap_data->eap_done_ok = TRUE;
wifi_ap_set_eap_ca_cert_file(eap_data->ap, "");
wifi_ap_set_eap_client_cert_file(eap_data->ap, "");
case WIFI_EAP_TYPE_PEAP:
case WIFI_EAP_TYPE_TTLS:
str_id = common_utils_get_list_item_entry_txt(eap_data->eap_id_item);
- if (!str_id || strlen(str_id) <= 0) {
- common_utils_show_info_ok_popup(eap_data->win, eap_data->str_pkg_name, EAP_CHECK_YOUR_ID_STR);
+ if (str_id == NULL || str_id[0] == '\0') {
+ common_utils_show_info_ok_popup(eap_data->win,
+ eap_data->str_pkg_name, EAP_CHECK_YOUR_ID_STR);
eap_data->eap_done_ok = FALSE;
+
__COMMON_FUNC_EXIT__;
return;
}
str_pw = common_utils_get_list_item_entry_txt(eap_data->eap_pw_item);
- if (!str_pw || strlen(str_pw) <= 0) {
- common_utils_show_info_ok_popup(eap_data->win, eap_data->str_pkg_name, EAP_CHECK_YOUR_PASWD_STR);
+ if (str_pw == NULL || str_pw[0] == '\0') {
+ common_utils_show_info_ok_popup(eap_data->win,
+ eap_data->str_pkg_name, EAP_CHECK_YOUR_PASWD_STR);
eap_data->eap_done_ok = FALSE;
+
__COMMON_FUNC_EXIT__;
return;
}
- char *temp_str = common_utils_get_list_item_entry_txt(eap_data->eap_anonyid_item);
- /* TODO: Set the anonymous id. CAPI not yet available. */
+ char *temp_str = common_utils_get_list_item_entry_txt(
+ eap_data->eap_anonyid_item);
+ /* TODO: Supporting anonymous id. */
+
g_free(temp_str);
wifi_ap_set_eap_passphrase(eap_data->ap, str_id, str_pw);
break;
case WIFI_EAP_TYPE_TLS:
-// g_strlcpy(p_conn_info->security_info.authentication.eap.username, str_id, NETPM_WLAN_USERNAME_LEN);
-// g_strlcpy(p_conn_info->security_info.authentication.eap.password, str_pw, NETPM_WLAN_USERNAME_LEN);
- wifi_ap_set_eap_ca_cert_file(eap_data->ap, "/mnt/ums/Certification/ca2.pem");
- wifi_ap_set_eap_client_cert_file(eap_data->ap, "/mnt/ums/Certification/user2.pem");
- wifi_ap_set_eap_private_key_info(eap_data->ap, "/mnt/ums/Certification/user2.prv", "wifi");
+ /* TODO: Correct TLS */
break;
case WIFI_EAP_TYPE_SIM:
break;
default:
- /* This case should never occur */
- ERROR_LOG(UG_NAME_NORMAL, "Err!");
+ ERROR_LOG(UG_NAME_NORMAL, "Unknown EAP method %d", eap_type);
break;
}
/* Before we proceed to make a connection, lets save the entered IP data */
ip_info_save_data(eap_data->ip_info_list);
- int ret = wlan_manager_connect_with_wifi_info(eap_data->ap);
- if (WLAN_MANAGER_ERR_NONE != ret) {
- ERROR_LOG(UG_NAME_NORMAL, "EAP connect request failed!!! Err = %d", ret);
- }
+ wlan_manager_connect(eap_data->ap);
- if (eap_data->navi_frame) {
- eap_view_close(eap_data);
- } else {
- __common_eap_connect_destroy(eap_data, NULL, NULL);
- }
+ __common_eap_connect_cleanup(eap_data);
__COMMON_FUNC_EXIT__;
}
static Eina_Bool __common_eap_connect_load_ip_info_list_cb(void *data)
{
- common_eap_connect_data_t *eap_data = (common_eap_connect_data_t *)data;
+ eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
Elm_Object_Item *navi_it = NULL;
Evas_Object *list = NULL;
Evas_Object *box = elm_object_content_get(eap_data->popup);
Eina_List *box_childs = elm_box_children_get(box);
list = eina_list_nth(box_childs, 0);
- eap_data->ip_info_list = ip_info_append_items(eap_data->ap, eap_data->str_pkg_name, list, __common_eap_connect_imf_ctxt_evnt_resize_cb, eap_data);
+ eap_data->ip_info_list = ip_info_append_items(eap_data->ap, eap_data->str_pkg_name, list, __common_eap_connect_im_ctxt_evnt_resize_cb, eap_data);
}
/* Add a separator */
return ECORE_CALLBACK_CANCEL;
}
-common_eap_connect_data_t *create_eap_connect_view(Evas_Object *win_main, Evas_Object *navi_frame, const char *pkg_name, wifi_device_info_t *device_info)
+eap_connect_data_t *create_eap_view(Evas_Object *win_main,
+ Evas_Object *navi_frame, const char *pkg_name,
+ wifi_device_info_t *device_info)
{
__COMMON_FUNC_ENTER__;
- if (!win_main || !device_info || !pkg_name)
+ /* Create eap connect view */
+ Elm_Object_Item *navi_it = NULL;
+ Evas_Object *back_btn = NULL;
+ Evas_Object *connect_btn = NULL;
+ Evas_Object *layout = NULL;
+ Evas_Object *list = NULL;
+ Evas_Object *label = NULL;
+
+ if (win_main == NULL || device_info == NULL || pkg_name == NULL)
return NULL;
- common_eap_connect_data_t *eap_data = g_new0(common_eap_connect_data_t, 1);
+ eap_connect_data_t *eap_data = g_new0(eap_connect_data_t, 1);
eap_data->str_pkg_name = pkg_name;
eap_data->win = win_main;
/* Clone the WiFi AP handle */
wifi_ap_clone(&(eap_data->ap), device_info->ap);
- /* Create eap connect view */
- Elm_Object_Item* navi_it;
- Evas_Object* button_back;
- Evas_Object *connect_button;
- Evas_Object *layout;
- Evas_Object *list = NULL;
-
eap_data->navi_frame = navi_frame;
+ evas_object_smart_callback_add(eap_data->navi_frame, "title,clicked",
+ __eap_view_title_clicked_cb, NULL);
layout = common_utils_create_layout(navi_frame);
+
/* Create an EAP connect view list */
list = _create_list(layout, eap_data);
elm_object_part_content_set(layout, "elm.swallow.content", list);
- navi_it = elm_naviframe_item_push(navi_frame, device_info->ssid, NULL, NULL, layout, NULL);
- evas_object_data_set(navi_frame, SCREEN_TYPE_ID_KEY, (void *)VIEW_MANAGER_VIEW_TYPE_EAP);
-
- /* Tool bar Connect button */
- connect_button = elm_button_add(navi_frame);
- elm_object_style_set(connect_button, "naviframe/toolbar/default");
- elm_object_text_set(connect_button, sc(pkg_name, I18N_TYPE_Connect));
- evas_object_smart_callback_add(connect_button, "clicked", __common_eap_connect_done_cb, eap_data);
- elm_object_item_part_content_set(navi_it, "toolbar_button1", connect_button);
/* Tool bar Back button */
- button_back = elm_object_item_part_content_get(navi_it, "prev_btn");
- evas_object_smart_callback_add(button_back, "clicked", __common_eap_connect_destroy, eap_data);
+ back_btn = elm_button_add(navi_frame);
+ elm_object_style_set(back_btn, "naviframe/end_btn/default");
+ evas_object_smart_callback_add(back_btn, "clicked",
+ __common_eap_connect_destroy, eap_data);
+
+ navi_it = elm_naviframe_item_push(navi_frame, NULL, back_btn, NULL,
+ layout, NULL);
+ evas_object_data_set(navi_frame, SCREEN_TYPE_ID_KEY,
+ (void *)VIEW_MANAGER_VIEW_TYPE_EAP);
+
+ /* Set the label style, slide mode & text */
+ label = elm_label_add(navi_frame);
+ elm_object_style_set(label, "naviframe_title");
+ elm_label_slide_mode_set(label, ELM_LABEL_SLIDE_MODE_ALWAYS);
+ elm_label_wrap_width_set(label, 1);
+ elm_label_ellipsis_set(label, EINA_TRUE);
+ elm_object_text_set(label, device_info->ssid);
+ evas_object_show(label);
+ elm_object_item_part_content_set(navi_it, "elm.swallow.title", label);
+
+ /* Tool bar Connect button */
+ connect_btn = elm_button_add(navi_frame);
+ elm_object_style_set(connect_btn, "naviframe/toolbar/default");
+ elm_object_text_set(connect_btn, sc(pkg_name, I18N_TYPE_Connect));
+ evas_object_smart_callback_add(connect_btn, "clicked",
+ __common_eap_connect_done_cb, eap_data);
+ elm_object_item_part_content_set(navi_it, "toolbar_button1",
+ connect_btn);
/* Append ip info items and add a seperator */
ecore_idler_add(__common_eap_connect_load_ip_info_list_cb, eap_data);
/* Title Connect button */
- connect_button = elm_button_add(navi_frame);
- elm_object_style_set(connect_button, "naviframe/toolbar/default");
- elm_object_text_set(connect_button, sc(pkg_name, I18N_TYPE_Connect));
- evas_object_smart_callback_add(connect_button, "clicked", __common_eap_connect_done_cb, eap_data);
- elm_object_item_part_content_set(navi_it, "title_toolbar_button1", connect_button);
+ connect_btn = elm_button_add(navi_frame);
+ elm_object_style_set(connect_btn, "naviframe/toolbar/default");
+ elm_object_text_set(connect_btn, sc(pkg_name, I18N_TYPE_Connect));
+ evas_object_smart_callback_add(connect_btn, "clicked",
+ __common_eap_connect_done_cb, eap_data);
+ elm_object_item_part_content_set(navi_it, "title_toolbar_button1",
+ connect_btn);
/* Title Back button */
- button_back = elm_button_add(navi_frame);
- elm_object_style_set(button_back, "naviframe/back_btn/default");
- evas_object_smart_callback_add(button_back, "clicked", (Evas_Smart_Cb)eap_view_close, eap_data);
- elm_object_item_part_content_set(navi_it, "title_prev_btn", button_back);
+ back_btn = elm_button_add(navi_frame);
+ elm_object_style_set(back_btn, "naviframe/back_btn/default");
+ evas_object_smart_callback_add(back_btn, "clicked",
+ __common_eap_connect_destroy, eap_data);
+ elm_object_item_part_content_set(navi_it, "title_prev_btn", back_btn);
/* Register imf event cbs */
__common_eap_view_set_imf_ctxt_evnt_cb(eap_data);
__COMMON_FUNC_EXIT__;
-
return eap_data;
}
-common_eap_connect_data_t *create_eap_connect_popup(Evas_Object *win_main, const char *pkg_name, wifi_device_info_t *device_info)
+eap_connect_data_t *create_eap_popup(Evas_Object *win_main,
+ const char *pkg_name, wifi_device_info_t *device_info)
{
__COMMON_FUNC_ENTER__;
Evas_Object *list = NULL;
- if (!win_main || !device_info || !pkg_name)
+
+ if (win_main == NULL || device_info == NULL || pkg_name == NULL)
return NULL;
- common_eap_connect_data_t *eap_data = g_new0(common_eap_connect_data_t, 1);
+ eap_connect_data_t *eap_data = g_new0(eap_connect_data_t, 1);
eap_data->str_pkg_name = pkg_name;
eap_data->win = win_main;
Evas_Object *box;
Evas_Object *btn;
int rotate_angle;
- int visible_area_height;
- int visible_area_width;
- /* Lets disable the scan updates so that the UI is not refreshed un necessarily */
+ /* Lets disable the scan updates so that the UI is not refreshed unnecessarily */
wlan_manager_disable_scan_result_update();
eap_data->popup = popup = elm_popup_add(win_main);
btn = elm_button_add(popup);
elm_object_text_set(btn, sc(pkg_name, I18N_TYPE_Connect));
elm_object_part_content_set(popup, "button1", btn);
- evas_object_smart_callback_add(btn, "clicked", __common_eap_connect_done_cb, eap_data);
+ evas_object_smart_callback_add(btn, "clicked",
+ __common_eap_connect_done_cb, eap_data);
btn = elm_button_add(popup);
elm_object_text_set(btn, sc(pkg_name, I18N_TYPE_Cancel));
elm_object_part_content_set(popup, "button2", btn);
- evas_object_smart_callback_add(btn, "clicked", __common_eap_connect_destroy, eap_data);
+ evas_object_smart_callback_add(btn, "clicked",
+ __common_eap_connect_destroy, eap_data);
/* Create and add a box into the layout. */
box = elm_box_add(popup);
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.0);
rotate_angle = common_utils_get_rotate_angle(APPCORE_RM_UNKNOWN);
+ if (0 == rotate_angle || 180 == rotate_angle)
+ evas_object_size_hint_min_set(box, -1,
+ DEVICE_PICKER_POPUP_H * elm_config_scale_get());
+ else
+ evas_object_size_hint_min_set(box, -1,
+ DEVICE_PICKER_POPUP_LN_H * elm_config_scale_get());
- __common_popup_size_get(NULL ,&visible_area_width, &visible_area_height);
- evas_object_size_hint_min_set(box, visible_area_width * elm_config_scale_get(), visible_area_height * elm_config_scale_get());
evas_object_name_set(box, EAP_CONNECT_POPUP);
/* Create an EAP connect view list */
/* Append ip info items and add a seperator */
ecore_idler_add(__common_eap_connect_load_ip_info_list_cb, eap_data);
-
/* Pack the list into the box */
elm_box_pack_end(box, list);
elm_object_content_set(popup, box);
evas_object_show(box);
evas_object_show(popup);
+ __common_eap_popup_set_imf_ctxt_evnt_cb(eap_data);
+
__COMMON_FUNC_EXIT__;
return eap_data;
/* This creates Auth type, ID, Anonymous Id and Password items
* This function should be called after creating the EAP type item
*/
-eap_info_list_t *eap_info_append_items(wifi_ap_h ap, Evas_Object* view_list, const char *str_pkg_name, imf_ctxt_panel_cb_t input_panel_cb, void *input_panel_cb_data)
+eap_info_list_t *eap_info_append_items(wifi_ap_h ap, Evas_Object* view_list,
+ const char *str_pkg_name, imf_ctxt_panel_cb_t input_panel_cb,
+ void *input_panel_cb_data)
{
__COMMON_FUNC_ENTER__;
+
eap_type_t eap_type;
eap_auth_t auth_type;
char *temp_str = NULL;
g_eap_entry_itc.func.state_get = NULL;
g_eap_entry_itc.func.del = _gl_eap_entry_item_del;
- /* TODO: Fetch the password. CAPI not available. */
- if (is_paswd_set)
- temp_str = g_strdup("XXXXX");
- else
- temp_str = g_strdup("");
-
edit_box_details = g_new0(common_utils_entry_info_t, 1);
edit_box_details->entry_id = ENTRY_TYPE_PASSWORD;
edit_box_details->title_txt = sc(str_pkg_name, I18N_TYPE_Password);
- edit_box_details->entry_txt = temp_str;
+ edit_box_details->entry_txt = NULL;
+ edit_box_details->guide_txt = sc(str_pkg_name, I18N_TYPE_Unchanged);
edit_box_details->input_panel_cb = input_panel_cb;
edit_box_details->input_panel_cb_data = input_panel_cb_data;
eap_info_list_data->pswd_item = elm_genlist_item_append(view_list, &g_eap_entry_itc, edit_box_details, NULL, ELM_GENLIST_ITEM_NONE, _gl_editbox_sel_cb, NULL);
wifi_ap_set_eap_passphrase(eap_info_list_data->ap, NULL, txt);
g_free(txt);
+ return;
}
void eap_info_remove(eap_info_list_t *eap_info_list_data)
}
elm_object_item_del(eap_info_list_data->pswd_item);
+
eap_info_list_data->pswd_item = NULL;
+
g_free(eap_info_list_data);
}
-void eap_view_close(common_eap_connect_data_t *eap_data)
+void eap_connect_data_free(eap_connect_data_t *eap_data)
{
- if (NULL == eap_data)
- return;
-
- Evas_Object *nf = eap_data->navi_frame;
__common_eap_connect_cleanup(eap_data);
- elm_naviframe_item_pop(nf);
}
-void eap_view_rotate_popup(common_eap_connect_data_t *eap_data, int rotate_angle)
+void eap_view_rotate_popup(eap_connect_data_t *eap_data, int rotate_angle)
{
__COMMON_FUNC_ENTER__;
if (NULL == eap_data || NULL == eap_data->popup)
return;
+ int value = eap_data->key_status;
Evas_Object *box = elm_object_content_get(eap_data->popup);
- __common_popup_size_get(NULL, &eap_data->visible_area_width, &eap_data->visible_area_height);
- evas_object_size_hint_min_set(box, eap_data->visible_area_width * elm_config_scale_get(), eap_data->visible_area_height* elm_config_scale_get());
+
+ if (value == ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
+ DEBUG_LOG(UG_NAME_NORMAL, "Key pad is open");
+
+ if (rotate_angle == 0 || rotate_angle == 180)
+ evas_object_size_hint_min_set(box, -1,
+ 530 * elm_config_scale_get());
+ else
+ evas_object_size_hint_min_set(box, -1,
+ 200 * elm_config_scale_get());
+ } else if (value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
+ if (rotate_angle == 0 || rotate_angle == 180)
+ evas_object_size_hint_min_set(box, -1,
+ DEVICE_PICKER_POPUP_H * elm_config_scale_get());
+ else
+ evas_object_size_hint_min_set(box, -1,
+ DEVICE_PICKER_POPUP_LN_H * elm_config_scale_get());
+ }
__COMMON_FUNC_EXIT__;
+ return;
}
+++ /dev/null
-/*
- * Wi-Fi
- *
- * 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 <wifi.h>
-#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
-
-#include "common.h"
-#include "common_invalid_password.h"
-
-#define SUPPLICANT_INTERFACE "fi.w1.wpa_supplicant1"
-#define SUPPLICANT_INTERFACE_SIGNAL_FILTER \
- "type='signal',interface='fi.w1.wpa_supplicant1.Interface'"
-
-static gboolean invalid_key = FALSE;
-static DBusConnection *connection = NULL;
-
-static void __common_pop_invalid_password(void)
-{
- invalid_key = TRUE;
-
- ERROR_LOG(UG_NAME_NORMAL, "Invalid password");
-}
-
-static DBusHandlerResult __common_check_invalid_password(
- DBusConnection* connection, DBusMessage* message, void* user_data)
-{
- DBusMessageIter iter, dict, entry, value;
- const char *key;
- const char *state;
- static char old_state[30] = { 0, };
-
- if (dbus_message_is_signal(message,
- SUPPLICANT_INTERFACE ".Interface", "PropertiesChanged") != TRUE)
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
- if (dbus_message_iter_init(message, &iter) == FALSE)
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY)
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
- dbus_message_iter_recurse(&iter, &dict);
- while (dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_DICT_ENTRY) {
- dbus_message_iter_recurse(&dict, &entry);
- if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_STRING)
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
- dbus_message_iter_get_basic(&entry, &key);
- dbus_message_iter_next(&entry);
-
- if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_VARIANT)
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
- dbus_message_iter_recurse(&entry, &value);
-
- if (g_strcmp0(key, "State") == 0) {
- dbus_message_iter_get_basic(&value, &state);
- if (state == NULL)
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
- if (g_strcmp0(old_state, "4way_handshake") == 0 &&
- g_strcmp0(state, "disconnected") == 0)
- __common_pop_invalid_password();
-
- g_strlcpy(old_state, state, 30);
- }
-
- dbus_message_iter_next(&dict);
- }
-
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-}
-
-int _common_register_invalid_password_popup(void)
-{
- DBusError error;
-
- invalid_key = FALSE;
-
- if (connection != NULL)
- return WIFI_ERROR_NONE;
-
- connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
- if (connection == NULL)
- return WIFI_ERROR_OUT_OF_MEMORY;
-
- dbus_connection_setup_with_g_main(connection, NULL);
-
- dbus_error_init(&error);
- dbus_bus_add_match(connection, SUPPLICANT_INTERFACE_SIGNAL_FILTER, &error);
- dbus_connection_flush(connection);
- if (dbus_error_is_set(&error) == TRUE) {
- dbus_error_free(&error);
-
- dbus_connection_unref(connection);
- connection = NULL;
-
- return WIFI_ERROR_OUT_OF_MEMORY;
- }
-
- if (dbus_connection_add_filter(connection,
- __common_check_invalid_password, NULL, NULL) == FALSE) {
- dbus_connection_unref(connection);
- connection = NULL;
-
- return WIFI_ERROR_OUT_OF_MEMORY;
- }
-
- return WIFI_ERROR_NONE;
-}
-
-int _common_deregister_invalid_password_popup(void)
-{
- if (connection == NULL)
- return WIFI_ERROR_NONE;
-
- dbus_bus_remove_match(connection, SUPPLICANT_INTERFACE_SIGNAL_FILTER, NULL);
- dbus_connection_flush(connection);
-
- dbus_connection_remove_filter(connection,
- __common_check_invalid_password, NULL);
-
- dbus_connection_unref(connection);
- connection = NULL;
-
- return WIFI_ERROR_NONE;
-}
-
-gboolean _common_is_invalid_password(void)
-{
- return invalid_key;
-}
void *input_panel_cb_data;
wifi_ap_h ap;
+ wifi_ip_config_type_e ip_type;
};
static Elm_Object_Item* _add_description(Evas_Object* genlist, char* title,
static void _ip_info_detail_description_del(void *data, Evas_Object *obj)
{
__COMMON_FUNC_ENTER__;
+
+ retm_if(NULL == data);
+
_view_detail_description_data_t* det = (_view_detail_description_data_t*) data;
- assertm_if(NULL == det, "NULL!!");
- assertm_if(NULL == det->title, "NULL!!");
- assertm_if(NULL == det->description, "NULL!!");
+
g_free(det->description);
g_free(det->title);
g_free(det);
det = NULL;
+
__COMMON_FUNC_EXIT__;
}
static char *_ip_info_detail_description_text_get(void *data,
Evas_Object *obj, const char *part)
{
+ retvm_if(NULL == data || NULL == part, NULL);
+
_view_detail_description_data_t* det = (_view_detail_description_data_t*) data;
- assertm_if(NULL == det, "NULL!!");
- assertm_if(NULL == det->title, "NULL!!");
- assertm_if(NULL == det->description, "NULL!!");
- assertm_if(NULL == part, "NULL!!");
if(0 == strncmp("elm.text.1", part, strlen(part))) {
- return g_strdup(det->title);
- } else if(0 == strncmp("elm.text.2", part, strlen(part))) {
return g_strdup(det->description);
+ } else if(0 == strncmp("elm.text.2", part, strlen(part))) {
+ return g_strdup(det->title);
}
return NULL;
if (entry_info) {
g_free(entry_info->entry_txt);
entry_info->entry_txt = NULL;
+
char *entry_text = elm_entry_markup_to_utf8(elm_entry_entry_get(obj));
if (entry_text != NULL && entry_text[0] != '\0')
title = entry_info->title_txt;
guide_txt = DEFAULT_GUIDE_PROXY_IP;
panel_type = ELM_INPUT_PANEL_LAYOUT_URL;
+ accepted = "0123456789.abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
break;
case ENTRY_TYPE_PROXY_PORT:
title = entry_info->title_txt;
elm_entry_input_panel_layout_set(entry, panel_type);
limit_filter_data.max_char_count = 32;
elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_filter_data);
+ elm_entry_context_menu_disabled_set(entry, EINA_TRUE);
Elm_Entry_Filter_Accept_Set digits_filter_data;
memset(&digits_filter_data, 0, sizeof(Elm_Entry_Filter_Accept_Set));
g_free(entry_info);
}
+static char *_access_info_cb(void *data, Evas_Object *obj)
+{
+ common_utils_entry_info_t *entry_info = (common_utils_entry_info_t *)data;
+ if (!entry_info)
+ return NULL;
+
+ if (entry_info->entry_txt)
+ return g_strdup_printf("%s %s", entry_info->title_txt, entry_info->entry_txt);
+ else
+ return g_strdup_printf("%s %s", entry_info->title_txt, entry_info->guide_txt);
+}
+
static void _create_static_ip_table(ip_info_list_t *ip_info_list_data)
{
char *txt = NULL;
edit_box_details->input_panel_cb_data = ip_info_list_data->input_panel_cb_data;
ip_info_list_data->ip_addr_item = elm_genlist_item_insert_after(ip_info_list_data->genlist, &ip_entry_itc, edit_box_details, NULL, ip_info_list_data->ip_toggle_item, ELM_GENLIST_ITEM_NONE, _gl_editbox_sel_cb, NULL);
elm_genlist_item_select_mode_set(ip_info_list_data->ip_addr_item, ELM_OBJECT_SELECT_MODE_NONE);
+ Evas_Object *ao = elm_object_item_access_object_get(ip_info_list_data->ip_addr_item);
+ elm_access_info_cb_set(ao, ELM_ACCESS_INFO, _access_info_cb, edit_box_details);
/* Subnet Mask */
wifi_ap_get_subnet_mask(ap, WIFI_ADDRESS_FAMILY_IPV4, &txt);
edit_box_details->input_panel_cb_data = ip_info_list_data->input_panel_cb_data;
ip_info_list_data->subnet_mask_item = elm_genlist_item_insert_after(ip_info_list_data->genlist, &ip_entry_itc, edit_box_details, NULL, ip_info_list_data->ip_addr_item, ELM_GENLIST_ITEM_NONE, _gl_editbox_sel_cb, NULL);
elm_genlist_item_select_mode_set(ip_info_list_data->subnet_mask_item, ELM_OBJECT_SELECT_MODE_NONE);
+ ao = elm_object_item_access_object_get(ip_info_list_data->subnet_mask_item);
+ elm_access_info_cb_set(ao, ELM_ACCESS_INFO, _access_info_cb, edit_box_details);
/* Gateway Address */
wifi_ap_get_gateway_address(ap, WIFI_ADDRESS_FAMILY_IPV4, &txt);
edit_box_details->input_panel_cb_data = ip_info_list_data->input_panel_cb_data;
ip_info_list_data->gateway_addr_item = elm_genlist_item_insert_after(ip_info_list_data->genlist, &ip_entry_itc, edit_box_details, NULL, ip_info_list_data->subnet_mask_item, ELM_GENLIST_ITEM_NONE, _gl_editbox_sel_cb, NULL);
elm_genlist_item_select_mode_set(ip_info_list_data->gateway_addr_item, ELM_OBJECT_SELECT_MODE_NONE);
+ ao = elm_object_item_access_object_get(ip_info_list_data->gateway_addr_item);
+ elm_access_info_cb_set(ao, ELM_ACCESS_INFO, _access_info_cb, edit_box_details);
/* DNS 1 */
wifi_ap_get_dns_address(ap, 1, WIFI_ADDRESS_FAMILY_IPV4, &txt);
edit_box_details->input_panel_cb_data = ip_info_list_data->input_panel_cb_data;
ip_info_list_data->dns_1_item = elm_genlist_item_insert_after(ip_info_list_data->genlist, &ip_entry_itc, edit_box_details, NULL, ip_info_list_data->gateway_addr_item, ELM_GENLIST_ITEM_NONE, _gl_editbox_sel_cb, NULL);
elm_genlist_item_select_mode_set(ip_info_list_data->dns_1_item, ELM_OBJECT_SELECT_MODE_NONE);
+ ao = elm_object_item_access_object_get(ip_info_list_data->dns_1_item);
+ elm_access_info_cb_set(ao, ELM_ACCESS_INFO, _access_info_cb, edit_box_details);
/* DNS 2 */
wifi_ap_get_dns_address(ap, 2, WIFI_ADDRESS_FAMILY_IPV4, &txt);
edit_box_details->input_panel_cb_data = ip_info_list_data->input_panel_cb_data;
ip_info_list_data->dns_2_item = elm_genlist_item_insert_after(ip_info_list_data->genlist, &ip_entry_itc, edit_box_details, NULL, ip_info_list_data->dns_1_item, ELM_GENLIST_ITEM_NONE, _gl_editbox_sel_cb, NULL);
elm_genlist_item_select_mode_set(ip_info_list_data->dns_2_item, ELM_OBJECT_SELECT_MODE_NONE);
+ ao = elm_object_item_access_object_get(ip_info_list_data->dns_2_item);
+ elm_access_info_cb_set(ao, ELM_ACCESS_INFO, _access_info_cb, edit_box_details);
__COMMON_FUNC_EXIT__;
{
__COMMON_FUNC_ENTER__;
+ retm_if(NULL == ip_info_list_data);
+
elm_object_item_del(ip_info_list_data->ip_addr_item);
ip_info_list_data->ip_addr_item = NULL;
elm_object_item_del(ip_info_list_data->subnet_mask_item);
ip_info_list_data->dns_2_item = NULL;
__COMMON_FUNC_EXIT__;
-
- return;
}
-static int _genlist_item_disable_later(void* data)
+static Eina_Bool __genlist_item_disable_later(void *data)
{
- elm_genlist_item_selected_set((Elm_Object_Item*) data, FALSE);
- return FALSE;
+ elm_genlist_item_selected_set((Elm_Object_Item *)data, FALSE);
+
+ return ECORE_CALLBACK_CANCEL;
}
-static void _gl_deselect_callback(void* data, Evas_Object* obj,
- void* event_info)
+static void _gl_deselect_callback(void* data,
+ Evas_Object* obj, void* event_info)
{
- ecore_idler_add( (Ecore_Task_Cb) _genlist_item_disable_later, event_info);
+ ecore_idler_add(__genlist_item_disable_later, event_info);
}
static char* _ip_info_iptoggle_text_get(void *data, Evas_Object *obj,
{
__COMMON_FUNC_ENTER__;
- assertm_if(NULL == data, "NULL!!");
- assertm_if(NULL == obj, "NULL!!");
- assertm_if(NULL == part, "NULL!!");
- if (part != NULL) {
- if (!strncmp(part, "elm.text", strlen(part))) {
- __COMMON_FUNC_EXIT__;
- ip_info_list_t *ip_info_list_data = (ip_info_list_t *)data;
- return (char*)g_strdup(sc(ip_info_list_data->str_pkg_name, I18N_TYPE_Static_IP));
- }
+ retvm_if(NULL == data || NULL == part, NULL);
+
+ if (!strncmp(part, "elm.text", strlen(part))) {
+ ip_info_list_t *ip_info_list_data = (ip_info_list_t *)data;
+
+ Evas_Object *ao = elm_object_item_access_object_get(ip_info_list_data->ip_toggle_item);
+ elm_access_info_set(ao, ELM_ACCESS_TYPE, "on/off button");
+ if (WIFI_IP_CONFIG_TYPE_STATIC == ip_info_list_data->ip_type)
+ elm_access_info_set(ao, ELM_ACCESS_STATE, "on");
+ else
+ elm_access_info_set(ao, ELM_ACCESS_STATE, "off");
+
+ return (char*)g_strdup(sc(ip_info_list_data->str_pkg_name, I18N_TYPE_Static_IP));
}
__COMMON_FUNC_EXIT__;
static Elm_Object_Item* _add_description(Evas_Object* genlist, char* title,
char* description, Elm_Object_Item* insert_after)
{
- assertm_if(NULL == genlist, "NULL!!");
- assertm_if(NULL == title, "NULL!!");
- assertm_if(NULL == description, "NULL!!");
+ retvm_if(NULL == genlist, NULL);
_view_detail_description_data_t* description_data = g_new0(_view_detail_description_data_t, 1);
- assertm_if(NULL == description_data, "NULL!!");
+ retvm_if(NULL == description_data, NULL);
description_data->title = g_strdup(title);
description_data->description = g_strdup(description);
_gl_deselect_callback,
NULL);
}
- assertm_if(NULL == det, "NULL!!");
elm_genlist_item_select_mode_set(det, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
return det;
}
-static void _ip_info_toggle_item_sel_cb(void* data, Evas_Object* obj,
- void* event_info)
+static void __ip_info_toggle_item_sel_cb(void* data,
+ Evas_Object* obj, void* event_info)
{
__COMMON_FUNC_ENTER__;
- if (!data)
+ const char *object_type;
+ wifi_ip_config_type_e ip_type = WIFI_IP_CONFIG_TYPE_DYNAMIC;
+ ip_info_list_t *ip_info_list_data = (ip_info_list_t *)data;
+ if (ip_info_list_data == NULL)
return;
- ip_info_list_t *ip_info_list_data = (ip_info_list_t *)data;
wifi_ap_h ap = ip_info_list_data->ap;
- elm_object_item_disabled_set(ip_info_list_data->ip_toggle_item, TRUE);
- wifi_ip_config_type_e type = WIFI_IP_CONFIG_TYPE_NONE;
- wifi_ap_get_ip_config_type(ap, WIFI_ADDRESS_FAMILY_IPV4, &type);
- if (WIFI_IP_CONFIG_TYPE_STATIC == type) { /* Static IP */
- char *ip_addr = NULL;
- ip_info_save_data(ip_info_list_data);
- _delete_static_ip_table(ip_info_list_data);
+ elm_object_item_disabled_set(ip_info_list_data->ip_toggle_item, EINA_TRUE);
- wifi_ap_get_ip_address(ap, WIFI_ADDRESS_FAMILY_IPV4, &ip_addr);
- /* Dynamic IP Address */
- ip_info_list_data->ip_addr_item =
- _add_description(ip_info_list_data->genlist,
- sc(ip_info_list_data->str_pkg_name, I18N_TYPE_IP_address),
- ip_addr, ip_info_list_data->ip_toggle_item);
- elm_object_item_disabled_set(ip_info_list_data->ip_addr_item, TRUE);
- g_free(ip_addr);
+ object_type = evas_object_type_get(obj);
- wifi_ap_set_ip_config_type(ap, WIFI_ADDRESS_FAMILY_IPV4,
- WIFI_IP_CONFIG_TYPE_DYNAMIC);
- } else if (WIFI_IP_CONFIG_TYPE_DYNAMIC == type) { /* Dynamic IP */
+ if (g_strcmp0(object_type, "elm_check") == 0) {
+ Eina_Bool ip_mode = elm_check_state_get(obj);
- elm_object_item_del(ip_info_list_data->ip_addr_item);
- ip_info_list_data->ip_addr_item = NULL;
+ if (ip_mode == TRUE)
+ ip_type = WIFI_IP_CONFIG_TYPE_STATIC;
+ else
+ ip_type = WIFI_IP_CONFIG_TYPE_DYNAMIC;
+ } else if (g_strcmp0(object_type, "elm_genlist") == 0) {
+ if (ip_info_list_data->ip_type == WIFI_IP_CONFIG_TYPE_STATIC)
+ ip_type = WIFI_IP_CONFIG_TYPE_DYNAMIC;
+ else
+ ip_type = WIFI_IP_CONFIG_TYPE_STATIC;
+ }
- /* Create the entry layouts */
- _create_static_ip_table(ip_info_list_data);
- wifi_ap_set_ip_config_type(ap, WIFI_ADDRESS_FAMILY_IPV4,
- WIFI_IP_CONFIG_TYPE_STATIC);
+ if (ip_type == WIFI_IP_CONFIG_TYPE_DYNAMIC) {
+ if (WIFI_ERROR_NONE == wifi_ap_set_ip_config_type(ap,
+ WIFI_ADDRESS_FAMILY_IPV4, WIFI_IP_CONFIG_TYPE_DYNAMIC)) {
+ char *ip_addr = NULL;
+
+ ip_info_save_data(ip_info_list_data);
+ _delete_static_ip_table(ip_info_list_data);
+
+ wifi_ap_get_ip_address(ap, WIFI_ADDRESS_FAMILY_IPV4, &ip_addr);
+
+ /* Dynamic IP Address */
+ ip_info_list_data->ip_addr_item = _add_description(
+ ip_info_list_data->genlist,
+ sc(ip_info_list_data->str_pkg_name, I18N_TYPE_IP_address),
+ ip_addr,
+ ip_info_list_data->ip_toggle_item);
+
+ elm_object_item_disabled_set(ip_info_list_data->ip_addr_item, EINA_TRUE);
+
+ g_free(ip_addr);
+
+ ip_info_list_data->ip_type = WIFI_IP_CONFIG_TYPE_DYNAMIC;
+ }
+ } else if (ip_type == WIFI_IP_CONFIG_TYPE_STATIC) {
+ if (WIFI_ERROR_NONE == wifi_ap_set_ip_config_type(ap,
+ WIFI_ADDRESS_FAMILY_IPV4, WIFI_IP_CONFIG_TYPE_STATIC)) {
+ elm_object_item_del(ip_info_list_data->ip_addr_item);
+ ip_info_list_data->ip_addr_item = NULL;
+
+ /* Create the entry layouts */
+ _create_static_ip_table(ip_info_list_data);
+ ip_info_list_data->ip_type = WIFI_IP_CONFIG_TYPE_STATIC;
+ }
}
- type = WIFI_IP_CONFIG_TYPE_NONE;
- wifi_ap_get_ip_config_type(ap, WIFI_ADDRESS_FAMILY_IPV4, &type);
- DEBUG_LOG(UG_NAME_NORMAL, "AP[0x%x] ip config type: %d", ap, type);
+
elm_genlist_item_update(ip_info_list_data->ip_toggle_item);
elm_object_item_disabled_set(ip_info_list_data->ip_toggle_item, FALSE);
- ecore_idler_add( (Ecore_Task_Cb) _genlist_item_disable_later, event_info);
+
+ ecore_idler_add(__genlist_item_disable_later, event_info);
__COMMON_FUNC_EXIT__;
}
static Evas_Object *_ip_info_iptoggle_content_get(void *data,
Evas_Object *obj, const char *part)
{
- if (NULL == data || obj == NULL || part == NULL) {
- return NULL;
- }
+ retvm_if(NULL == data || NULL == obj || NULL == part, NULL);
ip_info_list_t *ip_info_list_data = (ip_info_list_t *)data;
- wifi_ap_h ap = ip_info_list_data->ap;
Evas_Object *toggle_btn = elm_check_add(obj);
- assertm_if(NULL == toggle_btn, "NULL!!");
+ retvm_if(NULL == toggle_btn, NULL);
+
elm_object_style_set(toggle_btn, "on&off");
- evas_object_propagate_events_set(toggle_btn, EINA_TRUE);
- wifi_ip_config_type_e type;
- wifi_ap_get_ip_config_type(ap, WIFI_ADDRESS_FAMILY_IPV4, &type);
- if (WIFI_IP_CONFIG_TYPE_STATIC == type) { /* Static IP */
+ evas_object_propagate_events_set(toggle_btn, EINA_FALSE);
+
+ if (WIFI_IP_CONFIG_TYPE_STATIC == ip_info_list_data->ip_type)
elm_check_state_set(toggle_btn, EINA_TRUE);
- } else {
+ else
elm_check_state_set(toggle_btn, EINA_FALSE);
- }
+
+ evas_object_smart_callback_add(toggle_btn, "changed",
+ __ip_info_toggle_item_sel_cb, ip_info_list_data);
+
return toggle_btn;
}
{
char *txt;
wifi_ip_config_type_e type = WIFI_IP_CONFIG_TYPE_NONE;
- wifi_ap_get_ip_config_type(ap, WIFI_ADDRESS_FAMILY_IPV4, &type);
- if (WIFI_IP_CONFIG_TYPE_STATIC == type) { /* Static IP */
+ wifi_ap_get_ip_config_type(ap, WIFI_ADDRESS_FAMILY_IPV4, &type);
+ if (WIFI_IP_CONFIG_TYPE_STATIC == type) {
DEBUG_LOG(UG_NAME_NORMAL, "* STATIC CONFIGURATION *");
/* IP Address */
DEBUG_LOG(UG_NAME_NORMAL, "* DNS-2 address [%s]", txt);
g_free(txt);
- } else if (WIFI_IP_CONFIG_TYPE_DYNAMIC == type) { /* Dynamic IP */
-
+ } else if (WIFI_IP_CONFIG_TYPE_DYNAMIC == type) {
DEBUG_LOG(UG_NAME_NORMAL, "* DYNAMIC CONFIGURATION *");
/* Dynamic IP Address */
wifi_get_mac_address(&txt);
DEBUG_LOG(UG_NAME_NORMAL, "* MAC address [%s]", txt);
g_free(txt);
-
txt = NULL;
+
wifi_ap_get_proxy_address(ap, WIFI_ADDRESS_FAMILY_IPV4, &txt);
assertm_if(NULL == txt, "NULL!!");
g_free(txt);
txt = g_strdup(DEFAULT_PROXY_ADDR);
}
+
/* Proxy Address */
char *proxy_addr = strtok(txt, ":");
DEBUG_LOG(UG_NAME_NORMAL, "* PROXY ADDR [%s]", proxy_addr);
char *proxy_port = strtok(NULL, ":");
DEBUG_LOG(UG_NAME_NORMAL, "* PROXY PORT [%s]", proxy_port);
g_free(txt);
-
}
ip_info_list_t *ip_info_append_items(wifi_ap_h ap, const char *pkg_name,
assertm_if(NULL == genlist, "NULL!!");
ip_info_list_t *ip_info_list_data = g_new0(ip_info_list_t, 1);
+ retvm_if(NULL == ip_info_list_data, NULL);
+
ip_info_list_data->ap = ap;
ip_info_list_data->str_pkg_name = pkg_name;
ip_info_list_data->genlist = genlist;
ip_toggle_itc.func.state_get = NULL;
ip_toggle_itc.func.del = NULL;
- description_itc.item_style = "dialogue/2text.3";
+ description_itc.item_style = "dialogue/2text.2";
description_itc.func.text_get = _ip_info_detail_description_text_get;
description_itc.func.content_get = NULL;
description_itc.func.state_get = NULL;
common_utils_add_dialogue_separator(genlist, "dialogue/separator.2");
/* Static/Dynamic switch button */
- ip_info_list_data->ip_toggle_item =
- elm_genlist_item_append(genlist,
- &ip_toggle_itc, ip_info_list_data, NULL, ELM_GENLIST_ITEM_NONE,
- _ip_info_toggle_item_sel_cb, ip_info_list_data);
-
- /* IP address */
wifi_ip_config_type_e type = WIFI_IP_CONFIG_TYPE_NONE;
wifi_ap_get_ip_config_type(ap, WIFI_ADDRESS_FAMILY_IPV4, &type);
+ ip_info_list_data->ip_type = type;
+ ip_info_list_data->ip_toggle_item = elm_genlist_item_append(genlist,
+ &ip_toggle_itc, ip_info_list_data, NULL, ELM_GENLIST_ITEM_NONE,
+ __ip_info_toggle_item_sel_cb, ip_info_list_data);
+
+ /* IP address */
if (WIFI_IP_CONFIG_TYPE_STATIC == type) { /* Static IP */
/* Create the entry layouts */
_create_static_ip_table(ip_info_list_data);
edit_box_details->entry_id = ENTRY_TYPE_PROXY_ADDR;
edit_box_details->title_txt = sc(pkg_name, I18N_TYPE_Proxy_address);
edit_box_details->entry_txt = proxy_addr;
+ edit_box_details->guide_txt = DEFAULT_GUIDE_PROXY_IP;
edit_box_details->input_panel_cb = input_panel_cb;
edit_box_details->input_panel_cb_data = input_panel_cb_data;
ip_info_list_data->proxy_addr_item = elm_genlist_item_append(genlist, &ip_entry_itc, edit_box_details, NULL, ELM_GENLIST_ITEM_NONE, _gl_editbox_sel_cb, NULL);
elm_genlist_item_select_mode_set(ip_info_list_data->proxy_addr_item, ELM_OBJECT_SELECT_MODE_NONE);
+ Evas_Object *ao = elm_object_item_access_object_get(ip_info_list_data->proxy_addr_item);
+ elm_access_info_cb_set(ao, ELM_ACCESS_INFO, _access_info_cb, edit_box_details);
edit_box_details = g_new0(common_utils_entry_info_t, 1);
edit_box_details->entry_id = ENTRY_TYPE_PROXY_PORT;
edit_box_details->title_txt = sc(pkg_name, I18N_TYPE_Proxy_port);
edit_box_details->entry_txt = proxy_port;
+ edit_box_details->guide_txt = DEFAULT_GUIDE_PROXY_PORT;
edit_box_details->input_panel_cb = input_panel_cb;
edit_box_details->input_panel_cb_data = input_panel_cb_data;
ip_info_list_data->proxy_port_item = elm_genlist_item_append(genlist, &ip_entry_itc, edit_box_details, NULL, ELM_GENLIST_ITEM_NONE, _gl_editbox_sel_cb, NULL);
elm_genlist_item_select_mode_set(ip_info_list_data->proxy_port_item, ELM_OBJECT_SELECT_MODE_NONE);
+ ao = elm_object_item_access_object_get(ip_info_list_data->proxy_port_item);
+ elm_access_info_cb_set(ao, ELM_ACCESS_INFO, _access_info_cb, edit_box_details);
g_free(proxy_data);
void ip_info_save_data(ip_info_list_t *ip_info_list_data)
{
__COMMON_FUNC_ENTER__;
- assertm_if(NULL == ip_info_list_data, "NULL!!");
+ retm_if(NULL == ip_info_list_data);
+
char* txt = NULL;
char* proxy_addr = NULL;
char* proxy_port = NULL;
wifi_ap_h ap = ip_info_list_data->ap;
- wifi_ip_config_type_e type = WIFI_IP_CONFIG_TYPE_NONE;
- wifi_ap_get_ip_config_type(ap, WIFI_ADDRESS_FAMILY_IPV4, &type);
- if (WIFI_IP_CONFIG_TYPE_STATIC == type) { /* Static IP */
+ if (WIFI_IP_CONFIG_TYPE_STATIC == ip_info_list_data->ip_type) { /* Static IP */
txt = common_utils_get_list_item_entry_txt(ip_info_list_data->ip_addr_item);
DEBUG_LOG(UG_NAME_NORMAL, "IP [%s]", txt);
wifi_ap_set_ip_address(ap, WIFI_ADDRESS_FAMILY_IPV4, txt);
g_free(txt);
- txt =
- common_utils_get_list_item_entry_txt(ip_info_list_data->subnet_mask_item);
+ txt = common_utils_get_list_item_entry_txt(ip_info_list_data->subnet_mask_item);
DEBUG_LOG(UG_NAME_NORMAL, "Subnet [%s]", txt);
wifi_ap_set_subnet_mask(ap, WIFI_ADDRESS_FAMILY_IPV4, txt);
g_free(txt);
- txt =
- common_utils_get_list_item_entry_txt(ip_info_list_data->gateway_addr_item);
+ txt = common_utils_get_list_item_entry_txt(ip_info_list_data->gateway_addr_item);
DEBUG_LOG(UG_NAME_NORMAL, "Gateway [%s]", txt);
wifi_ap_set_gateway_address(ap, WIFI_ADDRESS_FAMILY_IPV4, txt);
g_free(txt);
- txt =
- common_utils_get_list_item_entry_txt(ip_info_list_data->dns_1_item);
+ txt = common_utils_get_list_item_entry_txt(ip_info_list_data->dns_1_item);
DEBUG_LOG(UG_NAME_NORMAL, "DNS1 [%s]", txt);
wifi_ap_set_dns_address(ap, 1, WIFI_ADDRESS_FAMILY_IPV4, txt);
g_free(txt);
- txt =
- common_utils_get_list_item_entry_txt(ip_info_list_data->dns_2_item);
+ txt = common_utils_get_list_item_entry_txt(ip_info_list_data->dns_2_item);
DEBUG_LOG(UG_NAME_NORMAL, "DNS2 [%s]", txt);
wifi_ap_set_dns_address(ap, 2, WIFI_ADDRESS_FAMILY_IPV4, txt);
g_free(txt);
}
- proxy_addr =
- common_utils_get_list_item_entry_txt(ip_info_list_data->proxy_addr_item);
- proxy_port =
- common_utils_get_list_item_entry_txt(ip_info_list_data->proxy_port_item);
- txt = g_strdup_printf("%s:%s", proxy_addr?proxy_addr:"", proxy_port?proxy_port:"");
- DEBUG_LOG( UG_NAME_NORMAL, "Proxy addr:port [%s]", txt);
- wifi_ap_set_proxy_type(ap, WIFI_PROXY_TYPE_MANUAL);
- wifi_ap_set_proxy_address(ap, WIFI_ADDRESS_FAMILY_IPV4, txt);
- g_free((gpointer)proxy_addr);
- g_free((gpointer)proxy_port);
- g_free((gpointer)txt);
+
+ proxy_addr = common_utils_get_list_item_entry_txt(ip_info_list_data->proxy_addr_item);
+ if (proxy_addr == NULL) {
+ DEBUG_LOG(UG_NAME_NORMAL, "Set proxy type - auto");
+ wifi_ap_set_proxy_type(ap, WIFI_PROXY_TYPE_AUTO);
+ } else {
+ proxy_port = common_utils_get_list_item_entry_txt(ip_info_list_data->proxy_port_item);
+ if (proxy_port)
+ txt = g_strdup_printf("%s:%s", proxy_addr, proxy_port);
+ else
+ txt = g_strdup_printf("%s:%s", proxy_addr, DEFAULT_GUIDE_PROXY_PORT);
+
+ DEBUG_LOG(UG_NAME_NORMAL, "Set proxy type - manual : Proxy addr [%s]", txt);
+
+ wifi_ap_set_proxy_type(ap, WIFI_PROXY_TYPE_MANUAL);
+ wifi_ap_set_proxy_address(ap, WIFI_ADDRESS_FAMILY_IPV4, txt);
+
+ g_free((gpointer)proxy_addr);
+ g_free((gpointer)proxy_port);
+ g_free((gpointer)txt);
+ }
ip_info_print_values(ap);
void ip_info_remove(ip_info_list_t *ip_info_list)
{
__COMMON_FUNC_ENTER__;
- assertm_if(NULL == ip_info_list, "NULL!!");
+
_delete_static_ip_table(ip_info_list);
g_free(ip_info_list);
+
+ __COMMON_FUNC_EXIT__;
+}
+
+void ip_info_close_all_keypads(ip_info_list_t *ip_info_list)
+{
+ __COMMON_FUNC_ENTER__;
+
+ if (!ip_info_list) {
+ __COMMON_FUNC_EXIT__;
+ return;
+ }
+
+ if (WIFI_IP_CONFIG_TYPE_STATIC == ip_info_list->ip_type) {
+ if (ip_info_list->ip_addr_item)
+ common_utils_edit_box_focus_set(ip_info_list->ip_addr_item, EINA_FALSE);
+ if (ip_info_list->subnet_mask_item)
+ common_utils_edit_box_focus_set(ip_info_list->subnet_mask_item, EINA_FALSE);
+ if (ip_info_list->gateway_addr_item)
+ common_utils_edit_box_focus_set(ip_info_list->gateway_addr_item, EINA_FALSE);
+ if (ip_info_list->dns_1_item)
+ common_utils_edit_box_focus_set(ip_info_list->dns_1_item, EINA_FALSE);
+ if (ip_info_list->dns_2_item)
+ common_utils_edit_box_focus_set(ip_info_list->dns_2_item, EINA_FALSE);
+ if (ip_info_list->proxy_addr_item)
+ common_utils_edit_box_focus_set(ip_info_list->proxy_addr_item, EINA_FALSE);
+ if (ip_info_list->proxy_port_item)
+ common_utils_edit_box_focus_set(ip_info_list->proxy_port_item, EINA_FALSE);
+ }
__COMMON_FUNC_EXIT__;
}
return ECORE_CALLBACK_CANCEL;
}
-void common_pswd_popup_pbc_popup_create(pswd_popup_t *pswd_popup_data, Evas_Smart_Cb cancel_cb, void *cancel_cb_data)
+void create_pbc_popup(pswd_popup_t *pswd_popup_data, Evas_Smart_Cb cancel_cb, void *cancel_cb_data)
{
if (!pswd_popup_data) {
return;
return;
}
-pswd_popup_t *common_pswd_popup_create(Evas_Object *win_main, const char *pkg_name, pswd_popup_create_req_data_t *popup_info)
+pswd_popup_t *create_passwd_popup(Evas_Object *win_main,
+ const char *pkg_name, pswd_popup_create_req_data_t *popup_info)
{
__COMMON_FUNC_ENTER__;
pswd_popup_t *pswd_popup_data = g_new0(pswd_popup_t, 1);
if (popup_info->ap) {
- if (WIFI_ERROR_NONE != wifi_ap_clone(&(pswd_popup_data->ap), popup_info->ap)) {
+ if (WIFI_ERROR_NONE !=
+ wifi_ap_clone(&(pswd_popup_data->ap), popup_info->ap)) {
g_free(pswd_popup_data);
+
return NULL;
}
} else {
/* Lets disable the scan updates so that the UI is not refreshed un necessarily */
wlan_manager_disable_scan_result_update();
- popup_btn_info_t popup_btn_data;
+ popup_btn_info_t popup_btn_data;
memset(&popup_btn_data, 0, sizeof(popup_btn_data));
+
popup_btn_data.title_txt = popup_info->title;
popup_btn_data.btn1_cb = popup_info->ok_cb;
popup_btn_data.btn1_data = popup_info->cb_data;
popup_btn_data.btn2_txt = sc(pkg_name, I18N_TYPE_Cancel);
Evas_Object *passpopup = common_utils_show_info_popup(win_main, &popup_btn_data);
+ Evas_Object *eo = elm_layout_edje_get(passpopup);
+ const Evas_Object *po = edje_object_part_object_get(eo, "elm.text.title");
+ Evas_Object *ao = elm_access_object_get(po);
+ elm_access_info_set(ao, ELM_ACCESS_INFO, popup_info->title);
+
Evas_Object *box = elm_box_add(passpopup);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_part_content_set(entry_ly, "elm.swallow.content", entry);
limit_filter_data.max_char_count = 32;
- elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_filter_data);
-
- evas_object_smart_callback_add(entry, "changed", __popup_entry_changed_cb, entry_ly);
- evas_object_smart_callback_add(entry, "focused", __popup_entry_focused_cb, entry_ly);
- evas_object_smart_callback_add(entry, "unfocused", __popup_entry_unfocused_cb, entry_ly);
- elm_object_signal_callback_add(entry_ly, "elm,eraser,clicked", "elm", __popup_eraser_clicked_cb, entry);
+ elm_entry_markup_filter_append(entry,
+ elm_entry_filter_limit_size, &limit_filter_data);
+
+ evas_object_smart_callback_add(entry, "changed",
+ __popup_entry_changed_cb, entry_ly);
+ evas_object_smart_callback_add(entry, "focused",
+ __popup_entry_focused_cb, entry_ly);
+ evas_object_smart_callback_add(entry, "unfocused",
+ __popup_entry_unfocused_cb, entry_ly);
+ elm_object_signal_callback_add(entry_ly, "elm,eraser,clicked",
+ "elm", __popup_eraser_clicked_cb, entry);
evas_object_show(entry);
elm_entry_password_set(entry, EINA_TRUE);
evas_object_size_hint_align_set(btn,
EVAS_HINT_FILL,
EVAS_HINT_FILL);
- evas_object_smart_callback_add(btn, "clicked", popup_info->wps_btn_cb, popup_info->cb_data);
+ evas_object_smart_callback_add(btn, "clicked",
+ popup_info->wps_btn_cb, popup_info->cb_data);
elm_box_pack_end(box, btn);
evas_object_show(btn);
}
elm_object_focus_set(entry, EINA_TRUE);
__COMMON_FUNC_EXIT__;
-
return pswd_popup_data;
}
-char *common_pswd_popup_get_txt(pswd_popup_t *pswd_popup_data)
+char *passwd_popup_get_txt(pswd_popup_t *pswd_popup_data)
{
if (pswd_popup_data)
- return common_utils_entry_layout_get_text(pswd_popup_data->popup_entry_lyt);
+ return common_utils_entry_layout_get_text(
+ pswd_popup_data->popup_entry_lyt);
return NULL;
}
-wifi_ap_h common_pswd_popup_get_ap(pswd_popup_t *pswd_popup_data)
+wifi_ap_h passwd_popup_get_ap(pswd_popup_t *pswd_popup_data)
{
if (pswd_popup_data)
return pswd_popup_data->ap;
return NULL;
}
-void common_pswd_popup_destroy(pswd_popup_t *pswd_popup_data)
+void passwd_popup_free(pswd_popup_t *pswd_popup_data)
{
- if (pswd_popup_data) {
- if (pswd_popup_data->pbc_popup_data) {
- __common_pbc_popup_destroy(pswd_popup_data->pbc_popup_data);
- pswd_popup_data->pbc_popup_data = NULL;
- }
- evas_object_hide(pswd_popup_data->popup);
- evas_object_del(pswd_popup_data->popup);
- pswd_popup_data->popup = NULL;
- pswd_popup_data->popup_entry_lyt = NULL;
- wifi_ap_destroy(pswd_popup_data->ap);
- g_free(pswd_popup_data);
-
- /* A delay is needed to get the smooth Input panel closing animation effect */
- ecore_timer_add(0.1, _enable_scan_updates_cb, NULL);
+ if (pswd_popup_data == NULL)
+ return;
+
+ if (pswd_popup_data->pbc_popup_data) {
+ __common_pbc_popup_destroy(pswd_popup_data->pbc_popup_data);
+ pswd_popup_data->pbc_popup_data = NULL;
}
- return;
+
+ evas_object_hide(pswd_popup_data->popup);
+ evas_object_del(pswd_popup_data->popup);
+ pswd_popup_data->popup = NULL;
+ pswd_popup_data->popup_entry_lyt = NULL;
+
+ wifi_ap_destroy(pswd_popup_data->ap);
+
+ g_free(pswd_popup_data);
+
+ /* A delay is needed to get the smooth Input panel closing animation effect */
+ ecore_timer_add(0.1, _enable_scan_updates_cb, NULL);
}
#include "common_utils.h"
#include "i18nmanager.h"
-#define POPUP_HEAD_AREA 134
-#define POPUP_BUTTON_AREA 80
-
typedef struct {
char *title_str;
char *info_str;
return status_txt;
}
-char *common_utils_get_device_icon(const char *image_path_dir, wifi_device_info_t *device_info)
+void common_utils_get_device_icon(const char *image_path_dir, wifi_device_info_t *device_info, char **icon_path)
{
- char tmp_str[MAX_DEVICE_ICON_PATH_STR_LEN] = {'\0', };
- char *ret;
+ char buf[MAX_DEVICE_ICON_PATH_STR_LEN] = {'\0', };
- g_strlcpy(tmp_str, image_path_dir, sizeof(tmp_str));
- g_strlcat(tmp_str, "/37_wifi_icon", sizeof(tmp_str));
+ g_strlcpy(buf, image_path_dir, sizeof(buf));
+ g_strlcat(buf, "/37_wifi_icon", sizeof(buf));
if (device_info->security_mode != WLAN_SEC_MODE_NONE) {
- g_strlcat(tmp_str, "_lock", sizeof(tmp_str));
+ g_strlcat(buf, "_lock", sizeof(buf));
}
switch (wlan_manager_get_signal_strength(device_info->rssi)) {
case SIGNAL_STRENGTH_TYPE_EXCELLENT:
- g_strlcat(tmp_str, "_03", sizeof(tmp_str));
+ g_strlcat(buf, "_03", sizeof(buf));
break;
case SIGNAL_STRENGTH_TYPE_GOOD:
- g_strlcat(tmp_str, "_02", sizeof(tmp_str));
+ g_strlcat(buf, "_02", sizeof(buf));
break;
case SIGNAL_STRENGTH_TYPE_WEAK:
- g_strlcat(tmp_str, "_01", sizeof(tmp_str));
+ g_strlcat(buf, "_01", sizeof(buf));
break;
case SIGNAL_STRENGTH_TYPE_VERY_WEAK:
case SIGNAL_STRENGTH_TYPE_NULL:
default:
- g_strlcat(tmp_str, "_00", sizeof(tmp_str));
+ g_strlcat(buf, "_00", sizeof(buf));
break;
}
- /* Adding .png to the end of file */
- g_strlcat(tmp_str, ".png", sizeof(tmp_str));
+ if (icon_path) {
+ *icon_path = g_strdup_printf("%s", buf);
+ }
+}
- ret = g_strdup(tmp_str);
- return ret;
+char *common_utils_get_rssi_text(const char *str_pkg_name, int rssi)
+{
+ switch (wlan_manager_get_signal_strength(rssi)) {
+ case SIGNAL_STRENGTH_TYPE_EXCELLENT:
+ return g_strdup(sc(str_pkg_name, I18N_TYPE_Excellent));
+ case SIGNAL_STRENGTH_TYPE_GOOD:
+ return g_strdup(sc(str_pkg_name, I18N_TYPE_Good));
+ default:
+ return g_strdup(sc(str_pkg_name, I18N_TYPE_Week));
+ }
}
Evas_Object *common_utils_entry_layout_get_entry(Evas_Object *layout)
elm_entry_password_set(entry, pswd_set);
}
-void __common_popup_size_get(Ecore_IMF_Context *target_imf, int *width, int *height)
+void common_utils_set_edit_box_imf_panel_evnt_cb(Elm_Object_Item *item,
+ imf_ctxt_panel_cb_t input_panel_cb, void *user_data)
{
__COMMON_FUNC_ENTER__;
+ common_utils_entry_info_t *entry_info;
+ entry_info = elm_object_item_data_get(item);
+ if (!entry_info)
+ return;
- int window_width, window_height;
- int start_x, start_y, imf_width, imf_height;
- int rotate_angle;
- float resize_scale = 0.7f;
-
- rotate_angle = common_utils_get_rotate_angle(APPCORE_RM_UNKNOWN);
- ecore_x_window_size_get(ecore_x_window_root_first_get(), &window_width, &window_height);
-
- *width = window_width;
-
- if (rotate_angle == 0 || rotate_angle == 180)
- {
- *height = window_height * resize_scale;
- }else
- *height = window_width;
-
- if (target_imf != NULL) {
- ecore_imf_context_input_panel_geometry_get(target_imf, &start_x, &start_y, &imf_width, &imf_height);
- *height = start_y * resize_scale;
+ entry_info->input_panel_cb = input_panel_cb;
+ entry_info->input_panel_cb_data = user_data;
+ Evas_Object *entry = common_utils_entry_layout_get_entry(entry_info->layout);
+ Ecore_IMF_Context *imf_ctxt = elm_entry_imf_context_get(entry);
+ if (imf_ctxt && entry_info->input_panel_cb) {
+ /* Deleting the previously attached callback */
+ ecore_imf_context_input_panel_event_callback_del(imf_ctxt,
+ ECORE_IMF_INPUT_PANEL_STATE_EVENT,
+ entry_info->input_panel_cb);
+ ecore_imf_context_input_panel_event_callback_add(imf_ctxt,
+ ECORE_IMF_INPUT_PANEL_STATE_EVENT,
+ entry_info->input_panel_cb,
+ entry_info->input_panel_cb_data);
+ DEBUG_LOG(UG_NAME_NORMAL, "set the imf ctxt cbs");
}
- *height = *height-POPUP_HEAD_AREA-POPUP_BUTTON_AREA;
-
__COMMON_FUNC_EXIT__;
+ return;
}
-void common_utils_set_edit_box_imf_panel_evnt_cb(Elm_Object_Item *item,
- imf_ctxt_panel_cb_t input_panel_cb, void *user_data)
+void common_utils_edit_box_focus_set(Elm_Object_Item *item, Eina_Bool focus_set)
{
__COMMON_FUNC_ENTER__;
common_utils_entry_info_t *entry_info;
if (!entry_info)
return;
- entry_info->input_panel_cb = input_panel_cb;
- entry_info->input_panel_cb_data = user_data;
Evas_Object *entry = common_utils_entry_layout_get_entry(entry_info->layout);
- Ecore_IMF_Context *imf_ctxt = elm_entry_imf_context_get(entry);
- if (imf_ctxt) {
- ecore_imf_context_input_panel_event_callback_add(imf_ctxt, ECORE_IMF_INPUT_PANEL_STATE_EVENT, entry_info->input_panel_cb, entry_info->input_panel_cb_data);
- DEBUG_LOG(UG_NAME_NORMAL, "set the imf ctxt cbs");
- }
+ elm_object_focus_set(entry, focus_set);
__COMMON_FUNC_EXIT__;
return;
char *common_utils_get_list_item_entry_txt(Elm_Object_Item *entry_item)
{
- common_utils_entry_info_t *entry_info = (common_utils_entry_info_t *)elm_object_item_data_get(entry_item);
+ common_utils_entry_info_t *entry_info =
+ (common_utils_entry_info_t *)elm_object_item_data_get(entry_item);
if (entry_info == NULL)
return NULL;
- DEBUG_LOG(UG_NAME_NORMAL, "entry_info = 0x%x", entry_info);
+ DEBUG_LOG(UG_NAME_NORMAL, "entry_info: 0x%x", entry_info);
- if (entry_info->entry_txt)
- return g_strdup(entry_info->entry_txt);
- else
- return NULL;
+ return g_strdup(entry_info->entry_txt);
}
Evas_Object *common_utils_create_radio_button(Evas_Object *parent, const int value)
return layout;
}
+static void __common_utils_del_popup(void *data, Evas_Object *obj, void *event_info)
+{
+ Evas_Object *popup = (Evas_Object *)data;
+ evas_object_del(popup);
+}
+
Evas_Object *common_utils_show_info_popup(Evas_Object *parent, popup_btn_info_t *popup_data)
{
__COMMON_FUNC_ENTER__;
if (popup_data->btn1_cb) {
evas_object_smart_callback_add(btn_1, "clicked", popup_data->btn1_cb, popup_data->btn1_data);
} else { // set the default callback
- evas_object_smart_callback_add(btn_1, "clicked", (Evas_Smart_Cb)evas_object_del, popup);
+ evas_object_smart_callback_add(btn_1, "clicked", __common_utils_del_popup, popup);
}
}
if (popup_data->btn2_txt) {
if (popup_data->btn2_cb) {
evas_object_smart_callback_add(btn_2, "clicked", popup_data->btn2_cb, popup_data->btn2_data);
} else { // set the default callback
- evas_object_smart_callback_add(btn_2, "clicked", (Evas_Smart_Cb)evas_object_del, popup);
+ evas_object_smart_callback_add(btn_2, "clicked", __common_utils_del_popup, popup);
}
}
evas_object_show(popup);
elm_object_text_set(popup, info_text);
elm_popup_timeout_set(popup, timeout);
evas_object_smart_callback_add(popup, "timeout",
- (Evas_Smart_Cb)evas_object_del, popup);
+ __common_utils_del_popup, popup);
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
evas_object_show(popup);
"WEP requires 5, 10, 13, 26 letters for a password.<br>Please, check your input."
#define WPA_WRONG_PASSWORD_LEN_ERR_MSG_STR \
"WPA2 requires 8 - 63 letters for a password.<br>Please, check your input."
-#define FIND_HIDDEN_NETWORK_STR "Find hidden network"
-#define SCREEN_TYPE_ID_KEY "screen_type_id_key"
-#define INVALID_PASSWORD "Your password might be invalid"
+#define WIFI_TETHERING_FAILED_STR \
+ "Wi-Fi tethering enabled. Will you turn Wi-Fi tethering off?"
+#define OPEN_HIDDEN_NETWORK_STR "Wi-Fi network detected. Connect?"
+#define FIND_HIDDEN_NETWORK_STR "Find hidden network"
+#define SCREEN_TYPE_ID_KEY "screen_type_id_key"
+#define INVALID_PASSWORD "Your password might be invalid"
+
+/* Syspopup height for portrait mode*/
+#define DEVICE_PICKER_POPUP_H 880
+
+/* Syspopup height for landscape mode */
+#define DEVICE_PICKER_POPUP_LN_H 480
typedef enum {
VIEW_MANAGER_VIEW_TYPE_MAIN,
#define ERROR_LOG(MID, format, args...) \
SLOG(LOG_ERROR, MID, "\033[41m[%s:%d]\033[0m\033[31m " format "\033[0m", __func__, __LINE__, ##args)
+#define retm_if(expr) do { \
+ if (expr) { \
+ ERROR_LOG(COMMON_NAME_ERR, "[%s(): %d] (%s) [return]", __FUNCTION__, __LINE__, #expr); \
+ return; \
+ } \
+} while (0)
+
+#define retvm_if(expr, val) do { \
+ if (expr) { \
+ ERROR_LOG(COMMON_NAME_ERR, "[%s(): %d] (%s) [return]", __FUNCTION__, __LINE__, #expr); \
+ return (val); \
+ } \
+} while (0)
+
#define assertm_if(expr, fmt, arg...) do { \
if(expr) { \
ERROR_LOG(COMMON_NAME_ERR, " ##(%s) -> %s() assert!!## "fmt, #expr, __FUNCTION__, ##arg); \
+++ /dev/null
-/*
-* Wi-Fi UG
-*
-* 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 __VIEW_DETAIL_DATAMODEL_H_
-#define __VIEW_DETAIL_DATAMODEL_H_
-
-#include "wlan_manager.h"
-
-typedef enum {
- IP_TYPE_NULL,
- IP_TYPE_STATIC_IP,
- IP_TYPE_DHCP_IP,
- IP_TYPE_MAX
-} IP_TYPES;
-
-typedef struct view_datamodel_ip_info view_datamodel_ip_info_t;
-typedef struct view_datamodel_eap_info view_datamodel_eap_info_t;
-typedef struct view_datamodel_basic_info view_datamodel_basic_info_t;
-
-///////////////////////////////////////////////////////////////
-// managing function
-///////////////////////////////////////////////////////////////
-view_datamodel_basic_info_t *view_basic_detail_datamodel_create(const char *profile_name);
-view_datamodel_ip_info_t *view_detail_datamodel_ip_info_create(const char *profile_name);
-view_datamodel_eap_info_t *view_detail_datamodel_eap_info_create(const char *profile_name);
-void view_basic_detail_datamodel_destroy(view_datamodel_basic_info_t *data_object);
-void view_detail_datamodel_ip_info_destroy(view_datamodel_ip_info_t *data_object);
-void view_detail_datamodel_eap_info_destroy(view_datamodel_eap_info_t *data_object);
-///////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////
-// determine it`s changeness
-///////////////////////////////////////////////////////////////
-boolean view_detail_datamodel_save_ip_info_if_modified(const view_datamodel_ip_info_t *data_object);
-boolean view_detail_datamodel_save_eap_info_if_modified(const view_datamodel_eap_info_t *data_object);
-///////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////
-// getter and setter
-///////////////////////////////////////////////////////////////
-int view_detail_datamodel_ip_and_dns_type_set(view_datamodel_ip_info_t *data_object, const IP_TYPES type);
-int view_detail_datamodel_proxy_address_set(view_datamodel_ip_info_t *data_object, const char* proxy);
-int view_detail_datamodel_static_ip_address_set(view_datamodel_ip_info_t *data_object, const char* addr);
-int view_detail_datamodel_static_gateway_address_set(view_datamodel_ip_info_t *data_object, const char* addr);
-int view_detail_datamodel_static_subnet_mask_set(view_datamodel_ip_info_t *data_object, const char* addr);
-int view_detail_datamodel_static_dns1_address_set(view_datamodel_ip_info_t *data_object, const char* addr);
-int view_detail_datamodel_static_dns2_address_set(view_datamodel_ip_info_t *data_object, const char* addr);
-int view_detail_datamodel_eap_ap_name_set(view_datamodel_eap_info_t *data_object, const char *ssid);
-int view_detail_datamodel_eap_method_set(view_datamodel_eap_info_t *data_object, const wlan_eap_type_t eap_method);
-int view_detail_datamodel_eap_provision_set(view_datamodel_eap_info_t *data_object, const int provision);
-int view_detail_datamodel_eap_auth_set(view_datamodel_eap_info_t *data_object, const wlan_eap_auth_type_t auth_type);
-int view_detail_datamodel_eap_user_id_set(view_datamodel_eap_info_t *data_object, const char* user_id);
-int view_detail_datamodel_eap_anonymous_id_set(view_datamodel_eap_info_t *data_object, const char* anonymous_id);
-int view_detail_datamodel_eap_pswd_set(view_datamodel_eap_info_t *data_object, const char* pswd);
-int view_detail_datamodel_eap_ca_cert_set(view_datamodel_eap_info_t *data_object, const char* ca_cert);
-int view_detail_datamodel_eap_user_cert_set(view_datamodel_eap_info_t *data_object, const char* user_cert);
-IP_TYPES view_detail_datamodel_ip_and_dns_type_get(view_datamodel_ip_info_t *data_object);
-char *view_detail_datamodel_static_ip_address_get(view_datamodel_ip_info_t *data_object);
-char *view_detail_datamodel_static_gateway_address_get(view_datamodel_ip_info_t *data_object);
-char *view_detail_datamodel_static_subnet_mask_get(view_datamodel_ip_info_t *data_object);
-char *view_detail_datamodel_static_dns1_address_get(view_datamodel_ip_info_t *data_object);
-char *view_detail_datamodel_static_dns2_address_get(view_datamodel_ip_info_t *data_object);
-char* view_detail_datamodel_proxy_address_get(view_datamodel_ip_info_t *data_object);
-char* view_detail_datamodel_MAC_addr_get(view_datamodel_ip_info_t *data_object);
-
-wlan_eap_type_t view_detail_datamodel_eap_method_get(view_datamodel_eap_info_t *data_object);
-int view_detail_datamodel_eap_provision_get(view_datamodel_eap_info_t *data_object);
-wlan_eap_auth_type_t view_detail_datamodel_eap_auth_get(view_datamodel_eap_info_t *data_object);
-char *view_detail_datamodel_user_id_get(view_datamodel_eap_info_t *data_object);
-char *view_detail_datamodel_anonymous_id_get(view_datamodel_eap_info_t *data_object);
-char *view_detail_datamodel_pswd_get(view_datamodel_eap_info_t *data_object);
-char *view_detail_datamodel_ca_cert_get(view_datamodel_eap_info_t *data_object);
-char *view_detail_datamodel_user_cert_get(view_datamodel_eap_info_t *data_object);
-char *view_detail_datamodel_eap_ap_name_get(view_datamodel_eap_info_t *data_object);
-
-char *view_detail_datamodel_basic_info_profile_name_get(view_datamodel_basic_info_t *data_object);
-char *view_detail_datamodel_ap_name_get(view_datamodel_basic_info_t *data_object);
-unsigned int view_detail_datamodel_sig_strength_get(view_datamodel_basic_info_t *data_object);
-unsigned int view_detail_datamodel_sec_mode_get(view_datamodel_basic_info_t *data_object);
-boolean view_detail_datamodel_is_favourite_get(view_datamodel_basic_info_t *data_object);
-char view_detail_datamodel_wps_support_get(view_datamodel_basic_info_t *data_object);
-///////////////////////////////////////////////////////////////
-
-#endif
#define DISABLE_FAST_EAP_METHOD
typedef struct eap_info_list eap_info_list_t;
-typedef struct common_eap_connect_data common_eap_connect_data_t;
+typedef struct common_eap_connect_data eap_connect_data_t;
-common_eap_connect_data_t *create_eap_connect_view(Evas_Object *win_main, Evas_Object *navi_frame, const char *pkg_name, wifi_device_info_t *device_info);
-common_eap_connect_data_t *create_eap_connect_popup(Evas_Object *win_main, const char *pkg_name, wifi_device_info_t *device_info);
-eap_info_list_t *eap_info_append_items(wifi_ap_h ap, Evas_Object* view_list, const char *str_pkg_name, imf_ctxt_panel_cb_t input_panel_cb, void *input_panel_cb_data);
+eap_connect_data_t *create_eap_view(Evas_Object *win_main,
+ Evas_Object *navi_frame, const char *pkg_name,
+ wifi_device_info_t *device_info);
+eap_connect_data_t *create_eap_popup(Evas_Object *win_main,
+ const char *pkg_name, wifi_device_info_t *device_info);
+
+void eap_connect_data_free(eap_connect_data_t *eap_data);
+
+eap_info_list_t *eap_info_append_items(wifi_ap_h ap, Evas_Object* view_list,
+ const char *str_pkg_name, imf_ctxt_panel_cb_t input_panel_cb,
+ void *input_panel_cb_data);
void eap_info_save_data(eap_info_list_t *eap_info_list_data);
void eap_info_remove(eap_info_list_t *eap_info_list_data);
-void eap_view_close(common_eap_connect_data_t *eap_data);
-void eap_view_rotate_popup(common_eap_connect_data_t *eap_data, int rotate_angle);
+void eap_view_rotate_popup(eap_connect_data_t *eap_data, int rotate_angle);
#ifdef __cplusplus
}
ip_info_list_t *ip_info_append_items(wifi_ap_h ap, const char *pkg_name, Evas_Object *genlist, imf_ctxt_panel_cb_t input_panel_cb, void *input_panel_cb_data);
void ip_info_save_data(ip_info_list_t *ip_info_list);
void ip_info_remove(ip_info_list_t *ip_info_list);
+void ip_info_close_all_keypads(ip_info_list_t *ip_info_list);
#ifdef __cplusplus
}
typedef struct {
char *title;
- Eina_Bool show_wps_btn;
+ Eina_Bool show_wps_btn;
Evas_Smart_Cb ok_cb;
Evas_Smart_Cb cancel_cb;
Evas_Smart_Cb wps_btn_cb;
typedef struct pswd_popup pswd_popup_t;
-pswd_popup_t *common_pswd_popup_create(Evas_Object *win_main, const char *pkg_name, pswd_popup_create_req_data_t *popup_info);
-void common_pswd_popup_pbc_popup_create(pswd_popup_t *pswd_popup_data, Evas_Smart_Cb cancel_cb, void *cancel_cb_data);
-char *common_pswd_popup_get_txt(pswd_popup_t *pswd_popup_data);
-wifi_ap_h common_pswd_popup_get_ap(pswd_popup_t *pswd_popup_data);
-void common_pswd_popup_destroy(pswd_popup_t *pswd_popup_data);
+pswd_popup_t *create_passwd_popup(Evas_Object *win_main, const char *pkg_name,
+ pswd_popup_create_req_data_t *popup_info);
+void create_pbc_popup(pswd_popup_t *pswd_popup_data, Evas_Smart_Cb cancel_cb,
+ void *cancel_cb_data);
+
+void passwd_popup_free(pswd_popup_t *pswd_popup_data);
+
+char *passwd_popup_get_txt(pswd_popup_t *pswd_popup_data);
+wifi_ap_h passwd_popup_get_ap(pswd_popup_t *pswd_popup_data);
#ifdef __cplusplus
}
Evas_Object* genlist, const char *separator_style);
char *common_utils_get_ap_security_type_info_txt(
const char *pkg_name, wifi_device_info_t *device_info);
-char *common_utils_get_device_icon(
- const char *image_path_dir, wifi_device_info_t *device_info);
+void common_utils_get_device_icon(const char *image_path_dir,
+ wifi_device_info_t *device_info, char **icon_path);
+char *common_utils_get_rssi_text(
+ const char *str_pkg_name, int rssi);
Evas_Object *common_utils_entry_layout_get_entry(Evas_Object *layout);
char *common_utils_entry_layout_get_text(Evas_Object *layout);
Evas_Object *common_utils_add_edit_box(Evas_Object *parent,
common_utils_entry_info_t *entry_info);
void common_utils_set_edit_box_imf_panel_evnt_cb(Elm_Object_Item *item,
imf_ctxt_panel_cb_t input_panel_cb, void *user_data);
+void common_utils_edit_box_focus_set(Elm_Object_Item *item, Eina_Bool focus_set);
void common_utils_entry_password_set(Evas_Object *layout, Eina_Bool pswd_set);
Elm_Object_Item *common_utils_add_2_line_txt_disabled_item(
wifi_security_type_e sec_type);
int common_utils_send_message_to_net_popup(const char *title,
const char *content, const char *type, const char *ssid);
-void __common_popup_size_get(Ecore_IMF_Context *target_imf, int *width, int *height);
int common_util_set_system_registry(const char *key, int value);
int common_util_get_system_registry(const char *key);
+++ /dev/null
-/*
-* Wi-Fi UG
-*
-* 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 "common.h"
-#include "wlan_manager.h"
-
-
-typedef struct connman_profile_manager {
- int profile_num;
- net_profile_info_t* profile_table;
-} connman_profile_manager;
-connman_profile_manager *_profile_manager = NULL;
-
-static connman_profile_manager *connman_profile_manager_get_singleton()
-{
- if (_profile_manager == NULL) {
- _profile_manager = (connman_profile_manager *)malloc(sizeof(connman_profile_manager));
- _profile_manager->profile_num = 0;
- _profile_manager->profile_table = NULL;
- }
-
- return _profile_manager;
-}
-
-void connman_profile_manager_destroy()
-{
- if (_profile_manager) {
- if (_profile_manager->profile_table) {
- g_free(_profile_manager->profile_table);
- }
-
- g_free(_profile_manager);
- _profile_manager = NULL;
- }
-}
-
-int connman_profile_manager_profile_cache(int count)
-{
- int *p_num_of_profiles = 0;
- net_profile_info_t** p_profile_table;
- net_profile_info_t* old_profile_table;
- connman_profile_manager *profile_manager = NULL;
-
- INFO_LOG(COMMON_NAME_LIB, "connman_profile_manager_profile_cache");
-
- profile_manager = connman_profile_manager_get_singleton();
- old_profile_table = profile_manager->profile_table;
- profile_manager->profile_table = NULL;
-
- p_num_of_profiles = &(profile_manager->profile_num);
- p_profile_table = &(profile_manager->profile_table);
-
- net_get_profile_list(NET_DEVICE_WIFI, p_profile_table, p_num_of_profiles);
- g_free(old_profile_table);
- if (*p_num_of_profiles == 0) {
- INFO_LOG(COMMON_NAME_LIB, "count = 0");
- } else if (count < *p_num_of_profiles && count > 0) {
- *p_num_of_profiles = count;
- }
-
- INFO_LOG(COMMON_NAME_LIB, "count = %d", *p_num_of_profiles);
-
- return *p_num_of_profiles;
-}
-
-int connman_profile_manager_scanned_profile_table_size_get(void)
-{
- connman_profile_manager *profile_manager = NULL;
- profile_manager = connman_profile_manager_get_singleton();
- return profile_manager->profile_num;
-}
-
-int connman_profile_manager_check_favourite(const char *profile_name, int *favourite)
-{
- net_profile_info_t profile;
-
- int ret = net_get_profile_info(profile_name, &profile);
- if (ret != NET_ERR_NONE) {
- ERROR_LOG(COMMON_NAME_ERR, "Failed - net_get_profile_info : error[%d]", ret);
- return WLAN_MANAGER_ERR_UNKNOWN;
- }
-
- INFO_LOG(COMMON_NAME_LIB, "Favourite = %d", (int)profile.Favourite);
-
- *favourite = (int)profile.Favourite;
- return WLAN_MANAGER_ERR_NONE;
-}
-
-int connman_profile_manager_connected_ssid_set(const char *profile_name)
-{
- INFO_LOG(COMMON_NAME_LIB, "Profile name : %s", profile_name);
-
- net_profile_info_t profile;
- if (net_get_profile_info(profile_name, &profile) != NET_ERR_NONE)
- return FALSE;
-
- wlan_manager_set_connected_AP((const net_profile_info_t *)&profile);
-
- return TRUE;
-}
-
-int connman_profile_manager_disconnected_ssid_set(const char *profile_name)
-{
- INFO_LOG(COMMON_NAME_LIB, "Profile name : %s", profile_name);
-
- const char *connected_profile_name = wlan_manager_get_connected_profile();
- if (connected_profile_name)
- if (strncmp(connected_profile_name, profile_name, strlen(connected_profile_name)) == 0)
- wlan_manager_reset_connected_AP();
-
- return TRUE;
-}
-
-int connman_profile_manager_profile_modify(net_profile_info_t *new_profile)
-{
- int ret = net_modify_profile(new_profile->ProfileName, new_profile);
- if (ret != NET_ERR_NONE) {
- INFO_LOG(COMMON_NAME_ERR, "Failed to modify profile - %d\n", ret);
- return 0;
- }
- else {
- INFO_LOG(COMMON_NAME_LIB, "Succeed to modify profile - %d\n", ret);
- }
-
- return 1;
-}
-
-int connman_profile_manager_profile_modify_auth(const char* profile_name, void *authdata, int secMode)
-{
- if (profile_name == NULL || authdata == NULL)
- return 0;
-
- net_profile_info_t profile;
- if (net_get_profile_info(profile_name, &profile) != NET_ERR_NONE) {
- return 0;
- }
-
- wlan_manager_password_data* auth = (wlan_manager_password_data*)authdata;
- char security_key[NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN+1] = "";
-
- if (auth != NULL) {
- strncpy(security_key, auth->password, NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN);
- DEBUG_LOG(COMMON_NAME_LIB, "security_key [%s]", auth->password);
- }
-
- if (0 < strlen(security_key)) {
- if (secMode == WLAN_SEC_MODE_WEP) {
- INFO_LOG(COMMON_NAME_LIB, "SECURITY_TYPE_WEP");
- strncpy(profile.ProfileInfo.Wlan.security_info.authentication.wep.wepKey,
- security_key,
- NETPM_WLAN_MAX_WEP_KEY_LEN);
- } else {
- INFO_LOG(COMMON_NAME_LIB, "not SECURITY_TYPE_WEP" );
- strncpy(profile.ProfileInfo.Wlan.security_info.authentication.psk.pskKey, security_key,
- NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN);
- profile.ProfileInfo.Wlan.security_info.authentication.psk.pskKey[NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN] = '\0';
- }
- } else {
- INFO_LOG(COMMON_NAME_LIB, "security data <= 0" );
- strncpy(profile.ProfileInfo.Wlan.security_info.authentication.psk.pskKey, security_key,
- NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN);
- }
-
- int ret = net_modify_profile(profile_name, &profile);
- if (ret != NET_ERR_NONE) {
- INFO_LOG(COMMON_NAME_ERR, "Failed to modify profile - %d\n", ret);
- return 0;
- }
- else {
- INFO_LOG(COMMON_NAME_LIB, "Succeed to modify profile - %d\n", ret);
- }
-
- return 1;
-}
-
-void* connman_profile_manager_profile_table_get(void)
-{
- connman_profile_manager *profile_manager = NULL;
- profile_manager = connman_profile_manager_get_singleton();
- return profile_manager->profile_table;
-}
-
-int connman_profile_manager_profile_info_get(const char *profile_name, net_profile_info_t *profile)
-{
- if (profile_name == NULL)
- return 0;
-
- if (net_get_profile_info(profile_name, profile) != NET_ERR_NONE) {
- return 0;
- }
-
- return 1;
-}
int connman_request_scan_mode_set(net_wifi_background_scan_mode_t scan_mode)
{
int ret = net_wifi_set_background_scan_mode(scan_mode);
- INFO_LOG(COMMON_NAME_LIB, "net_wifi_set_background_scan_mode ret: %d", ret);
switch (ret) {
case NET_ERR_NONE:
return WLAN_MANAGER_ERR_NONE;
+
default:
return WLAN_MANAGER_ERR_UNKNOWN;
}
int wifi_set_specific_scan_cb(wifi_specific_scan_finished_cb cb, void *data)
{
__COMMON_FUNC_ENTER__;
+
if (!cb) {
__COMMON_FUNC_EXIT__;
return WIFI_ERROR_INVALID_PARAMETER;
wifi_callbacks.specific_scan_cb = cb;
wifi_callbacks.specific_scan_user_data = data;
- __COMMON_FUNC_EXIT__;
+ __COMMON_FUNC_EXIT__;
return WIFI_ERROR_NONE;
}
int wifi_unset_specific_scan_cb(void)
{
__COMMON_FUNC_ENTER__;
+
if (wifi_callbacks.specific_scan_cb == NULL) {
__COMMON_FUNC_EXIT__;
return WIFI_ERROR_INVALID_OPERATION;
wifi_callbacks.specific_scan_cb = NULL;
wifi_callbacks.specific_scan_user_data = NULL;
- __COMMON_FUNC_EXIT__;
+ __COMMON_FUNC_EXIT__;
return WIFI_ERROR_NONE;
}
-void network_evt_cb(const net_event_info_t* net_event, void* user_data)
+void network_evt_cb(const net_event_info_t *net_event, void *user_data)
{
__COMMON_FUNC_ENTER__;
switch (net_event->Event) {
- case NET_EVENT_SPECIFIC_SCAN_RSP:
- INFO_LOG(COMMON_NAME_LIB, "Callback - NET_EVENT_SPECIFIC_SCAN_RSP");
- if (net_event->Error != NET_ERR_NONE) {
- if (wifi_callbacks.specific_scan_cb)
- wifi_callbacks.specific_scan_cb(WIFI_ERROR_OPERATION_FAILED, NULL, wifi_callbacks.specific_scan_user_data);
- else
- ERROR_LOG(COMMON_NAME_LIB, "Specific scan cb is not set !!!");
- } else {
- INFO_LOG(COMMON_NAME_LIB, "Successfully sent the specific scan request");
- }
- break;
- case NET_EVENT_SPECIFIC_SCAN_IND:
- INFO_LOG(COMMON_NAME_LIB, "Callback - NET_EVENT_SPECIFIC_SCAN_IND");
- if (!wifi_callbacks.specific_scan_cb) {
- ERROR_LOG(COMMON_NAME_LIB, "Specific scan cb is not set !!!");
- } else if (net_event->Error != NET_ERR_NONE) {
- wifi_callbacks.specific_scan_cb(WIFI_ERROR_OPERATION_FAILED, NULL, wifi_callbacks.specific_scan_user_data);
- } else {
- wifi_callbacks.specific_scan_cb(WIFI_ERROR_NONE, net_event->Data, wifi_callbacks.specific_scan_user_data);
- }
- break;
- default:
- INFO_LOG(COMMON_NAME_LIB, "Callback - %d", net_event->Event);
- break;
+ case NET_EVENT_SPECIFIC_SCAN_RSP:
+ INFO_LOG(COMMON_NAME_LIB, "NET_EVENT_SPECIFIC_SCAN_RSP");
+
+ if (wifi_callbacks.specific_scan_cb) {
+ if (net_event->Error != NET_ERR_NONE)
+ wifi_callbacks.specific_scan_cb(
+ WIFI_ERROR_OPERATION_FAILED,
+ NULL,
+ wifi_callbacks.specific_scan_user_data);
+ else
+ INFO_LOG(COMMON_NAME_LIB, "Specific scan request successful");
+ } else {
+ ERROR_LOG(COMMON_NAME_LIB, "Specific scan cb is not set !!!");
+ }
+ break;
+
+ case NET_EVENT_SPECIFIC_SCAN_IND:
+ INFO_LOG(COMMON_NAME_LIB, "SSID scan results");
+
+ if (wifi_callbacks.specific_scan_cb) {
+ if (net_event->Error == NET_ERR_NONE)
+ wifi_callbacks.specific_scan_cb(WIFI_ERROR_NONE,
+ net_event->Data,
+ wifi_callbacks.specific_scan_user_data);
+ else
+ wifi_callbacks.specific_scan_cb(WIFI_ERROR_OPERATION_FAILED,
+ NULL,
+ wifi_callbacks.specific_scan_user_data);
+ }
+ break;
+
+ default:
+ break;
}
__COMMON_FUNC_EXIT__;
+++ /dev/null
-/*
-* Wi-Fi UG
-*
-* 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 __WIFI_CONNMAN_PROFILE_MANAGER_H__
-#define __WIFI_CONNMAN_PROFILE_MANAGER_H_
-
-#include <network-pm-intf.h>
-
-int connman_profile_manager_profile_cache(int count);
-int connman_profile_manager_check_favourite(const char *profile_name, int *favourite);
-int connman_profile_manager_connected_ssid_set(const char *profile_name);
-int connman_profile_manager_disconnected_ssid_set(const char *profile_name);
-int connman_profile_manager_profile_modify(net_profile_info_t *new_profile);
-int connman_profile_manager_profile_modify_auth(const char *profile_name, void *authdata, int secMode);
-void *connman_profile_manager_profile_table_get(void);
-int connman_profile_manager_profile_info_get(const char *profile_name, net_profile_info_t *profile);
-int connman_profile_manager_scanned_profile_table_size_get(void);
-void connman_profile_manager_destroy(void);
-
-#endif
*
*/
-#ifndef __COMMON_INVALID_PASSWORD_H__
-#define __COMMON_INVALID_PASSWORD_H__
+#ifndef __WLAN_ALTERNATIVE_CONNECTION_H__
+#define __WLAN_ALTERNATIVE_CONNECTION_H__
#ifdef __cplusplus
extern "C"
#endif
#include <glib.h>
+#include <wifi.h>
-int _common_register_invalid_password_popup(void);
-int _common_deregister_invalid_password_popup(void);
-
-gboolean _common_is_invalid_password(void);
+int wlan_connect(wifi_ap_h ap, wifi_connected_cb callback, void *user_data);
+void wlan_validate_alt_connection(void);
#ifdef __cplusplus
}
#endif
-#endif /* __COMMON_INVALID_PASSWORD_H__ */
+#endif /* __WLAN_ALTERNATIVE_CONNECTION_H__ */
#include "connman-response.h"
typedef enum {
- WLAN_MANAGER_ERR_NONE = 0,
+ WLAN_MANAGER_ERR_NONE = 0x00,
WLAN_MANAGER_ERR_UNKNOWN,
WLAN_MANAGER_ERR_INVALID_PARAM,
WLAN_MANAGER_ERR_ALREADY_REGISTERED,
WLAN_MANAGER_ERR_CONNECT_PASSWORD_NEEDED,
WLAN_MANAGER_ERR_CONNECT_EAP_SEC_TYPE,
- WLAN_MANAGER_ERR_MOBILE_HOTSPOT_OCCUPIED,
+ WLAN_MANAGER_ERR_WIFI_TETHERING_OCCUPIED,
WLAN_MANAGER_ERR_NOSERVICE,
WLAN_MANAGER_ERR_IN_PROGRESS,
} WLAN_MANAGER_ERR_TYPE;
* It should be merged into one enumerations
*/
typedef enum {
- SECURITY_TYPE_NONE=0x01,
+ SECURITY_TYPE_NONE = 0x01,
SECURITY_TYPE_WEP,
SECURITY_TYPE_WPA_PSK,
SECURITY_TYPE_WPA2_PSK,
* RESPONSES
*/
typedef enum {
- WLAN_MANAGER_RESPONSE_TYPE_NONE,
- WLAN_MANAGER_RESPONSE_TYPE_CONNECTING,
- WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_OK,
- WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_FAIL_IN_PROGRESS,
- WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_FAIL_ABORTED,
- WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_FAIL_ALREADY_EXIST,
- WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_FAIL_TIMEOUT,
- WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_FAIL_UNKNOWN,
- WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_FAIL_UNKNOWN_METHOD,
- WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_CONNECT_FAILED,
- WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_INVALID_KEY,
- WLAN_MANAGER_RESPONSE_TYPE_DISCONNECTION_OK,
- WLAN_MANAGER_RESPONSE_TYPE_POWER_ON_OK,
- WLAN_MANAGER_RESPONSE_TYPE_POWER_ON_NOT_SUPPORTED,
- WLAN_MANAGER_RESPONSE_TYPE_POWER_ON_RESTRICTED,
- WLAN_MANAGER_RESPONSE_TYPE_POWER_OFF_OK,
- WLAN_MANAGER_RESPONSE_TYPE_SCAN_OK,
- WLAN_MANAGER_RESPONSE_TYPE_WPS_ENROLL_OK,
- WLAN_MANAGER_RESPONSE_TYPE_WPS_ENROLL_FAIL,
- WLAN_MANAGER_RESPONSE_TYPE_CANCEL_WPS_ENROLL_OK,
- WLAN_MANAGER_RESPONSE_TYPE_CANCEL_WPS_ENROLL_FAIL,
- WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_IND,
- WLAN_MANAGER_RESPONSE_TYPE_DISCONNECTION_IND,
- WLAN_MANAGER_RESPONSE_TYPE_SCAN_RESULT_IND,
- WLAN_MANAGER_RESPONSE_TYPE_MAC_ID_IND,
- WLAN_MANAGER_RESPONSE_TYPE_SPECIFIC_SCAN_OK,
- WLAN_MANAGER_RESPONSE_TYPE_SPECIFIC_SCAN_FAIL,
- WLAN_MANAGER_RESPONSE_TYPE_SPECIFIC_SCAN_IND,
- WLAN_MANAGER_RESPONSE_TYPE_UPDATE_SIG_STR,
- WLAN_MANAGER_RESPONSE_TYPE_MAX
+ WLAN_MANAGER_RESPONSE_TYPE_NONE = 0x00,
+ WLAN_MANAGER_RESPONSE_TYPE_CONNECTING = 0x01,
+ WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_OK = 0x02,
+ WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_FAIL_IN_PROGRESS = 0x03,
+ WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_FAIL_ABORTED = 0x04,
+ WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_FAIL_ALREADY_EXIST = 0x05,
+ WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_FAIL_TIMEOUT = 0x06,
+ WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_FAIL_UNKNOWN = 0x07,
+ WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_FAIL_UNKNOWN_METHOD = 0x08,
+ WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_CONNECT_FAILED = 0x09,
+ WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_INVALID_KEY = 0x0A,
+ WLAN_MANAGER_RESPONSE_TYPE_DISCONNECTION_OK = 0x0B,
+ WLAN_MANAGER_RESPONSE_TYPE_POWER_ON_OK = 0x0C,
+ WLAN_MANAGER_RESPONSE_TYPE_POWER_ON_NOT_SUPPORTED = 0x0D,
+ WLAN_MANAGER_RESPONSE_TYPE_POWER_ON_RESTRICTED = 0x0E,
+ WLAN_MANAGER_RESPONSE_TYPE_POWER_OFF_OK = 0x0F,
+ WLAN_MANAGER_RESPONSE_TYPE_SCAN_OK = 0x10,
+ WLAN_MANAGER_RESPONSE_TYPE_WPS_ENROLL_OK = 0x11,
+ WLAN_MANAGER_RESPONSE_TYPE_WPS_ENROLL_FAIL = 0x12,
+ WLAN_MANAGER_RESPONSE_TYPE_CANCEL_WPS_ENROLL_OK = 0x13,
+ WLAN_MANAGER_RESPONSE_TYPE_CANCEL_WPS_ENROLL_FAIL = 0x14,
+ WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_IND = 0x15,
+ WLAN_MANAGER_RESPONSE_TYPE_DISCONNECTION_IND = 0x16,
+ WLAN_MANAGER_RESPONSE_TYPE_SCAN_RESULT_IND = 0x17,
+ WLAN_MANAGER_RESPONSE_TYPE_MAC_ID_IND = 0x18,
+ WLAN_MANAGER_RESPONSE_TYPE_SPECIFIC_SCAN_OK = 0x19,
+ WLAN_MANAGER_RESPONSE_TYPE_SPECIFIC_SCAN_FAIL = 0x1A,
+ WLAN_MANAGER_RESPONSE_TYPE_SPECIFIC_SCAN_IND = 0x1B,
+ WLAN_MANAGER_RESPONSE_TYPE_UPDATE_WIFI_RSSI = 0x1C,
+ WLAN_MANAGER_RESPONSE_TYPE_MAX = 0x1D,
} WLAN_MANAGER_RESPONSE_TYPES;
#define WLAN_RSSI_LEVEL_EXCELLENT 64
gboolean is_handled;
} wifi_pending_call_info_t;
-wifi_pending_call_info_t g_pending_call;
+wifi_pending_call_info_t g_pending_call;
typedef struct _wifi_device_info_t {
wifi_ap_h ap;
- char* ssid;
- char* ap_status_txt;
- char* ap_image_path;
+ char *ssid;
+ char *ap_status_txt;
+ char *ap_image_path;
int ipconfigtype;
int rssi;
wlan_security_mode_type_t security_mode;
} wifi_device_info_t;
typedef struct {
- const char* password;
- char* category;
- char* subcategory;
- char* username;
- char* userpassword;
- char* ca_cert_filename;
- char* client_cert_filename;
- char* private_key;
- char* private_key_password;
+ const char *password;
+ char *category;
+ char *subcategory;
+ char *username;
+ char *userpassword;
+ char *ca_cert_filename;
+ char *client_cert_filename;
+ char *private_key;
+ char *private_key_password;
int wlan_eap_type;
} wlan_manager_password_data;
/* it should be implement. */
typedef enum {
- WLAN_MANAGER_ERROR=0x01,
- WLAN_MANAGER_OFF,
- WLAN_MANAGER_UNCONNECTED,
- WLAN_MANAGER_CONNECTED,
- WLAN_MANAGER_CONNECTING,
- WLAN_MANAGER_DISCONNECTING,
- WLAN_MANAGER_MAX
+ WLAN_MANAGER_ERROR = 0x01,
+ WLAN_MANAGER_OFF = 0x02,
+ WLAN_MANAGER_UNCONNECTED = 0x03,
+ WLAN_MANAGER_CONNECTED = 0x04,
+ WLAN_MANAGER_CONNECTING = 0x05,
+ WLAN_MANAGER_MAX = 0x06,
} WLAN_MANAGER_STATES;
typedef void (*wlan_manager_ui_refresh_func_t)(void);
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
-// FUNCTIONS
+// FUNCTIONS
/////////////////////////////////////////////////////////////////
-
-wlan_manager_object* wlan_manager_get_singleton(void);
-void* wlan_manager_create();
-int wlan_manager_destroy();
-int wlan_manager_start();
+wlan_manager_object *wlan_manager_get_singleton(void);
+void *wlan_manager_create(void);
+int wlan_manager_destroy(void);
+int wlan_manager_start(void);
wifi_ap_h wlan_manager_get_ap_with_state(int ap_state);
int wlan_manager_state_get(void);
void wlan_manager_disable_scan_result_update(void);
char *wlan_manager_get_connected_ssid(void);
-// * request
-int wlan_manager_request_connection(wifi_ap_h ap);
-int wlan_manager_request_disconnection(wifi_ap_h ap);
-int wlan_manager_request_wps_connection(wifi_ap_h ap);
-int wlan_manager_request_power_on(void);
-int wlan_manager_request_power_off(void);
-int wlan_manager_request_scan(void);
-
-// * connect, disconnect and forget
+// request
+int wlan_manager_connect(wifi_ap_h ap);
int wlan_manager_connect_with_password(wifi_ap_h ap, const char *pass_phrase);
-int wlan_manager_connect_with_wifi_info(wifi_ap_h ap);
+int wlan_manager_disconnect(wifi_ap_h ap);
+int wlan_manager_wps_connect(wifi_ap_h ap);
+int wlan_manager_power_on(void);
+int wlan_manager_power_off(void);
+int wlan_manager_scan(void);
int wlan_manager_forget(wifi_ap_h ap);
-int wlan_manager_request_specific_scan(const char *ssid, void *data);
+int wlan_manager_scan_with_ssid(const char *ssid, void *data);
int wlan_manager_profile_modify_by_device_info(net_profile_info_t *profiles);
//// profile refresh /////////////////////////////////////////////
void wlan_manager_scanned_profile_refresh(void);
-int wlan_manager_scanned_profile_refresh_with_count(int count);
wifi_device_info_t *wlan_manager_profile_device_info_blank_create(void);
-int wlan_manager_network_syspopup_message(const char *title, const char *content, const char *type);
+void wlan_manager_set_last_scan_time(void);
+time_t wlan_manager_get_last_scan_time(void);
#ifdef __cplusplus
}
--- /dev/null
+/*
+ * Wi-Fi
+ *
+ * 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 "common.h"
+#include "wlan_connection.h"
+
+struct wlan_connection {
+ wifi_ap_h ap;
+ wifi_connected_cb callback;
+ void *user_data;
+};
+
+static struct wlan_connection current_item = { NULL, };
+static struct wlan_connection next_item = { NULL, };
+
+static void wlan_connect_debug(wifi_ap_h ap)
+{
+ char *next_ssid, *ap_ssid;
+
+ wifi_ap_get_essid(ap, &ap_ssid);
+
+ if (next_item.ap == NULL) {
+ ERROR_LOG(UG_NAME_REQ, "%s will be connected", ap_ssid);
+ } else {
+ wifi_ap_get_essid(next_item.ap, &next_ssid);
+
+ ERROR_LOG(UG_NAME_REQ, "%s will be connected (%s replaced)",
+ ap_ssid, next_ssid);
+
+ g_free(next_ssid);
+ }
+
+ g_free(ap_ssid);
+}
+
+static gboolean wlan_is_same_with_next(wifi_ap_h ap)
+{
+ gboolean is_same = FALSE;
+ char *next_ssid, *ap_ssid;
+ wifi_security_type_e next_sec, ap_sec;
+
+ if (next_item.ap == NULL)
+ return FALSE;
+
+ wifi_ap_get_security_type(ap, &ap_sec);
+ wifi_ap_get_security_type(next_item.ap, &next_sec);
+
+ if (ap_sec != next_sec)
+ return is_same;
+
+ wifi_ap_get_essid(ap, &ap_ssid);
+ wifi_ap_get_essid(next_item.ap, &next_ssid);
+
+ if (g_strcmp0(ap_ssid, next_ssid) == 0)
+ is_same = TRUE;
+
+ g_free(ap_ssid);
+ g_free(next_ssid);
+
+ return is_same;
+}
+
+static void wlan_go_fast_next(void)
+{
+ bool favorite = false;
+
+ if (current_item.ap == NULL || next_item.ap == NULL)
+ return;
+
+ wifi_ap_is_favorite(current_item.ap, &favorite);
+ if (favorite == true)
+ return;
+
+ wifi_disconnect(current_item.ap, current_item.callback,
+ current_item.user_data);
+}
+
+static void wlan_update_next(wifi_ap_h ap, wifi_connected_cb callback,
+ void *user_data)
+{
+ if (wlan_is_same_with_next(ap) == TRUE) {
+ wifi_ap_destroy(ap);
+ g_free(user_data);
+
+ return;
+ }
+
+ wlan_connect_debug(ap);
+
+ if (next_item.ap != NULL) {
+ wifi_ap_destroy(next_item.ap);
+ g_free(next_item.user_data);
+ }
+
+ next_item.ap = ap;
+ next_item.callback = callback;
+ next_item.user_data = user_data;
+
+ wlan_go_fast_next();
+}
+
+static void wlan_connect_next(void)
+{
+ current_item.ap = next_item.ap;
+ current_item.callback = next_item.callback;
+ current_item.user_data = next_item.user_data;
+
+ if (next_item.ap == NULL)
+ return;
+
+ next_item.ap = NULL;
+ next_item.callback = NULL;
+ next_item.user_data = NULL;
+
+ wifi_connect(current_item.ap, current_item.callback, current_item.user_data);
+}
+
+int wlan_connect(wifi_ap_h ap, wifi_connected_cb callback, void *user_data)
+{
+ if (current_item.ap == NULL) {
+ current_item.ap = ap;
+ current_item.callback = callback;
+ current_item.user_data = user_data;
+
+ return wifi_connect(ap, callback, user_data);
+ }
+
+ wlan_update_next(ap, callback, user_data);
+
+ return WIFI_ERROR_NONE;
+}
+
+void wlan_validate_alt_connection(void)
+{
+ wifi_connection_state_e state = WIFI_CONNECTION_STATE_DISCONNECTED;
+
+ if (current_item.ap == NULL)
+ return;
+
+ wifi_get_connection_state(&state);
+
+ switch (state) {
+ case WIFI_CONNECTION_STATE_CONNECTED:
+ case WIFI_CONNECTION_STATE_DISCONNECTED:
+ wlan_connect_next();
+ break;
+
+ case WIFI_CONNECTION_STATE_ASSOCIATION:
+ case WIFI_CONNECTION_STATE_CONFIGURATION:
+ wlan_go_fast_next();
+ break;
+ default:
+ break;
+ }
+}
#include "common.h"
#include "wlan_manager.h"
#include "common_utils.h"
+#include "wlan_connection.h"
#include "wifi-engine-callback.h"
-#include "common_invalid_password.h"
typedef enum {
WLAN_MANAGER_REQ_TYPE_ACTIVATE,
static void wlan_manager_register_cbs(void);
static void wlan_manager_deregister_cbs(void);
-static wlan_manager_object* manager_object = NULL;
+static wlan_manager_object *manager_object = NULL;
+static time_t g_last_scan_time = 0;
-wlan_manager_object* wlan_manager_get_singleton(void)
+wlan_manager_object *wlan_manager_get_singleton(void)
{
if (NULL == manager_object) {
manager_object = g_new0(wlan_manager_object, 1);
manager_object->refresh_func = func;
}
-
-void* wlan_manager_create()
+void *wlan_manager_create(void)
{
wlan_manager_get_singleton();
+
return NULL;
}
-int wlan_manager_destroy()
+int wlan_manager_destroy(void)
{
int ret = WLAN_MANAGER_ERR_NONE;
- _common_deregister_invalid_password_popup();
+ wifi_unset_device_state_changed_cb();
wlan_manager_deregister_cbs();
- wifi_deinitialize();
+ ret = wifi_deinitialize();
if (manager_object != NULL) {
g_free(manager_object);
return ret;
}
-int wlan_manager_start()
+int wlan_manager_start(void)
{
__COMMON_FUNC_ENTER__;
+
+ int ret = WLAN_MANAGER_ERR_NONE;
+
switch (wifi_initialize()) {
case WIFI_ERROR_NONE:
/* Register the callbacks */
wlan_manager_register_cbs();
break;
+
case WIFI_ERROR_INVALID_OPERATION:
/* Register the callbacks */
wlan_manager_register_cbs();
- return WLAN_MANAGER_ERR_ALREADY_REGISTERED;
+ ret = WLAN_MANAGER_ERR_ALREADY_REGISTERED;
+ break;
+
default:
- return WLAN_MANAGER_ERR_UNKNOWN;
+ ret = WLAN_MANAGER_ERR_UNKNOWN;
+ break;
}
- return WLAN_MANAGER_ERR_NONE;
+
+ __COMMON_FUNC_EXIT__;
+
+ return ret;
}
int wlan_manager_forget(wifi_ap_h ap)
{
wifi_forget_ap(ap);
+
return WLAN_MANAGER_ERR_NONE;
}
-static void wlan_manager_device_state_changed_cb(wifi_device_state_e state, void *user_data)
+static void wlan_manager_device_state_changed_cb(
+ wifi_device_state_e state, void *user_data)
{
__COMMON_FUNC_ENTER__;
+
wlan_mgr_event_info_t event_info;
memset(&event_info, 0, sizeof(event_info));
+
switch (state) {
case WIFI_DEVICE_STATE_ACTIVATED:
wlan_manager_enable_scan_result_update();
wlan_manager_register_cbs();
event_info.event_type = WLAN_MANAGER_RESPONSE_TYPE_POWER_ON_OK;
break;
+
case WIFI_DEVICE_STATE_DEACTIVATED:
wlan_manager_deregister_cbs();
event_info.event_type = WLAN_MANAGER_RESPONSE_TYPE_POWER_OFF_OK;
break;
+
default:
return;
}
manager_object->message_func(&event_info, user_data);
__COMMON_FUNC_EXIT__;
- return;
}
-static void wlan_manager_connection_state_changed_cb(wifi_connection_state_e state, wifi_ap_h ap, void *user_data)
+static void wlan_manager_connection_state_changed_cb(
+ wifi_connection_state_e state, wifi_ap_h ap, void *user_data)
{
__COMMON_FUNC_ENTER__;
- if (TRUE == manager_object->b_scan_blocked) {
- __COMMON_FUNC_EXIT__;
- return;
- }
-
wlan_mgr_event_info_t event_info;
memset(&event_info, 0, sizeof(event_info));
{
__COMMON_FUNC_ENTER__;
- if (TRUE == manager_object->b_scan_blocked) {
- __COMMON_FUNC_EXIT__;
- return;
- }
-
wlan_mgr_event_info_t event_info;
memset(&event_info, 0, sizeof(event_info));
- event_info.event_type = WLAN_MANAGER_RESPONSE_TYPE_UPDATE_SIG_STR;
+ event_info.event_type = WLAN_MANAGER_RESPONSE_TYPE_UPDATE_WIFI_RSSI;
event_info.rssi_level = rssi_level;
manager_object->message_func(&event_info, user_data);
wlan_mgr_event_info_t event_info;
memset(&event_info, 0, sizeof(event_info));
+ wifi_unset_specific_scan_cb();
+
if (WIFI_ERROR_NONE == error_code) {
event_info.event_type = WLAN_MANAGER_RESPONSE_TYPE_SPECIFIC_SCAN_OK;
event_info.bss_info_list = bss_info_list;
switch (req_data->req_type) {
case WLAN_MANAGER_REQ_TYPE_ACTIVATE:
- if (WIFI_ERROR_NONE == error_code) {
- wlan_manager_enable_scan_result_update();
- wlan_manager_register_cbs();
- event_info.event_type = WLAN_MANAGER_RESPONSE_TYPE_POWER_ON_OK;
- } else
- goto exit;
-
- break;
case WLAN_MANAGER_REQ_TYPE_DEACTIVATE:
- if (WIFI_ERROR_NONE == error_code) {
- wlan_manager_deregister_cbs();
- event_info.event_type = WLAN_MANAGER_RESPONSE_TYPE_POWER_OFF_OK;
- } else
- goto exit;
+ /* We will send POWER_ON_OK / POWER_OFF_OK response when we receive
+ * device state change. Lets just clean up the request data now.
+ */
+ goto exit;
- break;
case WLAN_MANAGER_REQ_TYPE_SCAN:
if (WIFI_ERROR_NONE == error_code)
event_info.event_type = WLAN_MANAGER_RESPONSE_TYPE_SCAN_OK;
goto exit;
break;
+
case WLAN_MANAGER_REQ_TYPE_SPECIFIC_SCAN:
if (WIFI_ERROR_NONE == error_code)
event_info.event_type = WLAN_MANAGER_RESPONSE_TYPE_SPECIFIC_SCAN_OK;
event_info.event_type = WLAN_MANAGER_RESPONSE_TYPE_SPECIFIC_SCAN_FAIL;
break;
+
case WLAN_MANAGER_REQ_TYPE_BG_SCAN:
if (WIFI_ERROR_NONE == error_code) {
event_info.event_type = WLAN_MANAGER_RESPONSE_TYPE_SCAN_RESULT_IND;
}
return; // The request data is static. So returning here.
+
case WLAN_MANAGER_REQ_TYPE_CONNECT:
event_info.ap = req_data->ap;
- _common_deregister_invalid_password_popup();
-
if (WIFI_ERROR_NONE != error_code) {
- if (_common_is_invalid_password() == TRUE)
+ if (error_code == WIFI_ERROR_INVALID_KEY)
event_info.event_type =
WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_INVALID_KEY;
else
goto exit;
break;
+
case WLAN_MANAGER_REQ_TYPE_WPS_CONNECT:
event_info.ap = req_data->ap;
goto exit;
break;
+
default:
goto exit;
}
static void wlan_manager_register_cbs(void)
{
__COMMON_FUNC_ENTER__;
+
wifi_set_device_state_changed_cb(wlan_manager_device_state_changed_cb, NULL);
wifi_set_connection_state_changed_cb(wlan_manager_connection_state_changed_cb, NULL);
wifi_set_rssi_level_changed_cb(wlan_manager_rssi_level_changed_cb, NULL);
static void wlan_manager_deregister_cbs(void)
{
__COMMON_FUNC_ENTER__;
-// wifi_unset_device_state_changed_cb();
+
+ /* NOTE:
+ * We don't deregister the device state change cb here.
+ * We need to continue to listen to the device state change, because it is
+ * possible that the WiFi could be powered on / off from multiple entry
+ * points like example: Quick panel WiFi icon, Wi-Fi UG, Setting Menu.
+ *
+ * We will deregister the device state change cb only on wlan manager
+ * detsroy.
+ */
+
+
wifi_unset_background_scan_cb();
wifi_unset_connection_state_changed_cb();
wifi_unset_rssi_level_changed_cb();
wifi_unset_specific_scan_cb();
connman_request_deregister();
+
__COMMON_FUNC_EXIT__;
}
return ret_val;
}
-int wlan_manager_request_power_on(void)
+int wlan_manager_power_on(void)
{
__COMMON_FUNC_ENTER__;
INFO_LOG(UG_NAME_REQ, "power on");
int ret = 0;
- int hot_spot_mode =
+ int tethering =
common_util_get_system_registry("memory/mobile_hotspot/mode");
- if (hot_spot_mode < 0) {
- INFO_LOG(COMMON_NAME_LIB, "FAILED to get the mobile hotspot mode");
- __COMMON_FUNC_EXIT__;
- return WLAN_MANAGER_ERR_UNKNOWN;
- } else if (VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI & hot_spot_mode) {
- INFO_LOG(COMMON_NAME_LIB, "mobile_hotspot wifi ON");
+ if (tethering < 0)
+ INFO_LOG(COMMON_NAME_LIB, "Fail to get tethering state");
+ else if (VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI & tethering) {
+ INFO_LOG(COMMON_NAME_LIB, "Wi-Fi tethering is ON");
__COMMON_FUNC_EXIT__;
- return WLAN_MANAGER_ERR_MOBILE_HOTSPOT_OCCUPIED;
+ return WLAN_MANAGER_ERR_WIFI_TETHERING_OCCUPIED;
}
- INFO_LOG(UG_NAME_REQ, "Mobile hotspot mode = %d\n", hot_spot_mode);
-
wlan_mgr_req_data_t *req_data = g_new0(wlan_mgr_req_data_t, 1);
req_data->req_type = WLAN_MANAGER_REQ_TYPE_ACTIVATE;
ret = wifi_activate(wlan_manager_network_event_cb, req_data);
if (WIFI_ERROR_NONE != ret) {
ERROR_LOG(UG_NAME_REQ, "Power on request. Error Reason [%d]", ret);
+
g_free(req_data);
+
__COMMON_FUNC_EXIT__;
return WLAN_MANAGER_ERR_UNKNOWN;
}
return WLAN_MANAGER_ERR_NONE;
}
-int wlan_manager_request_power_off(void)
+int wlan_manager_power_off(void)
{
__COMMON_FUNC_ENTER__;
+
wlan_mgr_req_data_t *req_data = g_new0(wlan_mgr_req_data_t, 1);
req_data->req_type = WLAN_MANAGER_REQ_TYPE_DEACTIVATE;
+
int ret = wifi_deactivate(wlan_manager_network_event_cb, req_data);
if (WIFI_ERROR_NONE != ret) {
ERROR_LOG(UG_NAME_REQ, "Power off request. Error Reason [%d]", ret);
+
g_free(req_data);
+
__COMMON_FUNC_EXIT__;
return WLAN_MANAGER_ERR_UNKNOWN;
}
return WLAN_MANAGER_ERR_NONE;
}
-int wlan_manager_request_wps_connection(wifi_ap_h ap)
+int wlan_manager_wps_connect(wifi_ap_h ap)
{
__COMMON_FUNC_ENTER__;
+
wlan_mgr_req_data_t *req_data = g_new0(wlan_mgr_req_data_t, 1);
req_data->req_type = WLAN_MANAGER_REQ_TYPE_WPS_CONNECT;
wifi_ap_clone(&(req_data->ap), ap);
- int ret = wifi_connect_by_wps_pbc(req_data->ap, wlan_manager_network_event_cb, req_data);
+ int ret = wifi_connect_by_wps_pbc(req_data->ap,
+ wlan_manager_network_event_cb, req_data);
if (WIFI_ERROR_NONE != ret) {
ERROR_LOG(UG_NAME_REQ, "WPS Connect failed. Error Reason [%d]", ret);
+
wifi_ap_destroy(req_data->ap);
+
g_free(req_data);
+
__COMMON_FUNC_EXIT__;
return WLAN_MANAGER_ERR_UNKNOWN;
}
return WLAN_MANAGER_ERR_NONE;
}
-int wlan_manager_request_connection(wifi_ap_h ap)
+int wlan_manager_connect(wifi_ap_h ap)
{
__COMMON_FUNC_ENTER__;
- bool favourite;
- int ret = wifi_ap_is_favorite(ap, &favourite);
- wifi_security_type_e sec_type;
- if (WIFI_ERROR_NONE != ret) {
- __COMMON_FUNC_EXIT__;
- return WLAN_MANAGER_ERR_NOSERVICE;
- }
-
- if (false == favourite) {
- if (WIFI_ERROR_NONE != wifi_ap_get_security_type(ap, &sec_type)) {
- __COMMON_FUNC_EXIT__;
- return WLAN_MANAGER_ERR_NOSERVICE;
- }
-
- if (WIFI_SECURITY_TYPE_EAP == sec_type) {
- __COMMON_FUNC_EXIT__;
- return WLAN_MANAGER_ERR_CONNECT_EAP_SEC_TYPE;
- } else if (WIFI_SECURITY_TYPE_NONE == sec_type) {
- /* Allow Open APs to connect */
- } else {
- __COMMON_FUNC_EXIT__;
- return WLAN_MANAGER_ERR_CONNECT_PASSWORD_NEEDED;
- }
- }
+ int ret;
- INFO_LOG(UG_NAME_REQ, "All OK to connect to ap[0x%x]", ap);
+ if (ap == NULL)
+ return WLAN_MANAGER_ERR_NOSERVICE;
wlan_mgr_req_data_t *req_data = g_new0(wlan_mgr_req_data_t, 1);
req_data->req_type = WLAN_MANAGER_REQ_TYPE_CONNECT;
wifi_ap_clone(&(req_data->ap), ap);
- _common_register_invalid_password_popup();
- ret = wifi_connect(req_data->ap, wlan_manager_network_event_cb, req_data);
- if (WIFI_ERROR_NONE != ret) {
- _common_deregister_invalid_password_popup();
-
+ ret = wlan_connect(req_data->ap, wlan_manager_network_event_cb, req_data);
+ if (ret != WIFI_ERROR_NONE) {
ERROR_LOG(UG_NAME_REQ, "Connect failed. Error Reason [%d]", ret);
wifi_ap_destroy(req_data->ap);
g_free(req_data);
-
- __COMMON_FUNC_EXIT__;
- return WLAN_MANAGER_ERR_UNKNOWN;
}
__COMMON_FUNC_EXIT__;
- return WLAN_MANAGER_ERR_NONE;
+ return ret;
}
int wlan_manager_connect_with_password(wifi_ap_h ap, const char *pass_phrase)
{
__COMMON_FUNC_ENTER__;
- if (!ap) {
- ERROR_LOG(UG_NAME_SCAN, "AP handler is NULL");
- return WLAN_MANAGER_ERR_INVALID_PARAM;
- }
-
- int ret = wifi_ap_set_passphrase(ap, pass_phrase);
- if (WIFI_ERROR_NONE != ret) {
- __COMMON_FUNC_EXIT__;
- return WLAN_MANAGER_ERR_UNKNOWN;
- }
-
- wlan_mgr_req_data_t *req_data = g_new0(wlan_mgr_req_data_t, 1);
- req_data->req_type = WLAN_MANAGER_REQ_TYPE_CONNECT;
- wifi_ap_clone(&(req_data->ap), ap);
-
- _common_register_invalid_password_popup();
- ret = wifi_connect(req_data->ap, wlan_manager_network_event_cb, req_data);
- if (WIFI_ERROR_NONE != ret) {
- _common_deregister_invalid_password_popup();
- ERROR_LOG(UG_NAME_REQ, "Connect failed. Error Reason [%d]", ret);
+ int ret;
- wifi_ap_destroy(req_data->ap);
- g_free(req_data);
+ if (ap == NULL)
+ return WLAN_MANAGER_ERR_INVALID_PARAM;
+ ret = wifi_ap_set_passphrase(ap, pass_phrase);
+ if (ret != WIFI_ERROR_NONE) {
__COMMON_FUNC_EXIT__;
- return WLAN_MANAGER_ERR_UNKNOWN;
+ return ret;
}
- __COMMON_FUNC_EXIT__;
- return WLAN_MANAGER_ERR_NONE;
-}
-
-int wlan_manager_connect_with_wifi_info(wifi_ap_h ap)
-{
- __COMMON_FUNC_ENTER__;
-
- int ret;
-
- INFO_LOG(UG_NAME_REQ, "All OK to connect to ap[0x%x]", ap);
-
wlan_mgr_req_data_t *req_data = g_new0(wlan_mgr_req_data_t, 1);
req_data->req_type = WLAN_MANAGER_REQ_TYPE_CONNECT;
wifi_ap_clone(&(req_data->ap), ap);
- _common_register_invalid_password_popup();
- ret = wifi_connect(req_data->ap, wlan_manager_network_event_cb, req_data);
- if (WIFI_ERROR_NONE != ret) {
- _common_deregister_invalid_password_popup();
-
+ ret = wlan_connect(req_data->ap, wlan_manager_network_event_cb, req_data);
+ if (ret != WIFI_ERROR_NONE) {
ERROR_LOG(UG_NAME_REQ, "Connect failed. Error Reason [%d]", ret);
wifi_ap_destroy(req_data->ap);
g_free(req_data);
-
- __COMMON_FUNC_EXIT__;
- return WLAN_MANAGER_ERR_UNKNOWN;
}
__COMMON_FUNC_EXIT__;
- return WLAN_MANAGER_ERR_NONE;
+ return ret;
}
-int wlan_manager_request_disconnection(wifi_ap_h ap)
+int wlan_manager_disconnect(wifi_ap_h ap)
{
__COMMON_FUNC_ENTER__;
+
int ret;
INFO_LOG(UG_NAME_REQ, "Request disconnection for ap [0x%x]", ap);
ret = wifi_disconnect(ap, NULL, NULL);
if (WIFI_ERROR_NONE != ret) {
ERROR_LOG(UG_NAME_REQ, "Disconnect failed. Error Reason [%d]", ret);
+
__COMMON_FUNC_EXIT__;
return WLAN_MANAGER_ERR_UNKNOWN;
}
return WLAN_MANAGER_ERR_NONE;
}
-int wlan_manager_request_scan(void)
+int wlan_manager_scan(void)
{
__COMMON_FUNC_ENTER__;
return ret;
}
-int wlan_manager_request_specific_scan(const char *ssid, void *user_data)
+int wlan_manager_scan_with_ssid(const char *ssid, void *user_data)
{
__COMMON_FUNC_ENTER__;
return ret;
}
-int wlan_manager_scanned_profile_refresh_with_count(int count)
-{
- __COMMON_FUNC_ENTER__;
-
- manager_object->refresh_func();
-
- __COMMON_FUNC_EXIT__;
- return 0;
-}
-
void wlan_manager_scanned_profile_refresh(void)
{
__COMMON_FUNC_ENTER__;
- if (FALSE == manager_object->b_scan_blocked) {
+ if (FALSE == manager_object->b_scan_blocked)
manager_object->refresh_func();
- DEBUG_LOG(COMMON_NAME_LIB, "success profiles update");
- } else {
+ else
manager_object->b_ui_refresh = TRUE;
- DEBUG_LOG(COMMON_NAME_LIB, "Scan update is blocked");
- }
+
+ wlan_manager_set_last_scan_time();
+
__COMMON_FUNC_EXIT__;
}
* Weak: -82 ~ -75 / 38 ~ 45
* Very weak: ~ -83 / ~ 37
*/
- if (rssi >= 57) {
+ if (rssi >= 57)
return SIGNAL_STRENGTH_TYPE_EXCELLENT;
- } else if (rssi >= 46) {
+ else if (rssi >= 46)
return SIGNAL_STRENGTH_TYPE_GOOD;
- } else if (rssi >= 38) {
+ else if (rssi >= 38)
return SIGNAL_STRENGTH_TYPE_WEAK;
- } else {
+ else
return SIGNAL_STRENGTH_TYPE_VERY_WEAK;
- }
}
wifi_device_info_t* wlan_manager_profile_device_info_blank_create()
{
__COMMON_FUNC_ENTER__;
+
wifi_device_info_t *di_s0 = g_new0(wifi_device_info_t, 1);
if (di_s0 == NULL) {
static Eina_Bool _refresh_ui(void *data)
{
manager_object->refresh_func();
+
manager_object->b_scan_blocked = FALSE;
manager_object->b_ui_refresh = FALSE;
+
return ECORE_CALLBACK_CANCEL;
}
void wlan_manager_enable_scan_result_update(void)
{
+ __COMMON_FUNC_ENTER__;
+
if (TRUE == manager_object->b_scan_blocked) {
if (TRUE == manager_object->b_ui_refresh) {
DEBUG_LOG(COMMON_NAME_LIB, "Refresh the UI with last scan update");
- /* We delay the rendering inorder to get smooth effect of popup close */
+ /* Delayed rendering in order to get smooth effect of popup close */
ecore_idler_add(_refresh_ui, NULL);
- } else {
+ } else
manager_object->b_scan_blocked = FALSE;
- }
}
+
+ __COMMON_FUNC_EXIT__;
}
void wlan_manager_disable_scan_result_update(void)
{
+ __COMMON_FUNC_ENTER__;
+
manager_object->b_scan_blocked = TRUE;
+
+ __COMMON_FUNC_EXIT__;
}
char *wlan_manager_get_connected_ssid(void)
{
wifi_ap_h ap;
char *essid = NULL;
+ int ret;
wifi_get_connected_ap(&ap);
if (ap) {
- wifi_ap_get_essid(ap, &essid);
+ ret = wifi_ap_get_essid(ap, &essid);
+ if (ret != WIFI_ERROR_NONE)
+ ERROR_LOG(UG_NAME_REQ, "Power on request. Error Reason [%d]", ret);
}
wifi_ap_destroy(ap);
return essid;
}
+
+void wlan_manager_set_last_scan_time(void)
+{
+ g_last_scan_time = time(NULL);
+ return;
+}
+
+time_t wlan_manager_get_last_scan_time(void)
+{
+ return g_last_scan_time;
+}
#include "common.h"
#include "appcoreWrapper.h"
-void appcore_win_del(void *data, Evas_Object *obj, void *event)
+static void __appcore_win_del(void *data, Evas_Object *obj, void *event)
{
INFO_LOG(UG_NAME_NORMAL, "win_del");
elm_exit();
elm_win_title_set(eo, name);
elm_win_borderless_set(eo, EINA_TRUE);
evas_object_smart_callback_add(eo, "delete,request",
- (Evas_Smart_Cb)appcore_win_del, NULL);
+ __appcore_win_del, NULL);
ecore_x_window_size_get(ecore_x_window_root_first_get(),
&w, &h);
evas_object_resize(eo, w, h);
#include <Evas.h>
-void appcore_win_del(void *data, Evas_Object *obj, void *event);
Evas_Object* appcore_create_win(const char *name);
Evas_Object* appcore_load_edj(Evas_Object *parent, const char *file,const char *group);
return apply_i18n(pkg_name, I18N_MODE_SELF_MADE, "IDS_COM_BODY_PHASE_2_AUTHENTICATION");
case I18N_TYPE_Activating_WiFi:
return apply_i18n(pkg_name, I18N_MODE_SELF_MADE, "IDS_WIFI_POP_ACTIVATING_WI_FI_ING");
+ case I18N_TYPE_Unchanged:
+ return apply_i18n(pkg_name, I18N_MODE_SELF_MADE, "IDS_ST_BODY_HUNCHANGED");
case I18N_TYPE_WPA_PSK:
return apply_i18n(pkg_name, I18N_MODE_NO_NEEDED, "WPA-PSK");
case I18N_TYPE_WPA2_PSK:
I18N_TYPE_Button_Cancel,
I18N_TYPE_Ssid,
I18N_TYPE_Find_Hidden_Network,
+ I18N_TYPE_Unchanged,
/* etc */
I18N_TYPE_DNS_1,
+++ /dev/null
-/*
-* Wi-Fi UG
-*
-* 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 _WIFI_SETTING_H_
-#define _WIFI_SETTING_H_
-
-#include <vconf-keys.h>
-
-#define WIFI_SETTING_WIFI_CONNECTED_AP_NAME VCONFKEY_WIFI_CONNECTED_AP_NAME
-
-int wifi_setting_value_set(const char *key, int value);
-int wifi_setting_value_get(const char *key);
-
-int wifi_setting_key_notify_set();
-
-#endif //_WIFI_SETTING_H_
+++ /dev/null
-/*
-* Wi-Fi UG
-*
-* 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 <vconf.h>
-#include "wifi-setting.h"
-#include "common.h"
-
-int wifi_setting_value_set(const char *key, int value)
-{
- __COMMON_FUNC_ENTER__;
-
- INFO_LOG(UG_NAME_NORMAL, "setting value : %d\n", value);
-
- if (vconf_set_int(key, value) < 0) {
- ERROR_LOG(UG_NAME_NORMAL, "Failed to set vconf\n");
- __COMMON_FUNC_EXIT__;
- return -1;
- }
-
- __COMMON_FUNC_EXIT__;
- return 0;
-}
-
-int wifi_setting_value_get(const char *key)
-{
- __COMMON_FUNC_ENTER__;
-
- int value = 0;
- if (vconf_get_int(key, &value) < 0) {
- ERROR_LOG(UG_NAME_NORMAL, "Failed to get vconf\n");
- __COMMON_FUNC_EXIT__;
- return -1;
- }
-
- __COMMON_FUNC_EXIT__;
- return value;
-}
-
-static void wifi_flight_mode_changed(keynode_t* node, void* user_data)
-{
- INFO_LOG(UG_NAME_NORMAL, "Airplane mode [%s] \n", node);
- return;
-}
-
-static void mobile_hotspot_status(keynode_t* node, void* user_data)
-{
- INFO_LOG(UG_NAME_NORMAL, "MobileAP mode [%s] \n", node);
-}
-
-int wifi_setting_key_notify_set()
-{
- vconf_notify_key_changed(VCONFKEY_SETAPPL_FLIGHT_MODE_BOOL, (vconf_callback_fn) wifi_flight_mode_changed, NULL);
- vconf_notify_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE, (vconf_callback_fn) mobile_hotspot_status, NULL);
-
- return TRUE;
-}
-
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(ug-wifi-efl-UG C)
-# defines
+# defines
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX "\${prefix}")
SET(LIBDIR "\${prefix}/lib")
SET(VERSION 0.1.0)
# source files
-SET(SRCS
+SET(SRCS
../libraries/i18nManager/i18nmanager.c
../libraries/appcoreWrapper/appcoreWrapper.c
- ../libraries/WlanManager/wlan-manager/wlan_manager.c
+ ../libraries/WlanManager/WlanManager/wlan_manager.c
+ ../libraries/WlanManager/WlanManager/wlan_connection.c
../libraries/Common/common_utils.c
../libraries/Common/common_ip_info.c
../libraries/Common/common_pswd_popup.c
../libraries/Common/common_eap_connect.c
- ../libraries/Common/common_invalid_password.c
${ENGINE_SOURCES}
wifi-efl-UG.c
- viewers-layout/viewer_manager.c
+ viewers-layout/viewer_manager.c
viewers-layout/wifi_viewer_list.c
viewers-layout/view_detail.c
viewers-layout/view_ime_hidden.c
ADD_CUSTOM_TARGET(custom_editfield.edj
COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images
- ${CMAKE_CURRENT_SOURCE_DIR}/edcs/custom_editfield.edc ${CMAKE_CURRENT_SOURCE_DIR}/edcs/custom_editfield.edj
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/edcs/custom_editfield.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/edcs/custom_editfield.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/edcs/custom_editfield.edj
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/edcs/custom_editfield.edc
)
ADD_DEPENDENCIES(${PROJECT_NAME} custom_editfield.edj)
-
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/ug/lib)
# install image files
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images/ DESTINATION /usr/ug/res/images/wifi-efl-UG FILES_MATCHING PATTERN "*.png")
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/edcs/custom_editfield.edj DESTINATION /usr/ug/res/edje/wifi-efl-UG)
-
+++ /dev/null
-collections {
- group {
- name: "fake_radio";
- parts {
- part { name: "radio";
- type: SWALLOW;
- scale: 1;
- description {
- state: "default" 0.0;
- fixed: 0 0;
- min: 48 48;
- align: 0.0 0.0;
- rel1 { relative: 0 0; offset: 10 0; }
- rel2 { relative: 1 1; offset: -10 0; }
- }
- }
- part { name: "image";
- type: RECT;
- scale: 1;
- description {
- state: "default" 0.0;
- fixed: 0 0;
- min: 48 48;
- align: 0.0 0.0;
- rel1 { relative: 0 0; offset: 10 0; }
- rel2 { relative: 1 1; offset: -10 0; }
- color: 0 0 0 0;
- }
- }
-
- }
- }
-}
char *rbutton_setup_wizard_next;
char *rbutton_setup_wizard_skip;
popup_manager_object_t *popup_manager;
- common_eap_connect_data_t *eap_view;
+ eap_connect_data_t *eap_view;
} wifi_appdata ;
-int wifi_exit();
+int wifi_exit(void);
#ifdef __cplusplus
}
#include "viewer_manager.h"
-//////// genlist struct data ////////////////////////////////////////////////////////////////////
typedef struct {
wifi_device_info_t *device_info;
VIEWER_ITEM_RADIO_MODES radio_mode;
+ gboolean highlighted;
} ug_genlist_data_t;
-/////////////////////////////////////////////////////////////////////////////////////////////
-
-Evas_Object* viewer_list_create(Evas_Object *win);
+Evas_Object *viewer_list_create(Evas_Object *win);
int viewer_list_destroy(void);
-void viewer_list_title_item_del();
-void viewer_list_title_item_update();
-
-////////////////////////////////////////////////////////////////////////////////////////////////
+void viewer_list_title_item_del(void);
+void viewer_list_title_item_update(void);
//////// list item add / remove ///////////////////////////////////////////////////////////////
-int viewer_list_title_item_set(void);
-int viewer_list_item_radio_mode_set(Elm_Object_Item* item, VIEWER_ITEM_RADIO_MODES mode);
-Elm_Object_Item* viewer_list_item_insert_after(wifi_ap_h ap, Elm_Object_Item *after);
-Elm_Object_Item* viewer_list_get_first_item(void);
+void viewer_list_title_item_set(void);
+int viewer_list_item_radio_mode_set(Elm_Object_Item* item,
+ VIEWER_ITEM_RADIO_MODES mode);
+Elm_Object_Item *viewer_list_item_insert_after(wifi_ap_h ap,
+ Elm_Object_Item *after);
+Elm_Object_Item *viewer_list_get_first_item(void);
void viewer_list_item_clear(void);
////////////////////////////////////////////////////////////////////////////////////////////////
//////// item iteration /////////////////////////////////////////////////////////////////////////
int viewer_list_item_size_get(void);
void viewer_list_item_del(Elm_Object_Item *item);
-Elm_Object_Item* viewer_list_item_first_get(Evas_Object* list);
-Elm_Object_Item* viewer_list_item_next_get(const Elm_Object_Item* current);
-Elm_Object_Item* viewer_list_item_at_index(int index);
+Elm_Object_Item *viewer_list_item_first_get(Evas_Object* list);
+Elm_Object_Item *viewer_list_item_next_get(const Elm_Object_Item* current);
+Elm_Object_Item *viewer_list_item_at_index(int index);
/////////////////////////////////////////////////////////////////////////////////////////////////
//////// item control /////////////////////////////////////////////////////////////////////////
void viewer_list_item_disable_all(void);
//////////////////////////////////////////////////////////////////////////////////////////////////
-Elm_Object_Item* item_get_for_ap(wifi_ap_h ap);
+Elm_Object_Item *item_get_for_ap(wifi_ap_h ap);
Elm_Object_Item *item_get_for_ssid(const char* ssid, int *num_aps);
-void viewer_list_item_move_connected_ap_to_top(const Elm_Object_Item *connected_item);
#ifdef __cplusplus
}
#include "wlan_manager.h"
typedef enum {
- HEADER_MODE_OFF=0x01,
+ HEADER_MODE_OFF = 0x01,
HEADER_MODE_ON,
HEADER_MODE_ACTIVATING,
HEADER_MODE_CONNECTING,
HEADER_MODE_CONNECTED,
- HEADER_MODE_DISCONNECTING,
HEADER_MODE_DEACTIVATING,
- HEADER_MODE_CANCEL_CONNECTING,
HEADER_MODE_SEARCHING,
HEADER_MODE_MAX
} HEADER_MODES;
typedef enum {
- VIEWER_ITEM_RADIO_MODE_OFF = 0,
+ VIEWER_ITEM_RADIO_MODE_OFF = 0x01,
VIEWER_ITEM_RADIO_MODE_CONNECTED,
VIEWER_ITEM_RADIO_MODE_CONNECTING,
- VIEWER_ITEM_RADIO_MODE_CANCEL_CONNECTING,
- VIEWER_ITEM_RADIO_MODE_WPS_CONNECTING,
- VIEWER_ITEM_RADIO_MODE_DISCONNECTING,
VIEWER_ITEM_RADIO_MODE_MAX
-
} VIEWER_ITEM_RADIO_MODES;
typedef enum {
VIEWER_WINSET_SUB_CONTENTS
} VIEWER_WINSETS;
-Evas_Object* viewer_manager_create(Evas_Object* parent);
-Eina_Bool viewer_manager_destroy();
+Evas_Object *viewer_manager_create(Evas_Object *parent);
+Eina_Bool viewer_manager_destroy(void);
Eina_Bool viewer_manager_show(VIEWER_WINSETS winset);
Eina_Bool viewer_manager_hide(VIEWER_WINSETS winset);
Eina_Bool viewer_manager_refresh(void);
-int power_control();
+void power_control(void);
+
+void viewer_manager_update_hidden_btn(void);
+Evas_Object *viewer_manager_get_naviframe(void);
-int viewer_manager_hidden_disable_set(int mode);
-Evas_Object *viewer_manager_get_naviframe();
-int viewer_manager_header_mode_set(HEADER_MODES mode);
+void viewer_manager_header_mode_set(HEADER_MODES new_mode);
HEADER_MODES viewer_manager_header_mode_get(void);
-void viewer_manager_scroll_to_top(void);
+
Elm_Object_Item *viewer_manager_move_item_to_top(Elm_Object_Item *item);
-void viewer_manager_specific_scan_response_hlr(
- GSList *bss_info_list, void *user_data);
-void viewer_manager_update_ap_handle(Elm_Object_Item *item, wifi_ap_h ap);
-void viewer_manager_update_connected_ap_sig_str(void);
+void viewer_manager_specific_scan_response_hlr(GSList *bss_info_list,
+ void *user_data);
+void viewer_manager_refresh_ap_info(Elm_Object_Item *item);
+void viewer_manager_update_rssi(void);
#ifdef __cplusplus
}
+++ /dev/null
-/*
-* Wi-Fi UG
-*
-* 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 __WIFI_CALLBACKS_H_
-#define __WIFI_CALLBACKS_H_
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-void radio_button_cb(void *data, Evas_Object *obj, void *event_info);
-void list_select_cb(void *data, Evas_Object *obj, void *event_info);
-void eap_view_close_cb(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+++ /dev/null
-/*
-* Wi-Fi UG
-*
-* 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 __NEW_WIFI_H_
-#define __NEW_WIFI_H_
-
-#define TARGET
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-#include "common.h"
-#include "common_pswd_popup.h"
-#include "view_ime_hidden.h"
-#include "common_eap_connect.h"
-#include "winset_popup.h"
-#include "wlan_manager.h"
-#include "viewer_manager.h"
-#include <ui-gadget-module.h>
-
-#define PACKAGE "ug-wifi-efl-UG"
-#define LOCALEDIR "/usr/ug/res/locale"
-#define CUSTOM_EDITFIELD_PATH "/usr/ug/res/edje/wifi-efl-UG/custom_editfield.edj"
-
-#define WIFI_APP_IMAGE_DIR FACTORYFS"/res/images/wifi-efl-UG"
-#define WIFI_APP_ICON_PATH_SCAN WIFI_APP_IMAGE_DIR"/01_controlbar_icon_update.png"
-#define WIFI_APP_ICON_PATH_DONE WIFI_APP_IMAGE_DIR"/01_controlbar_icon_edit.png"
-#define WIFI_APP_ICON_PATH_FORGET WIFI_APP_IMAGE_DIR"/01_controlbar_icon_delete.png"
-
-#define UG_CALLER "caller"
-#define UG_MAIN_MESSAGE_DESTROY 1
-
-typedef enum {
- UG_VIEW_DEFAULT = 0,
- UG_VIEW_SETUP_WIZARD
-} UG_TYPE;
-
-typedef struct {
- /* ui gadget object */
- void* gadget;
- ui_gadget_h ug;
-
- //Basic Evas_Objects
- Evas_Object *win_main;
- Evas *evas;
- pswd_popup_t *passpopup;
- hiddep_ap_popup_data_t *hidden_ap_popup;
-
- UG_TYPE ug_type;
- Eina_Bool bAlive;
-
- char *lbutton_setup_wizard_prev;
- char *rbutton_setup_wizard_next;
- char *rbutton_setup_wizard_skip;
- popup_manager_object_t *popup_manager;
- common_eap_connect_data_t *eap_view;
-} wifi_appdata ;
-
-int wifi_exit();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __WIFI_H_ */
-
-
typedef enum {
POPUP_OPTION_NONE = 0X01,
- POPUP_OPTION_REGISTER_FAILED_COMMUNICATION_FAILED,
- POPUP_OPTION_POWER_ON_FAILED_MOBILE_HOTSPOT,
+ POPUP_OPTION_POWER_ON_FAILED_TETHERING_OCCUPIED,
POPUP_OPTION_CONNECTING_FAILED,
POPUP_OPTION_HIDDEN_AP_SSID_LEN_ERROR,
POPUP_OPTION_WEP_PSWD_LEN_ERROR,
*
*/
-#include "sensor.h"
+#include <vconf.h>
+#include <sensor.h>
+#include <vconf-keys.h>
+
+#include "common.h"
+#include "wlan_manager.h"
#include "motion_control.h"
#include "viewer_manager.h"
-#include "wlan_manager.h"
-#include "vconf.h"
#include "wifi-engine-callback.h"
static int motion_handle = -1;
static void __motion_shake_cb(unsigned int event_type, sensor_event_data_t *event_data, void *data)
{
- int vconf_value = 0;
+ int scan_result;
+ int motion_activated = 0;
+ HEADER_MODES current_state;
- vconf_get_bool(VCONFKEY_SETAPPL_MOTION_ACTIVATION, &vconf_value);
- if(vconf_value != 1)
+ vconf_get_bool(VCONFKEY_SETAPPL_MOTION_ACTIVATION, &motion_activated);
+ if(motion_activated != 1)
return;
- vconf_get_bool(VCONFKEY_SETAPPL_USE_SHAKE, &vconf_value);
- if(vconf_value != 1)
+ vconf_get_bool(VCONFKEY_SETAPPL_USE_SHAKE, &motion_activated);
+ if(motion_activated != 1)
return;
- HEADER_MODES header_mode = viewer_manager_header_mode_get();
+ current_state = viewer_manager_header_mode_get();
- switch(header_mode) {
+ switch(current_state) {
case HEADER_MODE_OFF:
power_control();
- viewer_manager_show(VIEWER_WINSET_SEARCHING);
break;
+
case HEADER_MODE_ON:
case HEADER_MODE_CONNECTED:
- if (WLAN_MANAGER_ERR_NONE == wlan_manager_request_scan()) {
- viewer_manager_show(VIEWER_WINSET_SEARCHING);
- viewer_manager_header_mode_set(HEADER_MODE_SEARCHING);
+ viewer_manager_show(VIEWER_WINSET_SEARCHING);
+ viewer_manager_header_mode_set(HEADER_MODE_SEARCHING);
+
+ scan_result = wlan_manager_scan();
+ if (scan_result != WLAN_MANAGER_ERR_NONE) {
+ viewer_manager_hide(VIEWER_WINSET_SEARCHING);
+ viewer_manager_header_mode_set(current_state);
}
break;
+
default:
break;
}
///////////////////////////////////////////////////////////////
// implementation
///////////////////////////////////////////////////////////////
-
-static char* _view_detail_grouptitle_text_get(void *data, Evas_Object *obj, const char *part)
+static char *_view_detail_grouptitle_text_get(void *data,
+ Evas_Object *obj, const char *part)
{
__COMMON_FUNC_ENTER__;
+
+ retvm_if(NULL == part, NULL);
+
char *ret = NULL;
- assertm_if(NULL == obj, "NULL!!");
- assertm_if(NULL == part, "NULL!!");
- assertm_if(NULL == data, "NULL!!");
- view_detail_data *detail_data = (view_detail_data *)data;
if (!strncmp(part, "elm.text.2", strlen(part))) {
ret = (char*) g_strdup(sc(PACKAGE, I18N_TYPE_Name));
} else if (!strncmp(part, "elm.text.1", strlen(part))) {
- wifi_ap_get_essid(detail_data->ap, &ret);
+ view_detail_data *detail_data = (view_detail_data *)data;
+ retvm_if(NULL == detail_data, NULL);
+
+ if (wifi_ap_get_essid(detail_data->ap, &ret) != WIFI_ERROR_NONE)
+ ret = NULL;
}
__COMMON_FUNC_EXIT__;
static Evas_Object *_view_detail_grouptitle_content_get(void *data, Evas_Object *obj, const char *part)
{
+ retvm_if(NULL == data || NULL == part, NULL);
+
view_detail_data *detail_data = (view_detail_data *)data;
Evas_Object* icon = NULL;
- assertm_if(NULL == obj, "NULL!!");
- assertm_if(NULL == data, "NULL!!");
- assertm_if(NULL == part, "NULL!!");
if (detail_data->ap_image_path == NULL) {
/* if there is no ap_image_path (NO AP Found situation) */
} else if (!strncmp(part, "elm.icon", strlen(part))) {
/* for strength */
icon = elm_image_add(obj);
- assertm_if(NULL == icon, "NULL!!");
+ retvm_if(NULL == icon, NULL);
+
elm_image_file_set(icon, detail_data->ap_image_path, NULL);
}
static void _remove_all(view_detail_data *_detail_data)
{
__COMMON_FUNC_ENTER__;
+
if(_detail_data) {
if (_detail_data->eap_info_list) {
eap_info_remove(_detail_data->eap_info_list);
g_free(_detail_data->ap_image_path);
g_free(_detail_data);
+
_detail_data = NULL;
}
__COMMON_FUNC_EXIT__;
}
+static gboolean __forget_wifi_ap(gpointer data)
+{
+ __COMMON_FUNC_ENTER__;
+
+ wifi_ap_h ap = (wifi_ap_h)data;
+
+ wlan_manager_forget(ap);
+
+ wifi_ap_destroy(ap);
+
+ __COMMON_FUNC_EXIT__;
+ return FALSE;
+}
+
static void ok_cb(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
- if(view_detail_end == TRUE) {
+
+ wifi_ap_h ap = NULL;
+ view_detail_data *_detail_data;
+
+ if (view_detail_end == TRUE)
return;
- }
+
view_detail_end = TRUE;
- view_detail_data *_detail_data = (view_detail_data *)data;
- assertm_if(NULL == _detail_data, "NULL!!");
+ _detail_data = (view_detail_data *)data;
+ retm_if(NULL == _detail_data);
+
+ wifi_ap_clone(&ap, _detail_data->ap);
evas_object_del(_detail_data->forget_confirm_popup);
_detail_data->forget_confirm_popup = NULL;
- wlan_manager_forget(_detail_data->ap);
+
_remove_all(_detail_data);
+
elm_naviframe_item_pop(viewer_manager_get_naviframe());
+ g_idle_add(__forget_wifi_ap, (gpointer)ap);
+
__COMMON_FUNC_EXIT__;
- return;
}
static void cancel_cb(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
+
view_detail_data *_detail_data = (view_detail_data *)data;
- assertm_if(NULL == _detail_data, "NULL!!");
+ retm_if(NULL == _detail_data);
+
evas_object_del(_detail_data->forget_confirm_popup);
_detail_data->forget_confirm_popup = NULL;
+
__COMMON_FUNC_EXIT__;
}
static void forget_sk_cb(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
+
view_detail_data *_detail_data = (view_detail_data *)data;
- assertm_if(NULL == _detail_data, "NULL!!");
+ retm_if(NULL == _detail_data);
if (!_detail_data->forget_confirm_popup) {
popup_btn_info_t popup_data;
}
view_detail_end = TRUE;
view_detail_data *_detail_data = (view_detail_data *)data;
- assertm_if(NULL == _detail_data, "NULL!!");
+ retm_if(NULL == _detail_data);
if (_detail_data->eap_info_list)
eap_info_save_data(_detail_data->eap_info_list);
view_detail_end = TRUE;
view_detail_data *_detail_data = (view_detail_data *)data;
- assertm_if(NULL == _detail_data, "NULL!!");
+ retm_if(NULL == _detail_data);
if (_detail_data->eap_info_list)
eap_info_save_data(_detail_data->eap_info_list);
{
__COMMON_FUNC_ENTER__;
- bool favourite = 0;
+ bool favorite = 0;
wifi_ap_h ap;
static Elm_Genlist_Item_Class grouptitle_itc;
if (device_info == NULL) {
- ERROR_LOG(UG_NAME_NORMAL, "Failed : device_info is NULL");
+ ERROR_LOG(UG_NAME_NORMAL, "Failed: device_info is NULL");
return;
}
Evas_Object *layout = NULL;
Evas_Object* navi_frame = viewer_manager_get_naviframe();
if (navi_frame == NULL) {
- ERROR_LOG(UG_NAME_NORMAL, "Failed : get naviframe");
+ ERROR_LOG(UG_NAME_NORMAL, "Failed to get naviframe");
return;
}
view_detail_end = FALSE;
view_detail_data *_detail_data = g_new0(view_detail_data, 1);
- assertm_if(NULL == _detail_data, "NULL!!");
+ retm_if(NULL == _detail_data);
_detail_data->ap = ap = device_info->ap;
- wifi_ap_is_favorite(ap, &favourite);
+ wifi_ap_is_favorite(ap, &favorite);
_detail_data->ap_image_path = g_strdup(device_info->ap_image_path);
layout = common_utils_create_layout(navi_frame);
evas_object_show(layout);
- Evas_Object* detailview_list = elm_genlist_add(layout);
+ Evas_Object *detailview_list = elm_genlist_add(layout);
+ retm_if(NULL == detailview_list);
+
elm_object_style_set(detailview_list, "dialogue");
- assertm_if(NULL == detailview_list, "NULL!!");
_detail_data->view_detail_list = detailview_list;
grouptitle_itc.item_style = "dialogue/2text.1icon.5";
_detail_data->win = win_main;
- if (favourite) {
+ if (favorite) {
/* Toolbar Forget button */
Evas_Object* forget_button = elm_button_add(navi_frame);
elm_object_style_set(forget_button, "naviframe/toolbar/default");
if (WIFI_SECURITY_TYPE_EAP == type) {
wifi_connection_state_e connection_state;
wifi_ap_get_connection_state(ap, &connection_state);
- if (favourite || WIFI_CONNECTION_STATE_CONNECTED == connection_state) {
+ if (favorite || WIFI_CONNECTION_STATE_CONNECTED == connection_state) {
_detail_data->eap_info_list = eap_info_append_items(ap, detailview_list, PACKAGE, __view_detail_imf_ctxt_evnt_cb, navi_it);
}
}
/* A delay is needed to get the smooth Input panel closing animation effect */
ecore_timer_add(0.1, _enable_scan_updates_cb, NULL);
-
- return;
}
-static void view_hidden_ap_popup_ok_cb(void *data, Evas_Object *obj, void *event_info)
+static void view_hidden_ap_popup_ok_cb(
+ void *data, Evas_Object *obj, void *event_info)
{
hiddep_ap_popup_data_t *popup_data = (hiddep_ap_popup_data_t *)data;
- char *entry_txt = common_utils_entry_layout_get_text(popup_data->popup_entry_lyt);
- if (WLAN_MANAGER_ERR_NONE != wlan_manager_request_specific_scan(entry_txt, entry_txt)) {
+
+ char *entry_txt = common_utils_entry_layout_get_text(
+ popup_data->popup_entry_lyt);
+
+ if (WLAN_MANAGER_ERR_NONE != wlan_manager_scan_with_ssid(entry_txt, entry_txt)) {
char *disp_msg = g_strdup_printf("Unable to find %s", entry_txt);
+
common_utils_show_info_ok_popup(popup_data->win, popup_data->str_pkg_name, disp_msg);
+
g_free(disp_msg);
g_free(entry_txt);
+
view_hidden_ap_popup_destroy(popup_data);
} else {
-
- /* Show progress idication popup */
+ /* Show progress indication popup */
popup_data->progress_popup = common_utils_show_info_ok_popup(popup_data->win, popup_data->str_pkg_name, "Please Wait...");
evas_object_del(popup_data->popup);
/* A delay is needed to get the smooth Input panel closing animation effect */
ecore_timer_add(0.1, _enable_scan_updates_cb, NULL);
}
-
- return;
}
static void view_hidden_ap_popup_cancel_cb(void *data, Evas_Object *obj, void *event_info)
{
- hiddep_ap_popup_data_t *hidden_ap_popup_data = (hiddep_ap_popup_data_t *)data;
+ hiddep_ap_popup_data_t *hidden_ap_popup_data;
+
+ hidden_ap_popup_data = (hiddep_ap_popup_data_t *)data;
view_hidden_ap_popup_destroy(hidden_ap_popup_data);
- return;
}
static Eina_Bool _enable_scan_updates_cb(void *data)
} hidden_ap_data_t;
typedef struct viewer_manager_object {
- Evas_Object* nav;
- Evas_Object* scan_button;
- Evas_Object* next_button;
- Evas_Object* prev_button;
- Evas_Object* list;
+ Evas_Object *nav;
+ Evas_Object *scan_button;
+ Evas_Object *next_button;
+ Evas_Object *prev_button;
+ Evas_Object *list;
Elm_Object_Item *item_hidden_btn;
Elm_Object_Item *item_sep_above_hidden_button;
Elm_Object_Item *item_sep_below_hidden_button;
- char* header_text;
+ char *header_text;
HEADER_MODES header_mode;
- Elm_Object_Item* item_header;
+ Elm_Object_Item *item_header;
+ Elm_Object_Item *item_bottom;
} viewer_manager_object;
typedef struct {
- Evas_Object* list;
+ Evas_Object *list;
Elm_Object_Item *last_appended_item;
int total_items_added;
} view_manager_list_update_info_t;
-static viewer_manager_object* manager_object = NULL;
+static viewer_manager_object *manager_object = NULL;
extern wifi_appdata *ug_app_state;
static Elm_Genlist_Item_Class bottom_itc_helper_text;
static Elm_Genlist_Item_Class hidden_button_itc;
-int power_control()
+void power_control(void)
{
__COMMON_FUNC_ENTER__;
INFO_LOG(UG_NAME_NORMAL, "current state %d\n", cur_state);
- int ret = TRUE;
+ int ret;
switch (cur_state) {
case HEADER_MODE_OFF:
case HEADER_MODE_ACTIVATING:
- INFO_LOG(UG_NAME_NORMAL, "wifi state power off/powering off");
-
- ret = wlan_manager_request_power_on();
+ ret = wlan_manager_power_on();
switch (ret){
- case WLAN_MANAGER_ERR_NONE:
- INFO_LOG(UG_NAME_NORMAL, "power on ok");
- viewer_manager_header_mode_set(HEADER_MODE_ACTIVATING);
- break;
- case WLAN_MANAGER_ERR_MOBILE_HOTSPOT_OCCUPIED:
- viewer_manager_header_mode_set(HEADER_MODE_ACTIVATING);
- winset_popup_mode_set(ug_app_state->popup_manager, POPUP_OPTION_POWER_ON_FAILED_MOBILE_HOTSPOT, NULL);
- break;
- case WLAN_MANAGER_ERR_IN_PROGRESS:
- /* Do nothing */
- break;
- default:
- viewer_manager_header_mode_set(HEADER_MODE_OFF);
- INFO_LOG(UG_NAME_NORMAL, "power on failed. ret = %d", ret);
- break;
+ case WLAN_MANAGER_ERR_NONE:
+ viewer_manager_show(VIEWER_WINSET_SEARCHING);
+ viewer_manager_header_mode_set(HEADER_MODE_ACTIVATING);
+ break;
+
+ case WLAN_MANAGER_ERR_WIFI_TETHERING_OCCUPIED:
+ winset_popup_mode_set(ug_app_state->popup_manager,
+ POPUP_OPTION_POWER_ON_FAILED_TETHERING_OCCUPIED, NULL);
+ break;
+
+ case WLAN_MANAGER_ERR_IN_PROGRESS:
+ /* Do nothing */
+ break;
+
+ default:
+ viewer_manager_header_mode_set(HEADER_MODE_OFF);
+ INFO_LOG(UG_NAME_NORMAL, "power on failed. ret = %d", ret);
+ break;
}
+
break;
case HEADER_MODE_ON:
case HEADER_MODE_CONNECTING:
- case HEADER_MODE_DISCONNECTING:
- case HEADER_MODE_CANCEL_CONNECTING:
case HEADER_MODE_CONNECTED:
case HEADER_MODE_SEARCHING:
-
viewer_list_item_clear();
- INFO_LOG(UG_NAME_NORMAL, "wifi state power on/connected");
- ret = wlan_manager_request_power_off();
+
+ ret = wlan_manager_power_off();
switch (ret) {
case WLAN_MANAGER_ERR_NONE:
viewer_manager_show(VIEWER_WINSET_SEARCHING);
viewer_manager_hide(VIEWER_WINSET_SUB_CONTENTS);
viewer_manager_header_mode_set(HEADER_MODE_DEACTIVATING);
- wlan_manager_disable_scan_result_update(); // Lets ignore all the scan updates because we are powering off now.
+
+ // Lets ignore all the scan updates because we are powering off now.
+ wlan_manager_disable_scan_result_update();
break;
+
case WLAN_MANAGER_ERR_IN_PROGRESS:
/* Do nothing */
break;
+
default:
INFO_LOG(UG_NAME_NORMAL, "power off failed. ret = %d", ret);
break;
}
+
break;
case HEADER_MODE_DEACTIVATING:
}
__COMMON_FUNC_EXIT__;
- return TRUE;
}
static void _hide_finished_cb(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
- view_manager_view_type_t top_view_id =
- (view_manager_view_type_t)evas_object_data_get(obj,
- SCREEN_TYPE_ID_KEY);
+ view_manager_view_type_t top_view_id;
+
+ top_view_id = (view_manager_view_type_t)evas_object_data_get(
+ obj, SCREEN_TYPE_ID_KEY);
if (data == elm_naviframe_top_item_get(obj)) {
/* We are now in main view */
- evas_object_data_set(obj, SCREEN_TYPE_ID_KEY, (void *)VIEW_MANAGER_VIEW_TYPE_MAIN);
+ evas_object_data_set(obj, SCREEN_TYPE_ID_KEY,
+ (void *)VIEW_MANAGER_VIEW_TYPE_MAIN);
top_view_id = VIEW_MANAGER_VIEW_TYPE_MAIN;
}
switch(top_view_id) {
case VIEW_MANAGER_VIEW_TYPE_MAIN:
ug_app_state->eap_view = NULL;
+
/* Lets enable the scan updates */
wlan_manager_enable_scan_result_update();
break;
__COMMON_FUNC_EXIT__;
}
-static Eina_Bool __scan_request(void *data)
-{
- int ret = WLAN_MANAGER_ERR_NONE;
-
- ret = wlan_manager_request_scan();
- if (ret == WLAN_MANAGER_ERR_NONE) {
- viewer_manager_show(VIEWER_WINSET_SEARCHING);
- viewer_manager_header_mode_set(HEADER_MODE_SEARCHING);
- } else
- INFO_LOG(COMMON_NAME_ERR, "Manual scan failed. Err = %d", ret);
-
- return ECORE_CALLBACK_CANCEL;
-}
-
static void __refresh_scan_callback(void *data,
Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
- int cur_state = -1;
- cur_state = viewer_manager_header_mode_get();
+ int scan_result;
+ HEADER_MODES current_state;
+ current_state = viewer_manager_header_mode_get();
- switch (cur_state) {
+ switch (current_state) {
case HEADER_MODE_DEACTIVATING:
case HEADER_MODE_OFF:
power_control();
- viewer_manager_show(VIEWER_WINSET_SEARCHING);
break;
case HEADER_MODE_ON:
case HEADER_MODE_CONNECTED:
- ecore_idler_add(__scan_request, NULL);
+ viewer_manager_show(VIEWER_WINSET_SEARCHING);
+ viewer_manager_header_mode_set(HEADER_MODE_SEARCHING);
+
+ scan_result = wlan_manager_scan();
+ if (scan_result != WLAN_MANAGER_ERR_NONE) {
+ viewer_manager_hide(VIEWER_WINSET_SEARCHING);
+ viewer_manager_header_mode_set(current_state);
+ }
break;
default:
- INFO_LOG(UG_NAME_NORMAL, "Manual scan requested in wrong state: %d",
- cur_state);
break;
}
__COMMON_FUNC_ENTER__;
- if (manager_object == NULL)
- return NULL;
+ retvm_if(NULL == manager_object, NULL);
if (!strncmp(part, "elm.text", strlen(part))) {
det = g_strdup(manager_object->header_text);
return det;
}
-static void _gl_header_sel_cb(void *data, Evas_Object *obj, void *event_info)
+static void __gl_power_onoff_cb(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
- const HEADER_MODES header_mode = viewer_manager_header_mode_get();
- if (HEADER_MODE_ACTIVATING != header_mode && HEADER_MODE_DEACTIVATING != header_mode)
- power_control();
- elm_genlist_item_update(manager_object->item_header);
+ Elm_Object_Item *item;
+ const char *object_type;
+ HEADER_MODES current_mode;
- elm_genlist_item_selected_set(manager_object->item_header, EINA_FALSE);
+ item = (Elm_Object_Item *)event_info;
+ object_type = evas_object_type_get(obj);
+ current_mode = viewer_manager_header_mode_get();
+
+ if (current_mode == HEADER_MODE_ACTIVATING ||
+ current_mode == HEADER_MODE_DEACTIVATING) {
+ elm_genlist_item_selected_set(item, EINA_FALSE);
+ __COMMON_FUNC_EXIT__;
+ return;
+ }
+
+ if (g_strcmp0(object_type, "elm_check") == 0) {
+ Eina_Bool check_mode = elm_check_state_get(obj);
+
+ if (check_mode == TRUE && current_mode == HEADER_MODE_OFF)
+ power_control();
+ else if (check_mode != TRUE && current_mode != HEADER_MODE_OFF)
+ power_control();
+ } else if (g_strcmp0(object_type, "elm_genlist") == 0) {
+ power_control();
+ }
+
+ if (item) {
+ elm_genlist_item_update(item);
+ elm_genlist_item_selected_set(item, EINA_FALSE);
+ }
__COMMON_FUNC_EXIT__;
- return;
}
-static Evas_Object *_gl_header_content_get(void *data, Evas_Object *obj, const char *part)
+static Evas_Object *_gl_header_content_get(void *data,
+ Evas_Object *obj, const char *part)
{
+ __COMMON_FUNC_ENTER__;
+
if (manager_object == NULL)
return NULL;
Evas_Object *icon = NULL;
-
- __COMMON_FUNC_ENTER__;
+ Evas_Object *ao = NULL;
if (!strncmp(part, "elm.icon", strlen(part))) {
switch (manager_object->header_mode) {
case HEADER_MODE_OFF:
- /* Show WiFi off indication button */
+ /* Wi-Fi off indication button */
icon = elm_check_add(obj);
elm_object_style_set(icon, "on&off");
- evas_object_propagate_events_set(icon, EINA_TRUE);
+ evas_object_propagate_events_set(icon, EINA_FALSE);
elm_check_state_set(icon, EINA_FALSE);
- evas_object_smart_callback_add(icon, "changed", _gl_header_sel_cb, NULL);//item_data);
+ evas_object_smart_callback_add(icon, "changed",
+ __gl_power_onoff_cb, NULL);
evas_object_show(icon);
+
+ ao = elm_object_item_access_object_get(manager_object->item_header);
+ elm_access_info_set(ao, ELM_ACCESS_TYPE, "on/off button");
+ elm_access_info_set(ao, ELM_ACCESS_STATE, "off");
break;
case HEADER_MODE_ACTIVATING:
case HEADER_MODE_DEACTIVATING:
- /* Dont display the WiFi on/off indication while it is Activating/Deactivating */
+ /* Progress animation */
icon = elm_progressbar_add(obj);
elm_object_style_set(icon, "list_process");
evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, 0.5);
- evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_weight_set(icon,
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_progressbar_pulse(icon, TRUE);
break;
- default: /* Show WiFi on indication button */
+ default:
+ /* Wi-Fi on indication button */
icon = elm_check_add(obj);
elm_object_style_set(icon, "on&off");
- evas_object_propagate_events_set(icon, EINA_TRUE);
- evas_object_smart_callback_add(icon, "changed", _gl_header_sel_cb, NULL);//item_data);
+ evas_object_propagate_events_set(icon, EINA_FALSE);
elm_check_state_set(icon, EINA_TRUE);
+ evas_object_smart_callback_add(icon, "changed",
+ __gl_power_onoff_cb, NULL);
evas_object_show(icon);
+
+ ao = elm_object_item_access_object_get(manager_object->item_header);
+ elm_access_info_set(ao, ELM_ACCESS_TYPE, "on/off button");
+ elm_access_info_set(ao, ELM_ACCESS_STATE, "on");
break;
}
}
static char *_gl_bottom_text_get(void *data, Evas_Object *obj, const char *part)
{
- char* det = NULL;
-
__COMMON_FUNC_ENTER__;
+ char *det = NULL;
+
if (!strncmp(part, "elm.text", strlen(part))) {
det = g_strdup(sc(PACKAGE, I18N_TYPE_Network_notification));
assertm_if(NULL == det, "NULL!!");
static char *_gl_bottom_helper_text_get(void *data, Evas_Object *obj, const char *part)
{
- char* det = NULL;
-
__COMMON_FUNC_ENTER__;
+ char *det = NULL;
+
det = g_strdup(sc(PACKAGE, I18N_TYPE_Network_notify_me_later));
__COMMON_FUNC_EXIT__;
return det;
}
-static void _gl_bottom_sel_cb(void *data, Evas_Object *obj, void *event_info)
+static void __gl_net_notification_onoff_cb(void *data,
+ Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
- int ret = -1;
- int bottom_ret = (int)elm_check_state_get(obj);
- Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+ int value;
+ Elm_Object_Item *item;
+ const char *object_type;
- INFO_LOG(UG_NAME_NORMAL, "bottom state[%d] is different", bottom_ret);
+ item = (Elm_Object_Item *)event_info;
+ object_type = evas_object_type_get(obj);
- ret = common_util_get_system_registry(VCONFKEY_WIFI_ENABLE_QS);
- switch (ret) {
- case 1:
- common_util_set_system_registry(VCONFKEY_WIFI_ENABLE_QS,
- VCONFKEY_WIFI_QS_DISABLE);
- break;
+ value = common_util_get_system_registry(VCONFKEY_WIFI_ENABLE_QS);
- case 0:
- common_util_set_system_registry(VCONFKEY_WIFI_ENABLE_QS,
- VCONFKEY_WIFI_QS_ENABLE);
- break;
+ if (g_strcmp0(object_type, "elm_check") == 0) {
+ Eina_Bool check_enable = elm_check_state_get(obj);
- default:
- ERROR_LOG(UG_NAME_NORMAL, "Failed to get VCONFKEY_WIFI_ENABLE_QS");
- break;
+ common_util_set_system_registry(VCONFKEY_WIFI_ENABLE_QS,
+ (int)check_enable);
+ } else if (g_strcmp0(object_type, "elm_genlist") == 0) {
+ if (value == VCONFKEY_WIFI_QS_ENABLE)
+ value = VCONFKEY_WIFI_QS_DISABLE;
+ else
+ value = VCONFKEY_WIFI_QS_ENABLE;
+
+ common_util_set_system_registry(VCONFKEY_WIFI_ENABLE_QS, value);
}
elm_genlist_item_update(item);
__COMMON_FUNC_EXIT__;
}
-static Evas_Object *_gl_bottom_content_get(void *data, Evas_Object *obj, const char *part)
+static Evas_Object *_gl_bottom_content_get(void *data,
+ Evas_Object *obj, const char *part)
{
__COMMON_FUNC_ENTER__;
+ int ret;
+
if (manager_object == NULL || obj == NULL)
return NULL;
- int ret = -1;
-
+ Evas_Object *ao = NULL;
Evas_Object *toggle_btn = elm_check_add(obj);
- assertm_if(NULL == toggle_btn, "NULL!!");
+ retvm_if(NULL == toggle_btn, NULL);
+
elm_object_style_set(toggle_btn, "on&off");
- evas_object_propagate_events_set(toggle_btn, EINA_TRUE);
+ evas_object_propagate_events_set(toggle_btn, EINA_FALSE);
+
ret = common_util_get_system_registry(VCONFKEY_WIFI_ENABLE_QS);
switch (ret) {
- case 1:
- elm_check_state_set(toggle_btn, EINA_TRUE);
- break;
- case 0:
- elm_check_state_set(toggle_btn, EINA_FALSE);
- break;
- default:
- assertm_if(TRUE, "Setting fail!!");
- break;
+ case 1:
+ ao = elm_object_item_access_object_get(manager_object->item_bottom);
+ elm_access_info_set(ao, ELM_ACCESS_TYPE, "on/off button");
+ elm_access_info_set(ao, ELM_ACCESS_STATE, "on");
+ elm_check_state_set(toggle_btn, EINA_TRUE);
+ break;
+ case 0:
+ ao = elm_object_item_access_object_get(manager_object->item_bottom);
+ elm_access_info_set(ao, ELM_ACCESS_TYPE, "on/off button");
+ elm_access_info_set(ao, ELM_ACCESS_STATE, "off");
+ elm_check_state_set(toggle_btn, EINA_FALSE);
+ break;
+ default:
+ ERROR_LOG(COMMON_NAME_ERR, "Setting fail!!");
+ break;
}
+ evas_object_smart_callback_add(toggle_btn, "changed",
+ __gl_net_notification_onoff_cb, NULL);
+
__COMMON_FUNC_EXIT__;
return toggle_btn;
}
elm_object_style_set(find_hidden_ap_btn, "style2");
elm_object_text_set(find_hidden_ap_btn, sc(PACKAGE, I18N_TYPE_Find_Hidden_Network));
+ switch (viewer_manager_header_mode_get()) {
+ case HEADER_MODE_ACTIVATING:
+ case HEADER_MODE_CONNECTING:
+ case HEADER_MODE_DEACTIVATING:
+ case HEADER_MODE_SEARCHING:
+ elm_object_disabled_set(find_hidden_ap_btn, EINA_TRUE);
+ break;
+ default:
+ elm_object_disabled_set(find_hidden_ap_btn, EINA_FALSE);
+ break;
+ }
+
return find_hidden_ap_btn;
}
-static int viewer_manager_header_create(Evas_Object* genlist)
+static void __viewer_manager_header_create(Evas_Object* genlist)
{
__COMMON_FUNC_ENTER__;
+
manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Wi_Fi));
header_itc_text.item_style = "dialogue/1text.1icon";
common_utils_add_dialogue_separator(genlist, "dialogue/separator");
- assertm_if(NULL != manager_object->item_header, "ERROR!!");
- manager_object->item_header = elm_genlist_item_append(genlist, &header_itc_text, NULL, NULL, ELM_GENLIST_ITEM_NONE, _gl_header_sel_cb, NULL);
- assertm_if(NULL == manager_object->item_header, "NULL!!");
+ assertm_if(NULL != manager_object->item_header, "Header item already set");
+ manager_object->item_header = elm_genlist_item_append(genlist,
+ &header_itc_text, NULL, NULL, ELM_GENLIST_ITEM_NONE,
+ __gl_power_onoff_cb, NULL);
+ assertm_if(NULL == manager_object->item_header, "Header item NULL");
common_utils_add_dialogue_separator(genlist, "dialogue/separator");
__COMMON_FUNC_EXIT__;
- return TRUE;
}
-static int viewer_manager_bottom_create(Evas_Object* genlist)
+static void __viewer_manager_bottom_create(Evas_Object* genlist)
{
__COMMON_FUNC_ENTER__;
+
assertm_if(NULL == genlist, "NULL!!");
bottom_itc_text.item_style = "dialogue/1text.1icon";
bottom_itc_helper_text.func.state_get = NULL;
bottom_itc_helper_text.func.del = NULL;
- elm_genlist_item_append(genlist, &bottom_itc_text, NULL, NULL, ELM_GENLIST_ITEM_NONE, _gl_bottom_sel_cb, NULL);
+ manager_object->item_bottom = elm_genlist_item_append(genlist, &bottom_itc_text, NULL, NULL,
+ ELM_GENLIST_ITEM_NONE, __gl_net_notification_onoff_cb, NULL);
elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
- Elm_Object_Item *item = elm_genlist_item_append(genlist, &bottom_itc_helper_text, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ Elm_Object_Item *item = elm_genlist_item_append(genlist,
+ &bottom_itc_helper_text, NULL, NULL,
+ ELM_GENLIST_ITEM_NONE, NULL, NULL);
elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
common_utils_add_dialogue_separator(genlist, "dialogue/separator");
__COMMON_FUNC_EXIT__;
-
- return TRUE;
}
static int viewer_manager_hidden_button_create(Evas_Object* genlist)
manager_object->item_sep_above_hidden_button = common_utils_add_dialogue_separator(genlist, "dialogue/separator");
manager_object->item_hidden_btn = elm_genlist_item_append(genlist, &hidden_button_itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- assertm_if(NULL == manager_object->item_hidden_btn, "NULL!!");
+ assertm_if(NULL == manager_object->item_hidden_btn, "Hidden button is NULL");
manager_object->item_sep_below_hidden_button = common_utils_add_dialogue_separator(genlist, "dialogue/separator");
{
__COMMON_FUNC_ENTER__;
- if(NULL == manager_object) {
+ if (NULL == manager_object) {
__COMMON_FUNC_EXIT__;
return EINA_FALSE;
}
- if (show_state == EINA_TRUE) {
- Evas_Object* navi_frame = viewer_manager_get_naviframe();
- view_manager_view_type_t top_view_id = (view_manager_view_type_t)evas_object_data_get(navi_frame, SCREEN_TYPE_ID_KEY);
- if(VIEW_MANAGER_VIEW_TYPE_MAIN == top_view_id) {
- INFO_LOG(UG_NAME_NORMAL,"Show directly");
- elm_object_item_disabled_set((Elm_Object_Item *)manager_object->scan_button, EINA_FALSE);
- } else {
- INFO_LOG(UG_NAME_NORMAL,"Show reserve");
- }
- } else if (show_state == EINA_FALSE) {
- elm_object_item_disabled_set((Elm_Object_Item *)manager_object->scan_button, EINA_TRUE);
- }
+ /* TODO: need to check VIEW_MANAGER_VIEW_TYPE_MAIN ?
+ * Evas_Object* navi_frame = viewer_manager_get_naviframe();
+ * view_manager_view_type_t top_view_id =
+ * (view_manager_view_type_t)evas_object_data_get(navi_frame,
+ * SCREEN_TYPE_ID_KEY);
+ */
- __COMMON_FUNC_EXIT__;
+ if (show_state == EINA_TRUE)
+ elm_object_disabled_set(manager_object->scan_button, EINA_FALSE);
+ else if (show_state == EINA_FALSE)
+ elm_object_disabled_set(manager_object->scan_button, EINA_TRUE);
+ __COMMON_FUNC_EXIT__;
return EINA_TRUE;
}
{
__COMMON_FUNC_ENTER__;
- if (manager_object != NULL || _parent == NULL) {
- __COMMON_FUNC_EXIT__;
- return NULL;
- }
+ retvm_if(NULL != manager_object || NULL == _parent, NULL);
manager_object = g_new0(viewer_manager_object, 1);
+ retvm_if(NULL == manager_object, NULL);
/* Add Full Layout */
Evas_Object *layout = elm_layout_add(_parent);
elm_layout_theme_set(layout, "layout", "application", "default");
evas_object_size_hint_weight_set(layout,
EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(_parent, layout);
edje_object_signal_emit(elm_layout_edje_get(layout),
"elm,state,show,content", "elm");
edje_object_signal_emit(elm_layout_edje_get(layout),
/* Add Naviframe */
manager_object->nav = elm_naviframe_add(layout);
+ assertm_if(NULL == manager_object->nav, "manager_object->nav is NULL");
elm_object_part_content_set(layout,
"elm.swallow.content", manager_object->nav);
edje_object_signal_emit(elm_layout_edje_get(view_content),
"elm,bg,show,group_list", "elm");
- /* Add Genlist */
+ /* Add genlist */
manager_object->list = viewer_list_create(view_content);
- assertm_if(NULL == manager_object->list, "manager_object->list is NULL!!");
- viewer_manager_header_create(manager_object->list);
- viewer_manager_bottom_create(manager_object->list);
+ assertm_if(NULL == manager_object->list, "manager_object->list is NULL");
+ __viewer_manager_header_create(manager_object->list);
+ __viewer_manager_bottom_create(manager_object->list);
elm_object_part_content_set(view_content,
"elm.swallow.content", manager_object->list);
{
__COMMON_FUNC_ENTER__;
- assertm_if(NULL == manager_object, "NULL!!");
+ assertm_if(NULL == manager_object, "Manager object is NULL");
switch (winset) {
case VIEWER_WINSET_SEARCHING:
viewer_manager_scan_button_set(EINA_FALSE);
viewer_list_item_disable_all();
break;
+
case VIEWER_WINSET_SUB_CONTENTS:
- assertm_if(NULL == manager_object->list, "NULL!!");
+ assertm_if(NULL == manager_object->list, "List is NULL");
+
viewer_list_title_item_set();
viewer_manager_hidden_button_create(manager_object->list);
break;
+
+ default:
+ break;
}
__COMMON_FUNC_EXIT__;
viewer_manager_scan_button_set(EINA_TRUE);
viewer_list_item_enable_all();
break;
+
case VIEWER_WINSET_SUB_CONTENTS:
/* hidden AP and WPS PBC */
if (ug_app_state->passpopup) {
- common_pswd_popup_destroy(ug_app_state->passpopup);
+ passwd_popup_free(ug_app_state->passpopup);
ug_app_state->passpopup = NULL;
}
+
if (ug_app_state->eap_view) {
- eap_view_close(ug_app_state->eap_view);
+ eap_connect_data_free(ug_app_state->eap_view);
ug_app_state->eap_view = NULL;
}
+
viewer_list_title_item_del();
- assertm_if(NULL == manager_object->item_sep_above_hidden_button, "NULL!!");
- assertm_if(NULL == manager_object->item_sep_below_hidden_button, "NULL!!");
- assertm_if(NULL == manager_object->item_hidden_btn, "NULL!!");
+
elm_object_item_del(manager_object->item_sep_above_hidden_button);
elm_object_item_del(manager_object->item_sep_below_hidden_button);
elm_object_item_del(manager_object->item_hidden_btn);
+
manager_object->item_sep_above_hidden_button = NULL;
manager_object->item_sep_below_hidden_button = NULL;
manager_object->item_hidden_btn = NULL;
break;
+
default:
- /* Err */
- assertm_if(TRUE, "Err!!");
break;
}
return EINA_FALSE;
}
-int viewer_manager_hidden_disable_set(int mode)
+void viewer_manager_update_hidden_btn(void)
{
__COMMON_FUNC_ENTER__;
- assertm_if(NULL == manager_object->item_hidden_btn, "NULL!!");
-
- elm_object_item_disabled_set(manager_object->item_hidden_btn, mode);
+ retm_if(NULL == manager_object->item_hidden_btn);
+
elm_genlist_item_update(manager_object->item_hidden_btn);
__COMMON_FUNC_EXIT__;
- return TRUE;
-}
-
-static Eina_Bool _gl_bring_in(void *data)
-{
- if (manager_object == NULL)
- return ECORE_CALLBACK_CANCEL;
-
- if (manager_object->item_header == NULL)
- return ECORE_CALLBACK_CANCEL;
-
- elm_genlist_item_bring_in(manager_object->item_header, ELM_GENLIST_ITEM_SCROLLTO_IN);
- return ECORE_CALLBACK_CANCEL;
-}
-
-void viewer_manager_scroll_to_top()
-{
- if (manager_object->item_header == NULL)
- return;
-
- ecore_idler_add((Ecore_Task_Cb)_gl_bring_in, NULL);
}
static void viewer_manager_setup_wizard_button_controller(HEADER_MODES mode)
if (manager_object->next_button != NULL && ug_app_state->rbutton_setup_wizard_skip != NULL)
elm_object_text_set(manager_object->next_button, ug_app_state->rbutton_setup_wizard_skip);
break;
+
case HEADER_MODE_CONNECTED:
if (manager_object->next_button != NULL && ug_app_state->rbutton_setup_wizard_next != NULL)
elm_object_text_set(manager_object->next_button, ug_app_state->rbutton_setup_wizard_next);
break;
+
default:
break;
}
}
-int viewer_manager_header_mode_set(HEADER_MODES mode)
+void viewer_manager_header_mode_set(HEADER_MODES new_mode)
{
__COMMON_FUNC_ENTER__;
- assertm_if(NULL == manager_object, "NULL!!");
+ HEADER_MODES old_mode;
+
+ retm_if(NULL == manager_object);
+
assertm_if(NULL == manager_object->item_header, "NULL!!");
- assertm_if(HEADER_MODE_OFF > mode || HEADER_MODE_MAX <= mode, "Err!!");
+ assertm_if(HEADER_MODE_OFF > new_mode ||
+ HEADER_MODE_MAX <= new_mode, "Err!!");
- if (manager_object->header_mode == mode) {
- return FALSE;
- }
+ old_mode = manager_object->header_mode;
+ if (old_mode == new_mode)
+ return;
+
+ DEBUG_LOG(UG_NAME_NORMAL, "Header mode %d --> %d", old_mode, new_mode);
+
+ manager_object->header_mode = new_mode;
- DEBUG_LOG(UG_NAME_NORMAL, "Header mode changing from %d --> %d", manager_object->header_mode, mode);
- manager_object->header_mode = mode;
if (manager_object->header_text) {
g_free(manager_object->header_text);
manager_object->header_text = NULL;
}
- switch (mode) {
+ switch (new_mode) {
case HEADER_MODE_OFF:
case HEADER_MODE_ON:
case HEADER_MODE_CONNECTED:
- viewer_manager_hidden_disable_set(FALSE);
- viewer_manager_scan_button_set(EINA_TRUE);
- manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Wi_Fi));
- break;
+ viewer_manager_scan_button_set(EINA_TRUE);
+ manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Wi_Fi));
+ break;
+
case HEADER_MODE_ACTIVATING:
- viewer_manager_hidden_disable_set(TRUE);
- manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Activating_WiFi));
- break;
+ manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Activating_WiFi));
+ break;
+
case HEADER_MODE_DEACTIVATING:
- viewer_manager_hidden_disable_set(TRUE);
- manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Deactivating));
- break;
+ manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Deactivating));
+ break;
+
case HEADER_MODE_CONNECTING:
- case HEADER_MODE_DISCONNECTING:
- case HEADER_MODE_CANCEL_CONNECTING:
case HEADER_MODE_SEARCHING:
- viewer_manager_hidden_disable_set(TRUE);
- manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Wi_Fi));
- break;
+ manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Wi_Fi));
+ break;
+
default:
- assertm_if(TRUE, "Err!!");
- break;
+ break;
}
-
+ viewer_manager_update_hidden_btn();
elm_genlist_item_update(manager_object->item_header);
viewer_list_title_item_update();
-
- if (ug_app_state->ug_type == UG_VIEW_SETUP_WIZARD) {
- viewer_manager_setup_wizard_button_controller(mode);
- }
+ if (ug_app_state->ug_type == UG_VIEW_SETUP_WIZARD)
+ viewer_manager_setup_wizard_button_controller(new_mode);
__COMMON_FUNC_EXIT__;
-
- return TRUE;
}
-HEADER_MODES viewer_manager_header_mode_get(void){
- __COMMON_FUNC_ENTER__;
- assertm_if(HEADER_MODE_OFF > manager_object->header_mode ||
- HEADER_MODE_MAX <= manager_object->header_mode, "Err!");
- __COMMON_FUNC_EXIT__;
-
+HEADER_MODES viewer_manager_header_mode_get(void)
+{
return manager_object->header_mode;
}
return manager_object->nav;
}
-void viewer_manager_update_ap_handle(Elm_Object_Item *item, wifi_ap_h ap)
+void viewer_manager_refresh_ap_info(Elm_Object_Item *item)
{
- if (!item || !ap) {
+ if (!item) {
return;
}
if (!wifi_device) {
return;
}
- wifi_ap_h ap_to_destroy = wifi_device->ap;
- if (WIFI_ERROR_NONE == wifi_ap_clone(&(wifi_device->ap), ap)) {
- wifi_ap_destroy(ap_to_destroy);
- }
+
+ wifi_ap_refresh(wifi_device->ap);
return;
}
Elm_Object_Item *viewer_manager_move_item_to_top(Elm_Object_Item *old_item)
{
__COMMON_FUNC_ENTER__;
- Elm_Object_Item *new_item = NULL;
+
Elm_Object_Item *first_item = viewer_list_get_first_item();
- ug_genlist_data_t *gdata = NULL;
- wifi_device_info_t *old_wifi_device = NULL;
+ ug_genlist_data_t *gdata = NULL, *first_it_gdata = NULL;
if (!old_item || !first_item) {
__COMMON_FUNC_EXIT__;
__COMMON_FUNC_EXIT__;
return NULL;
}
- old_wifi_device = gdata->device_info;
- if (old_item == first_item) {
- __COMMON_FUNC_EXIT__;
- return old_item;
- }
+ if (old_item != first_item) {
+ first_it_gdata = elm_object_item_data_get(first_item);
+ elm_object_item_data_set(first_item, gdata);
+ elm_object_item_data_set(old_item, first_it_gdata);
- new_item = viewer_list_item_insert_after(old_wifi_device->ap, NULL);
- viewer_list_item_del(old_item);
+ elm_genlist_item_update(first_item);
+ elm_genlist_item_update(old_item);
+ }
__COMMON_FUNC_EXIT__;
- return new_item;
+ return first_item;
}
-void viewer_manager_update_connected_ap_sig_str(void)
+void viewer_manager_update_rssi(void)
{
+ int ret;
wifi_ap_h ap;
- int ret = wifi_get_connected_ap(&ap);
- if (WIFI_ERROR_NONE != ret) {
+
+ ret = wifi_get_connected_ap(&ap);
+ if (WIFI_ERROR_NONE != ret)
return;
- }
+
Elm_Object_Item *item = item_get_for_ap(ap);
if (!item) {
wifi_ap_destroy(ap);
ug_genlist_data_t* gdata = elm_object_item_data_get(item);
if (gdata && gdata->device_info) {
int rssi = 0;
+
if (WIFI_ERROR_NONE != wifi_ap_get_rssi(ap, &rssi)) {
wifi_ap_destroy(ap);
return;
} else if (gdata->device_info->rssi != rssi) {
+ wifi_ap_refresh(gdata->device_info->ap);
gdata->device_info->rssi = rssi;
+
g_free(gdata->device_info->ap_image_path);
- gdata->device_info->ap_image_path = common_utils_get_device_icon(WIFI_APP_IMAGE_DIR, gdata->device_info);
+
+ common_utils_get_device_icon(WIFI_APP_IMAGE_DIR,
+ gdata->device_info,
+ &gdata->device_info->ap_image_path);
+
elm_genlist_item_update(item);
}
}
+
wifi_ap_destroy(ap);
}
static bool wifi_update_list_for_each_ap(wifi_ap_h ap, void *user_data)
{
- view_manager_list_update_info_t *update_info = (view_manager_list_update_info_t *)user_data;
Elm_Object_Item *item;;
+ view_manager_list_update_info_t *update_info;
+
+ update_info = (view_manager_list_update_info_t *)user_data;
item = viewer_list_item_insert_after(ap, update_info->last_appended_item);
if (item) {
Eina_Bool viewer_manager_refresh(void)
{
- INFO_LOG(UG_NAME_SCAN, "UI update start");
- int profile_state;
+ int state;
+
+ INFO_LOG(UG_NAME_SCAN, "viewer manager refresh");
if (manager_object == NULL)
return EINA_FALSE;
+ if (viewer_manager_header_mode_get() == HEADER_MODE_CONNECTING)
+ return EINA_FALSE;
+
/* Remove the list */
+ viewer_list_item_disable_all();
viewer_list_item_clear();
- profile_state = wlan_manager_state_get();
- if (WLAN_MANAGER_ERROR == profile_state || WLAN_MANAGER_OFF == profile_state) {
- /* Some body requested to refresh the list while the WLAN manager is OFF or Unable to get the profile state */
- INFO_LOG(UG_NAME_ERR, "Refresh requested in wrong state or Unable to get the state. Profile state = %d !!! ", profile_state);
+ state = wlan_manager_state_get();
+ if (WLAN_MANAGER_ERROR == state || WLAN_MANAGER_OFF == state) {
+ /* Some body requested to refresh the list
+ * while the WLAN manager is OFF or Unable to get the profile state
+ */
+ INFO_LOG(UG_NAME_ERR, "WLAN Manager state: %d", state);
+
viewer_manager_header_mode_set(HEADER_MODE_OFF);
+
return EINA_FALSE;
}
- wifi_ap_h ap = wlan_manager_get_ap_with_state(profile_state);
+ wifi_ap_h ap = wlan_manager_get_ap_with_state(state);
viewer_manager_update_list_all();
- if (WLAN_MANAGER_CONNECTING == profile_state) {
- INFO_LOG(UG_NAME_NORMAL, "Profile is connecting...");
+ if (WLAN_MANAGER_CONNECTING == state) {
+ INFO_LOG(UG_NAME_NORMAL, "Wi-Fi is connecting");
+
Elm_Object_Item* target_item = item_get_for_ap(ap);
+
viewer_manager_header_mode_set(HEADER_MODE_CONNECTING);
- viewer_list_item_radio_mode_set(target_item, VIEWER_ITEM_RADIO_MODE_CONNECTING);
- } else if (WLAN_MANAGER_CONNECTED == profile_state) {
- INFO_LOG(UG_NAME_NORMAL, "Profile is connected");
+ viewer_list_item_radio_mode_set(target_item,
+ VIEWER_ITEM_RADIO_MODE_CONNECTING);
+ } else if (WLAN_MANAGER_CONNECTED == state) {
+ INFO_LOG(UG_NAME_NORMAL, "Wi-Fi is connected");
+
Elm_Object_Item* target_item = item_get_for_ap(ap);
+
target_item = viewer_manager_move_item_to_top(target_item);
viewer_manager_header_mode_set(HEADER_MODE_CONNECTED);
- viewer_list_item_radio_mode_set(target_item, VIEWER_ITEM_RADIO_MODE_CONNECTED);
- } else if (WLAN_MANAGER_DISCONNECTING == profile_state) {
- INFO_LOG(UG_NAME_NORMAL, "Profile is disconnecting");
- Elm_Object_Item* target_item = item_get_for_ap(ap);
- viewer_manager_header_mode_set(HEADER_MODE_DISCONNECTING);
- viewer_list_item_radio_mode_set(target_item, VIEWER_ITEM_RADIO_MODE_DISCONNECTING);
+ viewer_list_item_radio_mode_set(target_item,
+ VIEWER_ITEM_RADIO_MODE_CONNECTED);
} else {
- INFO_LOG(UG_NAME_NORMAL, "Profile state = %d", profile_state);
+ INFO_LOG(UG_NAME_NORMAL, "Wi-Fi state: %d", state);
+
viewer_manager_header_mode_set(HEADER_MODE_ON);
}
wifi_ap_destroy(ap);
- INFO_LOG(UG_NAME_SCAN, "UI update finish");
+
+ INFO_LOG(UG_NAME_SCAN, "viewer manager refresh finished");
return EINA_TRUE;
}
-static void hidden_ap_connect_ok_cb (void *data, Evas_Object *obj, void *event_info)
+static void hidden_ap_connect_ok_cb (void *data,
+ Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
hidden_ap_data_t *hidden_ap_data = (hidden_ap_data_t *)data;
- if (!hidden_ap_data)
+ if (hidden_ap_data == NULL) {
+ __COMMON_FUNC_EXIT__;
return;
+ }
char* szPassword = NULL;
wifi_ap_h ap;
+
int ret = wifi_ap_create(hidden_ap_data->ssid, &ap);
if (WIFI_ERROR_NONE != ret) {
ERROR_LOG(UG_NAME_ERR, "Failed to create an AP handle. Err = %d", ret);
+
+ __COMMON_FUNC_EXIT__;
return;
}
- INFO_LOG(UG_NAME_NORMAL, "Hidden AP[%s]. Sec mode = %d. Connect ok cb", hidden_ap_data->ssid, hidden_ap_data->sec_mode);
+
+ INFO_LOG(UG_NAME_NORMAL, "Hidden AP[%s]. Sec mode = %d. Connect ok cb",
+ hidden_ap_data->ssid, hidden_ap_data->sec_mode);
switch (hidden_ap_data->sec_mode) {
case WLAN_SEC_MODE_NONE:
- INFO_LOG(UG_NAME_NORMAL, "This hidden AP is Open. event info = %x; passpopup = %x", event_info, ug_app_state->passpopup);
+ INFO_LOG(UG_NAME_NORMAL, "OPEN: event %x; passpopup %x",
+ event_info, ug_app_state->passpopup);
+
wifi_ap_set_security_type(ap, WIFI_SECURITY_TYPE_NONE);
evas_object_del(hidden_ap_data->confirmation_popup);
hidden_ap_data->confirmation_popup = NULL;
case WLAN_SEC_MODE_WEP:
case WLAN_SEC_MODE_WPA_PSK:
case WLAN_SEC_MODE_WPA2_PSK:
- szPassword = common_pswd_popup_get_txt(ug_app_state->passpopup);
- INFO_LOG(UG_NAME_NORMAL, "Hidden AP paswd = [%s]", szPassword);
- if (WLAN_SEC_MODE_WEP == hidden_ap_data->sec_mode) {
+ szPassword = passwd_popup_get_txt(ug_app_state->passpopup);
+
+ if (WLAN_SEC_MODE_WEP == hidden_ap_data->sec_mode)
wifi_ap_set_security_type(ap, WIFI_SECURITY_TYPE_WEP);
- } else if (WLAN_SEC_MODE_WPA_PSK == hidden_ap_data->sec_mode) {
+ else if (WLAN_SEC_MODE_WPA_PSK == hidden_ap_data->sec_mode)
wifi_ap_set_security_type(ap, WIFI_SECURITY_TYPE_WPA_PSK);
- } else {
+ else
wifi_ap_set_security_type(ap, WIFI_SECURITY_TYPE_WPA2_PSK);
- }
+
wifi_ap_set_passphrase(ap, szPassword);
g_free(szPassword);
- common_pswd_popup_destroy(ug_app_state->passpopup);
+
+ passwd_popup_free(ug_app_state->passpopup);
ug_app_state->passpopup = NULL;
break;
default:
- INFO_LOG(UG_NAME_NORMAL, "Fatal: Unknown Sec mode: %d", hidden_ap_data->sec_mode);
+ INFO_LOG(UG_NAME_NORMAL, "Fatal: Unknown Sec mode: %d",
+ hidden_ap_data->sec_mode);
+
goto hidden_ap_connect_end;
}
- wlan_manager_connect_with_wifi_info(ap);
+ wlan_manager_connect(ap);
hidden_ap_connect_end:
wifi_ap_destroy(ap);
+
g_free(hidden_ap_data->ssid);
g_free(hidden_ap_data);
+
__COMMON_FUNC_EXIT__;
- return;
}
-static void hidden_ap_connect_cacel_cb (void *data, Evas_Object *obj, void *event_info)
+static void hidden_ap_connect_cacel_cb(void *data, Evas_Object *obj,
+ void *event_info)
{
__COMMON_FUNC_ENTER__;
+
hidden_ap_data_t *hidden_ap_data = (hidden_ap_data_t *)data;
- if (!hidden_ap_data)
+ if (hidden_ap_data == NULL) {
+ __COMMON_FUNC_EXIT__;
return;
+ }
switch (hidden_ap_data->sec_mode) {
case WLAN_SEC_MODE_NONE:
INFO_LOG(UG_NAME_NORMAL, "This hidden AP is Open");
+
evas_object_del(hidden_ap_data->confirmation_popup);
hidden_ap_data->confirmation_popup = NULL;
break;
case WLAN_SEC_MODE_WPA_PSK:
case WLAN_SEC_MODE_WPA2_PSK:
INFO_LOG(UG_NAME_NORMAL, "Hidden AP Secured");
- common_pswd_popup_destroy(ug_app_state->passpopup);
+
+ passwd_popup_free(ug_app_state->passpopup);
ug_app_state->passpopup = NULL;
break;
default:
- INFO_LOG(UG_NAME_NORMAL, "Fatal: Unknown Sec mode: %d", hidden_ap_data->sec_mode);
+ INFO_LOG(UG_NAME_NORMAL, "Fatal: Unknown Sec mode: %d",
+ hidden_ap_data->sec_mode);
break;
}
g_free(hidden_ap_data->ssid);
g_free(hidden_ap_data);
+
__COMMON_FUNC_EXIT__;
return;
}
-void viewer_manager_specific_scan_response_hlr(GSList *bss_info_list, void *user_data)
+void viewer_manager_specific_scan_response_hlr(
+ GSList *bss_info_list, void *user_data)
{
hidden_ap_data_t *hidden_ap_data = NULL;
const char *ssid = (const char *)user_data;
wlan_security_mode_type_t sec_mode;
- if (!ug_app_state->hidden_ap_popup) {
+ if (ug_app_state->hidden_ap_popup == NULL) {
ERROR_LOG(UG_NAME_RESP, "Popup is already destroyed \n");
+
g_free(user_data);
return;
}
- if (!ssid) {
+ if (ssid == NULL) {
ERROR_LOG(UG_NAME_RESP, "SSID is empty \n");
+
view_hidden_ap_popup_destroy(ug_app_state->hidden_ap_popup);
ug_app_state->hidden_ap_popup = NULL;
+
return;
}
- INFO_LOG(UG_NAME_RESP, "Specific scan complete response received for AP[%s]", ssid);
int ap_count = g_slist_length(bss_info_list);
net_wifi_connection_info_t *bss_info = NULL;
+ INFO_LOG(UG_NAME_RESP, "Find %s(%d) hidden Wi-Fi networks", ssid, ap_count);
+
if (ap_count == 1) {
bss_info = g_slist_nth_data(bss_info_list, 0);
- if (!bss_info || g_strcmp0(ssid, bss_info->essid)) {
- INFO_LOG(UG_NAME_RESP, "Fatal: Bss info is NULL OR response received for wrong ssid. ", ssid);
+
+ if (bss_info == NULL || g_strcmp0(ssid, bss_info->essid) != 0) {
+ INFO_LOG(UG_NAME_RESP,
+ "Bss info is NULL OR response received for wrong ssid",
+ ssid);
+
/* Bss info not available or Response recieved for wrong ssid */
ap_count = 0;
- } else {
+ } else
sec_mode = bss_info->security_info.sec_mode;
- }
}
if (ap_count == 1) {
switch (sec_mode) {
case WLAN_SEC_MODE_NONE:
- INFO_LOG(UG_NAME_NORMAL, "One AP item with ssid[%s] found. Its security is Open.", ssid);
- /* This is an Open AP. Ask for confirmation to connect. */
+ INFO_LOG(UG_NAME_NORMAL, "%s open network found", ssid);
+
hidden_ap_data = g_new0(hidden_ap_data_t, 1);
hidden_ap_data->sec_mode = WLAN_SEC_MODE_NONE;
hidden_ap_data->ssid = g_strdup(ssid);
popup_btn_info_t popup_btn_data;
memset(&popup_btn_data, 0, sizeof(popup_btn_data));
- popup_btn_data.info_txt = "Wi-Fi network detected. Connect?";
+ popup_btn_data.info_txt = OPEN_HIDDEN_NETWORK_STR;
popup_btn_data.btn1_cb = hidden_ap_connect_ok_cb;
popup_btn_data.btn2_cb = hidden_ap_connect_cacel_cb;
popup_btn_data.btn2_data = popup_btn_data.btn1_data = hidden_ap_data;
popup_btn_data.btn1_txt = sc(PACKAGE, I18N_TYPE_Connect);
popup_btn_data.btn2_txt = sc(PACKAGE, I18N_TYPE_Cancel);
- hidden_ap_data->confirmation_popup = common_utils_show_info_popup(ug_app_state->layout_main, &popup_btn_data);
+ hidden_ap_data->confirmation_popup =
+ common_utils_show_info_popup(ug_app_state->layout_main,
+ &popup_btn_data);
break;
+
case WLAN_SEC_MODE_IEEE8021X:
- INFO_LOG(UG_NAME_NORMAL, "One AP item with ssid[%s] found. Its security is EAP.", ssid);
- /* This is a EAP secured AP. Ask for confirmation to connect. */
+ INFO_LOG(UG_NAME_NORMAL, "%s IEEE8021X found", ssid);
+
Evas_Object* navi_frame = viewer_manager_get_naviframe();
wifi_device_info_t device_info;
wifi_ap_h ap;
wifi_ap_create(ssid, &ap);
- wifi_ap_set_security_type(ap, common_utils_get_sec_mode(sec_mode));
+ wifi_ap_set_security_type(ap, WIFI_SECURITY_TYPE_EAP);
memset(&device_info, 0, sizeof(device_info));
- device_info.security_mode = sec_mode;
+ device_info.security_mode = WIFI_SECURITY_TYPE_EAP;
device_info.ssid = (char *)ssid;
device_info.ap = ap;
- ug_app_state->eap_view = create_eap_connect_view(ug_app_state->layout_main, navi_frame, PACKAGE, &device_info);
+ ug_app_state->eap_view =
+ create_eap_view(ug_app_state->layout_main, navi_frame,
+ PACKAGE, &device_info);
+
wifi_ap_destroy(ap);
break;
+
case WLAN_SEC_MODE_WEP:
case WLAN_SEC_MODE_WPA_PSK:
case WLAN_SEC_MODE_WPA2_PSK:
- INFO_LOG(UG_NAME_NORMAL, "One AP item with ssid[%s] found. Its security is %d", ssid, sec_mode);
- /* This is a WEP/WPA/WPA-2 secured AP. Ask for confirmation to connect. */
+ INFO_LOG(UG_NAME_NORMAL, "Secured(%d) %s found", sec_mode, ssid);
+
+ pswd_popup_create_req_data_t popup_info;
+
hidden_ap_data = g_new0(hidden_ap_data_t, 1);
- pswd_popup_create_req_data_t popup_info;
- memset(&popup_info, 0, sizeof(pswd_popup_create_req_data_t));
hidden_ap_data->sec_mode = sec_mode;
hidden_ap_data->ssid = g_strdup(ssid);
+
+ memset(&popup_info, 0, sizeof(pswd_popup_create_req_data_t));
popup_info.title = (char *)ssid;
popup_info.ok_cb = hidden_ap_connect_ok_cb;
popup_info.cancel_cb = hidden_ap_connect_cacel_cb;
popup_info.wps_btn_cb = NULL;
popup_info.cb_data = hidden_ap_data;
popup_info.ap = NULL;
- INFO_LOG(UG_NAME_NORMAL, "Going to create a popup. ug_app_state = 0x%x", ug_app_state);
- ug_app_state->passpopup = common_pswd_popup_create(ug_app_state->layout_main, PACKAGE, &popup_info);
- INFO_LOG(UG_NAME_NORMAL, "After create a popup");
- if (ug_app_state->passpopup == NULL) {
- INFO_LOG(UG_NAME_ERR, "pass popup create failed !");
- }
+
+ ug_app_state->passpopup =
+ create_passwd_popup(ug_app_state->layout_main,
+ PACKAGE, &popup_info);
+
+ if (ug_app_state->passpopup == NULL)
+ INFO_LOG(UG_NAME_ERR, "Fail to create password popup");
+
break;
+
default:
- INFO_LOG(UG_NAME_NORMAL, "Unkown security mode: %d", sec_mode);
+ INFO_LOG(UG_NAME_NORMAL, "Unknown security mode: %d", sec_mode);
break;
}
} else if (ap_count == 0) {
- INFO_LOG(UG_NAME_NORMAL, "No AP item with ssid[%s] found", ssid);
char *disp_msg = g_strdup_printf("Unable to find %s", ssid);
common_utils_show_info_ok_popup(ug_app_state->layout_main, PACKAGE, disp_msg);
g_free(disp_msg);
- } else {
- INFO_LOG(UG_NAME_NORMAL, "More than one AP items with ssid[%s] found", ssid);
}
- /* If the hidden AP found on first and second scan OR not found even after first and second scan then delete the popup */
+ /* If the hidden AP found on first and
+ * second scan OR not found even after first and second scan
+ * then delete the popup
+ */
g_free(user_data);
+
view_hidden_ap_popup_destroy(ug_app_state->hidden_ap_popup);
ug_app_state->hidden_ap_popup = NULL;
- return;
}
#include "appcoreWrapper.h"
#include "i18nmanager.h"
-#define LIST_ITEM_CONNECTED_AP_FONT_SIZE 28
-#define LIST_ITEM_CONNECTED_AP_FONT_COLOR "#3B73B6"
-#define FIRST_ITEM_NUMBER 8
+#define LIST_ITEM_CONNECTED_AP_FONT_SIZE 28
+#define LIST_ITEM_CONNECTED_AP_FONT_COLOR "#3B73B6"
+#define LIST_ITEM_CONNECTED_AP_FONT_COLOR_HL "#FFFFFF"
+#define FIRST_ITEM_NUMBER 8
static Evas_Object* viewer_list = NULL;
extern wifi_appdata *ug_app_state;
-void list_select_cb(void *data, Evas_Object *obj, void *event_info)
+static void _gl_listview_more_btn_cb(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
static char* _gl_listview_text_get(void *data, Evas_Object *obj, const char *part)
{
char* det = NULL;
- assertm_if(NULL == obj, "NULL!!");
- assertm_if(NULL == part, "NULL!!");
- assertm_if(NULL == data, "NULL!!");
ug_genlist_data_t* gdata = (ug_genlist_data_t*) data;
- assertm_if(NULL == gdata, "NULL!!");
- assertm_if(NULL == gdata->device_info, "NULL!!");
+ retvm_if(NULL == gdata || NULL == gdata->device_info, NULL);
+
assertm_if(NULL == gdata->device_info->ssid, "NULL!!");
assertm_if(NULL == gdata->device_info->ap_status_txt, "NULL!!");
det = g_strdup(gdata->device_info->ssid);
assertm_if(NULL == det, "NULL!!");
} else if (!strncmp(part, "elm.text.2", strlen(part))) {
- det = g_strdup(gdata->device_info->ap_status_txt);
+ if (VIEWER_ITEM_RADIO_MODE_CONNECTED == gdata->radio_mode) {
+ if (FALSE == gdata->highlighted)
+ det = g_strdup_printf("<color=%s><b>%s</b></color>", LIST_ITEM_CONNECTED_AP_FONT_COLOR, gdata->device_info->ap_status_txt);
+ else
+ det = g_strdup_printf("<color=%s><b>%s</b></color>", LIST_ITEM_CONNECTED_AP_FONT_COLOR_HL, gdata->device_info->ap_status_txt);
+ } else
+ det = g_strdup(gdata->device_info->ap_status_txt);
assertm_if(NULL == det, "NULL!!");
}
return det;
static Evas_Object *_gl_listview_content_get(void *data, Evas_Object *obj, const char *part)
{
- assertm_if(NULL == obj, "NULL!!");
- assertm_if(NULL == data, "NULL!!");
- assertm_if(NULL == part, "NULL!!");
+ ug_genlist_data_t *gdata = (ug_genlist_data_t *)data;
+ retvm_if(NULL == gdata, NULL);
- ug_genlist_data_t* gdata = (ug_genlist_data_t*) data;
- Evas_Object* icon = NULL;
+ Evas_Object *icon = NULL;
if (gdata->device_info->ap_image_path == NULL) {
/* if there is no ap_image_path (NO AP Found situation) */
DEBUG_LOG(UG_NAME_ERR, "Fatal: Image path is NULL");
} else if (!strncmp(part, "elm.icon.1", strlen(part))) {
/* for strength */
+ char *temp_str = NULL;
icon = elm_image_add(obj);
- assertm_if(NULL == icon, "NULL!!");
- elm_image_file_set(icon, gdata->device_info->ap_image_path, NULL);
+ retvm_if(NULL == icon, NULL);
+
+ if (FALSE == gdata->highlighted)
+ temp_str = g_strdup_printf("%s.png", gdata->device_info->ap_image_path);
+ else
+ temp_str = g_strdup_printf("%s_press.png", gdata->device_info->ap_image_path);
+ elm_image_file_set(icon, temp_str, NULL);
+ g_free(temp_str);
} else if (!strncmp(part, "elm.icon.2", strlen(part))) {
if (VIEWER_ITEM_RADIO_MODE_CONNECTING == gdata->radio_mode) {
icon = elm_progressbar_add(obj);
+ retvm_if(NULL == icon, NULL);
+
elm_object_style_set(icon, "list_process");
evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, 0.5);
evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_progressbar_pulse(icon, TRUE);
} else {
icon = elm_button_add(obj);
- assertm_if(NULL == icon, "NULL!!");
+ retvm_if(NULL == icon, NULL);
+
elm_object_style_set(icon, "reveal");
- evas_object_smart_callback_add(icon, "clicked", (Evas_Smart_Cb)list_select_cb, gdata->device_info);
+ evas_object_smart_callback_add(icon, "clicked", _gl_listview_more_btn_cb, gdata->device_info);
evas_object_propagate_events_set(icon, EINA_FALSE);
}
}
return;
ug_genlist_data_t* gdata = (ug_genlist_data_t*) data;
- assertm_if(NULL == gdata->device_info->ssid, "NULL!!");
+ retm_if(NULL == gdata || NULL == gdata->device_info);
DEBUG_LOG(UG_NAME_NORMAL, "del target ssid:[%s]", gdata->device_info->ssid);
static Evas_Object *_gl_content_title_get(void *data, Evas_Object *obj, const char *part)
{
__COMMON_FUNC_ENTER__;
+
Evas_Object *title_progressbar = NULL;
+
if (HEADER_MODE_SEARCHING == viewer_manager_header_mode_get()) {
if (!strcmp(part, "elm.icon")) {
title_progressbar = elm_progressbar_add(obj);
elm_progressbar_pulse(title_progressbar, EINA_TRUE);
}
}
+
__COMMON_FUNC_EXIT__;
return title_progressbar;
}
-
Elm_Object_Item* viewer_list_get_first_item(void)
{
return first_item;
return last_item;
}
+static char *_access_info_cb(void *data, Evas_Object *obj)
+{
+ char *strength = NULL;
+ char *buf = NULL;
+
+ ug_genlist_data_t *gdata = (ug_genlist_data_t *)data;
+ if (!gdata)
+ return NULL;
+
+ strength = common_utils_get_rssi_text(PACKAGE, gdata->device_info->rssi);
+ buf = g_strdup_printf("%s %s %s", strength, gdata->device_info->ssid, gdata->device_info->ap_status_txt);
+
+ g_free(strength);
+ return buf;
+}
+
static void _gl_realized(void *data, Evas_Object *obj, void *event_info)
{
HEADER_MODES header_mode = viewer_manager_header_mode_get();
elm_object_item_signal_emit(item, "elm,state,bottom", "");
else
elm_object_item_signal_emit(item, "elm,state,center", "");
+
+ Evas_Object *ao = elm_object_item_access_object_get(item);
+ elm_access_info_cb_set(ao, ELM_ACCESS_INFO, _access_info_cb, elm_object_item_data_get(item));
+ elm_access_info_set(ao, ELM_ACCESS_TYPE, "double tap to connect device");
+ elm_access_info_set(ao, ELM_ACCESS_STATE, "More button");
}
+}
- elm_genlist_item_update(item);
+static void _gl_highlighted(void *data, Evas_Object *obj, void *event_info)
+{
+ Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+ if (item) {
+ ug_genlist_data_t *gdata = (ug_genlist_data_t *)elm_object_item_data_get(item);
+ if (gdata) {
+ gdata->highlighted = TRUE;
+ elm_genlist_item_fields_update(item, "elm.icon.1", ELM_GENLIST_ITEM_FIELD_CONTENT);
+ elm_genlist_item_fields_update(item, "elm.text.2", ELM_GENLIST_ITEM_FIELD_TEXT);
+ }
+ }
+}
- return;
+static void _gl_unhighlighted(void *data, Evas_Object *obj, void *event_info)
+{
+ Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+ if (item) {
+ ug_genlist_data_t *gdata = (ug_genlist_data_t *)elm_object_item_data_get(item);
+ if (gdata) {
+ gdata->highlighted = FALSE;
+ elm_genlist_item_fields_update(item, "elm.icon.1", ELM_GENLIST_ITEM_FIELD_CONTENT);
+ elm_genlist_item_fields_update(item, "elm.text.2", ELM_GENLIST_ITEM_FIELD_TEXT);
+ }
+ }
}
-static void _popup_cancel_cb(void *data, Evas_Object *obj, void *event_info)
+static void __passwd_popup_cancel_cb(void *data, Evas_Object *obj,
+ void *event_info)
{
__COMMON_FUNC_ENTER__;
- if (!ug_app_state->passpopup) {
+
+ if (ug_app_state->passpopup == NULL)
return;
- }
- common_pswd_popup_destroy(ug_app_state->passpopup);
+ passwd_popup_free(ug_app_state->passpopup);
ug_app_state->passpopup = NULL;
+
__COMMON_FUNC_EXIT__;
}
-static void _popup_ok_cb(void *data, Evas_Object *obj, void *event_info)
+static void __passwd_popup_ok_cb(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
- if (!ug_app_state->passpopup) {
+
+ wifi_ap_h ap = NULL;
+ int password_len = 0;
+ const char *password = NULL;
+ wifi_security_type_e sec_type = WIFI_SECURITY_TYPE_NONE;
+
+ if (ug_app_state->passpopup == NULL)
return;
- }
- wifi_security_type_e sec_mode = 0;
- wifi_ap_h ap = common_pswd_popup_get_ap(ug_app_state->passpopup);
- int ret = WLAN_MANAGER_ERR_NONE;
- int nLen = 0;
- const char* szPassword = common_pswd_popup_get_txt(ug_app_state->passpopup);
- nLen = strlen(szPassword);
- INFO_LOG(UG_NAME_NORMAL, "password = [%s]", szPassword);
+ ap = passwd_popup_get_ap(ug_app_state->passpopup);
+ password = passwd_popup_get_txt(ug_app_state->passpopup);
+ password_len = strlen(password);
- wifi_ap_get_security_type(ap, &sec_mode);
- switch (sec_mode) {
+ wifi_ap_get_security_type(ap, &sec_type);
+
+ switch (sec_type) {
case WIFI_SECURITY_TYPE_WEP:
+ if (password_len != 5 && password_len != 13 &&
+ password_len != 26 && password_len != 10) {
+ winset_popup_mode_set(ug_app_state->popup_manager,
+ POPUP_OPTION_WEP_PSWD_LEN_ERROR, NULL);
- if (nLen != 5 && nLen != 13 && nLen != 26 && nLen != 10) {
- winset_popup_mode_set(ug_app_state->popup_manager, POPUP_OPTION_WEP_PSWD_LEN_ERROR, NULL);
goto popup_ok_cb_exit;
}
break;
case WIFI_SECURITY_TYPE_WPA_PSK:
case WIFI_SECURITY_TYPE_WPA2_PSK:
+ if (password_len < 8 || password_len > 63) {
+ winset_popup_mode_set(ug_app_state->popup_manager,
+ POPUP_OPTION_WPA_PSWD_LEN_ERROR, NULL);
- if (nLen < 8 || nLen > 63) {
- winset_popup_mode_set(ug_app_state->popup_manager, POPUP_OPTION_WPA_PSWD_LEN_ERROR, NULL);
goto popup_ok_cb_exit;
}
break;
default:
- ERROR_LOG(UG_NAME_SCAN, "Fatal: Wrong security mode : %d", sec_mode);
- common_pswd_popup_destroy(ug_app_state->passpopup);
+ ERROR_LOG(UG_NAME_NORMAL, "Wrong security mode: %d", sec_type);
+ passwd_popup_free(ug_app_state->passpopup);
ug_app_state->passpopup = NULL;
+
goto popup_ok_cb_exit;
}
- INFO_LOG(UG_NAME_SCAN, "connect with password comp");
- ret = wlan_manager_connect_with_password(ap, szPassword);
- if (WLAN_MANAGER_ERR_NONE == ret) {
- viewer_manager_header_mode_set(HEADER_MODE_CONNECTING);
- } else {
- ERROR_LOG(UG_NAME_SCAN, "wlan error %d", ret);
- viewer_manager_header_mode_set(HEADER_MODE_ON);
- }
+ wlan_manager_connect_with_password(ap, password);
- common_pswd_popup_destroy(ug_app_state->passpopup);
+ passwd_popup_free(ug_app_state->passpopup);
ug_app_state->passpopup = NULL;
-
popup_ok_cb_exit:
- g_free((gpointer)szPassword);
+ g_free((gpointer)password);
__COMMON_FUNC_EXIT__;
}
-static void _wps_pbc_popup_cancel_connecting(void* data, Evas_Object* obj, void* event_info)
+static void __wps_pbc_popup_cancel_connecting(void *data, Evas_Object *obj,
+ void *event_info)
{
- if (!ug_app_state->passpopup) {
+ if (ug_app_state->passpopup == NULL)
return;
- }
- wifi_ap_h ap = common_pswd_popup_get_ap(ug_app_state->passpopup);;
- int ret = wlan_manager_request_disconnection(ap);
- if (ret == WLAN_MANAGER_ERR_NONE) {
- INFO_LOG(UG_NAME_NORMAL, "WPS conection cancelled successfully for AP[0x%x]", ap);
- } else {
- ERROR_LOG(UG_NAME_NORMAL, "Error!!! wlan_manager_request_disconnection failed for AP[0x%x]", ap);
- }
- common_pswd_popup_destroy(ug_app_state->passpopup);
+ wifi_ap_h ap = passwd_popup_get_ap(ug_app_state->passpopup);;
+
+ int ret = wlan_manager_disconnect(ap);
+ if (ret != WLAN_MANAGER_ERR_NONE)
+ ERROR_LOG(UG_NAME_NORMAL, "Failed WPS PBC cancellation [0x%x]", ap);
+
+ passwd_popup_free(ug_app_state->passpopup);
ug_app_state->passpopup = NULL;
+
viewer_manager_header_mode_set(HEADER_MODE_ON);
- return;
}
static void _wps_btn_cb(void* data, Evas_Object* obj, void* event_info)
return;
}
- wifi_ap_h ap = common_pswd_popup_get_ap(ug_app_state->passpopup);
- int ret = wlan_manager_request_wps_connection(ap);
+ wifi_ap_h ap = passwd_popup_get_ap(ug_app_state->passpopup);
+ int ret = wlan_manager_wps_connect(ap);
if (ret == WLAN_MANAGER_ERR_NONE) {
- viewer_manager_header_mode_set(HEADER_MODE_CONNECTING);
- common_pswd_popup_pbc_popup_create(ug_app_state->passpopup, _wps_pbc_popup_cancel_connecting, NULL);
+ create_pbc_popup(ug_app_state->passpopup, __wps_pbc_popup_cancel_connecting, NULL);
} else {
- ERROR_LOG(UG_NAME_NORMAL, "Error!!! wlan_manager_request_wps_connection failed");
- common_pswd_popup_destroy(ug_app_state->passpopup);
+ ERROR_LOG(UG_NAME_NORMAL, "wlan_manager_wps_connect failed");
+ passwd_popup_free(ug_app_state->passpopup);
ug_app_state->passpopup = NULL;
}
+
__COMMON_FUNC_EXIT__;
}
-#if 0
-static gint __viewer_list_compare_mode(gconstpointer a, gconstpointer b)
+static void __viewer_list_wifi_connect(wifi_device_info_t *device_info)
{
- Elm_Object_Item *item = (Elm_Object_Item *)a;
- if (item) {
- ug_genlist_data_t* gdata = elm_object_item_data_get(item);
- if (gdata) {
- VIEWER_ITEM_RADIO_MODES mode = (VIEWER_ITEM_RADIO_MODES)b;
- if (gdata->radio_mode == mode)
- return 0;
- }
- }
- return -1;
-}
+ int rv;
+ bool favorite = false;
+ Evas_Object* navi_frame = NULL;
+ pswd_popup_create_req_data_t popup_info;
+ wifi_security_type_e sec_type = WIFI_SECURITY_TYPE_NONE;
-static Elm_Object_Item *__wifi_viewer_list_get_item_in_mode(VIEWER_ITEM_RADIO_MODES mode)
-{
- Elm_Object_Item *item = NULL;
- GSList *found = g_slist_find_custom(container, (gconstpointer)mode, __viewer_list_compare_mode);
- if (found) {
- INFO_LOG(UG_NAME_NORMAL, "item found in mode [%d]", mode);
- item = found->data;
- }
- return item;
-}
-#endif
+ if (device_info == NULL)
+ return;
-static void __wifi_viewer_list_request_connection(wifi_device_info_t *device_info)
-{
- if (!device_info)
+ wifi_ap_is_favorite(device_info->ap, &favorite);
+
+ if (favorite == true) {
+ rv = wlan_manager_connect(device_info->ap);
return;
+ }
- pswd_popup_create_req_data_t popup_info;
- Evas_Object* navi_frame = NULL;
- int ret = wlan_manager_request_connection(device_info->ap);;
- switch (ret) {
- case WLAN_MANAGER_ERR_NONE:
- INFO_LOG(UG_NAME_NORMAL, "ERROR_NONE");
- viewer_manager_header_mode_set(HEADER_MODE_CONNECTING);
+ wifi_ap_get_security_type(device_info->ap, &sec_type);
+
+ switch (sec_type) {
+ case WIFI_SECURITY_TYPE_NONE:
+ rv = wlan_manager_connect(device_info->ap);
break;
- case WLAN_MANAGER_ERR_CONNECT_PASSWORD_NEEDED:
+
+ case WIFI_SECURITY_TYPE_WEP:
+ case WIFI_SECURITY_TYPE_WPA_PSK:
+ case WIFI_SECURITY_TYPE_WPA2_PSK:
memset(&popup_info, 0, sizeof(pswd_popup_create_req_data_t));
+
popup_info.title = device_info->ssid;
- popup_info.ok_cb = _popup_ok_cb;
- popup_info.cancel_cb = _popup_cancel_cb;
+ popup_info.ok_cb = __passwd_popup_ok_cb;
+ popup_info.cancel_cb = __passwd_popup_cancel_cb;
popup_info.show_wps_btn = device_info->wps_mode;
popup_info.wps_btn_cb = _wps_btn_cb;
popup_info.ap = device_info->ap;
popup_info.cb_data = NULL;
- INFO_LOG(UG_NAME_NORMAL, "Going to create a popup. ug_app_state = 0x%x", ug_app_state);
- ug_app_state->passpopup = common_pswd_popup_create(ug_app_state->layout_main, PACKAGE, &popup_info);
- INFO_LOG(UG_NAME_NORMAL, "After create a popup");
- if (ug_app_state->passpopup == NULL) {
- INFO_LOG(UG_NAME_ERR, "pass popup create failed !");
- }
+
+ /* TODO: parameter with device_info */
+ /* TODO: finally parameter with wifi_ap_h, WPA, EAP */
+ ug_app_state->passpopup = create_passwd_popup(
+ ug_app_state->layout_main, PACKAGE, &popup_info);
+
+ if (ug_app_state->passpopup == NULL)
+ INFO_LOG(UG_NAME_ERR, "Fail to create password popup");
+
break;
- case WLAN_MANAGER_ERR_CONNECT_EAP_SEC_TYPE:
+ case WIFI_SECURITY_TYPE_EAP:
navi_frame = viewer_manager_get_naviframe();
- ug_app_state->eap_view = create_eap_connect_view(ug_app_state->layout_main, navi_frame, PACKAGE, device_info);
+ ug_app_state->eap_view = create_eap_view(
+ ug_app_state->layout_main, navi_frame, PACKAGE, device_info);
break;
default:
- ERROR_LOG(UG_NAME_NORMAL, "errro code [%d]", ret);
+ ERROR_LOG(UG_NAME_NORMAL, "Unknown security type [%d]", sec_type);
break;
}
}
-static void viewer_list_item_clicked_cb(void* data, Evas_Object* obj, void* event_info)
+static void __viewer_list_item_clicked_cb(void *data, Evas_Object *obj,
+ void *event_info)
{
__COMMON_FUNC_ENTER__;
+
assertm_if(NULL == event_info, "event_info is NULL!!");
- assertm_if(NULL == data, "data is NULL!!");
assertm_if(NULL == obj, "obj is NULL!!");
- int ret = WLAN_MANAGER_ERR_UNKNOWN;
Elm_Object_Item *it = (Elm_Object_Item *)event_info;
-// Elm_Object_Item *connecting_item = NULL;
- ug_genlist_data_t *gdata = (ug_genlist_data_t *)elm_object_item_data_get(it);
- wifi_device_info_t *device_info = (wifi_device_info_t *)data;
+ ug_genlist_data_t *gdata = NULL;
+ wifi_device_info_t *device_info = NULL;
- if (!gdata || !device_info || !device_info->ssid) {
- ERROR_LOG(UG_NAME_NORMAL, "Error!!! Invalid inout params");
- __COMMON_FUNC_EXIT__;
- return;
- }
+ gdata = (ug_genlist_data_t *)elm_object_item_data_get(it);
+ retm_if(NULL == gdata);
+
+ device_info = gdata->device_info;
+ retm_if(NULL == device_info || NULL == device_info->ssid);
int item_state = gdata->radio_mode;
int current_state = 0;
INFO_LOG(UG_NAME_NORMAL, "current item_state state is --- %d\n", item_state);
switch (item_state) {
- case VIEWER_ITEM_RADIO_MODE_OFF:
- current_state = viewer_manager_header_mode_get();
-
- INFO_LOG(UG_NAME_NORMAL, "Clicked AP`s information\n");
- INFO_LOG(UG_NAME_NORMAL, "header mode [%d]", current_state);
-
- switch (current_state) {
- case HEADER_MODE_CONNECTED:
- case HEADER_MODE_ON:
- __wifi_viewer_list_request_connection(device_info);
- break;
-
- case HEADER_MODE_CONNECTING:
-#if 0 // Enable this later when two connect requests is supported by libnet.
- /* Try connecting to the selected AP */
- connecting_item = __wifi_viewer_list_get_item_in_mode(VIEWER_ITEM_RADIO_MODE_CONNECTING);
- viewer_manager_header_mode_set(HEADER_MODE_ON);
- wlan_manager_request_connection(device_info->ap);
-
- /* Disconnect the connecting AP */
- if (connecting_item) {
- ug_genlist_data_t *connecting_gdata = elm_object_item_data_get(connecting_item);
- if (connecting_gdata) {
- wlan_manager_request_disconnection(connecting_gdata->device_info->ap);
- }
- }
- break;
-#endif
- case HEADER_MODE_OFF:
- case HEADER_MODE_SEARCHING:
- case HEADER_MODE_ACTIVATING:
- case HEADER_MODE_DISCONNECTING:
- case HEADER_MODE_DEACTIVATING:
- default:
- INFO_LOG(UG_NAME_NORMAL, "Ignore the item click");
- break;
- }
- break;
+ case VIEWER_ITEM_RADIO_MODE_OFF:
+ current_state = viewer_manager_header_mode_get();
- case VIEWER_ITEM_RADIO_MODE_CONNECTED:
- INFO_LOG(UG_NAME_NORMAL, "want to disconnect for connected item");
- ret = wlan_manager_request_disconnection(device_info->ap);
- if(ret == WLAN_MANAGER_ERR_NONE){
- viewer_manager_header_mode_set(HEADER_MODE_DISCONNECTING);
- }
- break;
+ INFO_LOG(UG_NAME_NORMAL, "Clicked AP information\n");
+ INFO_LOG(UG_NAME_NORMAL, "header mode [%d]", current_state);
- case VIEWER_ITEM_RADIO_MODE_CONNECTING:
- INFO_LOG(UG_NAME_NORMAL, "want to cancel connecting for connected item");
- ret = wlan_manager_request_disconnection(device_info->ap);
- if(ret == WLAN_MANAGER_ERR_NONE){
- viewer_manager_header_mode_set(HEADER_MODE_CANCEL_CONNECTING);
- }
+ switch (current_state) {
+ case HEADER_MODE_ON:
+ case HEADER_MODE_CONNECTED:
+ case HEADER_MODE_CONNECTING:
+ __viewer_list_wifi_connect(device_info);
break;
+ case HEADER_MODE_OFF:
+ case HEADER_MODE_SEARCHING:
+ case HEADER_MODE_ACTIVATING:
+ case HEADER_MODE_DEACTIVATING:
default:
- ret = WLAN_MANAGER_ERR_UNKNOWN;
+ INFO_LOG(UG_NAME_NORMAL, "Ignore click");
break;
+ }
+ break;
+
+ case VIEWER_ITEM_RADIO_MODE_CONNECTED:
+ case VIEWER_ITEM_RADIO_MODE_CONNECTING:
+ default:
+ INFO_LOG(UG_NAME_NORMAL, "Ignore click");
+ break;
}
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
__COMMON_FUNC_EXIT__;
- return;
}
static char *viewer_list_get_device_status_txt(wifi_device_info_t *wifi_device, VIEWER_ITEM_RADIO_MODES mode)
{
char *status_txt = NULL;
- char *ret_txt = NULL;
/* The strings are currently hard coded. It will be replaced with string ids later */
- if (VIEWER_ITEM_RADIO_MODE_CONNECTING == mode || VIEWER_ITEM_RADIO_MODE_WPS_CONNECTING == mode) {
+ if (VIEWER_ITEM_RADIO_MODE_CONNECTING == mode) {
status_txt = g_strdup(sc(PACKAGE, I18N_TYPE_Connecting));
} else if (VIEWER_ITEM_RADIO_MODE_CONNECTED == mode) {
- status_txt = g_strdup_printf("<color=%s><b>%s</b></color>", LIST_ITEM_CONNECTED_AP_FONT_COLOR, sc(PACKAGE, I18N_TYPE_Connected));
- } else if (VIEWER_ITEM_RADIO_MODE_DISCONNECTING == mode) {
- status_txt = g_strdup(sc(PACKAGE, I18N_TYPE_Disconnecting));
+ status_txt = g_strdup(sc(PACKAGE, I18N_TYPE_Connected));
} else if (VIEWER_ITEM_RADIO_MODE_OFF == mode) {
status_txt = common_utils_get_ap_security_type_info_txt(PACKAGE, wifi_device);
} else {
status_txt = g_strdup(WIFI_UNKNOWN_DEVICE_STATUS_STR);
INFO_LOG(UG_NAME_NORMAL, "Invalid mode: %d", mode);
}
- ret_txt = g_strdup_printf("%s", status_txt);
- g_free(status_txt);
- return ret_txt;
+ return status_txt;
}
Evas_Object* viewer_list_create(Evas_Object *win)
__COMMON_FUNC_ENTER__;
assertm_if(NULL == win, "NULL!!");
-
assertm_if(NULL != viewer_list, "Err!!");
- viewer_list = elm_genlist_add(win);
-
- elm_object_style_set(viewer_list, "dialogue");
+ viewer_list = elm_genlist_add(win);
assertm_if(NULL == viewer_list, "NULL!!");
+ elm_object_style_set(viewer_list, "dialogue");
elm_genlist_mode_set(viewer_list, ELM_LIST_LIMIT);
evas_object_size_hint_weight_set(viewer_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
first_item = last_item = NULL;
evas_object_smart_callback_add(viewer_list, "realized", _gl_realized, NULL);
+ evas_object_smart_callback_add(viewer_list, "highlighted", _gl_highlighted, NULL);
+ evas_object_smart_callback_add(viewer_list, "unhighlighted", _gl_unhighlighted, NULL);
+
__COMMON_FUNC_EXIT__;
return viewer_list;
}
return TRUE;
}
-void viewer_list_title_item_del()
+void viewer_list_title_item_del(void)
{
if (grouptitle) {
elm_object_item_del(grouptitle);
}
}
-void viewer_list_title_item_update()
+void viewer_list_title_item_update(void)
{
elm_genlist_item_update(grouptitle);
}
-int viewer_list_title_item_set(void)
+void viewer_list_title_item_set(void)
{
- if (viewer_list_item_size_get() == 0 && !grouptitle) {
- // To use multiline textblock/entry/editfield in genlist, set height_for_width mode
- // then the item's height is calculated while the item's width fits to genlist width.
- elm_genlist_mode_set(viewer_list, ELM_LIST_COMPRESS);
+ if (grouptitle != NULL || viewer_list_item_size_get() != 0)
+ return;
- grouptitle_itc.item_style = "dialogue/title";
- grouptitle_itc.func.text_get = _gl_text_title_get;
- grouptitle_itc.func.content_get = _gl_content_title_get;
- grouptitle_itc.func.state_get = NULL;
- grouptitle_itc.func.del = NULL;
+ // To use multiline textblock/entry/editfield in genlist, set height_for_width mode
+ // then the item's height is calculated while the item's width fits to genlist width.
+ elm_genlist_mode_set(viewer_list, ELM_LIST_COMPRESS);
- assertm_if(NULL != grouptitle, "Err!!");
+ grouptitle_itc.item_style = "dialogue/title";
+ grouptitle_itc.func.text_get = _gl_text_title_get;
+ grouptitle_itc.func.content_get = _gl_content_title_get;
+ grouptitle_itc.func.state_get = NULL;
+ grouptitle_itc.func.del = NULL;
- grouptitle = elm_genlist_item_append(viewer_list,
- &grouptitle_itc,
- NULL,
- NULL,
- ELM_GENLIST_ITEM_NONE,
- NULL,
- NULL);
+ assertm_if(NULL != grouptitle, "Err!!");
- assertm_if(NULL == grouptitle, "NULL!!");
+ grouptitle = elm_genlist_item_append(viewer_list,
+ &grouptitle_itc,
+ NULL,
+ NULL,
+ ELM_GENLIST_ITEM_NONE,
+ NULL,
+ NULL);
- elm_genlist_item_select_mode_set(grouptitle, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+ assertm_if(NULL == grouptitle, "NULL!!");
- return TRUE;
- } else {
- return FALSE;
- }
+ elm_genlist_item_select_mode_set(grouptitle, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
-int viewer_list_item_radio_mode_set(Elm_Object_Item* item, VIEWER_ITEM_RADIO_MODES mode)
+int viewer_list_item_radio_mode_set(Elm_Object_Item* item,
+ VIEWER_ITEM_RADIO_MODES mode)
{
__COMMON_FUNC_ENTER__;
+
if (NULL == item) {
INFO_LOG(COMMON_NAME_ERR, "item is NULL");
return FALSE;
Elm_Object_Item* ret = NULL;
wifi_security_type_e sec_type;
- if (!viewer_list) {
- assertm_if(NULL == viewer_list, "NULL!!");
- return NULL;
- }
+ retvm_if(NULL == viewer_list, NULL);
wifi_device_info_t *wifi_device = NULL;
- if (!ap) {
+ if (ap == NULL) {
wifi_device = wlan_manager_profile_device_info_blank_create();
- if (!wifi_device)
- return NULL;
+ retvm_if(NULL == wifi_device, NULL);
} else {
wifi_device = g_new0(wifi_device_info_t, 1);
+ retvm_if(NULL == wifi_device, NULL);
+
if (WIFI_ERROR_NONE != wifi_ap_clone(&(wifi_device->ap), ap)) {
goto FREE_DEVICE_INFO;
} else if (WIFI_ERROR_NONE != wifi_ap_get_essid(ap, &(wifi_device->ssid))) {
goto FREE_DEVICE_INFO;
} else if (WIFI_ERROR_NONE != wifi_ap_get_rssi(ap, &(wifi_device->rssi))) {
goto FREE_DEVICE_INFO;
- } else if (WIFI_ERROR_NONE != wifi_ap_get_security_type (ap, &sec_type)) {
+ } else if (WIFI_ERROR_NONE != wifi_ap_get_security_type(ap, &sec_type)) {
goto FREE_DEVICE_INFO;
- } else if (WIFI_ERROR_NONE != wifi_ap_is_wps_supported (ap, &(wifi_device->wps_mode))) {
+ } else if (WIFI_ERROR_NONE != wifi_ap_is_wps_supported(ap, &(wifi_device->wps_mode))) {
goto FREE_DEVICE_INFO;
}
wifi_device->security_mode = common_utils_get_sec_mode(sec_type);
- wifi_device->ap_image_path = common_utils_get_device_icon(WIFI_APP_IMAGE_DIR, wifi_device);
wifi_device->ap_status_txt = viewer_list_get_device_status_txt(wifi_device, VIEWER_ITEM_RADIO_MODE_OFF);
+ common_utils_get_device_icon(WIFI_APP_IMAGE_DIR,
+ wifi_device,
+ &wifi_device->ap_image_path);
+
}
ug_genlist_data_t* gdata = g_new0(ug_genlist_data_t, 1);
+ retvm_if(NULL == gdata, NULL);
+
gdata->device_info = wifi_device;
gdata->radio_mode = VIEWER_ITEM_RADIO_MODE_OFF;
NULL,/*parent*/
after, /*after than*/
ELM_GENLIST_ITEM_NONE, /*flags*/
- viewer_list_item_clicked_cb,/*func*/
- wifi_device);/*func_data*/
+ __viewer_list_item_clicked_cb,/*func*/
+ NULL);/*func_data*/
if (!ret) {
assertm_if(NULL == ret, "NULL!!");
while(it) {
elm_object_item_disabled_set(it, EINA_FALSE);
+
if (it == last_item)
break;
+
it = elm_genlist_item_next_get(it);
}
while(it) {
elm_object_item_disabled_set(it, EINA_TRUE);
+
if (it == last_item)
break;
+
it = elm_genlist_item_next_get(it);
}
#include "view_ime_hidden.h"
#include "wifi-engine-callback.h"
+#define MAX_BSS_EXPIRY_TIME 600 /* time in seconds */
+
static int wifi_exit_end = FALSE;
wifi_appdata *ug_app_state = NULL;
-struct ug_data
-{
+struct ug_data {
Evas_Object *base;
ui_gadget_h ug;
};
static Eina_Bool __wifi_efl_ug_del_found_ap_noti(void *data)
{
- common_utils_send_message_to_net_popup(NULL, NULL, "del_found_ap_noti", NULL);
+ common_utils_send_message_to_net_popup(NULL, NULL,
+ "del_found_ap_noti", NULL);
+
return ECORE_CALLBACK_CANCEL;
}
-static void *on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv)
+static void __make_scan_if_bss_expired(void)
{
- Ecore_Idler *idler;
+ __COMMON_FUNC_ENTER__;
+
+ time_t time_since_last_scan = 0;
+
+ /* Trigger a scan, if last scan was more than 600 secs */
+ time_since_last_scan = time(NULL) - wlan_manager_get_last_scan_time();
+ INFO_LOG(SP_NAME_NORMAL, "time since last scan = %d secs", time_since_last_scan);
+ if (time_since_last_scan >= MAX_BSS_EXPIRY_TIME) {
+ HEADER_MODES current_state;
+ int scan_result;
+ current_state = viewer_manager_header_mode_get();
+ switch (current_state) {
+ case HEADER_MODE_DEACTIVATING:
+ case HEADER_MODE_OFF:
+ break;
+
+ case HEADER_MODE_ON:
+ case HEADER_MODE_CONNECTED:
+ INFO_LOG(SP_NAME_NORMAL, "Time to make a scan..");
+
+ viewer_manager_show(VIEWER_WINSET_SEARCHING);
+ viewer_manager_header_mode_set(HEADER_MODE_SEARCHING);
+
+ scan_result = wlan_manager_scan();
+ if (scan_result != WLAN_MANAGER_ERR_NONE) {
+ viewer_manager_hide(VIEWER_WINSET_SEARCHING);
+ viewer_manager_header_mode_set(current_state);
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ __COMMON_FUNC_EXIT__;
+}
+
+static void *on_create(ui_gadget_h ug, enum ug_mode mode,
+ service_h service, void *priv)
+{
__COMMON_FUNC_ENTER__;
if (!ug || !priv) {
- INFO_LOG(UG_NAME_ERR, "[Error]Data is NULL - ug or priv");
+ INFO_LOG(UG_NAME_ERR, "UG and PRIV should not be NULL");
+
+ __COMMON_FUNC_EXIT__;
return NULL;
}
ug_app_state = g_new0(wifi_appdata, 1);
- assertm_if(NULL == ug_app_state, "Err!! ug_app_state == NULL");
+ retvm_if(NULL == ug_app_state, NULL);
struct ug_data *ugd;
ugd = (struct ug_data*)priv;
char *caller = NULL;
if (service_get_extra_data(service, UG_CALLER, &caller)) {
- ERROR_LOG(UG_NAME_NORMAL, "Failed to get service extra data");
+ ERROR_LOG(UG_NAME_NORMAL, "Fail to get service extra data");
+
+ __COMMON_FUNC_EXIT__;
return NULL;
}
if (caller != NULL) {
- INFO_LOG(UG_NAME_NORMAL, "caller = [%s]", caller);
+ INFO_LOG(UG_NAME_NORMAL, "caller: %s", caller);
+
if (strcmp(caller, "pwlock") == 0) {
ug_app_state->ug_type = UG_VIEW_SETUP_WIZARD;
- service_get_extra_data(service, "lbutton", &ug_app_state->lbutton_setup_wizard_prev);
- service_get_extra_data(service, "rbutton_skip", &ug_app_state->rbutton_setup_wizard_skip);
- service_get_extra_data(service, "rbutton_next", &ug_app_state->rbutton_setup_wizard_next);
- } else {
+ service_get_extra_data(service, "lbutton",
+ &ug_app_state->lbutton_setup_wizard_prev);
+ service_get_extra_data(service, "rbutton_skip",
+ &ug_app_state->rbutton_setup_wizard_skip);
+ service_get_extra_data(service, "rbutton_next",
+ &ug_app_state->rbutton_setup_wizard_next);
+ } else
ug_app_state->ug_type = UG_VIEW_DEFAULT;
- }
free(caller);
} else {
Evas_Object *parent_layout = ug_get_parent_layout(ug);
if (parent_layout == NULL) {
ERROR_LOG(UG_NAME_NORMAL, "Failed to get parent layout");
+
+ __COMMON_FUNC_EXIT__;
return NULL;
}
VCONFKEY_WIFI_UG_RUN_STATE_ON_FOREGROUND);
/* Remove the "WiFi networks found" from the notification tray.*/
- idler = ecore_idler_add(__wifi_efl_ug_del_found_ap_noti, NULL);
-
- evas_object_show(parent_layout);
+ ecore_idler_add(__wifi_efl_ug_del_found_ap_noti, NULL);
memset(&g_pending_call, 0, sizeof(wifi_pending_call_info_t));
Evas_Object *layout_main = viewer_manager_create(parent_layout);
if (layout_main == NULL) {
- if( idler != NULL )
- ecore_idler_del(idler);
INFO_LOG(UG_NAME_ERR, "Failed to create viewer_manager");
+
+ __COMMON_FUNC_EXIT__;
return NULL;
}
case WLAN_MANAGER_ERR_ALREADY_REGISTERED:
break;
- case WLAN_MANAGER_ERR_UNKNOWN:
- winset_popup_mode_set(ug_app_state->popup_manager, POPUP_OPTION_REGISTER_FAILED_COMMUNICATION_FAILED, NULL);
-
- __COMMON_FUNC_EXIT__;
- return ugd->base;
-
default:
+ ERROR_LOG(UG_NAME_NORMAL, "Cannot start wlan_manager");
+
__COMMON_FUNC_EXIT__;
return ugd->base;
}
viewer_manager_header_mode_set(HEADER_MODE_OFF);
viewer_manager_hide(VIEWER_WINSET_SUB_CONTENTS);
break;
+
case WLAN_MANAGER_CONNECTING:
case WLAN_MANAGER_UNCONNECTED:
case WLAN_MANAGER_CONNECTED:
- connman_request_scan_mode_set(WIFI_BGSCAN_MODE_PERIODIC);
viewer_manager_header_mode_set(HEADER_MODE_SEARCHING);
- viewer_manager_show(VIEWER_WINSET_SEARCHING);
+ viewer_manager_hide(VIEWER_WINSET_SEARCHING);
viewer_manager_show(VIEWER_WINSET_SUB_CONTENTS);
break;
+
case WLAN_MANAGER_ERROR:
default:
return ugd->base;
}
+ evas_object_show(layout_main);
+
motion_create(layout_main);
__COMMON_FUNC_EXIT__;
return ugd->base;
}
-static Eina_Bool load_initial_ap_list(void *data)
+static gboolean load_initial_ap_list(gpointer data)
{
- wlan_manager_scanned_profile_refresh_with_count((int)data);
- return ECORE_CALLBACK_CANCEL;
+ __COMMON_FUNC_ENTER__;
+
+ /* Because of transition effect performance,
+ * Wi-Fi lists might be better to be updated at maximum delayed
+ */
+ wlan_manager_scanned_profile_refresh();
+
+ __COMMON_FUNC_EXIT__;
+ return FALSE;
}
static void on_start(ui_gadget_h ug, service_h service, void *priv)
{
__COMMON_FUNC_ENTER__;
- ecore_idler_add(load_initial_ap_list, (void *)8);
+
+ g_idle_add(load_initial_ap_list, NULL);
+
+ connman_request_scan_mode_set(WIFI_BGSCAN_MODE_PERIODIC);
motion_start();
__COMMON_FUNC_EXIT__;
- return;
}
static void on_pause(ui_gadget_h ug, service_h service, void *priv)
common_util_set_system_registry(VCONFKEY_WIFI_UG_RUN_STATE,
VCONFKEY_WIFI_UG_RUN_STATE_ON_FOREGROUND);
+ __make_scan_if_bss_expired();
+
__COMMON_FUNC_EXIT__;
}
{
__COMMON_FUNC_ENTER__;
+ int ret;
common_util_set_system_registry(VCONFKEY_WIFI_UG_RUN_STATE,
VCONFKEY_WIFI_UG_RUN_STATE_OFF);
viewer_manager_destroy();
DEBUG_LOG(UG_NAME_NORMAL, "* manager destroy complete");
DEBUG_LOG(UG_NAME_NORMAL, "* wlan manager destroying...");
- wlan_manager_destroy();
- if(g_pending_call.is_handled == FALSE)
- {
+ ret = wlan_manager_destroy();
+ if (ret != WLAN_MANAGER_ERR_NONE)
+ ERROR_LOG(UG_NAME_NORMAL, "Failed to destroy : %d",ret);
+
+ if (g_pending_call.is_handled == FALSE) {
dbus_g_proxy_cancel_call(g_pending_call.proxy, g_pending_call.pending_call);
g_pending_call.is_handled = TRUE;
+
memset(&g_pending_call, 0, sizeof(wifi_pending_call_info_t));
+
DEBUG_LOG(UG_NAME_NORMAL, "* pending dbus call cleared");
}
struct ug_data* ugd = priv;
- if(ugd->base){
+ if (ugd->base){
evas_object_del(ugd->base);
ugd->base = NULL;
}
+
+ __COMMON_FUNC_EXIT__;
}
static void on_message(ui_gadget_h ug, service_h msg, service_h service, void *priv)
static void on_event(ui_gadget_h ug, enum ug_event event, service_h service, void *priv)
{
+ __COMMON_FUNC_ENTER__;
+
switch (event) {
- case UG_EVENT_LOW_MEMORY:
- break;
- case UG_EVENT_LOW_BATTERY:
- break;
- case UG_EVENT_LANG_CHANGE:
- break;
- case UG_EVENT_ROTATE_PORTRAIT:
- break;
- case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN:
- break;
- case UG_EVENT_ROTATE_LANDSCAPE:
- break;
- case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN:
- break;
- default:
- break;
+ case UG_EVENT_LOW_MEMORY:
+ break;
+ case UG_EVENT_LOW_BATTERY:
+ break;
+ case UG_EVENT_LANG_CHANGE:
+ break;
+ case UG_EVENT_ROTATE_PORTRAIT:
+ break;
+ case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN:
+ break;
+ case UG_EVENT_ROTATE_LANDSCAPE:
+ break;
+ case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN:
+ break;
+ default:
+ break;
}
+
+ __COMMON_FUNC_EXIT__;
}
static void on_key_event(ui_gadget_h ug, enum ug_key_event event, service_h service, void *priv)
__COMMON_FUNC_ENTER__;
if (!ug) {
+ __COMMON_FUNC_EXIT__;
return;
}
switch (event) {
- case UG_KEY_EVENT_END:
- INFO_LOG(UG_NAME_NORMAL, "UG_KEY_EVENT_END");
-
- /* popup key event determine */
- winset_popup_hide_popup(ug_app_state->popup_manager);
-
- Evas_Object* navi_frame = viewer_manager_get_naviframe();
- view_manager_view_type_t top_view_id = (view_manager_view_type_t)evas_object_data_get(navi_frame, SCREEN_TYPE_ID_KEY);
- if(VIEW_MANAGER_VIEW_TYPE_MAIN == top_view_id) {
- INFO_LOG(UG_NAME_NORMAL, "same");
- } else {
- INFO_LOG(UG_NAME_NORMAL, "differ");
- elm_naviframe_item_pop(viewer_manager_get_naviframe());
- return;
- }
+ case UG_KEY_EVENT_END:
+ INFO_LOG(UG_NAME_NORMAL, "UG_KEY_EVENT_END");
+
+ /* popup key event determine */
+ winset_popup_hide_popup(ug_app_state->popup_manager);
+
+ Evas_Object* navi_frame = viewer_manager_get_naviframe();
+ view_manager_view_type_t top_view_id = (view_manager_view_type_t)evas_object_data_get(navi_frame, SCREEN_TYPE_ID_KEY);
+ if(VIEW_MANAGER_VIEW_TYPE_MAIN == top_view_id)
+ INFO_LOG(UG_NAME_NORMAL, "same");
+ else {
+ INFO_LOG(UG_NAME_NORMAL, "differ");
+ elm_naviframe_item_pop(viewer_manager_get_naviframe());
+
+ __COMMON_FUNC_EXIT__;
+ return;
+ }
- wifi_exit();
- break;
- default:
- INFO_LOG(UG_NAME_NORMAL, "UG_KEY_EVENT [%d]", event);
- break;
+ wifi_exit();
+ break;
+ default:
+ INFO_LOG(UG_NAME_NORMAL, "UG_KEY_EVENT [%d]", event);
+ break;
}
+
__COMMON_FUNC_EXIT__;
}
wifi_exit_end = FALSE;
- assertm_if(NULL == ops, "Err!! ug_module_ops == NULL");
+ retvm_if(NULL == ops, 0);
struct ug_data *ugd;
ugd = calloc(1, sizeof(struct ug_data));
UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops)
{
__COMMON_FUNC_ENTER__;
- assertm_if(NULL == ops, "Err!! ug_module_ops == NULL");
+
+ retm_if(NULL == ops);
struct ug_data *ugd;
if (ugd)
free(ugd);
+
__COMMON_FUNC_EXIT__;
}
static bool setting_plugin_wifi_found_ap_cb(wifi_ap_h ap, void* user_data)
{
- bool favourite = false;
+ bool favorite = false;
- wifi_ap_is_favorite(ap, &favourite);
+ wifi_ap_is_favorite(ap, &favorite);
- if (true == favourite)
+ if (true == favorite)
wlan_manager_forget(ap);
return true;
}
wifi_foreach_found_aps(setting_plugin_wifi_found_ap_cb, NULL);
- return_value = wlan_manager_request_power_off();
+ return_value = wlan_manager_power_off();
if (return_value != WLAN_MANAGER_ERR_NONE) {
ERROR_LOG(UG_NAME_NORMAL, "Failed to power_off: %d",return_value);
return_value = -1;
return return_value;
}
-int wifi_exit()
+int wifi_exit(void)
{
__COMMON_FUNC_ENTER__;
if(wifi_exit_end == TRUE) {
+++ /dev/null
-/*
-* Wi-Fi UG
-*
-* 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 "wifi.h"
-#include "wifi-ui-list-callbacks.h"
-#include "wlan_manager.h"
-#include "view_detail.h"
-#include "viewer_list.h"
-#include "common_pswd_popup.h"
-#include "common_eap_connect.h"
-#include "winset_popup.h"
-#include "i18nmanager.h"
-#include "common_datamodel.h"
-
-extern wifi_appdata *ug_app_state;
-
-static void _popup_cancel_cb(void *data, Evas_Object *obj, void *event_info)
-{
- __COMMON_FUNC_ENTER__;
- if (!ug_app_state->passpopup || !data) {
- return;
- }
-
- char *profile_name = (char *)data;
- common_pswd_popup_destroy(ug_app_state->passpopup);
- ug_app_state->passpopup = NULL;
- g_free(profile_name);
- __COMMON_FUNC_EXIT__;
-}
-
-static void _popup_ok_cb(void *data, Evas_Object *obj, void *event_info)
-{
- __COMMON_FUNC_ENTER__;
- if (!ug_app_state->passpopup || !data) {
- return;
- }
-
- char *profile_name = (char *)data;
- wlan_security_mode_type_t sec_mode;
- view_datamodel_basic_info_t *basic_data_model = view_basic_detail_datamodel_create(profile_name);
- if (!basic_data_model) {
- common_pswd_popup_destroy(ug_app_state->passpopup);
- ug_app_state->passpopup = NULL;
- g_free(profile_name);
- return;
- }
- int ret = WLAN_MANAGER_ERR_NONE;
- int nLen = 0;
- const char* szPassword = common_pswd_popup_get_txt(ug_app_state->passpopup);
- nLen = strlen(szPassword);
- INFO_LOG(UG_NAME_NORMAL, "password = [%s]", szPassword);
-
- sec_mode = view_detail_datamodel_sec_mode_get(basic_data_model);
- switch (sec_mode) {
- case WLAN_SEC_MODE_WEP:
-
- if (nLen != 5 && nLen != 13 && nLen != 26 && nLen != 10) {
- winset_popup_mode_set(ug_app_state->popup_manager, POPUP_OPTION_WEP_PSWD_LEN_ERROR, NULL);
- goto popup_ok_cb_exit;
- }
-
- break;
-
- case WLAN_SEC_MODE_WPA_PSK:
- case WLAN_SEC_MODE_WPA2_PSK:
-
- if (nLen < 8 || nLen > 63) {
- winset_popup_mode_set(ug_app_state->popup_manager, POPUP_OPTION_WPA_PSWD_LEN_ERROR, NULL);
- goto popup_ok_cb_exit;
- }
- break;
-
- default:
- ERROR_LOG(UG_NAME_SCAN, "Fatal: Wrong security mode : %d", sec_mode);
- common_pswd_popup_destroy(ug_app_state->passpopup);
- ug_app_state->passpopup = NULL;
- g_free(profile_name);
- goto popup_ok_cb_exit;
- }
-
- common_pswd_popup_destroy(ug_app_state->passpopup);
- ug_app_state->passpopup = NULL;
-
- INFO_LOG(UG_NAME_SCAN, "connect with password comp");
- wlan_manager_password_data param;
- memset(¶m, 0, sizeof(wlan_manager_password_data));
- param.wlan_eap_type = WLAN_MANAGER_EAP_TYPE_NONE;
- param.password = szPassword;
- ret = wlan_manager_connect_with_password(profile_name, sec_mode, ¶m);
- if (WLAN_MANAGER_ERR_NONE == ret) {
- viewer_manager_header_mode_set(HEADER_MODE_CONNECTING);
- } else {
- ERROR_LOG(UG_NAME_SCAN, "wlan error %d", ret);
- viewer_manager_header_mode_set(HEADER_MODE_ON);
- }
-
- g_free(profile_name);
-
-popup_ok_cb_exit:
- g_free((gpointer)szPassword);
- view_basic_detail_datamodel_destroy(basic_data_model);
-
- __COMMON_FUNC_EXIT__;
-}
-
-static void _wps_pbc_popup_cancel_connecting(void* data, Evas_Object* obj, void* event_info)
-{
- if (!ug_app_state->passpopup || !data) {
- return;
- }
-
- char *profile_name = (char *)data;
- int ret = wlan_manager_request_cancel_wps_connection(profile_name);
- if (ret == WLAN_MANAGER_ERR_NONE) {
- INFO_LOG(UG_NAME_NORMAL, "WPS conection cancelled successfully for AP[%s]", profile_name);
- } else {
- ERROR_LOG(UG_NAME_NORMAL, "Error!!! wlan_manager_request_cancel_wps_connection failed for AP[%s]", profile_name);
- }
- common_pswd_popup_destroy(ug_app_state->passpopup);
- ug_app_state->passpopup = NULL;
- viewer_manager_header_mode_set(HEADER_MODE_ON);
- g_free(profile_name);
- return;
-}
-
-static void _wps_btn_cb(void* data, Evas_Object* obj, void* event_info)
-{
- __COMMON_FUNC_ENTER__;
- if (!ug_app_state->passpopup || !data) {
- return;
- }
-
- char *profile_name = (char *)data;
- int ret = wlan_manager_request_wps_connection(profile_name);
- if (ret == WLAN_MANAGER_ERR_NONE) {
- viewer_manager_header_mode_set(HEADER_MODE_CONNECTING);
- common_pswd_popup_pbc_popup_create(ug_app_state->passpopup, _wps_pbc_popup_cancel_connecting, profile_name);
- } else {
- ERROR_LOG(UG_NAME_NORMAL, "Error!!! wlan_manager_request_wps_connection failed");
- common_pswd_popup_destroy(ug_app_state->passpopup);
- ug_app_state->passpopup = NULL;
- g_free(profile_name);
- }
- __COMMON_FUNC_EXIT__;
-}
-
-void eap_view_close_cb(void)
-{
- ug_app_state->eap_view = NULL;
-}
-
-void radio_button_cb(void *data, Evas_Object *obj, void *event_info)
-{
- __COMMON_FUNC_ENTER__;
-
- int ret = WLAN_MANAGER_ERR_UNKNOWN;
- Elm_Object_Item *it = (Elm_Object_Item *)event_info;
- wifi_device_info_t *device_info = (wifi_device_info_t *)data;
-
- if (!it || !device_info || device_info->ssid == NULL) {
- ERROR_LOG(UG_NAME_NORMAL, "Error!!! Invalid inout params");
- __COMMON_FUNC_EXIT__;
- return;
- }
-
- ug_genlist_data_t *gdata = (ug_genlist_data_t *) elm_object_item_data_get((Elm_Object_Item*)it);
- if(NULL == gdata) {
- ERROR_LOG(UG_NAME_NORMAL, "Error!!! list item data null");
- __COMMON_FUNC_EXIT__;
- return;
- }
-
- int item_state = gdata->radio_mode;
- int current_state = 0;
-
- INFO_LOG(UG_NAME_NORMAL, "ssid --- %s", device_info->ssid);
- INFO_LOG(UG_NAME_NORMAL, "current item_state state is --- %d\n", item_state);
-
- switch (item_state) {
- case VIEWER_ITEM_RADIO_MODE_OFF:
- current_state = viewer_manager_header_mode_get();
-
- INFO_LOG(UG_NAME_NORMAL, "Clicked AP`s information\n");
- INFO_LOG(UG_NAME_NORMAL, "header mode [%d]", current_state);
-
- switch (current_state) {
- case HEADER_MODE_CONNECTED:
- case HEADER_MODE_ON:
- ret = wlan_manager_request_connection(device_info);
- if (ret == WLAN_MANAGER_ERR_NONE) {
- viewer_manager_header_mode_set(HEADER_MODE_CONNECTING);
- }
- break;
-
- case HEADER_MODE_OFF:
- case HEADER_MODE_SEARCHING:
- case HEADER_MODE_ACTIVATING:
- case HEADER_MODE_CONNECTING:
- case HEADER_MODE_DISCONNECTING:
- case HEADER_MODE_DEACTIVATING:
- default:
- INFO_LOG(UG_NAME_NORMAL, "Ignore the item click");
- break;
- }
- break;
-
- case VIEWER_ITEM_RADIO_MODE_CONNECTED:
- INFO_LOG(UG_NAME_NORMAL, "want to disconnect for connected item");
- ret = wlan_manager_request_disconnection(device_info);
- if(ret == WLAN_MANAGER_ERR_NONE){
- viewer_manager_header_mode_set(HEADER_MODE_DISCONNECTING);
- }
- break;
-
- case VIEWER_ITEM_RADIO_MODE_CONNECTING:
- INFO_LOG(UG_NAME_NORMAL, "want to cancel connecting for connected item");
- ret = wlan_manager_request_cancel_connecting(device_info->profile_name);
- if(ret == WLAN_MANAGER_ERR_NONE){
- viewer_manager_header_mode_set(HEADER_MODE_CANCEL_CONNECTING);
- }
- break;
-
- default:
- ret = WLAN_MANAGER_ERR_UNKNOWN;
- break;
- }
-
- switch (ret) {
- case WLAN_MANAGER_ERR_NONE:
- INFO_LOG(UG_NAME_NORMAL, "ERROR_NONE");
- break;
- case WLAN_MANAGER_ERR_CONNECT_PASSWORD_NEEDED:
- {
- pswd_popup_create_req_data_t popup_info;
- popup_info.title = device_info->ssid;
- popup_info.ok_cb = _popup_ok_cb;
- popup_info.cancel_cb = _popup_cancel_cb;
- popup_info.show_wps_btn = device_info->wps_mode;
- popup_info.wps_btn_cb = _wps_btn_cb;
- popup_info.cb_data = g_strdup(gdata->device_info->profile_name);
- INFO_LOG(UG_NAME_NORMAL, "Going to create a popup. ug_app_state = 0x%x", ug_app_state);
- ug_app_state->passpopup = common_pswd_popup_create(ug_app_state->win_main, PACKAGE, &popup_info);
- INFO_LOG(UG_NAME_NORMAL, "After create a popup");
- if (ug_app_state->passpopup == NULL) {
- INFO_LOG(UG_NAME_ERR, "pass popup create failed !");
- }
- }
- break;
-
- case WLAN_MANAGER_ERR_CONNECT_EAP_SEC_TYPE:
- {
- Evas_Object* navi_frame = viewer_manager_get_naviframe();
- if (navi_frame == NULL) {
- ERROR_LOG(UG_NAME_NORMAL, "Failed : get naviframe");
- return;
- }
- ug_app_state->eap_view = create_eap_connect(ug_app_state->win_main, navi_frame, PACKAGE, device_info, eap_view_close_cb);
- }
- break;
-
- case WLAN_MANAGER_ERR_NOSERVICE:
- break;
-
- default:
- ERROR_LOG(UG_NAME_NORMAL, "errro code [%d]", ret);
- break;
- }
-
- __COMMON_FUNC_EXIT__;
- return;
-}
-
-void list_select_cb(void *data, Evas_Object *obj, void *event_info)
-{
- __COMMON_FUNC_ENTER__;
-
- INFO_LOG(UG_NAME_NORMAL,"=================\n");
- INFO_LOG(UG_NAME_NORMAL," %s %d\n", __func__ ,__LINE__);
- INFO_LOG(UG_NAME_NORMAL,"=================\n");
-
- if (data == NULL) {
- __COMMON_FUNC_EXIT__;
- return;
- }
-
- wifi_device_info_t *device_info = (wifi_device_info_t *)data;
-
- DEBUG_LOG(UG_NAME_NORMAL, "ssid [%s]", device_info->ssid);
-
- view_detail(device_info, ug_app_state->win_main);
-
- __COMMON_FUNC_EXIT__;
-}
-
*/
#include "ug_wifi.h"
+#include "viewer_list.h"
#include "wlan_manager.h"
-#include "viewer_manager.h"
#include "winset_popup.h"
-#include "wifi-engine-callback.h"
-#include "viewer_list.h"
#include "motion_control.h"
+#include "viewer_manager.h"
+#include "wlan_connection.h"
+#include "wifi-engine-callback.h"
extern wifi_appdata *ug_app_state;
return;
}
- Elm_Object_Item* target_item = NULL;
- ug_genlist_data_t* gdata = NULL;
+ Elm_Object_Item *target_item = NULL;
+ ug_genlist_data_t *gdata = NULL;
int header_state = -1;
header_state = viewer_manager_header_mode_get();
if (!target_item ||
!(gdata = (ug_genlist_data_t *)elm_object_item_data_get(target_item))) {
ERROR_LOG(UG_NAME_RESP, "Error!!! Fatal: Unable to add a connecting/connected item with item data[0x%x].", gdata);
- __COMMON_FUNC_EXIT__;
- return;
+
+ goto exit;
}
} else {
ERROR_LOG(UG_NAME_RESP, "Fatal: target_item or gdata is NULL");
- __COMMON_FUNC_EXIT__;
- return;
+
+ goto exit;
}
}
/* All OK to process the response */
switch (event_info->event_type) {
case WLAN_MANAGER_RESPONSE_TYPE_POWER_ON_OK:
- connman_request_scan_mode_set(WIFI_BGSCAN_MODE_PERIODIC);
viewer_manager_header_mode_set(HEADER_MODE_SEARCHING);
viewer_manager_show(VIEWER_WINSET_SEARCHING);
viewer_manager_show(VIEWER_WINSET_SUB_CONTENTS);
HEADER_MODE_OFF == header_state)
break;
- viewer_manager_hidden_disable_set(FALSE);
+ viewer_manager_update_hidden_btn();
viewer_manager_hide(VIEWER_WINSET_SEARCHING);
/* fall through */
case WLAN_MANAGER_RESPONSE_TYPE_SCAN_RESULT_IND:
break;
case WLAN_MANAGER_RESPONSE_TYPE_CONNECTING:
- target_item = viewer_manager_move_item_to_top(target_item);
- viewer_manager_update_ap_handle(target_item, event_info->ap);
viewer_manager_header_mode_set(HEADER_MODE_CONNECTING);
- viewer_list_item_radio_mode_set(target_item, VIEWER_ITEM_RADIO_MODE_CONNECTING);
- viewer_manager_scroll_to_top();
+
+ viewer_manager_refresh_ap_info(target_item);
+ viewer_list_item_radio_mode_set(target_item,
+ VIEWER_ITEM_RADIO_MODE_CONNECTING);
break;
case WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_OK:
case WLAN_MANAGER_RESPONSE_TYPE_WPS_ENROLL_OK:
- target_item = viewer_manager_move_item_to_top(target_item);
- viewer_manager_update_ap_handle(target_item, event_info->ap);
- viewer_list_item_radio_mode_set(target_item , VIEWER_ITEM_RADIO_MODE_CONNECTED);
viewer_manager_header_mode_set(HEADER_MODE_CONNECTED);
- viewer_manager_scroll_to_top();
+
+ viewer_manager_refresh_ap_info(target_item);
+ viewer_list_item_radio_mode_set(target_item,
+ VIEWER_ITEM_RADIO_MODE_CONNECTED);
if (ug_app_state->passpopup) {
/* This is needed to remove the PBC timer popup */
- common_pswd_popup_destroy(ug_app_state->passpopup);
+ passwd_popup_free(ug_app_state->passpopup);
ug_app_state->passpopup = NULL;
}
break;
case WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_CONNECT_FAILED:
case WLAN_MANAGER_RESPONSE_TYPE_WPS_ENROLL_FAIL:
viewer_manager_header_mode_set(HEADER_MODE_ON);
- viewer_list_item_radio_mode_set(target_item , VIEWER_ITEM_RADIO_MODE_OFF);
+ viewer_list_item_radio_mode_set(target_item, VIEWER_ITEM_RADIO_MODE_OFF);
if (ug_app_state->passpopup) {
- common_pswd_popup_destroy(ug_app_state->passpopup);
+ passwd_popup_free(ug_app_state->passpopup);
ug_app_state->passpopup = NULL;
}
break;
case WLAN_MANAGER_RESPONSE_TYPE_DISCONNECTION_OK:
- viewer_manager_update_ap_handle(target_item, event_info->ap);
+ viewer_manager_refresh_ap_info(target_item);
viewer_list_item_radio_mode_set(target_item, VIEWER_ITEM_RADIO_MODE_OFF);
viewer_manager_header_mode_set(HEADER_MODE_ON);
break;
viewer_manager_specific_scan_response_hlr(event_info->bss_info_list, user_data);
break;
- case WLAN_MANAGER_RESPONSE_TYPE_UPDATE_SIG_STR:
- viewer_manager_update_connected_ap_sig_str();
+ case WLAN_MANAGER_RESPONSE_TYPE_UPDATE_WIFI_RSSI:
+ viewer_manager_update_rssi();
break;
case WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_INVALID_KEY:
break;
}
+exit:
+ wlan_validate_alt_connection();
__COMMON_FUNC_EXIT__;
}
void wlan_engine_refresh_callback(void)
{
__COMMON_FUNC_ENTER__;
+
viewer_manager_refresh();
+
__COMMON_FUNC_EXIT__;
}
char *str_pkg_name;
};
-static void _mobilehotspot_disable_cb(DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
+static void __wifi_tethering_deactivated_cb(DBusGProxy *proxy,
+ DBusGProxyCall *call, gpointer user_data)
{
__COMMON_FUNC_ENTER__;
INFO_LOG(COMMON_NAME_LIB, "OK\n");
/* Tethering is now disabled. All OK to switch on Wi-Fi */
power_control();
- } else {
+ } else
viewer_manager_header_mode_set(HEADER_MODE_OFF);
- }
}
g_pending_call.is_handled = TRUE;
__COMMON_FUNC_EXIT__;
}
-static void _retry_clicked_cb(void* data, Evas_Object* obj, void* event_info)
-{
- __COMMON_FUNC_ENTER__;
-
- popup_manager_object_t *manager_object = (popup_manager_object_t *)data;
- if (manager_object == NULL)
- return;
-
- INFO_LOG(UG_NAME_NORMAL, "Response OK");
-
- switch (wlan_manager_start()) {
- case WLAN_MANAGER_ERR_NONE:
- break;
-
- case WLAN_MANAGER_ERR_ALREADY_REGISTERED:
- break;
-
- case WLAN_MANAGER_ERR_UNKNOWN:
- winset_popup_mode_set(manager_object, POPUP_OPTION_REGISTER_FAILED_COMMUNICATION_FAILED, NULL);
-
- __COMMON_FUNC_EXIT__;
- return;
-
- default:
- __COMMON_FUNC_EXIT__;
- return;
- }
-
- switch (wlan_manager_state_get()) {
- case WLAN_MANAGER_OFF:
- viewer_manager_header_mode_set(HEADER_MODE_OFF);
- viewer_manager_hide(VIEWER_WINSET_SUB_CONTENTS);
- break;
- case WLAN_MANAGER_UNCONNECTED:
- case WLAN_MANAGER_CONNECTING:
- case WLAN_MANAGER_CONNECTED:
- connman_request_scan_mode_set(WIFI_BGSCAN_MODE_PERIODIC);
- viewer_manager_header_mode_set(HEADER_MODE_SEARCHING);
- viewer_manager_hide(VIEWER_WINSET_SEARCHING);
- viewer_manager_show(VIEWER_WINSET_SUB_CONTENTS);
- break;
- case WLAN_MANAGER_ERROR:
- default:
- break;
- }
-
- __COMMON_FUNC_EXIT__;
-}
-
-static void _back_clicked_cb(void* data, Evas_Object* obj, void* event_info)
-{
- INFO_LOG(UG_NAME_NORMAL, "Response CANCEL");
- wifi_exit();
-}
-
-static int mobilehotspot_deactivate()
+static gboolean __wifi_tethering_deativate(void)
{
__COMMON_FUNC_ENTER__;
DBusGConnection *bus;
DBusGProxy *proxy;
- GError *error= NULL;
+ GError *error = NULL;
bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
if (error != NULL) {
INFO_LOG(COMMON_NAME_LIB, "Couldn't connect to the system bus");
+
g_error_free(error);
return FALSE;
}
proxy = dbus_g_proxy_new_for_name(bus,
- "org.tizen.tethering", /* name */
- "/Tethering", /* obj path */
- "org.tizen.tethering");/* interface */
+ "org.tizen.tethering",
+ "/Tethering",
+ "org.tizen.tethering");
if (proxy == NULL) {
- INFO_LOG(COMMON_NAME_LIB, "Couldn't create the proxy object");
+ INFO_LOG(COMMON_NAME_LIB, "Cannot create DBus proxy");
+
dbus_g_connection_unref(bus);
return FALSE;
}
- g_pending_call.pending_call = dbus_g_proxy_begin_call(proxy, "disable_wifi_tethering",
- _mobilehotspot_disable_cb, bus, NULL, G_TYPE_INVALID);
+ g_pending_call.pending_call = dbus_g_proxy_begin_call(proxy,
+ "disable_wifi_tethering",
+ __wifi_tethering_deactivated_cb,
+ bus, NULL, G_TYPE_INVALID);
g_pending_call.proxy = proxy;
g_pending_call.is_handled = FALSE;
return TRUE;
}
-static void _turn_off_mobileap_yes_clicked_cb(void* data, Evas_Object* obj, void* event_info)
+static void __wifi_tethering_off_ok_cb(void* data, Evas_Object* obj,
+ void* event_info)
{
__COMMON_FUNC_ENTER__;
+
popup_manager_object_t *manager_object = (popup_manager_object_t *)data;
+
INFO_LOG(UG_NAME_NORMAL, "Response OK");
- if(manager_object && NULL != manager_object->popup_user_prompt) {
+ if (manager_object && NULL != manager_object->popup_user_prompt) {
evas_object_hide(manager_object->popup_user_prompt);
evas_object_del(manager_object->popup_user_prompt);
manager_object->popup_user_prompt = NULL;
}
- if (FALSE != mobilehotspot_deactivate()) {
- INFO_LOG(UG_NAME_NORMAL, "Mobile AP return value TRUE");
- } else {
- INFO_LOG(UG_NAME_NORMAL, "Mobile AP return value FALSE");
- }
+ if (FALSE != __wifi_tethering_deativate())
+ INFO_LOG(UG_NAME_NORMAL, "Successfully de-activate Wi-Fi tethering");
+ else
+ INFO_LOG(UG_NAME_NORMAL, "Fail to de-activate Wi-Fi tethering");
__COMMON_FUNC_EXIT__;
}
-static void _turn_off_mobileap_no_clicked_cb(void* data, Evas_Object* obj, void* event_info)
+static void __wifi_tethering_off_no_cb(void* data, Evas_Object* obj,
+ void* event_info)
{
__COMMON_FUNC_ENTER__;
+
popup_manager_object_t *manager_object = (popup_manager_object_t *)data;
INFO_LOG(UG_NAME_NORMAL, "Response CANCEL");
- if(manager_object && NULL != manager_object->popup_user_prompt) {
+ if (manager_object && NULL != manager_object->popup_user_prompt) {
evas_object_hide(manager_object->popup_user_prompt);
evas_object_del(manager_object->popup_user_prompt);
manager_object->popup_user_prompt = NULL;
viewer_manager_header_mode_set(HEADER_MODE_OFF);
}
- __COMMON_FUNC_EXIT__;
-}
-#if 0
-static void _winset_popup_close_cb(void *data, Evas_Object *obj, void *event_info)
-{
- popup_manager_object_t *manager_object = (popup_manager_object_t *)data;
- if (manager_object && manager_object->popup) {
- evas_object_del(manager_object->popup);
- manager_object->popup = NULL;
- }
- return;
+ __COMMON_FUNC_EXIT__;
}
-#endif
-popup_manager_object_t *winset_popup_manager_create(Evas_Object* win, const char *str_pkg_name)
+popup_manager_object_t *winset_popup_manager_create(Evas_Object* win,
+ const char *str_pkg_name)
{
popup_manager_object_t *manager_object;
manager_object = g_new0(popup_manager_object_t, 1);
if (manager_object == NULL)
return;
- if(NULL != manager_object->popup) {
+ if (NULL != manager_object->popup) {
evas_object_hide(manager_object->popup);
evas_object_del(manager_object->popup);
manager_object->popup = NULL;
}
+
INFO_LOG(UG_NAME_NORMAL, "option = %d", option);
memset(&popup_btn_data, 0, sizeof(popup_btn_data));
+
switch (option) {
- case POPUP_OPTION_REGISTER_FAILED_COMMUNICATION_FAILED:
- popup_btn_data.info_txt = "connman is not working now";
- popup_btn_data.btn1_cb = _retry_clicked_cb;
- popup_btn_data.btn2_cb = _back_clicked_cb;
- popup_btn_data.btn1_data = manager_object;
- popup_btn_data.btn1_txt = "Retry";
- popup_btn_data.btn2_txt = "Back";
- manager_object->popup =
- common_utils_show_info_popup(
- manager_object->win, &popup_btn_data);
- break;
+ case POPUP_OPTION_POWER_ON_FAILED_TETHERING_OCCUPIED:
+ if (NULL != manager_object->popup_user_prompt)
+ break;
+
+ popup_btn_data.info_txt = WIFI_TETHERING_FAILED_STR;
+ popup_btn_data.btn1_cb = __wifi_tethering_off_ok_cb;
+ popup_btn_data.btn2_cb = __wifi_tethering_off_no_cb;
+ popup_btn_data.btn1_data = popup_btn_data.btn2_data = manager_object;
+ popup_btn_data.btn1_txt = sc(manager_object->str_pkg_name, I18N_TYPE_Yes);
+ popup_btn_data.btn2_txt = sc(manager_object->str_pkg_name, I18N_TYPE_No);
+ manager_object->popup_user_prompt =
+ common_utils_show_info_popup(manager_object->win, &popup_btn_data);
- case POPUP_OPTION_POWER_ON_FAILED_MOBILE_HOTSPOT:
- if(NULL == manager_object->popup_user_prompt) {
- popup_btn_data.info_txt =
- "Connecting Wi-Fi will turn off Mobile hotspot. Continue?";
- popup_btn_data.btn1_cb = _turn_off_mobileap_yes_clicked_cb;
- popup_btn_data.btn2_cb = _turn_off_mobileap_no_clicked_cb;
- popup_btn_data.btn1_data = popup_btn_data.btn2_data = manager_object;
- popup_btn_data.btn1_txt = sc(manager_object->str_pkg_name, I18N_TYPE_Yes);
- popup_btn_data.btn2_txt = sc(manager_object->str_pkg_name, I18N_TYPE_No);
- manager_object->popup_user_prompt =
- common_utils_show_info_popup(
- manager_object->win, &popup_btn_data);
- }
break;
case POPUP_OPTION_CONNECTING_FAILED:
- if (input_data) {
+ if (input_data)
info_txt = g_strdup_printf("Unable to connect %s", (char *)input_data);
- } else {
+ else
info_txt = g_strdup("Unable to connect");
- }
+
manager_object->popup =
common_utils_show_info_ok_popup(
manager_object->win, manager_object->str_pkg_name, info_txt);
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(wifi-qs C)
-# defines
+# defines
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX "\${prefix}")
SET(LIBDIR "\${prefix}/lib")
SET(VERSION 0.1.0)
# source files
-SET(SRCS
+SET(SRCS
../libraries/i18nManager/i18nmanager.c
../libraries/appcoreWrapper/appcoreWrapper.c
- ../libraries/WlanManager/wlan-manager/wlan_manager.c
+ ../libraries/WlanManager/WlanManager/wlan_manager.c
+ ../libraries/WlanManager/WlanManager/wlan_connection.c
../libraries/Common/common_utils.c
../libraries/Common/common_ip_info.c
../libraries/Common/common_pswd_popup.c
../libraries/Common/common_eap_connect.c
- ../libraries/Common/common_invalid_password.c
${ENGINE_SOURCES}
viewer-popups/view-main.c
viewer-popups/view-alerts.c
- wifi-syspopup.c
+ wifi-syspopup.c
wifi-syspopup-engine-callback.c)
FOREACH(flag ${pkgs_CFLAGS})
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images/37_wifi_icon_lock_01.png DESTINATION /usr/share/icon)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images/37_wifi_icon_lock_02.png DESTINATION /usr/share/icon)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images/37_wifi_icon_lock_03.png DESTINATION /usr/share/icon)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images/37_wifi_icon_00_press.png DESTINATION /usr/share/icon)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images/37_wifi_icon_01_press.png DESTINATION /usr/share/icon)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images/37_wifi_icon_02_press.png DESTINATION /usr/share/icon)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images/37_wifi_icon_03_press.png DESTINATION /usr/share/icon)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images/37_wifi_icon_lock_00_press.png DESTINATION /usr/share/icon)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images/37_wifi_icon_lock_01_press.png DESTINATION /usr/share/icon)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images/37_wifi_icon_lock_02_press.png DESTINATION /usr/share/icon)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images/37_wifi_icon_lock_03_press.png DESTINATION /usr/share/icon)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images/Q02_Notification__wifi_in_range.png DESTINATION /usr/share/icon)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/net.${PROJECT_NAME}.xml DESTINATION /usr/share/packages/)
# install ini file
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.ini DESTINATION /usr/share/process-info)
-
#endif
#include "common.h"
+#include "wlan_manager.h"
#include "common_pswd_popup.h"
#include "common_eap_connect.h"
-#include "wlan_manager.h"
-#define PACKAGE "wifi-qs"
-#define LOCALEDIR "/usr/share/locale"
-#define WIFI_SP_ICON_PATH "/usr/share/icon"
+#define PACKAGE "wifi-qs"
+#define LOCALEDIR "/usr/share/locale"
+#define WIFI_SP_ICON_PATH "/usr/share/icon"
typedef enum {
- WIFI_SYSPOPUP_SUPPORT_NONE =0,
- WIFI_SYSPOPUP_SUPPORT_QUICKPANEL=1,
- WIFI_SYSPOPUP_SUPPORT_MAX
+ WIFI_SYSPOPUP_SUPPORT_NONE = 0x00,
+ WIFI_SYSPOPUP_SUPPORT_QUICKPANEL,
+ WIFI_SYSPOPUP_SUPPORT_MAX,
} WIFI_SYSPOPUP_SUPPORTS;
typedef enum {
- WIFI_SYSPOPUP_WITH_AP_LIST = 0,
+ WIFI_SYSPOPUP_WITH_AP_LIST = 0x00,
WIFI_SYSPOPUP_WITHOUT_AP_LIST
} WIFI_SYSPOPUP_TYPE;
WIFI_SYSPOPUP_TYPE syspopup_type;
/* window */
- Evas_Object* win_main;
- Evas_Object* conformant;
- Evas_Object* layout_main;
+ Evas_Object *win_main;
+ Evas_Object *conformant;
+ Evas_Object *layout_main;
- Evas* evas;
- bundle* b;
+ Evas *evas;
+ bundle *b;
/* popups */
- Evas_Object* syspopup;
+ Evas_Object *syspopup;
pswd_popup_t *passpopup;
- common_eap_connect_data_t *eap_popup;
- Evas_Object* alertpopup;
+ eap_connect_data_t *eap_popup;
+ Evas_Object *alertpopup;
} wifi_object;
typedef enum {
ITEM_CONNECTION_MODE_NULL,
ITEM_CONNECTION_MODE_OFF,
ITEM_CONNECTION_MODE_CONNECTING,
- ITEM_CONNECTION_MODE_DISCONNECTING,
ITEM_CONNECTION_MODE_MAX
} ITEM_CONNECTION_MODES;
Elm_Object_Item *it;
ITEM_CONNECTION_MODES connection_mode;
wifi_device_info_t *dev_info;
+ gboolean highlighted;
} syspopup_genlist_data_t;
int wifi_syspopup_create(void);
static Evas_Object* list = NULL;
static Elm_Genlist_Item_Class itc;
-static ITEM_CONNECTION_MODES view_main_state_get()
+static ITEM_CONNECTION_MODES view_main_state_get(void)
{
- return (ITEM_CONNECTION_MODES)evas_object_data_get(list, QS_POPUP_CONNECTION_STATE);
+ ITEM_CONNECTION_MODES state;
+
+ state = (ITEM_CONNECTION_MODES)evas_object_data_get(
+ list, QS_POPUP_CONNECTION_STATE);
+
+ return state;
}
static void view_main_state_set(ITEM_CONNECTION_MODES state)
{
- return evas_object_data_set(list, QS_POPUP_CONNECTION_STATE, (const void *)state);
+ evas_object_data_set(list, QS_POPUP_CONNECTION_STATE, (const void *)state);
}
-static void _popup_ok_cb(void *data, Evas_Object *obj, void *event_info)
+static void __popup_ok_cb(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
- if (!syspopup_app_state->passpopup) {
+
+ wifi_ap_h ap = NULL;
+ int password_len = 0;
+ const char* password = NULL;
+ wifi_security_type_e sec_type = WIFI_SECURITY_TYPE_NONE;
+
+ if (syspopup_app_state->passpopup == NULL)
return;
- }
- assertm_if(NULL == obj, "obj is NULL!!");
- assertm_if(NULL == event_info, "event_info is NULL!!");
- wifi_ap_h ap = common_pswd_popup_get_ap(syspopup_app_state->passpopup);
- wifi_security_type_e sec_type;
- wifi_ap_get_security_type(ap, &sec_type);
+ ap = passwd_popup_get_ap(syspopup_app_state->passpopup);
+ password = passwd_popup_get_txt(syspopup_app_state->passpopup);
+ password_len = strlen(password);
- char* password = NULL;
- int len_password = 0;
- int ret = WLAN_MANAGER_ERR_UNKNOWN;
- password = common_pswd_popup_get_txt(syspopup_app_state->passpopup);
- len_password = strlen(password);
- INFO_LOG(SP_NAME_NORMAL, "* password len [%d]", len_password);
+ wifi_ap_get_security_type(ap, &sec_type);
switch (sec_type) {
case WIFI_SECURITY_TYPE_WEP:
- if (len_password == 5 || len_password == 13 || len_password == 26 || len_password == 10) {
- ret = wlan_manager_connect_with_password(ap, password);
- } else {
+ if (password_len != 5 && password_len != 13 &&
+ password_len != 26 && password_len != 10) {
view_alerts_popup_show(WEP_WRONG_PASSWORD_LEN_ERR_MSG_STR);
goto popup_ok_exit;
}
case WIFI_SECURITY_TYPE_WPA_PSK:
case WIFI_SECURITY_TYPE_WPA2_PSK:
- if (len_password < 8 || len_password > 63) {
+ if (password_len < 8 || password_len > 63) {
view_alerts_popup_show(WPA_WRONG_PASSWORD_LEN_ERR_MSG_STR);
goto popup_ok_exit;
- } else {
- ret = wlan_manager_connect_with_password(ap, password);
}
break;
default:
- ret = WLAN_MANAGER_ERR_UNKNOWN;
- ERROR_LOG(SP_NAME_ERR, "Fatal: Wrong security type : %d", sec_type);
+ ERROR_LOG(SP_NAME_ERR, "Wrong security mode: %d", sec_type);
+ passwd_popup_free(syspopup_app_state->passpopup);
break;
}
- common_pswd_popup_destroy(syspopup_app_state->passpopup);
+ wlan_manager_connect_with_password(ap, password);
+
+ passwd_popup_free(syspopup_app_state->passpopup);
syspopup_app_state->passpopup = NULL;
popup_ok_exit:
- g_free(password);
+ g_free((gpointer)password);
__COMMON_FUNC_EXIT__;
}
-static void _popup_cancel_cb(void *data, Evas_Object *obj, void *event_info)
+static void __popup_cancel_cb(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
- INFO_LOG(SP_NAME_NORMAL, "button cancel");
+ if (syspopup_app_state->passpopup == NULL)
+ return;
- common_pswd_popup_destroy(syspopup_app_state->passpopup);
+ passwd_popup_free(syspopup_app_state->passpopup);
syspopup_app_state->passpopup = NULL;
__COMMON_FUNC_EXIT__;
}
-static void _wps_pbc_popup_cancel_connecting(void* data, Evas_Object* obj, void* event_info)
+static void __wps_pbc_popup_cancel_connecting(void *data, Evas_Object *obj,
+ void *event_info)
{
- if (!syspopup_app_state->passpopup) {
+ if (syspopup_app_state->passpopup == NULL)
return;
- }
- wifi_ap_h ap = common_pswd_popup_get_ap(syspopup_app_state->passpopup);
- int ret = wlan_manager_request_disconnection(ap);
- if (ret == WLAN_MANAGER_ERR_NONE) {
- INFO_LOG(SP_NAME_NORMAL, "WPS conection cancelled successfully for AP[0x%x]", ap);
- } else {
- ERROR_LOG(SP_NAME_ERR, "Error!!! wlan_manager_request_disconnection failed for AP[0x%x]", ap);
- }
- common_pswd_popup_destroy(syspopup_app_state->passpopup);
+ wifi_ap_h ap = passwd_popup_get_ap(syspopup_app_state->passpopup);
+
+ int ret = wlan_manager_disconnect(ap);
+ if (ret != WLAN_MANAGER_ERR_NONE)
+ ERROR_LOG(SP_NAME_ERR, "Failed WPS PBC cancellation [0x%x]", ap);
+
+ passwd_popup_free(syspopup_app_state->passpopup);
syspopup_app_state->passpopup = NULL;
- return;
}
static void _wps_btn_cb(void* data, Evas_Object* obj, void* event_info)
return;
}
- wifi_ap_h ap = common_pswd_popup_get_ap(syspopup_app_state->passpopup);
- int ret = wlan_manager_request_wps_connection(ap);
+ wifi_ap_h ap = passwd_popup_get_ap(syspopup_app_state->passpopup);
+ int ret = wlan_manager_wps_connect(ap);
if (ret == WLAN_MANAGER_ERR_NONE) {
- common_pswd_popup_pbc_popup_create(syspopup_app_state->passpopup, _wps_pbc_popup_cancel_connecting, NULL);
+ create_pbc_popup(syspopup_app_state->passpopup, __wps_pbc_popup_cancel_connecting, NULL);
} else {
- ERROR_LOG(SP_NAME_ERR, "Error!!! wlan_manager_request_wps_connection failed");
+ ERROR_LOG(SP_NAME_ERR, "wlan_manager_wps_connect failed");
wifi_ap_destroy(ap);
}
+
__COMMON_FUNC_EXIT__;
}
-static void __view_main_request_connection(syspopup_genlist_data_t *gdata)
+static void __view_main_wifi_connect(syspopup_genlist_data_t *gdata)
{
- if (!gdata)
+ int rv;
+ bool favorite = false;
+ wifi_device_info_t *device_info;
+ pswd_popup_create_req_data_t popup_info;
+ wifi_security_type_e sec_type = WIFI_SECURITY_TYPE_NONE;
+
+ retm_if(NULL == gdata);
+
+ device_info = gdata->dev_info;
+ retm_if(NULL == device_info);
+
+ wifi_ap_is_favorite(device_info->ap, &favorite);
+
+ if (favorite == true) {
+ rv = wlan_manager_connect(device_info->ap);
return;
+ }
- int ret = WLAN_MANAGER_ERR_UNKNOWN;
- ret = wlan_manager_request_connection(gdata->dev_info->ap);
- switch (ret) {
- case WLAN_MANAGER_ERR_NONE:
- INFO_LOG( SP_NAME_NORMAL, "ERROR_NONE");
- view_main_state_set(ITEM_CONNECTION_MODE_CONNECTING);
+ wifi_ap_get_security_type(device_info->ap, &sec_type);
+
+ switch (sec_type) {
+ case WIFI_SECURITY_TYPE_NONE:
+ rv = wlan_manager_connect(device_info->ap);
break;
- case WLAN_MANAGER_ERR_CONNECT_PASSWORD_NEEDED:
- INFO_LOG( SP_NAME_NORMAL, "Password view will show up");
- pswd_popup_create_req_data_t popup_info;
+
+ case WIFI_SECURITY_TYPE_WEP:
+ case WIFI_SECURITY_TYPE_WPA_PSK:
+ case WIFI_SECURITY_TYPE_WPA2_PSK:
memset(&popup_info, 0, sizeof(pswd_popup_create_req_data_t));
+
popup_info.title = gdata->dev_info->ssid;
- popup_info.ok_cb = _popup_ok_cb;
- popup_info.cancel_cb = _popup_cancel_cb;
+ popup_info.ok_cb = __popup_ok_cb;
+ popup_info.cancel_cb = __popup_cancel_cb;
popup_info.show_wps_btn = gdata->dev_info->wps_mode;
popup_info.wps_btn_cb = _wps_btn_cb;
popup_info.ap = gdata->dev_info->ap;
popup_info.cb_data = NULL;
- syspopup_app_state->passpopup = common_pswd_popup_create(syspopup_app_state->layout_main, PACKAGE, &popup_info);
+ syspopup_app_state->passpopup = create_passwd_popup(
+ syspopup_app_state->layout_main, PACKAGE, &popup_info);
break;
- case WLAN_MANAGER_ERR_CONNECT_EAP_SEC_TYPE:
- syspopup_app_state->eap_popup = create_eap_connect_popup(syspopup_app_state->layout_main, PACKAGE, gdata->dev_info);
+
+ case WIFI_SECURITY_TYPE_EAP:
+ syspopup_app_state->eap_popup = create_eap_popup(
+ syspopup_app_state->layout_main, PACKAGE, gdata->dev_info);
break;
+
default:
- ERROR_LOG( SP_NAME_NORMAL, "errro code [%d]", ret);
+ ERROR_LOG(SP_NAME_NORMAL, "Unknown security type [%d]", sec_type);
break;
}
}
return NULL;
}
-static void _gl_sel(void *data, Evas_Object *obj, void *event_info)
+static void __gl_sel(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
+
assertm_if(NULL == data, "data is NULL!!");
assertm_if(NULL == obj, "obj is NULL!!");
assertm_if(NULL == event_info, "event_info is NULL!!");
+
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
ITEM_CONNECTION_MODES state = view_main_state_get();
syspopup_genlist_data_t *gdata = (syspopup_genlist_data_t *)data;
- if (ITEM_CONNECTION_MODE_OFF == state) {
- INFO_LOG(SP_NAME_NORMAL, "item state: off");
- __view_main_request_connection(gdata);
- elm_genlist_item_update(item);
- } else if (ITEM_CONNECTION_MODE_CONNECTING == state) {
- if (ITEM_CONNECTION_MODE_CONNECTING == gdata->connection_mode) { // Connecting Item Selected
- if (WLAN_MANAGER_ERR_NONE == wlan_manager_request_disconnection(gdata->dev_info->ap)) {
- view_main_state_set(ITEM_CONNECTION_MODE_DISCONNECTING);
- gdata->connection_mode = ITEM_CONNECTION_MODE_DISCONNECTING;
- elm_genlist_item_update(item);
- }
- } else { // Item Selected while other item is in connecting state
-#if 0 // Enable this later when two connect requests is supported by libnet.
- Elm_Object_Item *connecting_it = __view_main_get_item_in_mode(ITEM_CONNECTION_MODE_CONNECTING);
- view_main_state_set(ITEM_CONNECTION_MODE_OFF);
- __view_main_request_connection(gdata);
- if (connecting_it) {
- syspopup_genlist_data_t *connecting_gdata = elm_object_item_data_get(connecting_it);
- if (connecting_gdata && WLAN_MANAGER_ERR_NONE == wlan_manager_request_disconnection(connecting_gdata->dev_info->ap)) {
- gdata->connection_mode = ITEM_CONNECTION_MODE_OFF;
- elm_genlist_item_update(connecting_it);
- }
- } else {
- ERROR_LOG(SP_NAME_NORMAL, "Could not find connecting item");
- }
-#endif
- }
- } else {
- INFO_LOG(SP_NAME_NORMAL, "In wrong state, nothing can do" );
+ switch (state) {
+ case ITEM_CONNECTION_MODE_OFF:
+ __view_main_wifi_connect(gdata);
+ break;
+
+ case ITEM_CONNECTION_MODE_CONNECTING:
+ default:
+ break;
}
elm_genlist_item_selected_set(item, EINA_FALSE);
assertm_if(NULL == part, "part param is NULL!!");
syspopup_genlist_data_t *gdata = (syspopup_genlist_data_t *) data;
+ retvm_if(NULL == gdata, NULL);
+
if (!strncmp(part, "elm.text.1", strlen(part))) {
ret = gdata->dev_info->ssid;
if (ret == NULL) {
} else if (!strncmp(part, "elm.text.2", strlen(part))) {
if (ITEM_CONNECTION_MODE_CONNECTING == gdata->connection_mode) {
ret = sc(PACKAGE, I18N_TYPE_Connecting);
- } else if (ITEM_CONNECTION_MODE_DISCONNECTING == gdata->connection_mode) {
+ } else if (ITEM_CONNECTION_MODE_CONNECTING == gdata->connection_mode) {
ret = sc(PACKAGE, I18N_TYPE_Disconnecting);
} else {
ret = gdata->dev_info->ap_status_txt;
Evas_Object* icon = NULL;
if (!strncmp(part, "elm.icon.1", strlen(part))) {
+ char *temp_str = NULL;
icon = elm_image_add(obj);
- elm_image_file_set(icon, gdata->dev_info->ap_image_path, NULL);
+ if (FALSE == gdata->highlighted)
+ temp_str = g_strdup_printf("%s.png", gdata->dev_info->ap_image_path);
+ else
+ temp_str = g_strdup_printf("%s_press.png", gdata->dev_info->ap_image_path);
+ elm_image_file_set(icon, temp_str, NULL);
+ g_free(temp_str);
evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 5, 5);
} else if (!strncmp(part, "elm.icon.2", strlen(part))) {
switch (gdata->connection_mode) {
case ITEM_CONNECTION_MODE_OFF:
- default:
break;
+
case ITEM_CONNECTION_MODE_CONNECTING:
- case ITEM_CONNECTION_MODE_DISCONNECTING:
icon = elm_progressbar_add(obj);
elm_object_style_set(icon, "list_process");
evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, 0.5);
evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_progressbar_pulse(icon, TRUE);
break;
- }
+ default:
+ break;
+ }
}
__COMMON_FUNC_EXIT__;
return;
}
+static void _gl_highlighted(void *data, Evas_Object *obj, void *event_info)
+{
+ Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+ if (item) {
+ syspopup_genlist_data_t *gdata = (syspopup_genlist_data_t *)elm_object_item_data_get(item);
+ if (gdata) {
+ gdata->highlighted = TRUE;
+ elm_genlist_item_fields_update(item, "elm.icon.1", ELM_GENLIST_ITEM_FIELD_CONTENT);
+ }
+ }
+}
+
+static void _gl_unhighlighted(void *data, Evas_Object *obj, void *event_info)
+{
+ Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+ if (item) {
+ syspopup_genlist_data_t *gdata = (syspopup_genlist_data_t *)elm_object_item_data_get(item);
+ if (gdata) {
+ gdata->highlighted = FALSE;
+ elm_genlist_item_fields_update(item, "elm.icon.1", ELM_GENLIST_ITEM_FIELD_CONTENT);
+ }
+ }
+}
+
Evas_Object *view_main_create(Evas_Object* parent)
{
__COMMON_FUNC_ENTER__;
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_smart_callback_add(list, "highlighted", _gl_highlighted, NULL);
+ evas_object_smart_callback_add(list, "unhighlighted", _gl_unhighlighted, NULL);
+
__COMMON_FUNC_EXIT__;
return list;
}
wifi_device->security_mode = common_utils_get_sec_mode(sec_type);
wifi_device->ap_status_txt = common_utils_get_ap_security_type_info_txt(PACKAGE, wifi_device);
- wifi_device->ap_image_path = common_utils_get_device_icon(WIFI_SP_ICON_PATH, wifi_device);
+ common_utils_get_device_icon(WIFI_SP_ICON_PATH,
+ wifi_device,
+ &wifi_device->ap_image_path);
__COMMON_FUNC_EXIT__;
return wifi_device;
if (WIFI_CONNECTION_STATE_ASSOCIATION == state ||
WIFI_CONNECTION_STATE_CONFIGURATION == state) {
gdata->connection_mode = ITEM_CONNECTION_MODE_CONNECTING;
- gdata->it = elm_genlist_item_append(list, &itc, gdata, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel, gdata);
+ gdata->it = elm_genlist_item_append(list, &itc, gdata, NULL, ELM_GENLIST_ITEM_NONE, __gl_sel, gdata);
*profile_size += 1;
view_main_state_set(ITEM_CONNECTION_MODE_CONNECTING);
gdata->connection_mode = ITEM_CONNECTION_MODE_OFF;
gdata->it = elm_genlist_item_append(list, &itc, gdata, NULL,
- ELM_GENLIST_ITEM_NONE, _gl_sel, gdata);
+ ELM_GENLIST_ITEM_NONE, __gl_sel, gdata);
*profile_size += 1;
return true;
if (list == NULL) {
ERROR_LOG( SP_NAME_NORMAL, "list is NULL!!" );
+
+ __COMMON_FUNC_EXIT__;
return ECORE_CALLBACK_CANCEL;
}
INFO_LOG(SP_NAME_NORMAL, "profiles list count [%d]\n", profiles_list_size);
if (profiles_list_size <= 0) {
WARN_LOG(SP_NAME_NORMAL, "scan size is ZERO");
+
+ __COMMON_FUNC_EXIT__;
return ECORE_CALLBACK_CANCEL;
}
evas_object_show(list);
- __COMMON_FUNC_EXIT__;
+ __COMMON_FUNC_EXIT__;
return ECORE_CALLBACK_CANCEL;
}
#include "view-main.h"
#include "view-alerts.h"
#include "common_utils.h"
+#include "wlan_connection.h"
#include "wifi-syspopup-engine-callback.h"
extern wifi_object* syspopup_app_state;
case WLAN_MANAGER_RESPONSE_TYPE_CONNECTION_CONNECT_FAILED:
case WLAN_MANAGER_RESPONSE_TYPE_WPS_ENROLL_FAIL:
if (syspopup_app_state->passpopup) {
- common_pswd_popup_destroy(syspopup_app_state->passpopup);
+ passwd_popup_free(syspopup_app_state->passpopup);
syspopup_app_state->passpopup = NULL;
}
break;
case WLAN_MANAGER_RESPONSE_TYPE_POWER_ON_OK:
- connman_request_scan_mode_set(WIFI_BGSCAN_MODE_PERIODIC);
-
if (syspopup_app_state->syspopup_type == WIFI_SYSPOPUP_WITHOUT_AP_LIST)
wifi_syspopup_destroy();
syspopup_app_state->alertpopup = NULL;
}
- common_utils_send_message_to_net_popup("Network connection popup", "not support", "notification", NULL);
+ common_utils_send_message_to_net_popup("Network connection popup",
+ "not support", "notification", NULL);
wifi_syspopup_destroy();
break;
syspopup_app_state->alertpopup = NULL;
}
- common_utils_send_message_to_net_popup("Network connection popup", "wifi restricted", "popup", NULL);
+ common_utils_send_message_to_net_popup("Network connection popup",
+ "wifi restricted", "popup", NULL);
wifi_syspopup_destroy();
break;
break;
}
+ wlan_validate_alt_connection();
__COMMON_FUNC_EXIT__;
}
*/
#include <wifi.h>
-#include <X11/Xatom.h>
-#include <X11/Xutil.h>
-#include <Ecore_X.h>
#include <syspopup.h>
+#include <vconf.h>
#include <vconf-keys.h>
#include <appcore-efl.h>
#include "appcoreWrapper.h"
#include "wifi-syspopup-engine-callback.h"
-#define POPUP_HEAD_AREA 134
-#define POPUP_BUTTON_AREA 200
-#define MAX_INITIAL_QS_POPUP_LIST_SIZE 8
-
wifi_object* syspopup_app_state = NULL;
-/* static */
-static int myterm(bundle* b, void* data);
-static int mytimeout(bundle *b, void* data);
-static int wifi_syspopup_exit( void );
-static void _exit_cb(void *data, Evas_Object *obj, void *event_info);
-static int syspopup_support_set(const char* support);
-static int app_reset(bundle *b, void *data);
-static int app_init(void *data);
-static int app_exit(void *data);
-static int app_start(void *data);
-static int app_stop(void *data);
-
-static int __get_window_property(Display *dpy, Window win, Atom atom,
- Atom type, unsigned int *val,
- unsigned int len)
-{
- __COMMON_FUNC_ENTER__;
- unsigned char *prop_ret = NULL;
- Atom type_ret = -1;
- unsigned long bytes_after = 0;
- unsigned long num_ret = -1;
- int format_ret = -1;
- unsigned int i = 0;
- int num = 0;
-
- prop_ret = NULL;
- if (XGetWindowProperty(dpy, win, atom, 0, 0x7fffffff, False,
- type, &type_ret, &format_ret, &num_ret,
- &bytes_after, &prop_ret) != Success) {
- return -1;
- }
-
- if (type_ret != type || format_ret != 32) {
- num = -1;
- } else if (num_ret == 0 || !prop_ret) {
- num = 0;
- } else {
- if (num_ret < len) {
- len = num_ret;
- }
- for (i = 0; i < len; i++) {
- val[i] = ((unsigned long *)prop_ret)[i];
- }
- num = len;
- }
-
- if (prop_ret) {
- XFree(prop_ret);
- }
-
- __COMMON_FUNC_EXIT__;
- return num;
-}
-
-static int __x_rotation_get(Display *dpy, Window win)
-{
- __COMMON_FUNC_ENTER__;
- Window active_win = 0;
- Window root_win = 0;
- int rotation = -1;
- int ret = -1;
-
- Atom atom_active_win;
- Atom atom_win_rotate_angle;
-
- root_win = XDefaultRootWindow(dpy);
-
- atom_active_win = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
- ret = __get_window_property(dpy, root_win, atom_active_win,
- XA_WINDOW,
- (unsigned int *)&active_win, 1);
-
- if (ret < 0)
- return ret;
-
- atom_win_rotate_angle =
- XInternAtom(dpy, "_E_ILLUME_ROTATE_WINDOW_ANGLE", False);
- ret = __get_window_property(dpy, active_win ,
- atom_win_rotate_angle, XA_CARDINAL,
- (unsigned int *)&rotation, 1);
-
- __COMMON_FUNC_EXIT__;
-
- if (ret != -1) {
- return rotation;
- }
-
- return -1;
-}
-
-static Eina_Bool __rotate(void *data, int type, void *event)
-{
- __COMMON_FUNC_ENTER__;
- struct wifi_object *ad = data;
- Ecore_X_Event_Client_Message *ev = event;
- int visible_area_width, visible_area_height;
- int rotate_angle;
-
- Evas_Object *box = NULL;
-
- if (!event)
- return ECORE_CALLBACK_RENEW;
-
- if (ev->message_type == ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE) {
- box = elm_object_content_get(syspopup_app_state->syspopup);
-
- if (box) {
- rotate_angle = __x_rotation_get(ecore_x_display_get(), elm_win_xwindow_get(syspopup_app_state->win_main));
- __common_popup_size_set(NULL ,&visible_area_width, &visible_area_height, rotate_angle);
- elm_win_rotation_with_resize_set(syspopup_app_state->win_main, rotate_angle);
- evas_object_size_hint_min_set(box, visible_area_width * elm_config_scale_get(), visible_area_height * elm_config_scale_get());
- }
-
- if (syspopup_app_state->eap_popup)
- eap_view_rotate_popup(syspopup_app_state->eap_popup, rotate_angle);
- }
-
- __COMMON_FUNC_EXIT__;
- return 0;
-}
-
-void __common_popup_size_set(Ecore_IMF_Context *target_imf, int *width, int *height, int rotate_angle)
-{
- __COMMON_FUNC_ENTER__;
-
- int window_width, window_height;
- int start_x, start_y, imf_width, imf_height;
- float resize_scale = 0.7f;
-
- ecore_x_window_size_get(ecore_x_window_root_first_get(), &window_width, &window_height);
-
- *width = window_width;
-
- if (rotate_angle == 0 || rotate_angle == 180)
- {
- *height = window_height * resize_scale;
- }else
- *height = window_width;
-
- if (target_imf != NULL) {
- ecore_imf_context_input_panel_geometry_get(target_imf, &start_x, &start_y, &imf_width, &imf_height);
- *height = start_y * resize_scale;
- }else
- *height = *height-POPUP_HEAD_AREA-POPUP_BUTTON_AREA;
-
- __COMMON_FUNC_EXIT__;
-}
-
static int wifi_syspopup_rotate_cb(enum appcore_rm rotate_mode, void *data)
{
- __COMMON_FUNC_ENTER__;
-
int rotate_angle;
- int visible_area_width, visible_area_height;
-
Evas_Object *box = NULL;
rotate_angle = common_utils_get_rotate_angle(rotate_mode);
box = elm_object_content_get(syspopup_app_state->syspopup);
+
elm_win_rotation_with_resize_set(syspopup_app_state->win_main, rotate_angle);
- __common_popup_size_get(NULL ,&visible_area_width, &visible_area_height);
- evas_object_size_hint_min_set(box, visible_area_width * elm_config_scale_get(), visible_area_height * elm_config_scale_get());
+ if (0 == rotate_angle || 180 == rotate_angle)
+ evas_object_size_hint_min_set(box, -1,
+ DEVICE_PICKER_POPUP_H * elm_config_scale_get());
+ else
+ evas_object_size_hint_min_set(box, -1,
+ DEVICE_PICKER_POPUP_LN_H * elm_config_scale_get());
if (syspopup_app_state->eap_popup)
eap_view_rotate_popup(syspopup_app_state->eap_popup, rotate_angle);
- INFO_LOG(SP_NAME_NORMAL, "rotate_angle : %d", rotate_angle);
+ INFO_LOG(SP_NAME_NORMAL, "rotate_angle: %d", rotate_angle);
- __COMMON_FUNC_EXIT__;
return 0;
}
-/* implements */
-static int myterm(bundle* b, void* data)
-{
- __COMMON_FUNC_ENTER__;
-
- wifi_syspopup_exit();
-
- __COMMON_FUNC_EXIT__;
-
- return 0;
-}
-
-static int mytimeout(bundle *b, void* data)
-{
- __COMMON_FUNC_ENTER__;
- __COMMON_FUNC_EXIT__;
-
- return FALSE;
-}
-
-syspopup_handler handler = {
- .def_term_fn = myterm,
- .def_timeout_fn = mytimeout
-};
-
-static int wifi_syspopup_exit(void)
+static void wifi_syspopup_exit(void)
{
__COMMON_FUNC_ENTER__;
view_main_destroy();
if (VCONFKEY_WIFI_QS_WIFI_CONNECTED == syspopup_app_state->connection_result)
- INFO_LOG(SP_NAME_NORMAL, "Result : WIFI");
+ INFO_LOG(SP_NAME_NORMAL, "Wi-Fi connected");
else if (VCONFKEY_WIFI_QS_3G == syspopup_app_state->connection_result)
- INFO_LOG(SP_NAME_NORMAL, "Result : 3G");
+ INFO_LOG(SP_NAME_NORMAL, "Cellular connected");
else {
- WARN_LOG(SP_NAME_NORMAL, "Result : ?? [%d]", syspopup_app_state->connection_result);
+ WARN_LOG(SP_NAME_NORMAL, "Result: [%d]",
+ syspopup_app_state->connection_result);
+
syspopup_app_state->connection_result = VCONFKEY_WIFI_QS_3G;
}
elm_exit();
__COMMON_FUNC_EXIT__;
- return TRUE;
}
static void _exit_cb(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
+
wifi_syspopup_exit();
+
__COMMON_FUNC_EXIT__;
}
int wifi_syspopup_destroy(void)
{
if (syspopup_app_state->passpopup) {
- common_pswd_popup_destroy(syspopup_app_state->passpopup);
+ passwd_popup_free(syspopup_app_state->passpopup);
syspopup_app_state->passpopup = NULL;
}
syspopup_app_state->win_main = NULL;
}
+ connman_request_scan_mode_set(WIFI_BGSCAN_MODE_EXPONENTIAL);
+
wifi_syspopup_exit();
- return TRUE;
+ return 1;
}
int wifi_syspopup_create(void)
{
__COMMON_FUNC_ENTER__;
int rotate_angle;
- int visible_area_height;
- int visible_area_width;
if (NULL == syspopup_app_state->syspopup) {
syspopup_app_state->syspopup = elm_popup_add(syspopup_app_state->layout_main);
elm_object_content_set(syspopup_app_state->layout_main, syspopup_app_state->syspopup);
assertm_if(NULL == syspopup_app_state->syspopup, "syspopup is NULL!!");
}
+
elm_object_style_set(syspopup_app_state->syspopup,"min_menustyle");
elm_object_part_text_set(syspopup_app_state->syspopup, "title,text", sc(PACKAGE, I18N_TYPE_WiFi_network));
evas_object_size_hint_weight_set(syspopup_app_state->syspopup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_box_pack_end(box, main_list);
evas_object_show(main_list);
- rotate_angle = __x_rotation_get(ecore_x_display_get(), elm_win_xwindow_get(syspopup_app_state->win_main));
- if (rotate_angle < 0)
- rotate_angle = 0;
-
- ecore_x_icccm_hints_set(elm_win_xwindow_get(syspopup_app_state->win_main), 1, 0, 0, 0, 0, 0, 0);
-
+ rotate_angle = common_utils_get_rotate_angle(APPCORE_RM_UNKNOWN);
elm_win_rotation_with_resize_set(syspopup_app_state->win_main, rotate_angle);
-
- __common_popup_size_set(NULL ,&visible_area_width, &visible_area_height, rotate_angle);
- evas_object_size_hint_min_set(box, visible_area_width * elm_config_scale_get(), visible_area_height * elm_config_scale_get());
+ if (0 == rotate_angle || 180 == rotate_angle)
+ evas_object_size_hint_min_set(box, -1,
+ DEVICE_PICKER_POPUP_H * elm_config_scale_get());
+ else
+ evas_object_size_hint_min_set(box, -1,
+ DEVICE_PICKER_POPUP_LN_H * elm_config_scale_get());
elm_object_content_set(syspopup_app_state->syspopup, box);
evas_object_show(syspopup_app_state->syspopup);
memset(&g_pending_call, 0, sizeof(wifi_pending_call_info_t));
__COMMON_FUNC_EXIT__;
-
- return TRUE;
+ return 1;
}
int wifi_syspopup_init()
wlan_manager_set_message_callback(wlan_engine_callback);
wlan_manager_set_refresh_callback(wlan_engine_refresh_callback);
- wlan_ret = wlan_manager_start(NULL);
+ wlan_ret = wlan_manager_start();
switch (wlan_ret) {
- case WLAN_MANAGER_ERR_NONE:
- wlan_ret = wifi_is_activated (&activated);
- if (WIFI_ERROR_NONE != wlan_ret) {
- ERROR_LOG(UG_NAME_ERR, "Failed to get the Wi-Fi State. Return error = %d", wlan_ret);
- return WLAN_MANAGER_ERR_UNKNOWN;
- }
-
- if (activated) {
- INFO_LOG(UG_NAME_NORMAL, "WiFi is activated");
- if (connman_request_scan_mode_set(WIFI_BGSCAN_MODE_PERIODIC) == WLAN_MANAGER_ERR_NONE) {
- INFO_LOG(SP_NAME_NORMAL, "Set BG scan mode - PERIODIC");
- }
- }
- INFO_LOG(SP_NAME_NORMAL, "wlan_manager start complete" );
- break;
-
case WLAN_MANAGER_ERR_ALREADY_REGISTERED:
ERROR_LOG(SP_NAME_ERR, "Already registered.");
- break;
+ /* fall through */
+ case WLAN_MANAGER_ERR_NONE:
+ wlan_ret = wifi_is_activated(&activated);
+ if (WIFI_ERROR_NONE == wlan_ret)
+ INFO_LOG(SP_NAME_NORMAL, "Wi-Fi activated: %d", activated);
- case WLAN_MANAGER_ERR_UNKNOWN:
- ERROR_LOG(SP_NAME_ERR, "wlan fail communication." );
+ INFO_LOG(SP_NAME_NORMAL, "wlan_manager start complete" );
break;
default:
- ERROR_LOG(SP_NAME_ERR, "wlan_manager start fail ret[%d]", wlan_ret );
+ ERROR_LOG(SP_NAME_ERR, "Failed to start wlan_manager (%d)", wlan_ret);
break;
}
+ connman_request_scan_mode_set(WIFI_BGSCAN_MODE_PERIODIC);
+
__COMMON_FUNC_EXIT__;
return wlan_ret;
}
-static int syspopup_support_set(const char* support) {
+static int syspopup_support_set(const char* support)
+{
__COMMON_FUNC_ENTER__;
- if(NULL == support) {
+
+ if (NULL == support) {
__COMMON_FUNC_EXIT__;
- return FALSE;
+ return 0;
}
- if(strcmp("WIFI_SYSPOPUP_SUPPORT_QUICKPANEL",support) == 0) {
- syspopup_app_state->wifi_syspopup_support = WIFI_SYSPOPUP_SUPPORT_QUICKPANEL;
- } else {
+ if (g_strcmp0("WIFI_SYSPOPUP_SUPPORT_QUICKPANEL",support) == 0)
+ syspopup_app_state->wifi_syspopup_support =
+ WIFI_SYSPOPUP_SUPPORT_QUICKPANEL;
+ else {
__COMMON_FUNC_EXIT__;
- return FALSE;
+ return 0;
}
- __COMMON_FUNC_EXIT__;
- return TRUE;
+ __COMMON_FUNC_EXIT__;
+ return 1;
}
-static int _power_on_check(void)
+static gboolean _power_on_check(void)
{
- int connection_state = wlan_manager_state_get();
+ int connection_state;
+
+ connection_state = wlan_manager_state_get();
switch (connection_state) {
case WLAN_MANAGER_OFF:
INFO_LOG(SP_NAME_NORMAL, "current state is wifi-off");
- int wlan_ret = wlan_manager_request_power_on();
+
+ int wlan_ret = wlan_manager_power_on();
if (wlan_ret == WLAN_MANAGER_ERR_NONE) {
view_alerts_powering_on_show();
+
__COMMON_FUNC_EXIT__;
return TRUE;
- } else if (wlan_ret == WLAN_MANAGER_ERR_MOBILE_HOTSPOT_OCCUPIED) {
+ } else if (wlan_ret == WLAN_MANAGER_ERR_WIFI_TETHERING_OCCUPIED) {
__COMMON_FUNC_EXIT__;
return TRUE;
} else {
return FALSE;
}
break;
+
case WLAN_MANAGER_UNCONNECTED:
case WLAN_MANAGER_CONNECTING:
__COMMON_FUNC_EXIT__;
return TRUE;
+
case WLAN_MANAGER_CONNECTED:
ERROR_LOG(SP_NAME_NORMAL, "current state is wifi-connected");
+
__COMMON_FUNC_EXIT__;
return FALSE;
+
case WLAN_MANAGER_ERROR:
ERROR_LOG(SP_NAME_NORMAL, "current state is wifi error");
+
__COMMON_FUNC_EXIT__;
return FALSE;
+
default:
ERROR_LOG(SP_NAME_NORMAL, "current state is wifi etc");
+
__COMMON_FUNC_EXIT__;
return FALSE;
}
return TRUE;
}
+/* implements */
+static int myterm(bundle* b, void* data)
+{
+ __COMMON_FUNC_ENTER__;
+
+ wifi_syspopup_exit();
+
+ __COMMON_FUNC_EXIT__;
+ return 0;
+}
+
+static int mytimeout(bundle *b, void* data)
+{
+ __COMMON_FUNC_ENTER__;
+
+ __COMMON_FUNC_EXIT__;
+ return 0;
+}
+
+syspopup_handler handler = {
+ .def_term_fn = myterm,
+ .def_timeout_fn = mytimeout
+};
+
static Eina_Bool __wifi_syspopup_del_found_ap_noti(void *data)
{
- common_utils_send_message_to_net_popup(NULL, NULL, "del_found_ap_noti", NULL);
+ common_utils_send_message_to_net_popup(NULL, NULL,
+ "del_found_ap_noti", NULL);
+
return ECORE_CALLBACK_CANCEL;
}
+static gboolean load_initial_ap_list(gpointer data)
+{
+ __COMMON_FUNC_ENTER__;
+
+ /* Because of transition effect performance,
+ * Wi-Fi lists might be better to be updated at maximum delayed
+ */
+ wlan_manager_scanned_profile_refresh();
+
+ __COMMON_FUNC_EXIT__;
+ return FALSE;
+}
+
+static void __pw_lock_state_change_cb(keynode_t *node, void *user_data)
+{
+ __COMMON_FUNC_ENTER__;
+
+ int pw_lock_state = 0;
+ if (0 != vconf_get_int(VCONFKEY_PWLOCK_STATE, &pw_lock_state) ||
+ pw_lock_state != VCONFKEY_PWLOCK_BOOTING_LOCK) {
+ vconf_ignore_key_changed(VCONFKEY_PWLOCK_STATE, __pw_lock_state_change_cb);
+ wifi_syspopup_create();
+ appcore_set_rotation_cb(wifi_syspopup_rotate_cb, NULL);
+ g_idle_add(load_initial_ap_list, NULL);
+ }
+
+ INFO_LOG(SP_NAME_NORMAL, "pwlock state = %d", pw_lock_state);
+
+ __COMMON_FUNC_EXIT__;
+ return;
+}
+
static int app_reset(bundle *b, void *data)
{
__COMMON_FUNC_ENTER__;
Evas_Object *win_main = NULL;
Evas *evas = NULL;
int ret = 0;
- int w, h = 0;
+ int pw_lock_state = 0;
assertm_if(NULL == data, "data param is NULL!!");
assertm_if(NULL == b, "bundle is NULL!!");
ecore_idler_add(__wifi_syspopup_del_found_ap_noti, NULL);
if (syspopup_has_popup(b)) {
- INFO_LOG(SP_NAME_NORMAL, "Wi-Fi Syspopup is already launched. So, no more.");
+ INFO_LOG(SP_NAME_NORMAL, "Wi-Fi device picker is already launched");
+
syspopup_reset(b);
} else {
win_main = appcore_create_win(PACKAGE);
syspopup_app_state->syspopup_type = WIFI_SYSPOPUP_WITHOUT_AP_LIST;
int wlan_ret = wifi_syspopup_init();
- if (WLAN_MANAGER_ERR_NONE != wlan_ret) {
+ if (WLAN_MANAGER_ERR_NONE != wlan_ret)
INFO_LOG(SP_NAME_ERR, "wifi_syspopup_init failed. wlan_ret = %d", wlan_ret);
- } else if (strcmp(is_onoff, "on") == 0) {
- INFO_LOG(SP_NAME_NORMAL, "request power on");
- ret = wlan_manager_request_power_on();
- INFO_LOG(SP_NAME_NORMAL, "* ret [%d]", ret);
+ else if (strcmp(is_onoff, "on") == 0) {
+ ret = wlan_manager_power_on();
+
+ INFO_LOG(SP_NAME_NORMAL, "Wi-Fi power on: [%d]", ret);
} else if (strcmp(is_onoff, "off") == 0) {
- INFO_LOG(SP_NAME_NORMAL, "request power off");
- ret = wlan_manager_request_power_off();
- INFO_LOG(SP_NAME_NORMAL, "* ret [%d]", ret);
+ ret = wlan_manager_power_off();
+
+ INFO_LOG(SP_NAME_NORMAL, "Wi-Fi power off: [%d]", ret);
}
wifi_syspopup_destroy();
+
+ __COMMON_FUNC_EXIT__;
return 0;
} else {
syspopup_app_state->syspopup_type = WIFI_SYSPOPUP_WITH_AP_LIST;
+
int wlan_ret = wifi_syspopup_init();
- if (WLAN_MANAGER_ERR_NONE != wlan_ret || _power_on_check() == FALSE) {
+ if (WLAN_MANAGER_ERR_NONE != wlan_ret ||
+ _power_on_check() == FALSE) {
wifi_syspopup_destroy();
+
__COMMON_FUNC_EXIT__;
return 0;
}
}
- syspopup_app_state->syspopup = elm_popup_add(syspopup_app_state->win_main);
- ret = syspopup_create(b, &handler, syspopup_app_state->win_main, syspopup_app_state);
- if(ret != 0){
- ERROR_LOG(SP_NAME_ERR, "Syspopup create error!! return [%d]", ret );
+ syspopup_app_state->syspopup =
+ elm_popup_add(syspopup_app_state->win_main);
+
+ ret = syspopup_create(b, &handler,
+ syspopup_app_state->win_main, syspopup_app_state);
+ if (ret != 0){
+ ERROR_LOG(SP_NAME_ERR, "Fail to create popup [%d]", ret );
wlan_manager_destroy();
- __COMMON_FUNC_EXIT__;
elm_exit();
+ __COMMON_FUNC_EXIT__;
return 0;
} else {
- const char* support = bundle_get_val(b, "[Wi-Fi_syspopup wifi_syspopup_supports:support]");
- if(NULL != support) {
+ const char* support = bundle_get_val(b,
+ "[Wi-Fi_syspopup wifi_syspopup_supports:support]");
+ if(NULL != support)
syspopup_support_set(support);
- }
-
- ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
- wifi_syspopup_create();
- wlan_manager_scanned_profile_refresh_with_count(MAX_INITIAL_QS_POPUP_LIST_SIZE);
- ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __rotate, (void *)syspopup_app_state);
+ if (0 != vconf_get_int(VCONFKEY_PWLOCK_STATE, &pw_lock_state) ||
+ pw_lock_state == VCONFKEY_PWLOCK_BOOTING_LOCK) {
+ /* The PW lock is in lock mode during the booting stage.
+ * Lets wait for the lock state to change.
+ * After the lock state is changed we can create the popup
+ */
+ vconf_notify_key_changed(VCONFKEY_PWLOCK_STATE, __pw_lock_state_change_cb, NULL);
+ } else {
+ wifi_syspopup_create();
+ appcore_set_rotation_cb(wifi_syspopup_rotate_cb, NULL);
+ g_idle_add(load_initial_ap_list, NULL);
+ }
+ INFO_LOG(SP_NAME_NORMAL, "pwlock state = %d", pw_lock_state);
}
}
- __COMMON_FUNC_EXIT__;
+ __COMMON_FUNC_EXIT__;
return 0;
}
-static int app_init(void *data)
+static int app_create(void *data)
{
__COMMON_FUNC_ENTER__;
+
bindtextdomain(PACKAGE, LOCALEDIR);
- __COMMON_FUNC_EXIT__;
+ __COMMON_FUNC_EXIT__;
return 0;
}
static int app_exit(void *data)
{
__COMMON_FUNC_ENTER__;
+
wlan_manager_destroy();
- __COMMON_FUNC_EXIT__;
+ __COMMON_FUNC_EXIT__;
return 0;
}
-static int app_start(void *data)
+static int app_pause(void *data)
{
__COMMON_FUNC_ENTER__;
- if (connman_request_scan_mode_set(WIFI_BGSCAN_MODE_PERIODIC) == WLAN_MANAGER_ERR_NONE) {
- INFO_LOG(SP_NAME_NORMAL, "Set BG scan mode - PERIODIC");
- }
- __COMMON_FUNC_EXIT__;
+ connman_request_scan_mode_set(WIFI_BGSCAN_MODE_EXPONENTIAL);
+
+ __COMMON_FUNC_EXIT__;
return 0;
}
-static int app_stop(void *data)
+static int app_resume(void *data)
{
__COMMON_FUNC_ENTER__;
- if (connman_request_scan_mode_set(WIFI_BGSCAN_MODE_EXPONENTIAL) == WLAN_MANAGER_ERR_NONE) {
- INFO_LOG(SP_NAME_NORMAL, "Set BG scan mode - EXPONENTIAL");
- }
- __COMMON_FUNC_EXIT__;
+ connman_request_scan_mode_set(WIFI_BGSCAN_MODE_PERIODIC);
+
+ __COMMON_FUNC_EXIT__;
return 0;
}
int main(int argc, char* argv[])
{
__COMMON_FUNC_ENTER__;
- INFO_LOG( SP_NAME_NORMAL, "argc [%d]", argc);
+
+ INFO_LOG(SP_NAME_NORMAL, "argc [%d]", argc);
wifi_object ad;
memset(&ad, 0x0, sizeof(wifi_object));
ad.alertpopup = NULL;
struct appcore_ops ops = {
- .create = app_init,
+ .create = app_create,
.terminate = app_exit,
- .pause = app_stop,
- .resume = app_start,
+ .pause = app_pause,
+ .resume = app_resume,
.reset = app_reset,
};
--- /dev/null
+e17 $1 rw
+$1 dbus rwx
+$1 pulseaudio rwxat
+$1 system::vconf rwxat
+$1 system::media rwxat
+$1 device::app_logging w