diff options
author | Andrzej Zaborowski <andrew.zaborowski@intel.com> | 2010-10-13 15:54:11 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-10-14 02:31:22 -0500 |
commit | 6cb64e1343cf0f8b0e8433b1145e2fbf03d3923f (patch) | |
tree | ae87bad6076f71c9cbf623d9410f86564cf93d55 | |
parent | 9da71c67edff6bcfab920774d3d32db7bd6397af (diff) | |
download | ofono-6cb64e1343cf0f8b0e8433b1145e2fbf03d3923f.tar.bz2 |
stk: IdleModeIcon and MainMenuIcon properties
-rw-r--r-- | src/stk.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -72,6 +72,7 @@ struct ofono_stk { guint remove_agent_source; struct extern_req *extern_req; char *idle_mode_text; + struct stk_icon_id idle_mode_icon; struct timeval get_inkey_start_ts; }; @@ -365,6 +366,11 @@ static void emit_menu_changed(struct ofono_stk *stk) "MainMenuTitle", DBUS_TYPE_STRING, &menu->title); + ofono_dbus_signal_property_changed(conn, path, + OFONO_STK_INTERFACE, + "MainMenuIcon", + DBUS_TYPE_BYTE, &menu->icon.id); + signal = dbus_message_new_signal(path, OFONO_STK_INTERFACE, "PropertyChanged"); if (!signal) { @@ -391,6 +397,9 @@ static void dict_append_menu(DBusMessageIter *dict, struct stk_menu *menu) ofono_dbus_dict_append(dict, "MainMenuTitle", DBUS_TYPE_STRING, &menu->title); + ofono_dbus_dict_append(dict, "MainMenuIcon", + DBUS_TYPE_BYTE, &menu->icon.id); + dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry); @@ -434,6 +443,10 @@ static DBusMessage *stk_get_properties(DBusConnection *conn, ofono_dbus_dict_append(&dict, "IdleModeText", DBUS_TYPE_STRING, &idle_mode_text); + if (stk->idle_mode_icon.id) + ofono_dbus_dict_append(&dict, "IdleModeIcon", DBUS_TYPE_BYTE, + &stk->idle_mode_icon.id); + if (stk->main_menu) dict_append_menu(&dict, stk->main_menu); @@ -783,6 +796,16 @@ static gboolean handle_command_set_idle_text(const struct stk_command *cmd, DBUS_TYPE_STRING, &idle_mode_text); + if (stk->idle_mode_icon.id != cmd->setup_idle_mode_text.icon_id.id) { + memcpy(&stk->idle_mode_icon, &cmd->setup_idle_mode_text.icon_id, + sizeof(stk->idle_mode_icon)); + + ofono_dbus_signal_property_changed(conn, path, + OFONO_STK_INTERFACE, + "IdleModeIcon", DBUS_TYPE_BYTE, + &stk->idle_mode_icon.id); + } + return TRUE; } |