move dial() from util.h to gui_dial() in gui.h
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Fri, 7 Sep 2012 19:04:23 +0000 (16:04 -0300)
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Fri, 7 Sep 2012 19:04:23 +0000 (16:04 -0300)
it depends on the existence of a window, which is done by gui.c.

This commit is in preparation to create a new libofono-efl-utils to be
used by dialer and other applications.

dialer/callscreen.c
dialer/contacts.c
dialer/gui.c
dialer/gui.h
dialer/history.c
dialer/keypad.c
dialer/util.c
dialer/util.h

index 9bb4036..0296bd8 100644 (file)
@@ -704,7 +704,7 @@ static void _popup_redial(void *data, Evas_Object *o __UNUSED__,
 {
        Callscreen *ctx = data;
 
-       dial(ctx->disconnected.number);
+       gui_dial(ctx->disconnected.number);
        _popup_close(ctx, NULL, NULL);
 }
 
index 9d2d016..8d8446b 100644 (file)
@@ -521,7 +521,7 @@ static void _on_number_clicked(void *data, Evas_Object *obj __UNUSED__,
                                void *event_inf __UNUSED__)
 {
        const char *number = data;
-       dial(number);
+       gui_dial(number);
 }
 
 static void _on_item_click(void *data, Evas_Object *obj __UNUSED__,
index 3b38953..289fede 100644 (file)
@@ -38,6 +38,28 @@ Contact_Info *gui_contact_search(const char *number, const char **type)
        return contact_search(contacts, number, type);
 }
 
+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 *gui_dial(const char *number)
+{
+       char *copy = strdup(number);
+       return ofono_dial(copy, NULL, _dial_reply, copy);
+}
+
 Evas_Object *gui_layout_add(Evas_Object *parent, const char *style)
 {
        Evas_Object *layout = elm_layout_add(parent);
@@ -432,7 +454,7 @@ static void _gui_voicemail(void)
        EINA_SAFETY_ON_NULL_RETURN(number);
        EINA_SAFETY_ON_FALSE_RETURN(*number != '\0');
 
-       dial(number);
+       gui_dial(number);
 }
 
 static void _on_clicked(void *data __UNUSED__, Evas_Object *o __UNUSED__,
index 6c1c5bd..85d45d7 100644 (file)
@@ -2,6 +2,7 @@
 #define _EFL_OFONO_GUI_H__ 1
 
 #include "contacts.h"
+#include "ofono.h"
 
 Evas_Object *gui_layout_add(Evas_Object *parent, const char *style);
 
@@ -40,4 +41,6 @@ void gui_shutdown(void);
 
 Contact_Info *gui_contact_search(const char *number, const char **type);
 
+OFono_Pending *gui_dial(const char *number);
+
 #endif
index 7f2394a..488f28d 100644 (file)
@@ -239,7 +239,7 @@ static void _on_item_clicked(void *data, Evas_Object *obj __UNUSED__,
        const char *number = data;
 
        INF("call %s", number);
-       dial(number);
+       gui_dial(number);
        elm_genlist_item_selected_set(it, EINA_FALSE);
 }
 
index 83f22d3..a19b9c3 100644 (file)
@@ -237,7 +237,7 @@ static void _dial(Keypad *ctx)
        const char *number = eina_strbuf_string_get(ctx->number);
 
        INF("call %s", number);
-       dial(number);
+       gui_dial(number);
        eina_stringshare_replace(&(ctx->last), number);
        eina_strbuf_reset(ctx->number);
        _number_display(ctx);
index ade73e1..e906d37 100644 (file)
@@ -120,25 +120,3 @@ Evas_Object *picture_icon_get(Evas_Object *parent, const char *picture)
        }
        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);
-}
index 774612f..ee23986 100644 (file)
@@ -8,14 +8,10 @@
 #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