SET(EDJDIR "${RESDIR}/edje")
SET(IMGDIR "${RESDIR}/images")
SET(JSDIR "${RESDIR}/js")
+SET(XMLDIR "${RESDIR}/xml")
SET(SHAREDIR "/usr/share")
SET(ICONDIR "${SHAREDIR}/icons/default/small")
SET(UGDIR "/usr/ug/lib")
%{_pkgdir}/res/images/*
%{_pkgdir}/bin/email
%{_pkgdir}/data/_email_default.html
-%{_pkgdir}/data/sp_list.xml
+%{_pkgdir}/res/xml/sp_list.xml
%{_sharedir}/packages/org.tizen.email.xml
/opt/usr/share/account/org.tizen.email.account.xml
%{_sharedir}/icons/default/small/org.tizen.email.png
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${UGDIR})
INSTALL(FILES ${CMAKE_SETTING_BINARY_DIR}/email-setting-theme.edj DESTINATION ${EDJDIR})
-INSTALL(FILES ${CMAKE_SETTING_BINARY_DIR}/include/sp_list.xml DESTINATION ${DATADIR})
+INSTALL(FILES ${CMAKE_SETTING_BINARY_DIR}/include/sp_list.xml DESTINATION ${XMLDIR})
char *setting_get_service_fail_type(int type);
xmlDocPtr setting_create_xml_tree(const char *path);
-void setting_traverse_xml_node(xmlNode *a_node, int depth, void *data);
+void setting_traverse_xml_node(xmlNode *a_node, int depth, void *data, int reset);
void setting_cleanup_xml_parser(xmlDocPtr xml_source);
+EmailSpDesc *setting_find_sp_desc(char *id, EmailSettingUGD *ugd);
void setting_dump_sp_desc(EmailSettingUGD *ugd);
+void setting_free_sp_desc(EmailSettingUGD *ugd);
#endif /* __EMAIL_SETTING_UTILS_H__ */
#define CBAR_ICON_ADD IMGDIR"/01_controlbar_icon_create_folder.png"
#define TITLE_ICON_REFRESH IMGDIR"/M02_email_icon_title_refresh.png"
-#define SP_XML_PATH DATADIR"/sp_list.xml"
-
-typedef enum {
- HOTMAIL = 1,
- GMAIL,
- YAHOOMAIL,
- AOL,
- OTHERS
-} AccountInfo;
+#define SP_XML_PATH RESDIR"/xml/sp_list.xml"
typedef struct sp_desc EmailSpDesc;
struct sp_desc {
- int id;
+ int index;
+ char *id;
char *csc_code;
char *name;
char *name_str_id;
char *receiving_address;
int receiving_port;
int receiving_security;
+ int rgb;
};
typedef struct ug_data EmailSettingUGD;
char *start_view_type;
/* view specified variables */
- AccountInfo account_info;
+ EmailSpDesc *account_info;
email_account_t *new_account;
email_account_t *account_list;
<sp_list>\r
<sp_desc csc_code="ALL">\r
- <id>1</id>\r
+ <id>Hotmail</id>\r
+ <name>Windows Live Hotmail</name>\r
+ <name_str_id>IDS_EMAIL_BODY_WINDOWS_LIVE_HOTMAIL</name_str_id>\r
+ <icon>/usr/apps/org.tizen.email/res/images/M02_email_list_icon_hotmail.png</icon>\r
+ <sending_address>smtp.live.com</sending_address>\r
+ <sending_port>587</sending_port>\r
+ <sending_security>2</sending_security>\r
+ <receiving_server_type>pop</receiving_server_type>\r
+ <receiving_address>pop3.live.com</receiving_address>\r
+ <receiving_port>995</receiving_port>\r
+ <receiving_security>1</receiving_security>\r
+ <rgb>0xdc143cff</rgb>\r
+ </sp_desc>\r
+ <sp_desc csc_code="ALL">\r
+ <id>Gmail</id>\r
<name>Google</name>\r
<name_str_id>IDS_COM_BODY_GOOGLE</name_str_id>\r
<icon>/usr/apps/org.tizen.email/res/images/M02_email_list_icon_gmail.png</icon>\r
<sending_address>smtp.gmail.com</sending_address>\r
<sending_port>465</sending_port>\r
- <sending_security>0</sending_security>\r
+ <sending_security>1</sending_security>\r
<receiving_server_type>imap</receiving_server_type>\r
<receiving_address>imap.gmail.com</receiving_address>\r
<receiving_port>993</receiving_port>\r
<receiving_security>1</receiving_security>\r
+ <rgb>0x0000ffff</rgb>\r
</sp_desc>\r
+ <!--\r
<sp_desc csc_code="ALL">\r
- <id>2</id>\r
+ <id>aol</id>\r
<name>AOL</name>\r
<name_str_id>IDS_EMAIL_BODY_AOL</name_str_id>\r
<icon>/usr/apps/org.tizen.email/res/images/M02_email_list_icon_AOL.png</icon>\r
<receiving_address>imap.aol.com</receiving_address>\r
<receiving_port>143</receiving_port>\r
<receiving_security>0</receiving_security>\r
- </sp_desc>\r
- <sp_desc csc_code="ALL">\r
- <id>3</id>\r
- <name>Windows Live Hotmail</name>\r
- <name_str_id>IDS_EMAIL_BODY_WINDOW_LIVE_HOTMAIL</name_str_id>\r
- <icon>/usr/apps/org.tizen.email/res/images/M02_email_list_icon_hotmail.png</icon>\r
- <sending_address>smtp.live.com</sending_address>\r
- <sending_port>587</sending_port>\r
- <sending_security>2</sending_security>\r
- <receiving_server_type>pop</receiving_server_type>\r
- <receiving_address>pop3.live.com</receiving_address>\r
- <receiving_port>995</receiving_port>\r
- <receiving_security>1</receiving_security>\r
+ <rgb>0x008080ff</rgb>\r
</sp_desc>\r
<sp_desc csc_code="SKT">\r
- <id>4</id>\r
+ <id>Yahoomail</id>\r
<name>Yahoo</name>\r
<name_str_id>IDS_EMAIL_BODY_YAHOO_E_MAIL</name_str_id>\r
<icon>/usr/apps/org.tizen.email/res/images/M02_email_list_icon_YahooMail.png</icon>\r
<receiving_address>pop.mail.yahoo.co.kr</receiving_address>\r
<receiving_port>995</receiving_port>\r
<receiving_security>1</receiving_security>\r
+ <rgb>0xdc143cff</rgb>\r
</sp_desc>\r
+ -->\r
</sp_list>\r
#include "email-setting-defines.h"
#include "email-view-setting.h"
#include "email-setting-account-set.h"
+#include "email-setting-utils.h"
#define DEFAULT_SIGNATURE _("IDS_EMAIL_BODY_SENT_USING_TIZEN_MOBILE")
-static void _set_gmail(struct viewdata *vd);
-static void _set_yahoomail(struct viewdata *vd);
-static void _set_hotmail(struct viewdata *vd);
-static void _set_aol(struct viewdata *vd);
-static void _set_others(struct viewdata *vd);
+static void _set_sp_email(struct viewdata *vd, EmailSpDesc *desc);
+static void _set_others_email(struct viewdata *vd);
static void _set_user_name_with_email_addr(char *email_addr, char **user_name);
static void _set_display_name_with_email_addr(char *email_addr, char **display_name);
static void _account_info_print(email_account_t *account);
}
EmailSettingUGD *ugd = vd->ugd;
+ EmailSpDesc *desc= ugd->account_info;
- debug_log("%d", ugd->account_info);
- int c = ugd->account_info;
- switch (c) {
- case GMAIL:
- _set_gmail(vd);
- break;
- case YAHOOMAIL:
- _set_yahoomail(vd);
- break;
- case HOTMAIL:
- _set_hotmail(vd);
- break;
- case AOL:
- _set_aol(vd);
- break;
- case OTHERS:
- _set_others(vd);
- break;
+ if (desc) {
+ _set_sp_email(vd, desc);
+ } else {
+ _set_others_email(vd);
}
+
return;
}
int rgb = 0x006400ff;
debug_log("service_name (%s)", service_name);
- if (!g_strcmp0(service_name, "Hotmail"))
+ if (g_strcmp0(service_name, "Hotmail") == 0 || g_strcmp0(service_name, "AOL") == 0)
account->incoming_server_user_name = g_strdup(account->user_email_address);
else
_set_user_name_with_email_addr(account->user_email_address, &(account->incoming_server_user_name));
account->return_address = g_strdup(account->user_email_address);
account->retrieval_mode = EMAIL_IMAP4_RETRIEVAL_MODE_ALL; /* EMAIL_IMAP4_RETRIEVAL_MODE_NEW; */
- if (!g_strcmp0(service_name, "Gmail"))
- preset_account = GMAIL;
- else if (!g_strcmp0(service_name, "Hotmail"))
- preset_account = HOTMAIL;
- else if (!g_strcmp0(service_name, "Yahoo"))
- preset_account = YAHOOMAIL;
- else if (!g_strcmp0(service_name, "AOL"))
- preset_account = AOL;
- else
+ EmailSpDesc *desc = setting_find_sp_desc(service_name, ugd);
+ if (desc) {
+ preset_account = desc->index;
+ account->logo_icon_path = g_strdup(desc->icon_path);
+ } else {
preset_account = 0;
+ account->logo_icon_path = g_strdup(ACCOUNT_ICON_OTHERS);
+ }
account->auto_download_size = 1024*10; /* downloading option, 0 is subject only, 1 is text body, 2 is normal. */
account->outgoing_server_use_same_authenticator = 1; /* Specifies the 'Same as POP3' option, 0 is none, 1 is 'Same as POP3' */
account->options.add_signature = 1;
account->options.signature = g_strdup(DEFAULT_SIGNATURE);
- if (!g_strcmp0(service_name, "Gmail"))
- account->logo_icon_path = g_strdup(ACCOUNT_ICON_GMAIL);
- else if (!g_strcmp0(service_name, "Hotmail"))
- account->logo_icon_path = g_strdup(ACCOUNT_ICON_HOTMAIL);
- else if (!g_strcmp0(service_name, "Yahoo"))
- account->logo_icon_path = g_strdup(ACCOUNT_ICON_YAHOO);
- else if (!g_strcmp0(service_name, "AOL"))
- account->logo_icon_path = g_strdup(ACCOUNT_ICON_AOL);
- else
- account->logo_icon_path = g_strdup(ACCOUNT_ICON_OTHERS);
-
account->outgoing_server_type = EMAIL_SERVER_TYPE_SMTP;
account->outgoing_server_need_authentication = 1;
_account_info_print(account);
}
-static void _set_gmail(struct viewdata *vd)
+static void _set_sp_email(struct viewdata *vd, EmailSpDesc *desc)
{
debug_log("");
return;
}
- EmailSettingUGD *ugd = vd->ugd;
- email_account_t *account = NULL;
- account = ugd->new_account;
-
- int rgb = 0x0000ffff;
-
- _set_user_name_with_email_addr(account->user_email_address, &(account->incoming_server_user_name));
- _set_display_name_with_email_addr(account->user_email_address, &(account->user_display_name));
-
- account->account_name = g_strdup(dgettext("sys_string", "IDS_COM_BODY_GOOGLE"));
- account->reply_to_address = g_strdup(account->user_email_address);
- account->return_address = g_strdup(account->user_email_address);
- account->retrieval_mode = EMAIL_IMAP4_RETRIEVAL_MODE_ALL; /* EMAIL_IMAP4_RETRIEVAL_MODE_NEW; */
-
- account->auto_download_size = 1024*10; /* downloading option, 0 is subject only, 1 is text body, 2 is normal. */
- account->outgoing_server_use_same_authenticator = 1; /* Specifies the 'Same as POP3' option, 0 is none, 1 is 'Same as POP3' */
- account->default_mail_slot_size = 25;
-
- account->pop_before_smtp = 0;
- account->incoming_server_requires_apop = 0;
-
- account->options.priority = 3;
- account->options.keep_local_copy = 1;
- account->options.req_delivery_receipt = 0;
- account->options.req_read_receipt = 0;
- account->options.download_limit = 0;
- account->options.block_address = 1;
- account->options.block_subject = 1;
- account->options.display_name_from = NULL;
- account->options.reply_with_body = 1;
- account->options.forward_with_files = 1;
- account->options.add_myname_card = 0;
- account->options.add_signature = 1;
- account->options.signature = g_strdup(DEFAULT_SIGNATURE);
-
- account->logo_icon_path = g_strdup(ACCOUNT_ICON_GMAIL);
-
- account->outgoing_server_type = EMAIL_SERVER_TYPE_SMTP;
- account->outgoing_server_need_authentication = 1;
-
- /*account->user_display_name = g_strdup(account->user_display_name);
- account->user_email_address = g_strdup("<User ID>@gmail.com");
- account->incoming_server_password = g_strdup(<User Password>);*/
-
- vconf_get_int("file/private/org.tizen.email/gmail_receiving_type", (int *)&(account->incoming_server_type));
- vconf_get_int("file/private/org.tizen.email/gmail_receiving_port", &(account->incoming_server_port_number));
- vconf_get_int("file/private/org.tizen.email/gmail_receiving_ssl", &(account->incoming_server_secure_connection));
- account->incoming_server_address = vconf_get_str("file/private/org.tizen.email/gmail_receiving_address");
-
- vconf_get_int("file/private/org.tizen.email/gmail_sending_port", &(account->outgoing_server_port_number));
- vconf_get_int("file/private/org.tizen.email/gmail_sending_ssl", &(account->outgoing_server_secure_connection));
- account->outgoing_server_address = vconf_get_str("file/private/org.tizen.email/gmail_sending_address");
- account->outgoing_server_user_name = g_strdup(account->incoming_server_user_name);
- account->outgoing_server_password = g_strdup(account->incoming_server_password);
-
- /*user data set*/
- account_user_data_t data;
- data.index_color = rgb;
- data.is_preset_account = GMAIL;
- data.show_images = 1;
- data.send_read_report = 0;
- data.pop3_deleting_option = 0;
-
- int data_len = sizeof(account_user_data_t);
- account->user_data = calloc(1, data_len);
- memcpy(account->user_data, (void *)&data, data_len);
- account->user_data_length = data_len;
-
- _account_info_print(account);
-}
-
-static void _set_yahoomail(struct viewdata *vd)
-{
- debug_log("");
-
- if (!vd) {
- debug_log("vd is NULL");
+ if (!desc) {
+ debug_log("EmailSpDesc is NULL");
return;
}
email_account_t *account = NULL;
account = ugd->new_account;
- int rgb = 0xdc143cff;
-
- _set_user_name_with_email_addr(account->user_email_address, &(account->incoming_server_user_name));
- _set_display_name_with_email_addr(account->user_email_address, &(account->user_display_name));
-
- account->account_name = g_strdup(_("IDS_EMAIL_BODY_YAHOO_E_MAIL"));
- account->reply_to_address = g_strdup(account->user_email_address);
- account->return_address = g_strdup(account->user_email_address);
- account->retrieval_mode = EMAIL_IMAP4_RETRIEVAL_MODE_ALL; /* EMAIL_IMAP4_RETRIEVAL_MODE_NEW; */
-
- account->auto_download_size = 1024*10; /* downloading option, 0 is subject only, 1 is text body, 2 is normal. */
- account->outgoing_server_use_same_authenticator = 1; /* Specifies the 'Same as POP3' option, 0 is none, 1 is 'Same as POP3' */
- account->default_mail_slot_size = 25;
-
- account->pop_before_smtp = 0;
- account->incoming_server_requires_apop = 0;
-
- account->options.priority = 3;
- account->options.keep_local_copy = 1;
- account->options.req_delivery_receipt = 0;
- account->options.req_read_receipt = 0;
- account->options.download_limit = 0;
- account->options.block_address = 1;
- account->options.block_subject = 1;
- account->options.display_name_from = NULL;
- account->options.reply_with_body = 1;
- account->options.forward_with_files = 1;
- account->options.add_myname_card = 0;
- account->options.add_signature = 1;
- account->options.signature = g_strdup(DEFAULT_SIGNATURE);
-
- account->logo_icon_path = g_strdup(ACCOUNT_ICON_YAHOO);
-
- account->outgoing_server_type = EMAIL_SERVER_TYPE_SMTP;
- account->outgoing_server_need_authentication = 1;
-
- /*account->user_display_name = g_strdup(account->user_display_name);
- account->user_email_address = g_strdup("<User ID>@yahoo.com");
- account->incoming_server_password = g_strdup(<User Password>);*/
-
- vconf_get_int("file/private/org.tizen.email/yahoo_receiving_type", (int *)&(account->incoming_server_type));
- vconf_get_int("file/private/org.tizen.email/yahoo_receiving_port", &(account->incoming_server_port_number));
- vconf_get_int("file/private/org.tizen.email/yahoo_receiving_ssl", &(account->incoming_server_secure_connection));
- account->incoming_server_address = vconf_get_str("file/private/org.tizen.email/yahoo_receiving_address");
-
- account->outgoing_server_address = vconf_get_str("file/private/org.tizen.email/yahoo_sending_address");
- vconf_get_int("file/private/org.tizen.email/yahoo_sending_port", &(account->outgoing_server_port_number));
- vconf_get_int("file/private/org.tizen.email/yahoo_sending_ssl", &(account->outgoing_server_secure_connection));
- account->outgoing_server_user_name = g_strdup(account->incoming_server_user_name);
- account->outgoing_server_password = g_strdup(account->incoming_server_password);
-
- /*user data set*/
- account_user_data_t data;
- data.index_color = rgb;
- data.is_preset_account = YAHOOMAIL;
- data.show_images = 1;
- data.send_read_report = 0;
- data.pop3_deleting_option = 0;
-
- int data_len = sizeof(account_user_data_t);
- account->user_data = calloc(1, data_len);
- memcpy(account->user_data, (void *)&data, data_len);
- account->user_data_length = data_len;
-
- _account_info_print(account);
-}
-
-static void _set_hotmail(struct viewdata *vd)
-{
- debug_log("");
-
- if (!vd) {
- debug_log("vd is NULL");
- return;
- }
-
- EmailSettingUGD *ugd = vd->ugd;
- email_account_t *account = NULL;
- account = ugd->new_account;
-
- int rgb = 0xdc143cff;
-
- /* hotmail use email address in user name field */
- account->incoming_server_user_name = g_strdup(account->user_email_address);
- _set_display_name_with_email_addr(account->user_email_address, &(account->user_display_name));
-
- account->account_name = g_strdup(_("IDS_EMAIL_BODY_WINDOWS_LIVE_HOTMAIL"));
- account->reply_to_address = g_strdup(account->user_email_address);
- account->return_address = g_strdup(account->user_email_address);
- account->retrieval_mode = EMAIL_IMAP4_RETRIEVAL_MODE_ALL; /* EMAIL_IMAP4_RETRIEVAL_MODE_NEW; */
-
- account->auto_download_size = 1024*10; /* downloading option, 0 is subject only, 1 is text body, 2 is normal. */
- account->outgoing_server_use_same_authenticator = 1; /* Specifies the 'Same as POP3' option, 0 is none, 1 is 'Same as POP3' */
- account->default_mail_slot_size = 25;
-
- account->pop_before_smtp = 0;
- account->incoming_server_requires_apop = 0;
-
- account->options.priority = 3;
- account->options.keep_local_copy = 1;
- account->options.req_delivery_receipt = 0;
- account->options.req_read_receipt = 0;
- account->options.download_limit = 0;
- account->options.block_address = 1;
- account->options.block_subject = 1;
- account->options.display_name_from = NULL;
- account->options.reply_with_body = 1;
- account->options.forward_with_files = 1;
- account->options.add_myname_card = 0;
- account->options.add_signature = 1;
- account->options.signature = g_strdup(DEFAULT_SIGNATURE);
-
- account->logo_icon_path = g_strdup(ACCOUNT_ICON_HOTMAIL);
-
- account->outgoing_server_type = EMAIL_SERVER_TYPE_SMTP;
- account->outgoing_server_need_authentication = 1;
-
- /*account->user_display_name = g_strdup(account->user_display_name);
- account->user_email_address = g_strdup("<User ID>@aol.com");
- account->incoming_server_password = g_strdup(<User Password>);*/
-
- vconf_get_int("file/private/org.tizen.email/hotmail_receiving_type", (int *)&(account->incoming_server_type));
- vconf_get_int("file/private/org.tizen.email/hotmail_receiving_port", &(account->incoming_server_port_number));
- vconf_get_int("file/private/org.tizen.email/hotmail_receiving_ssl", &(account->incoming_server_secure_connection));
- account->incoming_server_address = vconf_get_str("file/private/org.tizen.email/hotmail_receiving_address");
-
- account->outgoing_server_address = vconf_get_str("file/private/org.tizen.email/hotmail_sending_address");
- vconf_get_int("file/private/org.tizen.email/hotmail_sending_port", &(account->outgoing_server_port_number));
- vconf_get_int("file/private/org.tizen.email/hotmail_sending_ssl", &(account->outgoing_server_secure_connection));
- account->outgoing_server_user_name = g_strdup(account->incoming_server_user_name);
- account->outgoing_server_password = g_strdup(account->incoming_server_password);
-
- /*user data set*/
- account_user_data_t data;
- data.index_color = rgb;
- data.is_preset_account = HOTMAIL;
- data.show_images = 1;
- data.send_read_report = 0;
- data.pop3_deleting_option = 0;
-
- int data_len = sizeof(account_user_data_t);
- account->user_data = calloc(1, data_len);
- memcpy(account->user_data, (void *)&data, data_len);
- account->user_data_length = data_len;
-
- _account_info_print(account);
-}
-
-static void _set_aol(struct viewdata *vd)
-{
- debug_log("");
-
- if (!vd) {
- debug_log("vd is NULL");
- return;
- }
-
- EmailSettingUGD *ugd = vd->ugd;
- email_account_t *account = NULL;
- account = ugd->new_account;
-
- int rgb = 0x008080ff;
+ if (g_strcmp0(desc->id, "Hotmail") == 0 || g_strcmp0(desc->id, "AOL") == 0)
+ account->incoming_server_user_name = g_strdup(account->user_email_address);
+ else
+ _set_user_name_with_email_addr(account->user_email_address, &(account->incoming_server_user_name));
- account->incoming_server_user_name = g_strdup(account->user_email_address);
_set_display_name_with_email_addr(account->user_email_address, &(account->user_display_name));
- account->account_name = g_strdup(_("IDS_EMAIL_BODY_AOL"));
+ if (g_str_has_prefix(desc->name_str_id, "IDS_EMAIL"))
+ account->account_name = g_strdup(_(desc->name_str_id));
+ else
+ account->account_name = g_strdup(dgettext("sys_string", desc->name_str_id));
account->reply_to_address = g_strdup(account->user_email_address);
account->return_address = g_strdup(account->user_email_address);
account->retrieval_mode = EMAIL_IMAP4_RETRIEVAL_MODE_ALL; /* EMAIL_IMAP4_RETRIEVAL_MODE_NEW; */
account->options.add_signature = 1;
account->options.signature = g_strdup(DEFAULT_SIGNATURE);
- account->logo_icon_path = g_strdup(ACCOUNT_ICON_AOL);
+ account->logo_icon_path = g_strdup(desc->icon_path);
account->outgoing_server_type = EMAIL_SERVER_TYPE_SMTP;
account->outgoing_server_need_authentication = 1;
- /*account->user_display_name = g_strdup(account->user_display_name);
- account->user_email_address = g_strdup("<User ID>@aol.com");
- account->incoming_server_password = g_strdup(<User Password>);*/
+ char *upper_str = g_ascii_strup(desc->receiving_server_type, -1);
+ if (g_strcmp0(upper_str, "IMAP") == 0 || g_strcmp0(upper_str, "IMAP4") == 0)
+ account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
+ else if (g_strcmp0(upper_str, "POP") == 0 || g_strcmp0(upper_str, "POP3") == 0)
+ account->incoming_server_type = EMAIL_SERVER_TYPE_POP3;
+ g_free(upper_str);
- vconf_get_int("file/private/org.tizen.email/aol_receiving_type", (int *)&(account->incoming_server_type));
- vconf_get_int("file/private/org.tizen.email/aol_receiving_port", &(account->incoming_server_port_number));
- vconf_get_int("file/private/org.tizen.email/aol_receiving_ssl", &(account->incoming_server_secure_connection));
- account->incoming_server_address = vconf_get_str("file/private/org.tizen.email/aol_receiving_address");
+ account->incoming_server_port_number = desc->receiving_port;
+ account->incoming_server_secure_connection = desc->receiving_security;
+ account->incoming_server_address = g_strdup(desc->receiving_address);
- account->outgoing_server_address = vconf_get_str("file/private/org.tizen.email/aol_sending_address");
- vconf_get_int("file/private/org.tizen.email/aol_sending_port", &(account->outgoing_server_port_number));
- vconf_get_int("file/private/org.tizen.email/aol_sending_ssl", &(account->outgoing_server_secure_connection));
+ account->outgoing_server_port_number = desc->sending_port;
+ account->outgoing_server_secure_connection = desc->sending_security;
+ account->outgoing_server_address = g_strdup(desc->sending_address);
account->outgoing_server_user_name = g_strdup(account->incoming_server_user_name);
account->outgoing_server_password = g_strdup(account->incoming_server_password);
/*user data set*/
account_user_data_t data;
- data.index_color = rgb;
- data.is_preset_account = AOL;
+ data.index_color = desc->rgb;
+ data.is_preset_account = desc->index;
data.show_images = 1;
data.send_read_report = 0;
data.pop3_deleting_option = 0;
_account_info_print(account);
}
-static void _set_others(struct viewdata *vd)
+static void _set_others_email(struct viewdata *vd)
{
debug_log("");
debug_log("account added");
if (g_strcmp0(ugd->start_view_type, EMAIL_BUNDLE_VAL_VIEW_FIRST_SETUP) == 0) {
- if (ugd->account_info >= HOTMAIL && ugd->account_info <= OTHERS) {
- if (!ugd->start_account_validation) {
+ if (!ugd->start_account_validation) {
ug_destroy_me(ugd->ug);
- }
- } else {
- ug_destroy_me(ugd->ug);
}
} else {
if (ugd->b_on_pause) {
ret = N_("Sytem failure");
return strdup(ret);
} else if (type == EMAIL_ERROR_CANCELLED) {
- ret = N_("Canceled by user");
+ ret = N_("Cancelled by user");
return strdup(ret);
} else if (type == EMAIL_ERROR_CERTIFICATE_FAILURE) {
ret = N_("Certificate failure");
ret = N_("TLS/SSL failure");
return strdup(ret);
} else {
- snprintf(str, sizeof(str), "%s (%d)", dgettext("sys_string", "IDS_COM_POP_INTERNAL_ERROR"), type);
+ snprintf(str, sizeof(str), "%s (%d)", dgettext("sys_string", "IDS_COM_POP_UNKNOWN_ERROR_OCCURRED"), type);
return strdup(str);
}
}
return xml_source;
}
-void setting_traverse_xml_node(xmlNode *a_node, int depth, void *data)
+void setting_traverse_xml_node(xmlNode *a_node, int depth, void *data, int reset)
{
- debug_log("");
xmlNode *cur_node = NULL;
EmailSettingUGD *ugd = (EmailSettingUGD *)data;
static int i=0;
+ if (reset) i = 0;
+
for (cur_node=a_node; cur_node; cur_node=cur_node->next) {
if (cur_node->type == XML_ELEMENT_NODE) {
- /*debug_log("Level%d Node\nName:%s", depth, cur_node->name);*/
+ //debug_log("Level%d Node\nName:%s", depth, cur_node->name);
if (cur_node->properties != NULL) {
struct _xmlAttr* pAttr=cur_node->properties;
while (pAttr != NULL) {
- /*debug_log("Property:%s=\"%s\"", pAttr->name, pAttr->children->content);*/
+ //debug_log("Property:%s=\"%s\"", pAttr->name, pAttr->children->content);
if (depth == 1 && i < ugd->sp_list_len && g_strcmp0("csc_code", (char *)pAttr->name) == 0)
ugd->sp_list[i].csc_code = g_strdup((char *)pAttr->children->content);
pAttr=pAttr->next;
}
if (cur_node->children != NULL) {
- /*debug_log("Content:%s", cur_node->children->content);*/
+ //debug_log("Content:%s", cur_node->children->content);
if (depth == 2 && i < ugd->sp_list_len) {
+ ugd->sp_list[i].index = i+1;
if (g_strcmp0("id", (char *)cur_node->name) == 0) {
- ugd->sp_list[i].id = atoi((char *)cur_node->children->content);
+ ugd->sp_list[i].id = g_strdup((char *)cur_node->children->content);
} else if (g_strcmp0("name", (char *)cur_node->name) == 0) {
ugd->sp_list[i].name = g_strdup((char *)cur_node->children->content);
} else if (g_strcmp0("name_str_id", (char *)cur_node->name) == 0) {
ugd->sp_list[i].receiving_port = atoi((char *)cur_node->children->content);
} else if (g_strcmp0("receiving_security", (char *)cur_node->name) == 0) {
ugd->sp_list[i].receiving_security = atoi((char *)cur_node->children->content);
+ } else if (g_strcmp0("rgb", (char *)cur_node->name) == 0) {
+ long rgb = strtoul((char *)cur_node->children->content, NULL, 16);
+ ugd->sp_list[i].rgb = rgb;
}
}
- setting_traverse_xml_node(cur_node->children, depth+1, data);
+ setting_traverse_xml_node(cur_node->children, depth+1, data, 0);
}
if (depth == 1) i++;
}
}
+EmailSpDesc *setting_find_sp_desc(char *id, EmailSettingUGD *ugd)
+{
+ debug_log("");
+ int i=0;
+ EmailSpDesc *desc = NULL;
+
+ for (i=0; i<ugd->sp_list_len; i++) {
+ desc = &(ugd->sp_list[i]);
+ if (g_strcmp0(desc->id, id) == 0) {
+ return desc;
+ }
+ }
+
+ return NULL;
+}
+
void setting_dump_sp_desc(EmailSettingUGD *ugd)
{
debug_log("");
for (i=0; i<ugd->sp_list_len; i++) {
desc = &(ugd->sp_list[i]);
debug_log("SP-%d===========================================", i);
- debug_log("ID:%d", desc->id);
+ debug_log("ID:%s", desc->id);
debug_log("CSC:%s", desc->csc_code);
debug_log("Name:%s", desc->name);
debug_log("Name STR:%s", desc->name_str_id);
debug_log("");
}
}
+
+void setting_free_sp_desc(EmailSettingUGD *ugd)
+{
+ debug_log("");
+ int i=0;
+ EmailSpDesc *desc = NULL;
+
+ if (ugd->sp_list_len > 0 && ugd->sp_list) {
+ for (i=0; i<ugd->sp_list_len; i++) {
+ desc = &(ugd->sp_list[i]);
+ if (desc) {
+ g_free(desc->id);
+ g_free(desc->csc_code);
+ g_free(desc->name);
+ g_free(desc->name_str_id);
+ g_free(desc->icon_path);
+ g_free(desc->sending_address);
+ g_free(desc->receiving_server_type);
+ g_free(desc->receiving_address);
+ }
+ }
+
+ g_free(ugd->sp_list);
+ ugd->sp_list = NULL;
+ }
+}
/* EOF */
ugd->del_timer = NULL;
}
+ setting_free_sp_desc(ugd);
+
/* theme extension */
/*elm_theme_extension_del(ugd->theme, EV_THEME_PATH);
elm_theme_free(ugd->theme);*/
debug_log("Failed to get account list");
}
-#if 0
/* create xml tree */
+ setting_free_sp_desc(ugd);
+
xmlDocPtr xml_source = setting_create_xml_tree(SP_XML_PATH);
if(!xml_source) {
Evas_Object *popup = elm_popup_add(ugd->layout_main);
debug_log("Count of SP list:%d", sp_count);
if (sp_count > 0) {
ugd->sp_list = (EmailSpDesc *)calloc(sp_count, sizeof(EmailSpDesc));
- setting_traverse_xml_node(root, 0, (void *)ugd);
+ setting_traverse_xml_node(root, 0, (void *)ugd, 1);
setting_dump_sp_desc(ugd);
}
setting_cleanup_xml_parser(xml_source);
-#endif
if (!_parse_option(service, ugd)) {
return;
/* account add view */
char *account_name = NULL;
service_get_extra_data(service, EMAIL_BUNDLE_KEY_ESP_NAME, &account_name);
- if (!strcmp(account_name, EMAIL_BUNDLE_VAL_ESP_GMAIL)) {
- debug_log("gmail");
- ugd->account_info = GMAIL;
- } else if (!strcmp(account_name, EMAIL_BUNDLE_VAL_ESP_YAHOO)) {
- debug_log("yahoomail");
- ugd->account_info = YAHOOMAIL;
- } else if (!strcmp(account_name, EMAIL_BUNDLE_VAL_ESP_AOL)) {
- debug_log("aol");
- ugd->account_info = AOL;
- } else if (!strcmp(account_name, EMAIL_BUNDLE_VAL_ESP_HOTMAIL)) {
- debug_log("hotmail");
- ugd->account_info = HOTMAIL;
- } else if (!strcmp(account_name, EMAIL_BUNDLE_VAL_ESP_MSN)) {
- debug_log("msn");
- ugd->account_info = HOTMAIL;
- } else if (!strcmp(account_name, EMAIL_BUNDLE_VAL_ESP_OTHERS)) {
- debug_log("others");
- ugd->account_info = OTHERS;
- } else {
- debug_log("Invalid account type!!(%s)", account_name);
- }
+ debug_log("Account name:%s", account_name);
+
+ EmailSpDesc *desc = NULL;
+ if (g_strcmp0(account_name, "gmail") == 0)
+ desc = setting_find_sp_desc("Gmail", ugd);
+ else if (g_strcmp0(account_name, "msn") == 0)
+ desc = setting_find_sp_desc("Hotmail", ugd);
+ else
+ desc = NULL;
+
+ if (desc)
+ ugd->account_info = desc;
+ else
+ ugd->account_info = NULL;
g_free(account_name);
}
Evas_Object *title_ic = elm_icon_add(vd->ugd->navi_bar);
evas_object_size_hint_aspect_set(title_ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_resizable_set(title_ic, EINA_TRUE, EINA_TRUE);
-
+ elm_icon_file_set(title_ic, account_data->logo_icon_path, NULL);
+
account_user_data_t *user_data = (account_user_data_t *)account_data->user_data;
- if (user_data->is_preset_account == GMAIL) {
- elm_icon_file_set(title_ic, ACCOUNT_ICON_GMAIL, NULL);
- } else if (user_data->is_preset_account == HOTMAIL) {
- elm_icon_file_set(title_ic, ACCOUNT_ICON_HOTMAIL, NULL);
- } else if (user_data->is_preset_account == YAHOOMAIL) {
- elm_icon_file_set(title_ic, ACCOUNT_ICON_YAHOO, NULL);
- } else if (user_data->is_preset_account == AOL) {
- elm_icon_file_set(title_ic, ACCOUNT_ICON_AOL, NULL);
- }
-
Elm_Object_Item *navi_it = NULL;
navi_it = elm_naviframe_item_push(vd->ugd->navi_bar, p->str_account_name, p->l_button, NULL, p->layout, NULL);
/*elm_object_item_part_content_set(navi_it, "title_left_btn", p->r_button1);
elm_object_item_part_content_set(navi_it, "title_right_btn", p->r_button2);*/
- elm_object_item_part_content_set(navi_it, "icon", title_ic);
+ if (user_data->is_preset_account != 0)
+ elm_object_item_part_content_set(navi_it, "icon", title_ic);
elm_object_item_part_content_set(navi_it, "controlbar", p->cbar);
evas_object_show(vd->ugd->navi_bar);
}
}
if (index == 2) {
- snprintf(buf, sizeof(buf), "%s", N_("Same as POP3/IMAP4"));
+ snprintf(buf, sizeof(buf), "%s", _("IDS_EMAIL_BODY_SAME_AS_POP3_IMAP4"));
}
return g_strdup(buf);
}
if (index == 3) {
- snprintf(buf, sizeof(buf), "%s", N_("Request delivery report"));
+ snprintf(buf, sizeof(buf), "%s", _("IDS_EMAIL_BODY_REQUEST_DELIVERY_REPORT"));
}
if (index == 4) {
}
if (!g_strcmp0(part, "elm.text.2")) {
- email_mailbox_t *mailbox;
+ email_mailbox_t *mailbox = NULL;
char buf[MAX_STR_LEN] = { 0, };
email_get_mailbox_by_mailbox_type(ugd->account_id, type, &mailbox);
- snprintf(buf, sizeof(buf), "%s", mailbox->alias);
- email_free_mailbox(&mailbox, 1);
+ if (mailbox) {
+ snprintf(buf, sizeof(buf), "%s", mailbox->alias);
+ email_free_mailbox(&mailbox, 1);
+ }
return g_strdup(buf);
}
if (!g_strcmp0(part, "elm.icon.1")) {
Evas_Object *icon = elm_icon_add(ugd->navi_bar);
- account_user_data_t *user_data = (account_user_data_t *)account_data->user_data;
-
- debug_log("is_preset_account:%d", user_data->is_preset_account);
-
- switch (user_data->is_preset_account) {
- case GMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_GMAIL, NULL);
- break;
- case HOTMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_HOTMAIL, NULL);
- break;
- case YAHOOMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_YAHOO, NULL);
- break;
- case AOL:
- elm_icon_file_set(icon, ACCOUNT_ICON_AOL, NULL);
- break;
- case OTHERS:
- default:
- elm_icon_file_set(icon, ACCOUNT_ICON_OTHERS, NULL);
- break;
- }
+ elm_icon_file_set(icon, account_data->logo_icon_path, NULL);
evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
p->account_icon = icon;
-
return icon;
}
elm_genlist_item_selected_set(item, EINA_FALSE);
account_user_data_t *user_data = NULL;
+ if (p->entry_sig)
+ elm_object_focus_set(p->entry_sig, EINA_FALSE);
+
switch (index) {
case 0:
account_data->options.reply_with_body = !account_data->options.reply_with_body;
/*EmailSettingUGD *ugd = vd->ugd;*/
int i = 0;
+ if (p->entry_sig)
+ elm_object_focus_set(p->entry_sig, EINA_FALSE);
+
if (it == p->gl_cc_item) {
for (i = 0; i < 3; i++) {
elm_genlist_item_append(p->genlist, &(p->itc_ex_cc), (void *)i,
debug_log("");
Elm_Object_Item *item = event_info;
elm_genlist_item_subitems_clear(item);
+
+ struct viewdata *vd = (struct viewdata *)data;
+ struct priv_data *p = vd->priv;
+
+ if (p->entry_sig)
+ elm_object_focus_set(p->entry_sig, EINA_FALSE);
}
/* EOF */
static int _check_null_field(struct viewdata *vd);
static int _check_preset_null_field(struct viewdata *vd);
-static int _check_preset_isp_name(char *addr, int isp_type);
+static int _check_preset_isp_name(char *addr, EmailSpDesc *desc);
static void _read_all_entries(struct viewdata *vd);
/*static void _set_help_string(Evas_Object *eo, struct viewdata *vd);*/
static void _set_domain_string(struct viewdata *vd);
g_vd = vd;
ugd->wds_account_creation = 0;
- if (vd->ugd->account_info != OTHERS) {
+ if (vd->ugd->account_info != NULL) {
_set_domain_string(vd);
}
ugd->popup_validate = NULL;
}
- ugd->account_info = 0;
+ ugd->account_info = NULL;
setting_new_acct_final(vd);
return TRUE;
elm_object_style_set(p->cbar, "naviframe");
evas_object_show(p->cbar);
- if (vd->ugd->account_info == OTHERS) {
+ if (vd->ugd->account_info == NULL) {
p->c_item[0] = elm_toolbar_item_append(p->cbar, NULL,
- dgettext("sys_string", "IDS_COM_BUTTON_LOGIN"), _next_cb, vd);
+ dgettext("sys_string", "IDS_COM_SK_NEXT"), _next_cb, vd);
} else {
p->c_item[0] = elm_toolbar_item_append(p->cbar, NULL,
dgettext("sys_string", "IDS_COM_BUTTON_LOGIN"), _save_cb, vd);
elm_object_focus_allow_set(p->l_button, EINA_FALSE);
evas_object_show(p->l_button);
- if (vd->ugd->account_info == OTHERS) {
- elm_object_text_set(p->l_button, dgettext("sys_string", "IDS_COM_BUTTON_LOGIN"));
+ if (vd->ugd->account_info == NULL) {
+ elm_object_text_set(p->l_button, dgettext("sys_string", "IDS_COM_SK_NEXT"));
evas_object_smart_callback_add(p->l_button, "clicked", _next_cb, vd);
} else {
elm_object_text_set(p->l_button, dgettext("sys_string", "IDS_COM_BUTTON_LOGIN"));
Elm_Object_Item *navi_it = NULL;
char title_str[50] = { 0, };
- if (vd->ugd->account_info == GMAIL) {
- snprintf(title_str, sizeof(title_str), "%s", dgettext("sys_string", "IDS_COM_BODY_GOOGLE"));
- elm_icon_file_set(title_ic, ACCOUNT_ICON_GMAIL, NULL);
- } else if (vd->ugd->account_info == HOTMAIL) {
- snprintf(title_str, sizeof(title_str), "%s", _("IDS_EMAIL_BODY_WINDOWS_LIVE_HOTMAIL"));
- elm_icon_file_set(title_ic, ACCOUNT_ICON_HOTMAIL, NULL);
- } else if (vd->ugd->account_info == YAHOOMAIL) {
- snprintf(title_str, sizeof(title_str), "%s", _("IDS_EMAIL_BODY_YAHOO_E_MAIL"));
- elm_icon_file_set(title_ic, ACCOUNT_ICON_YAHOO, NULL);
- } else if (vd->ugd->account_info == AOL) {
- snprintf(title_str, sizeof(title_str), "%s", _("IDS_EMAIL_BODY_AOL"));
- elm_icon_file_set(title_ic, ACCOUNT_ICON_AOL, NULL);
- } else
+ if (vd->ugd->account_info) {
+ if (g_str_has_prefix(vd->ugd->account_info->name_str_id, "IDS_EMAIL"))
+ snprintf(title_str, sizeof(title_str), "%s", _(vd->ugd->account_info->name_str_id));
+ else
+ snprintf(title_str, sizeof(title_str), "%s", dgettext("sys_string", vd->ugd->account_info->name_str_id));
+
+ elm_icon_file_set(title_ic, vd->ugd->account_info->icon_path, NULL);
+ } else {
snprintf(title_str, sizeof(title_str), "%s", dgettext("sys_string", "IDS_COM_BODY_OTHERS"));
+ }
navi_it = elm_naviframe_item_push(vd->ugd->navi_bar, title_str, p->r_button2, NULL, p->layout, NULL);
- if (vd->ugd->account_info != OTHERS) {
+ if (vd->ugd->account_info) {
elm_object_item_part_content_set(navi_it, "icon", title_ic);
}
elm_object_item_part_content_set(navi_it, "title_left_btn", p->l_button);
Evas_Object *sub_ly = elm_layout_add(ugd->navi_bar);
if (w == 480) {
- if (vd->ugd->account_info == OTHERS)
+ if (vd->ugd->account_info == NULL)
elm_layout_file_set(sub_ly, EV_THEME_PATH, "other_account_add_wvga");
else
elm_layout_file_set(sub_ly, EV_THEME_PATH, "account_add_wvga");
} else {
- if (vd->ugd->account_info == OTHERS)
+ if (vd->ugd->account_info == NULL)
elm_layout_file_set(sub_ly, EV_THEME_PATH, "other_account_add");
else
elm_layout_file_set(sub_ly, EV_THEME_PATH, "account_add");
elm_object_part_content_set(sub_ly, "list", p->genlist);
Evas_Object *checkbox_set = elm_layout_add(sub_ly);
- elm_layout_file_set(checkbox_set, EV_THEME_PATH, "account_add_checkbox_set");
+ if (w == 480) {
+ elm_layout_file_set(checkbox_set, EV_THEME_PATH, "account_add_checkbox_set_wvga");
+ } else {
+ elm_layout_file_set(checkbox_set, EV_THEME_PATH, "account_add_checkbox_set");
+ }
evas_object_size_hint_weight_set(checkbox_set, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(checkbox_set);
elm_object_part_content_set(sub_ly, "checkbox_set", checkbox_set);
Evas_Object *button_set = elm_layout_add(sub_ly);
- elm_layout_file_set(button_set, EV_THEME_PATH, "account_add_manual_button");
+ if (w == 480) {
+ elm_layout_file_set(button_set, EV_THEME_PATH, "account_add_manual_button_wvga");
+ } else {
+ elm_layout_file_set(button_set, EV_THEME_PATH, "account_add_manual_button");
+ }
evas_object_size_hint_weight_set(button_set, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(button_set);
ELM_GENLIST_ITEM_GROUP, NULL, NULL);
elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- if (ugd->account_info == OTHERS) {
+ if (ugd->account_info == NULL) {
/* Account name for OTHER */
i = 1;
item = elm_genlist_item_append(p->genlist, &(p->itc2), (void *)i, git,
return TRUE;
}
-static int _check_preset_isp_name(char *addr, int isp_type)
+static int _check_preset_isp_name(char *addr, EmailSpDesc *desc)
{
debug_log("");
int ret = FALSE;
- if (isp_type == HOTMAIL) {
+ if (g_strcmp0(desc->id, "Hotmail") == 0) {
char *ptr1 = NULL;
char *ptr2 = NULL;
ptr1 = g_strrstr(addr, "@hotmail.");
if (ptr1 != NULL || ptr2 != NULL)
ret = TRUE;
- } else if (isp_type == GMAIL) {
+ } else if (g_strcmp0(desc->id, "Gmail") == 0) {
ret = g_str_has_suffix(addr, "@gmail.com") ||
g_str_has_suffix(addr, "@googlemail.com");
- } else if (isp_type == AOL) {
+ } else if (g_strcmp0(desc->id, "AOL") == 0) {
char *ptr1 = NULL;
char *ptr2 = NULL;
ptr1 = g_strrstr(addr, "@aol.");
setting_new_acct_init(vd);
email_account_t *account = vd->ugd->new_account;
- if (vd->ugd->account_info == OTHERS) {
+ if (vd->ugd->account_info == NULL) {
/*buf = elm_entry_markup_to_utf8(elm_entry_entry_get(p->entry_account_name));*/
if (p->entry_account_name) {
buf = (char *)elm_entry_entry_get(p->entry_account_name);
struct priv_data *p;
p = vd->priv;
- if (ugd->account_info == HOTMAIL) {
+ if (g_strcmp0(ugd->account_info->id, "Hotmail") == 0) {
p->str_email_address = g_strdup("@hotmail.com");
- } else if (ugd->account_info == YAHOOMAIL) {
+ } else if (g_strcmp0(ugd->account_info->id, "Yahoomail") == 0) {
p->str_email_address = g_strdup("@yahoo.com");
- } else if (ugd->account_info == GMAIL) {
+ } else if (g_strcmp0(ugd->account_info->id, "Gmail") == 0) {
p->str_email_address = g_strdup("@gmail.com");
- } else if (ugd->account_info == AOL) {
+ } else if (g_strcmp0(ugd->account_info->id, "AOL") == 0) {
p->str_email_address = g_strdup("@aol.com");
} else {
debug_log("Unknown account type");
}
/* check Null field */
- if (vd->ugd->account_info == OTHERS) {
+ if (vd->ugd->account_info == NULL) {
ret = _check_null_field(vd);
} else {
ret = _check_preset_null_field(vd);
}
/* check ISP */
- if (ugd->account_info != OTHERS) {
+ if (ugd->account_info) {
buf = g_strdup(account->user_email_address);
ret = _check_preset_isp_name(buf, ugd->account_info);
if (ret == FALSE) {
g_free(buf);
/* account info setting */
- if (ugd->account_info != OTHERS)
+ if (ugd->account_info)
setting_set_account(vd);
setting_change_view(VIEW_MANUAL_SETUP, ugd);
ugd->focus_timer = NULL;
}
- if (ugd->account_info == OTHERS) {
+ if (ugd->account_info == NULL) {
p->clicked_object = p->entry_account_name;
elm_object_focus_set(p->entry_account_name, EINA_TRUE);
} else {
p->str_password = g_strdup(elm_entry_entry_get(eo));
}
- if (ugd->account_info == OTHERS) {
+ if (ugd->account_info == NULL) {
if (p->str_account_name == NULL) {
elm_object_disabled_set(p->l_button, EINA_TRUE);
elm_object_disabled_set(p->manual_btn, EINA_TRUE);
int index = (int)data;
struct viewdata *vd = g_vd;
struct priv_data *p = vd->priv;
- //EmailSettingUGD *ugd = vd->ugd;
+ EmailSettingUGD *ugd = vd->ugd;
Ecore_IMF_Context *imf_context = NULL;
if (!strcmp(part, "elm.icon")) {
if (index == 1) {
- //p->icon_get_cnt1++;
+ p->icon_get_cnt1++;
debug_log("");
p->ef_account_name = elm_layout_add(p->genlist);
if (p->str_account_name)
elm_entry_entry_set(p->entry_account_name, p->str_account_name);
- /*if (ugd->account_info == OTHERS && p->icon_get_cnt1 == 2 &&
+ if (ugd->account_info == NULL && p->icon_get_cnt1 == 2 &&
strcmp(ugd->start_view_type, EMAIL_BUNDLE_VAL_VIEW_ACCOUNT_ADD) != 0) {
p->clicked_object = p->entry_account_name;
evas_object_show(p->entry_account_name);
elm_object_focus_set(p->entry_account_name, EINA_TRUE);
}
- if (ugd->account_info == OTHERS && p->icon_get_cnt1 == 3 &&
+ if (ugd->account_info == NULL && p->icon_get_cnt1 == 3 &&
strcmp(ugd->start_view_type, EMAIL_BUNDLE_VAL_VIEW_ACCOUNT_ADD) == 0) {
p->clicked_object = p->entry_account_name;
evas_object_show(p->entry_account_name);
elm_object_focus_set(p->entry_account_name, EINA_TRUE);
- }*/
+ }
return p->ef_account_name;
} else if (index == 2) {
return p->ef_display_name;
} else if (index == 4) {
- //p->icon_get_cnt2++;
+ p->icon_get_cnt2++;
debug_log("");
p->ef_email_address = elm_layout_add(p->genlist);
if (p->str_email_address)
elm_entry_entry_set(p->entry_email_address, p->str_email_address);
- /*if (ugd->account_info != OTHERS && p->icon_get_cnt2 == 2 &&
+ if (ugd->account_info != NULL && p->icon_get_cnt2 == 2 &&
strcmp(ugd->start_view_type, EMAIL_BUNDLE_VAL_VIEW_ACCOUNT_ADD) != 0) {
p->clicked_object = p->entry_email_address;
evas_object_show(p->entry_email_address);
elm_entry_cursor_begin_set(p->entry_email_address);
}
- if (ugd->account_info != OTHERS && p->icon_get_cnt2 == 3 &&
+ if (ugd->account_info != NULL && p->icon_get_cnt2 == 3 &&
strcmp(ugd->start_view_type, EMAIL_BUNDLE_VAL_VIEW_ACCOUNT_ADD) == 0) {
p->clicked_object = p->entry_email_address;
evas_object_show(p->entry_email_address);
elm_object_focus_set(p->entry_email_address, EINA_TRUE);
elm_entry_cursor_begin_set(p->entry_email_address);
- }*/
+ }
return p->ef_email_address;
} else if (index == 5) {
static void _push_naviframe(struct viewdata *vd);
static void _create_view(struct viewdata *vd);
-#ifndef INITIAL_VIEW_ADD_BTN
static void _create_list(struct viewdata *vd);
-#endif
-#ifdef INITIAL_VIEW_ADD_BTN
-static void _add_account_cb(void *data, Evas_Object *obj, void *event_info);
-#endif
-#ifndef INITIAL_VIEW_ADD_BTN
static void _new_account_cb(void *data, Evas_Object *obj, void *event_info);
-#endif
static void _back_cb(void *data, Evas_Object *obj, void *event_info);
-#ifndef INITIAL_VIEW_ADD_BTN
static Eina_Bool _gl_state_get_cb(void *data, Evas_Object *obj, const char *part);
static void _gl_del_cb(void *data, Evas_Object *obj);
static char *_gl_text_get_cb(void *data, Evas_Object *obj, const char *part);
static Evas_Object *_gl_content_get_cb(void *data, Evas_Object *obj, const char *part);
-#endif
struct priv_data {
struct viewdata *vd;
Evas_Object *b_btn2;
Evas_Object *b_btn;
- Elm_Genlist_Item_Class itc;
+ Elm_Genlist_Item_Class itc1;
Elm_Genlist_Item_Class itc2;
+ Elm_Genlist_Item_Class itc3;
Ecore_Timer *vc_timer;
int as_flag;
};
evas_object_size_hint_weight_set(sub_ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(sub_ly);
-#ifdef INITIAL_VIEW_ADD_BTN
- Evas_Object *btn = elm_button_add(ugd->navi_bar);
- elm_object_text_set(btn, dgettext("sys_string", "IDS_COM_SK_ADD_ACCOUNT"));
- evas_object_smart_callback_add(btn, "clicked", _add_account_cb, (void *)vd);
- elm_object_style_set(btn, "text_only/style2");
- evas_object_show(btn);
-#endif
-
char *desc = g_strdup(_("IDS_EMAIL_BODY_YOU_CAN_USE_EMAIL_ON_YOUR_DEVICE_BY_ADDING_YOUR_ACCOUNT_IF_YOU_DO_NOT_HAVE_AN_EMAIL_ACCOUNT_SIGN_UP_FIRST"));
Evas_Object *label = elm_label_add(ugd->navi_bar);
elm_label_line_wrap_set(label, ELM_WRAP_WORD);
evas_object_show(label);
g_free(text);
-#ifndef INITIAL_VIEW_ADD_BTN
_create_list(vd);
-#endif
-#ifdef INITIAL_VIEW_ADD_BTN
- elm_object_part_content_set(sub_ly, "btn", btn);
-#endif
elm_object_part_content_set(sub_ly, "label", label);
-#ifndef INITIAL_VIEW_ADD_BTN
elm_object_part_content_set(sub_ly, "list", p->list);
-#endif
-
elm_object_part_content_set(p->layout, "elm.swallow.content", sub_ly);
}
-#ifndef INITIAL_VIEW_ADD_BTN
static void _create_list(struct viewdata *vd)
{
debug_log("");
/*elm_object_theme_set(p->list, ugd->theme);*/
evas_object_show(p->list);
- p->itc.item_style = "dialogue/1text.1icon.2";
- p->itc.func.text_get = _gl_text_get_cb;
- p->itc.func.content_get = _gl_content_get_cb;
- p->itc.func.state_get = _gl_state_get_cb;
- p->itc.func.del = _gl_del_cb;
+ p->itc1.item_style = "dialogue/1text.1icon.2";
+ p->itc1.func.text_get = _gl_text_get_cb;
+ p->itc1.func.content_get = _gl_content_get_cb;
+ p->itc1.func.state_get = _gl_state_get_cb;
+ p->itc1.func.del = _gl_del_cb;
- p->itc2.item_style = "dialogue/separator/11/with_line";
- p->itc2.func.text_get = NULL;
- p->itc2.func.content_get = NULL;
- p->itc2.func.state_get = NULL;
- p->itc2.func.del = NULL;
+ p->itc3.item_style = "dialogue/separator/11/with_line";
+ p->itc3.func.text_get = NULL;
+ p->itc3.func.content_get = NULL;
+ p->itc3.func.state_get = NULL;
+ p->itc3.func.del = NULL;
- git = elm_genlist_item_append(p->list, &(p->itc2), NULL, NULL,
+ git = elm_genlist_item_append(p->list, &(p->itc3), NULL, NULL,
ELM_GENLIST_ITEM_GROUP, NULL, NULL);
elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- for (index = HOTMAIL; index <= OTHERS; index++) {
- if (index != YAHOOMAIL) {
- elm_genlist_item_append(p->list, &p->itc, (void *)index, git,
- ELM_GENLIST_ITEM_NONE, _new_account_cb, vd);
- }
+ for (index = 0; index < ugd->sp_list_len; index++) {
+ EmailSpDesc *desc = &(ugd->sp_list[index]);
+ elm_genlist_item_append(p->list, &p->itc1, (void *)desc, git,
+ ELM_GENLIST_ITEM_NONE, _new_account_cb, vd);
}
-}
-#endif
-
-#ifdef INITIAL_VIEW_ADD_BTN
-static void _add_account_cb(void *data, Evas_Object *obj, void *event_info)
-{
- debug_log("");
- struct viewdata *vd = data;
- /*elm_object_style_set(vd->ugd->bg, "group_list");*/
- setting_change_view(VIEW_SP_SELECT, vd->ugd);
+ index = -1;
+ elm_genlist_item_append(p->list, &p->itc1, NULL, git,
+ ELM_GENLIST_ITEM_NONE, _new_account_cb, vd);
}
-#endif
-#ifndef INITIAL_VIEW_ADD_BTN
static void _new_account_cb(void *data, Evas_Object *obj, void *event_info)
{
debug_log("");
return;
}
- ugd->account_info = (int)elm_object_item_data_get(it);
- debug_log("ugd->account_info %d", ugd->account_info);
+ EmailSpDesc *desc = (EmailSpDesc *)elm_object_item_data_get(it);
+ if (desc)
+ ugd->account_info = desc;
+ else
+ ugd->account_info = NULL;
setting_change_view(VIEW_ACCOUNT_SETUP, vd->ugd);
}
-#endif
static void _back_cb(void *data, Evas_Object *obj, void *event_info)
{
elm_win_lower(vd->ugd->win);
}
-#ifndef INITIAL_VIEW_ADD_BTN
static Eina_Bool _gl_state_get_cb(void *data, Evas_Object *obj, const char *part)
{
debug_log("");
static char *_gl_text_get_cb(void *data, Evas_Object *obj, const char *part)
{
debug_log("");
- int index = (int)data;
+ EmailSpDesc *desc = (EmailSpDesc *)data;
char *str = NULL;
- switch (index) {
- case GMAIL:
- str = strdup(dgettext("sys_string", "IDS_COM_BODY_GOOGLE"));
- break;
- case HOTMAIL:
- str = strdup(_("IDS_EMAIL_BODY_WINDOWS_LIVE_HOTMAIL"));
- break;
- case YAHOOMAIL:
- str = strdup(_("IDS_EMAIL_BODY_YAHOO_E_MAIL"));
- break;
- case AOL:
- str = strdup(_("IDS_EMAIL_BODY_AOL"));
- break;
- case OTHERS:
- str = strdup(dgettext("sys_string", "IDS_COM_BODY_OTHERS"));
- break;
+ if (desc) {
+ if (g_str_has_prefix(desc->name_str_id, "IDS_EMAIL"))
+ str = g_strdup(_(desc->name_str_id));
+ else
+ str = g_strdup(dgettext("sys_string", desc->name_str_id));
+ } else {
+ str = g_strdup(dgettext("sys_string", "IDS_COM_BODY_OTHERS"));
}
return str;
debug_log("");
Evas_Object *icon = elm_icon_add(obj);
- int index = (int)data;
-
- switch (index) {
- case GMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_GMAIL, NULL);
- break;
- case HOTMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_HOTMAIL, NULL);
- break;
- case YAHOOMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_YAHOO, NULL);
- break;
- case AOL:
- elm_icon_file_set(icon, ACCOUNT_ICON_AOL, NULL);
- break;
- case OTHERS:
- default:
+ EmailSpDesc *desc = (EmailSpDesc *)data;
+
+ if (desc) {
+ elm_icon_file_set(icon, desc->icon_path, NULL);
+ } else {
elm_icon_file_set(icon, ACCOUNT_ICON_OTHERS, NULL);
- break;
}
evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
return icon;
}
-#endif
/* EOF */
p->account = ugd->new_account;
- if (ugd->account_info == OTHERS) {
+ if (ugd->account_info == NULL) {
p->account->incoming_server_type = EMAIL_SERVER_TYPE_POP3;
p->account->incoming_server_secure_connection = 0;
p->account->outgoing_server_secure_connection = 0;
elm_icon_resizable_set(title_ic, EINA_TRUE, EINA_TRUE);
char title_str[50] = { 0, };
- if (vd->ugd->account_info == GMAIL) {
- snprintf(title_str, sizeof(title_str), "%s", dgettext("sys_string", "IDS_COM_BODY_GOOGLE"));
- elm_icon_file_set(title_ic, ACCOUNT_ICON_GMAIL, NULL);
- } else if (vd->ugd->account_info == HOTMAIL) {
- snprintf(title_str, sizeof(title_str), "%s", _("IDS_EMAIL_BODY_WINDOWS_LIVE_HOTMAIL"));
- elm_icon_file_set(title_ic, ACCOUNT_ICON_HOTMAIL, NULL);
- } else if (vd->ugd->account_info == YAHOOMAIL) {
- snprintf(title_str, sizeof(title_str), "%s", _("IDS_EMAIL_BODY_YAHOO_E_MAIL"));
- elm_icon_file_set(title_ic, ACCOUNT_ICON_YAHOO, NULL);
- } else if (vd->ugd->account_info == AOL) {
- snprintf(title_str, sizeof(title_str), "%s", _("IDS_EMAIL_BODY_AOL"));
- elm_icon_file_set(title_ic, ACCOUNT_ICON_AOL, NULL);
- } else
+ if (vd->ugd->account_info) {
+ if (g_str_has_prefix(vd->ugd->account_info->name_str_id, "IDS_EMAIL"))
+ snprintf(title_str, sizeof(title_str), "%s", _(vd->ugd->account_info->name_str_id));
+ else
+ snprintf(title_str, sizeof(title_str), "%s", dgettext("sys_string", vd->ugd->account_info->name_str_id));
+
+ elm_icon_file_set(title_ic, vd->ugd->account_info->icon_path, NULL);
+ } else {
snprintf(title_str, sizeof(title_str), "%s", dgettext("sys_string", "IDS_COM_BODY_OTHERS"));
+ }
Elm_Object_Item *navi_it = NULL;
navi_it = elm_naviframe_item_push(vd->ugd->navi_bar, title_str, p->l_button2, NULL, p->layout, NULL);
- elm_object_item_part_content_set(navi_it, "icon", title_ic);
+ if (vd->ugd->account_info) {
+ elm_object_item_part_content_set(navi_it, "icon", title_ic);
+ }
/*elm_object_item_part_content_set(navi_it, "title_left_btn", p->r_button);
elm_object_item_part_content_set(navi_it, "title_right_btn", p->l_button);*/
elm_object_item_part_content_set(navi_it, "controlbar", p->cbar);
return;
}
/* account info setting */
- if (vd->ugd->account_info == OTHERS)
+ if (vd->ugd->account_info == NULL)
setting_set_account(vd);
_create_account(vd);
p->ly = elm_layout_add(ugd->popup_color);
elm_layout_file_set(p->ly, EV_THEME_PATH, "color_palette");
- evas_object_size_hint_align_set(p->ly, EVAS_HINT_FILL, 0.0);
+ evas_object_size_hint_align_set(p->ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(p->ly);
p->rect = evas_object_rectangle_add(evas_object_evas_get(ugd->popup_color));
evas_object_size_hint_weight_set(p->colorselector, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_smart_callback_add(p->colorselector, "color,item,selected", _colorselector_cb, vd);
+ int rotation = elm_win_rotation_get(ugd->win);
+ if (abs(rotation) == 90) {
+ elm_object_style_set(p->colorselector, "landscape");
+ }
+
/* set new colors */
elm_colorselector_palette_color_add(p->colorselector, 0x00, 0x80, 0x80, 0xff);
elm_colorselector_palette_color_add(p->colorselector, 0xff, 0xd7, 0x00, 0xff);
if (!strcmp(part, "elm.icon.1")) {
icon = elm_icon_add(obj);
-
- account_user_data_t *user_data = (account_user_data_t *)account_data->user_data;
- debug_log("is_preset_account:%d", user_data->is_preset_account);
-
- switch (user_data->is_preset_account) {
- case GMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_GMAIL, NULL);
- break;
- case HOTMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_HOTMAIL, NULL);
- break;
- case YAHOOMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_YAHOO, NULL);
- break;
- case AOL:
- elm_icon_file_set(icon, ACCOUNT_ICON_AOL, NULL);
- break;
- case OTHERS:
- default:
- elm_icon_file_set(icon, ACCOUNT_ICON_OTHERS, NULL);
- break;
- }
-
+ elm_icon_file_set(icon, account_data->logo_icon_path, NULL);
evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
-
return icon;
}
Evas_Object *b_btn2;
Evas_Object *b_btn;
- Elm_Genlist_Item_Class itc;
+ Elm_Genlist_Item_Class itc1;
Elm_Genlist_Item_Class itc2;
Elm_Genlist_Item_Class itc3;
+ Elm_Genlist_Item_Class itc4;
+
Ecore_Timer *vc_timer;
int as_flag;
};
elm_object_part_content_set(p->layout, "elm.swallow.content", p->list);
evas_object_show(p->list);
- p->itc.item_style = "dialogue/1text.1icon.2";
- p->itc.func.text_get = _gl_text_get_cb;
- p->itc.func.content_get = _gl_content_get_cb;
- p->itc.func.state_get = _gl_state_get_cb;
- p->itc.func.del = _gl_del_cb;
-
- p->itc2.item_style = "dialogue/separator";
- p->itc2.func.text_get = NULL;
- p->itc2.func.content_get = NULL;
- p->itc2.func.state_get = NULL;
- p->itc2.func.del = NULL;
+ p->itc1.item_style = "dialogue/1text.1icon.2";
+ p->itc1.func.text_get = _gl_text_get_cb;
+ p->itc1.func.content_get = _gl_content_get_cb;
+ p->itc1.func.state_get = _gl_state_get_cb;
+ p->itc1.func.del = _gl_del_cb;
- p->itc3.item_style = "dialogue/separator/end";
+ p->itc3.item_style = "dialogue/separator";
p->itc3.func.text_get = NULL;
p->itc3.func.content_get = NULL;
p->itc3.func.state_get = NULL;
p->itc3.func.del = NULL;
- git = elm_genlist_item_append(p->list, &(p->itc2), NULL, NULL,
+ p->itc4.item_style = "dialogue/separator/end";
+ p->itc4.func.text_get = NULL;
+ p->itc4.func.content_get = NULL;
+ p->itc4.func.state_get = NULL;
+ p->itc4.func.del = NULL;
+
+ git = elm_genlist_item_append(p->list, &(p->itc3), NULL, NULL,
ELM_GENLIST_ITEM_GROUP, NULL, NULL);
elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- for (index = HOTMAIL; index <= OTHERS; index++) {
- if (index != YAHOOMAIL) {
- elm_genlist_item_append(p->list, &p->itc, (void *)index, git,
- ELM_GENLIST_ITEM_NONE, _add_account_cb, vd);
- }
+ for (index = 0; index < ugd->sp_list_len; index++) {
+ EmailSpDesc *desc = &(ugd->sp_list[index]);
+ elm_genlist_item_append(p->list, &p->itc1, (void *)desc, git,
+ ELM_GENLIST_ITEM_NONE, _add_account_cb, vd);
}
- git = elm_genlist_item_append(p->list, &(p->itc3), NULL, NULL,
+ index = -1;
+ elm_genlist_item_append(p->list, &p->itc1, NULL, git,
+ ELM_GENLIST_ITEM_NONE, _add_account_cb, vd);
+
+ git = elm_genlist_item_append(p->list, &(p->itc4), NULL, NULL,
ELM_GENLIST_ITEM_GROUP, NULL, NULL);
elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
return;
}
- ugd->account_info = (int)elm_object_item_data_get(it);
- debug_log("ugd->account_info %d", ugd->account_info);
+ EmailSpDesc *desc = (EmailSpDesc *)elm_object_item_data_get(it);
+ if (desc)
+ ugd->account_info = desc;
+ else
+ ugd->account_info = NULL;
setting_change_view(VIEW_ACCOUNT_SETUP, vd->ugd);
}
static char *_gl_text_get_cb(void *data, Evas_Object *obj, const char *part)
{
debug_log("");
- int index = (int)data;
+
+ EmailSpDesc *desc = (EmailSpDesc *)data;
char *str = NULL;
- switch (index) {
- case GMAIL:
- str = strdup(dgettext("sys_string", "IDS_COM_BODY_GOOGLE"));
- break;
- case HOTMAIL:
- str = strdup(_("IDS_EMAIL_BODY_WINDOWS_LIVE_HOTMAIL"));
- break;
- case YAHOOMAIL:
- str = strdup(_("IDS_EMAIL_BODY_YAHOO_E_MAIL"));
- break;
- case AOL:
- str = strdup(_("IDS_EMAIL_BODY_AOL"));
- break;
- case OTHERS:
- str = strdup(dgettext("sys_string", "IDS_COM_BODY_OTHERS"));
- break;
+ if (desc) {
+ if (g_str_has_prefix(desc->name_str_id, "IDS_EMAIL"))
+ str = g_strdup(_(desc->name_str_id));
+ else
+ str = g_strdup(dgettext("sys_string", desc->name_str_id));
+ } else {
+ str = g_strdup(dgettext("sys_string", "IDS_COM_BODY_OTHERS"));
}
return str;
debug_log("");
Evas_Object *icon = elm_icon_add(obj);
- int index = (int)data;
-
- switch (index) {
- case GMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_GMAIL, NULL);
- break;
- case HOTMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_HOTMAIL, NULL);
- break;
- case YAHOOMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_YAHOO, NULL);
- break;
- case AOL:
- elm_icon_file_set(icon, ACCOUNT_ICON_AOL, NULL);
- break;
- case OTHERS:
- default:
+ EmailSpDesc *desc = (EmailSpDesc *)data;
+
+ if (desc) {
+ elm_icon_file_set(icon, desc->icon_path, NULL);
+ } else {
elm_icon_file_set(icon, ACCOUNT_ICON_OTHERS, NULL);
- break;
}
evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
if (!setting_get_acct_full_data(ugd->account_id, &account_data)) {
debug_log("failed to get account data");
+ return FALSE;
}
p->layout = setting_add_inner_layout(vd);
Evas_Object *title_ic = elm_icon_add(vd->ugd->navi_bar);
evas_object_size_hint_aspect_set(title_ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_resizable_set(title_ic, EINA_TRUE, EINA_TRUE);
+ elm_icon_file_set(title_ic, account_data->logo_icon_path, NULL);
account_user_data_t *user_data = (account_user_data_t *)account_data->user_data;
- if (user_data->is_preset_account == GMAIL) {
- elm_icon_file_set(title_ic, ACCOUNT_ICON_GMAIL, NULL);
- } else if (user_data->is_preset_account == HOTMAIL) {
- elm_icon_file_set(title_ic, ACCOUNT_ICON_HOTMAIL, NULL);
- } else if (user_data->is_preset_account == YAHOOMAIL) {
- elm_icon_file_set(title_ic, ACCOUNT_ICON_YAHOO, NULL);
- } else if (user_data->is_preset_account == AOL) {
- elm_icon_file_set(title_ic, ACCOUNT_ICON_AOL, NULL);
- }
-
Elm_Object_Item *navi_it = NULL;
navi_it = elm_naviframe_item_push(vd->ugd->navi_bar, account_data->account_name, p->l_button, NULL, p->layout, NULL);
- elm_object_item_part_content_set(navi_it, "icon", title_ic);
+ if (user_data->is_preset_account > 0) {
+ elm_object_item_part_content_set(navi_it, "icon", title_ic);
+ }
elm_object_item_part_content_set(navi_it, "title_right_btn", p->r_button);
elm_object_item_part_content_set(navi_it, "controlbar", p->cbar);
evas_object_show(vd->ugd->navi_bar);
elm_object_disabled_set(p->l_button, EINA_TRUE);
elm_object_item_disabled_set(p->c_item[0], EINA_TRUE);
- ugd->popup_one = setting_get_notify(vd, NULL, N_("All data related to this account will be deleted. Continue?"), 2,
+ ugd->popup_one = setting_get_notify(vd, NULL, _("IDS_EMAIL_POP_ALL_DATA_RELATED_TO_THIS_ACCOUNT_WILL_BE_DELETED_CONTINUE_Q"), 2,
dgettext("sys_string", "IDS_COM_SK_YES"),
_popup_delete_ok_cb,
dgettext("sys_string", "IDS_COM_SK_NO"),
setting_back_to_prev_view(vd);
}
- /*setting_get_small_notify(vd, dgettext("sys_string", "IDS_COM_POP_DELETED"));*/
+ setting_get_small_notify(vd, dgettext("sys_string", "IDS_COM_POP_DELETED"));
}
return ECORE_CALLBACK_CANCEL;
} else if (period == sync_schedule[1]) {
snprintf(buf, sizeof(buf), "%s", _("IDS_EMAIL_BODY_EVERY_30_MINUTES"));
} else if (period == sync_schedule[2]) {
- snprintf(buf, sizeof(buf), "%s", N_("Every 1 hour"));
+ snprintf(buf, sizeof(buf), "%s", _("IDS_EMAIL_BODY_EVERY_1_HOUR"));
} else if (period == sync_schedule[3]) {
snprintf(buf, sizeof(buf), _("IDS_EMAIL_BODY_EVERY_PD_HOURS"), 3);
} else if (period == sync_schedule[4]) {
} else if (index == 1) {
snprintf(buf, sizeof(buf), "%s", _("IDS_EMAIL_BODY_EVERY_30_MINUTES"));
} else if (index == 2) {
- snprintf(buf, sizeof(buf), "%s", N_("Every 1 hour"));
+ snprintf(buf, sizeof(buf), "%s", _("IDS_EMAIL_BODY_EVERY_1_HOUR"));
} else if (index == 3) {
snprintf(buf, sizeof(buf), _("IDS_EMAIL_BODY_EVERY_PD_HOURS"), 3);
} else if (index == 4) {
struct viewdata *vd = g_vd;
EmailSettingUGD *ugd = vd->ugd;
struct priv_data *p = vd->priv;
- /*Evas_Object *color_bar = NULL;*/
-
- /*if (!g_strcmp0(part, "elm.icon.1")) {
- Evas_Object *icon = elm_icon_add(ugd->navi_bar);
- account_user_data_t *user_data = (account_user_data_t *)account_data->user_data;
-
- debug_log("is_preset_account:%d", user_data->is_preset_account);
-
- switch (user_data->is_preset_account) {
- case GMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_GMAIL, NULL);
- break;
- case HOTMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_HOTMAIL, NULL);
- break;
- case YAHOOMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_YAHOO, NULL);
- break;
- case AOL:
- elm_icon_file_set(icon, ACCOUNT_ICON_AOL, NULL);
- break;
- case OTHERS:
- default:
- elm_icon_file_set(icon, ACCOUNT_ICON_OTHERS, NULL);
- break;
- }
-
- evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
- p->account_icon = icon;
- return icon;
- }*/
if (!g_strcmp0(part, "elm.icon")) {
if (p->syncing) {
}
}
- /*if (!g_strcmp0(part, "elm.swallow.colorbar")) {
- account_user_data_t *user_data = (account_user_data_t *)account_data->user_data;
- unsigned int val = user_data->index_color;
- int r = (val & 0xff000000) >> 24;
- int g = (val & 0x00ff0000) >> 16;
- int b = (val & 0x0000ff00) >> 8;
- int a = val & 0x000000ff;
-
- debug_log("R[%d] G[%d] B[%d] A[%d]", r, g, b, a);
-
- color_bar = evas_object_rectangle_add(evas_object_evas_get(obj));
- evas_object_size_hint_fill_set(color_bar, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_color_set(color_bar, r, g, b, a);
-
- return color_bar;
- }*/
-
return NULL;
}
if (!setting_get_acct_full_data(ugd->account_id, &account_data)) {
debug_log("failed to get account data");
+ return FALSE;
}
p->layout = setting_add_inner_layout(vd);
Evas_Object *title_ic = elm_icon_add(vd->ugd->navi_bar);
evas_object_size_hint_aspect_set(title_ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_resizable_set(title_ic, EINA_TRUE, EINA_TRUE);
+ elm_icon_file_set(title_ic, account_data->logo_icon_path, NULL);
account_user_data_t *user_data = (account_user_data_t *)account_data->user_data;
- if (user_data->is_preset_account == GMAIL) {
- elm_icon_file_set(title_ic, ACCOUNT_ICON_GMAIL, NULL);
- } else if (user_data->is_preset_account == HOTMAIL) {
- elm_icon_file_set(title_ic, ACCOUNT_ICON_HOTMAIL, NULL);
- } else if (user_data->is_preset_account == YAHOOMAIL) {
- elm_icon_file_set(title_ic, ACCOUNT_ICON_YAHOO, NULL);
- } else if (user_data->is_preset_account == AOL) {
- elm_icon_file_set(title_ic, ACCOUNT_ICON_AOL, NULL);
- }
-
Elm_Object_Item *navi_it = NULL;
navi_it = elm_naviframe_item_push(vd->ugd->navi_bar, account_data->account_name, p->l_button, NULL, p->layout, NULL);
- elm_object_item_part_content_set(navi_it, "icon", title_ic);
+ if (user_data->is_preset_account > 0) {
+ elm_object_item_part_content_set(navi_it, "icon", title_ic);
+ }
elm_object_item_part_content_set(navi_it, "title_right_btn", p->r_button);
elm_object_item_part_content_set(navi_it, "controlbar", p->cbar);
evas_object_show(vd->ugd->navi_bar);
gboolean res = FALSE;
email_mailbox_t *mailbox = NULL;
ret = email_get_mailbox_by_mailbox_type(account_id, EMAIL_MAILBOX_TYPE_INBOX, &mailbox);
- if (ret != EMAIL_ERROR_NONE || mailbox == NULL || mailbox->mailbox_name == NULL) {
+ if (ret != EMAIL_ERROR_NONE || mailbox == NULL) {
debug_log("email_get_mailbox_by_mailbox_type failed");
return;
}
elm_object_disabled_set(p->l_button, EINA_TRUE);
elm_object_item_disabled_set(p->c_item[0], EINA_TRUE);
- ugd->popup_one = setting_get_notify(vd, NULL, N_("All data related to this account will be deleted. Continue?"), 2,
+ ugd->popup_one = setting_get_notify(vd, NULL, _("IDS_EMAIL_POP_ALL_DATA_RELATED_TO_THIS_ACCOUNT_WILL_BE_DELETED_CONTINUE_Q"), 2,
dgettext("sys_string", "IDS_COM_SK_YES"),
_popup_delete_ok_cb,
dgettext("sys_string", "IDS_COM_SK_NO"),
ug_destroy_me(vd->ugd->ug);
} else if (vd->ugd->start_view_type != NULL &&
strcmp(vd->ugd->start_view_type, "select-account") == 0) {
-
- service_h service = NULL;
- service_create(&service);
- if (service) {
- service_add_extra_data(service, EMAIL_BUNDLE_KEY_REFRESH_ACCOUNT,
- EMAIL_BUNDLE_KEY_REFRESH_ACCOUNT);
- ug_send_result(vd->ugd->ug, service);
- service_destroy(service);
- }
+ ug_destroy_me(vd->ugd->ug);
} else {
setting_update_acct_list(vd);
if (vd->ugd->manual_setup) {
}
vd->ugd->atomic_pop = 0;
- /*setting_get_small_notify(vd, dgettext("sys_string", "IDS_COM_POP_DELETED"));*/
+ setting_get_small_notify(vd, dgettext("sys_string", "IDS_COM_POP_DELETED"));
}
return ECORE_CALLBACK_CANCEL;
} else if (period == sync_schedule[1]) {
snprintf(buf, sizeof(buf), "%s", _("IDS_EMAIL_BODY_EVERY_30_MINUTES"));
} else if (period == sync_schedule[2]) {
- snprintf(buf, sizeof(buf), "%s", N_("Every 1 hour"));
+ snprintf(buf, sizeof(buf), "%s", _("IDS_EMAIL_BODY_EVERY_1_HOUR"));
} else if (period == sync_schedule[3]) {
snprintf(buf, sizeof(buf), _("IDS_EMAIL_BODY_EVERY_PD_HOURS"), 3);
} else if (period == sync_schedule[4]) {
} else if (index == 1) {
snprintf(buf, sizeof(buf), "%s", _("IDS_EMAIL_BODY_EVERY_30_MINUTES"));
} else if (index == 2) {
- snprintf(buf, sizeof(buf), "%s", N_("Every 1 hour"));
+ snprintf(buf, sizeof(buf), "%s", _("IDS_EMAIL_BODY_EVERY_1_HOUR"));
} else if (index == 3) {
snprintf(buf, sizeof(buf), _("IDS_EMAIL_BODY_EVERY_PD_HOURS"), 3);
} else if (index == 4) {
struct viewdata *vd = g_vd;
EmailSettingUGD *ugd = vd->ugd;
struct priv_data *p = vd->priv;
- /*Evas_Object *color_bar = NULL;*/
-
- /*if (!g_strcmp0(part, "elm.icon.1")) {
- Evas_Object *icon = elm_icon_add(ugd->navi_bar);
- account_user_data_t *user_data = (account_user_data_t *)account_data->user_data;
-
- debug_log("is_preset_account:%d", user_data->is_preset_account);
-
- switch (user_data->is_preset_account) {
- case GMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_GMAIL, NULL);
- break;
- case HOTMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_HOTMAIL, NULL);
- break;
- case YAHOOMAIL:
- elm_icon_file_set(icon, ACCOUNT_ICON_YAHOO, NULL);
- break;
- case AOL:
- elm_icon_file_set(icon, ACCOUNT_ICON_AOL, NULL);
- break;
- case OTHERS:
- default:
- elm_icon_file_set(icon, ACCOUNT_ICON_OTHERS, NULL);
- break;
- }
-
- evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
- p->account_icon = icon;
- return icon;
- }*/
if (!g_strcmp0(part, "elm.icon")) {
if (p->syncing) {
}
}
- /*if (!g_strcmp0(part, "elm.swallow.colorbar")) {
- account_user_data_t *user_data = (account_user_data_t *)account_data->user_data;
- unsigned int val = user_data->index_color;
- int r = (val & 0xff000000) >> 24;
- int g = (val & 0x00ff0000) >> 16;
- int b = (val & 0x0000ff00) >> 8;
- int a = val & 0x000000ff;
-
- debug_log("R[%d] G[%d] B[%d] A[%d]", r, g, b, a);
-
- color_bar = evas_object_rectangle_add(evas_object_evas_get(obj));
- evas_object_size_hint_fill_set(color_bar, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_color_set(color_bar, r, g, b, a);
-
- return color_bar;
- }*/
-
return NULL;
}
rel1 { relative: 0.0 0.0;}
rel2 { relative: 1.0 1.0;}
color: 249 249 249 255;
- min: 720 570;
+ min: 0 570;
}
}
part {
description {
state: "default" 0.0;
visible: 0;
- min: 45 0;
+ min: 20 0;
fixed: 1 0;
rel1.relative: 0.0 1.0;
rel2.relative: 0.0 1.0;
description {
state: "default" 0.0;
visible: 0;
- min: 45 0;
+ min: 15 0;
fixed: 1 0;
rel1.relative: 1.0 1.0;
rel2.relative: 1.0 1.0;
group {
name: "email_block_noc";
parts {
- part { name: "bg";
- mouse_events: 0;
- type: RECT;
- scale: 1;
- description { state: "default" 0.0;
- visible: 1;
- rel1 { relative: 0.0 0.0;}
- rel2 { relative: 1.0 1.0;}
- color: 0 0 0 0;
- min: 480 700;
- }
- }
part {
name: "contents";
type: SWALLOW;
- scale: 1;
- mouse_events: 1;
description {
state: "default" 0.0;
}
}
part {
- name: "btn";
- type: SWALLOW;
- scale: 1;
- description {
- state: "default" 0.0;
- fixed: 1 1;
- min: 440 46;
- max: 440 46;
- rel1 { relative: 0 1.0; to_y: "top_padding"; }
- align: 0.5 0;
- }
- }
-
- part {
- name: "middle_padding1";
- type: RECT;
- scale: 1;
- description {
- state: "default" 0.0;
- min: 440 54;
- max: 440 54;
- fixed: 0 1;
- align: 0.5 0;
- rel1 { relative: 0 1.0; to_y: "btn"; }
- rel2 { relative: 1 1.0; to_y: "btn"; }
- color: 0 0 0 0;
- }
- }
-
- part {
name: "bg_for_sp";
type: RECT;
scale: 1;
fixed: 1 1;
min: 440 50;
max: 440 50;
- rel1 { relative: 0 1.0; to_y: "middle_padding1"; }
+ rel1 { relative: 0 1.0; to_y: "top_padding"; }
align: 0.5 0;
color: 0 0 0 0;
}
description {
state: "default" 0.0;
fixed: 1 1;
- min: 620 200;
- max: 620 200;
+ min: 440 200;
+ max: 440 200;
rel1 { relative: 0 1.0; to_y: "middle_padding2"; }
align: 0.5 0;
}
}
+
+ part {
+ name: "middle_padding3";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 440 16;
+ max: 440 16;
+ fixed: 1 1;
+ align: 0.5 0;
+ rel1 { relative: 0 1.0; to_y: "label"; }
+ rel2 { relative: 1 1.0; to_y: "label"; }
+ color: 0 0 0 0;
+ }
+ }
+
+ part {
+ name: "list";
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0 1.0; to_y: "middle_padding3"; }
+ }
+ }
}
}
}
}
}
+
+ group { name: "account_add_checkbox_set_wvga";
+ parts {
+
+ part { name: "base";
+ type: RECT;
+ repeat_events: 1;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 100;
+ color: 0 0 0 0;
+ align: 0.0 0.5;
+ }
+ }
+
+ part { name: "left_padding";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 16 0;
+ fixed: 1 0;
+ visible: 0;
+ rel1 { to: "base"; relative: 0 0; }
+ rel2 { to: "base"; relative: 0 1; }
+ align: 0.0 0.0;
+ }
+ }
+
+ part { name: "right_padding";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 16 0;
+ fixed: 1 0;
+ visible: 0;
+ rel1 { to: "base"; relative: 1 0; }
+ rel2 { to: "base"; relative: 1 1; }
+ align: 1.0 0.0;
+ }
+ }
+
+ part { name: "subbox.1";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 50;
+ fixed: 1 0;
+ visible: 0;
+ align: 0.0 0.5;
+ rel1 {
+ relative: 1.0 0.0;
+ to_x: "left_padding";
+ to_y: "base";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ offset: 0 50;
+ to_x: "right_padding";
+ to_y: "base";
+ }
+ }
+ }
+
+ part { name: "subbox.2";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 50;
+ fixed: 1 0;
+ visible: 0;
+ align: 0.0 0.5;
+ rel1 {
+ relative: 1.0 1.0;
+ to_x: "left_padding";
+ to_y: "subbox.1";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ to_x: "right_padding";
+ to_y: "base";
+ }
+ }
+ }
+
+ part { name: "checkbox.1";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 42 42;
+ max: 42 42;
+ fixed: 1 1;
+ align: 0.0 0.5;
+ visible: 1;
+ rel1 {
+ relative: 1.0 0.0;
+ to_x: "left_padding";
+ to_y: "subbox.1";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 42 0;
+ to_x: "left_padding";
+ to_y: "subbox.1";
+ }
+ }
+ }
+
+ part { name: "text.1";
+ type: SWALLOW;
+ ignore_flags: ON_HOLD;
+ mouse_events: 1;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 32;
+ fixed: 0 1;
+ align: 0.0 0.0;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: 16 8;
+ to_x: "checkbox.1";
+ to_y: "subbox.1";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: 0 0;
+ to_x: "right_padding";
+ to_y: "subbox.1";
+ }
+ }
+ }
+
+ part { name: "checkbox.2";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 42 42;
+ max: 42 42;
+ fixed: 1 1;
+ align: 0.0 0.5;
+ visible: 1;
+ rel1 {
+ relative: 1.0 0.0;
+ to_x: "left_padding";
+ to_y: "subbox.2";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 42 0;
+ to_x: "left_padding";
+ to_y: "subbox.2";
+ }
+ }
+ }
+
+ part { name: "text.2";
+ type: SWALLOW;
+ ignore_flags: ON_HOLD;
+ mouse_events: 1;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 32;
+ fixed: 0 1;
+ align: 0.0 0.5;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: 16 8;
+ to_x: "checkbox.2";
+ to_y: "subbox.2";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: 0 0;
+ to_x: "right_padding";
+ to_y: "subbox.2";
+ }
+ }
+ }
+ }
+
+ programs {
+ program {
+ name: "text1_clicked";
+ signal: "mouse,up,1";
+ source: "text.1";
+ action: SIGNAL_EMIT "elm,action,text1_clicked" "elm";
+ }
+
+ program {
+ name: "text2_clicked";
+ signal: "mouse,up,1";
+ source: "text.2";
+ action: SIGNAL_EMIT "elm,action,text2_clicked" "elm";
+ }
+ }
+ }
group { name: "account_add_manual_button";
parts {
}
}
}
+
+ group { name: "account_add_manual_button_wvga";
+ parts {
+ part { name: "base";
+ type: RECT;
+ repeat_events: 1;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 80;
+ color: 0 0 0 0;
+ align: 0.0 0.5;
+ }
+ }
+
+ part { name: "top_padding";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 15;
+ fixed: 0 1;
+ visible: 0;
+ rel1 { to: "base"; relative: 0 0; }
+ rel2 { to: "base"; relative: 1 0; }
+ align: 0.0 0.0;
+ }
+ }
+
+ part { name: "bottom_padding";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 15;
+ fixed: 0 1;
+ visible: 0;
+ rel1 { to: "base"; relative: 0 1; }
+ rel2 { to: "base"; relative: 1 1; }
+ align: 0.0 1.0;
+ }
+ }
+
+ part { name: "left_padding";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 117 0;
+ fixed: 1 0;
+ visible: 0;
+ rel1 { to: "base"; relative: 0 0; }
+ rel2 { to: "base"; relative: 0 1; }
+ align: 0.0 0.0;
+ }
+ }
+
+ part { name: "right_padding";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 117 0;
+ fixed: 1 0;
+ visible: 0;
+ rel1 { to: "base"; relative: 1 0; }
+ rel2 { to: "base"; relative: 1 1; }
+ align: 1.0 0.0;
+ }
+ }
+
+ part { name: "btn";
+ type: SWALLOW;
+ mouse_events: 1;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 50;
+ fixed: 0 1;
+ align: 0 0;
+ rel1 {
+ relative: 1.0 1.0;
+ to_x: "left_padding";
+ to_y: "top_padding";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to_x: "right_padding";
+ to_y: "bottom_padding";
+ }
+ }
+ }
+ }
+ }
group { name: "account_add";
parts {
description { state: "default" 0.0;
align: 0 0;
rel1 { relative: 0 0; to: "bg"; }
- rel2 { relative: 1 0; offset: 0 295.0*_SCALE; to: "bg"; }
+ rel2 { relative: 1 0; offset: 0 200.0*_SCALE; to: "bg"; }
}
}
type: SWALLOW;
scale: 1;
description { state: "default" 0.0;
- min: 0 200;
+ min: 0 100;
align: 0 0;
rel1 { relative: 0 1.0; to_y: "list"; }
- rel2 { relative: 1 1.0; offset: 0 200; to_y: "list"; }
+ rel2 { relative: 1 1.0; offset: 0 100; to_y: "list"; }
}
}
type: SWALLOW;
scale: 1;
description { state: "default" 0.0;
- min: 0 158;
+ min: 0 80;
align: 0 0;
rel1 { relative: 0 1.0; to_y: "checkbox_set"; }
- rel2 { relative: 1 1.0; offset: 0 128; to_y: "checkbox_set"; }
+ rel2 { relative: 1 1.0; offset: 0 80; to_y: "checkbox_set"; }
}
}
}
description { state: "default" 0.0;
align: 0 0;
rel1 { relative: 0 0; to: "bg"; }
- rel2 { relative: 1 0; offset: 0 425.0*_SCALE; to: "bg"; }
+ rel2 { relative: 1 0; offset: 0 290.0*_SCALE; to: "bg"; }
}
}
type: SWALLOW;
scale: 1;
description { state: "default" 0.0;
- min: 0 200;
+ min: 0 100;
align: 0 0;
rel1 { relative: 0 1.0; to_y: "list"; }
- rel2 { relative: 1 1.0; offset: 0 200; to_y: "list"; }
+ rel2 { relative: 1 1.0; offset: 0 100; to_y: "list"; }
}
}
type: SWALLOW;
scale: 1;
description { state: "default" 0.0;
- min: 0 158;
+ min: 0 80;
align: 0 0;
rel1 { relative: 0 1.0; to_y: "checkbox_set"; }
- rel2 { relative: 1 1.0; offset: 0 128; to_y: "checkbox_set"; }
+ rel2 { relative: 1 1.0; offset: 0 80; to_y: "checkbox_set"; }
}
}
}