{
Callscreen *ctx = data;
- ofono_dial(ctx->disconnected.number, NULL, NULL, NULL);
+ dial(ctx->disconnected.number);
_popup_close(ctx, NULL, NULL);
}
void *event_inf __UNUSED__)
{
const char *number = data;
- ofono_dial(number, NULL, NULL, NULL);
+ dial(number);
}
static void _on_item_click(void *data, Evas_Object *obj __UNUSED__,
in_flip_anim = EINA_FALSE;
}
-static void _dial_reply(void *data, OFono_Error err,
- OFono_Call *call __UNUSED__)
-{
- const char *number = data;
-
- if (err != OFONO_ERROR_NONE) {
- char buf[1024];
- const char *msg = ofono_error_message_get(err);
- snprintf(buf, sizeof(buf), "Could not call %s: %s",
- number, msg);
- gui_simple_popup("Error", buf);
- }
-}
-
static void _gui_voicemail(void)
{
const char *number = ofono_voicemail_number_get();
EINA_SAFETY_ON_NULL_RETURN(number);
EINA_SAFETY_ON_FALSE_RETURN(*number != '\0');
- ofono_dial(number, NULL, _dial_reply, number);
+ dial(number);
}
static void _on_clicked(void *data __UNUSED__, Evas_Object *o __UNUSED__,
return EINA_FALSE;
}
-static void _dial_reply(void *data, OFono_Error err,
- OFono_Call *call __UNUSED__)
-{
- const char *number = data;
-
- if (err != OFONO_ERROR_NONE) {
- char buf[1024];
- const char *msg = ofono_error_message_get(err);
- snprintf(buf, sizeof(buf), "Could not call %s: %s",
- number, msg);
- gui_simple_popup("Error", buf);
- }
-}
-
static void _on_item_clicked(void *data, Evas_Object *obj __UNUSED__,
void *event_info)
{
const char *number = data;
INF("call %s", number);
- ofono_dial(number, NULL, _dial_reply, number);
+ dial(number);
elm_genlist_item_selected_set(it, EINA_FALSE);
}
return EINA_FALSE;
}
-static void _dial_reply(void *data, OFono_Error err,
- OFono_Call *call __UNUSED__)
-{
- Keypad *ctx = data;
-
- if (err != OFONO_ERROR_NONE) {
- char buf[1024];
- const char *msg = ofono_error_message_get(err);
- snprintf(buf, sizeof(buf), "Could not call %s: %s",
- eina_strbuf_string_get(ctx->number), msg);
- gui_simple_popup("Error", buf);
- }
-}
-
static void _dial(Keypad *ctx)
{
const char *number = eina_strbuf_string_get(ctx->number);
INF("call %s", number);
- ofono_dial(number, NULL, _dial_reply, ctx);
+ dial(number);
eina_stringshare_replace(&(ctx->last), number);
eina_strbuf_reset(ctx->number);
_number_display(ctx);
#include <Evas.h>
#include <Elementary.h>
+#include "gui.h"
#include "util.h"
/* TODO: find a configurable way to format the number.
}
return icon;
}
+
+static void _dial_reply(void *data, OFono_Error err,
+ OFono_Call *call __UNUSED__)
+{
+ char *number = data;
+
+ if (err != OFONO_ERROR_NONE) {
+ char buf[1024];
+ const char *msg = ofono_error_message_get(err);
+ snprintf(buf, sizeof(buf), "Could not call %s: %s",
+ number, msg);
+ gui_simple_popup("Error", buf);
+ }
+
+ free(number);
+}
+
+OFono_Pending *dial(const char *number)
+{
+ char *copy = strdup(number);
+ return ofono_dial(copy, NULL, _dial_reply, copy);
+}
#define MONTH ((DAY) * 30)
#define YEAR ((MONTH) *12)
+#include "ofono.h"
+
char *phone_format(const char *number);
char *date_format(time_t date);
Evas_Object *picture_icon_get(Evas_Object *parent, const char *picture);
+OFono_Pending *dial(const char *number);
+
#endif