Skip to content
Snippets Groups Projects
Commit 1479ec6d authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

GTK GUI: improve backspace key behaviour

Hangup if NO number have been dialed, except if call->CALL_STATE_TRANSFERT
parent 02822757
Branches
Tags
No related merge requests found
...@@ -358,7 +358,7 @@ void process_dialing(call_t * c, guint keyval, gchar * key) ...@@ -358,7 +358,7 @@ void process_dialing(call_t * c, guint keyval, gchar * key)
case 65288: /* BACKSPACE */ case 65288: /* BACKSPACE */
{ /* Brackets mandatory because of local vars */ { /* Brackets mandatory because of local vars */
gchar * before = c->to; gchar * before = c->to;
if(strlen(c->to) > 1){ if(strlen(c->to) >= 1){
c->to = g_strndup(c->to, strlen(c->to) -1); c->to = g_strndup(c->to, strlen(c->to) -1);
g_free(before); g_free(before);
g_print("TO: %s\n", c->to); g_print("TO: %s\n", c->to);
...@@ -371,8 +371,9 @@ void process_dialing(call_t * c, guint keyval, gchar * key) ...@@ -371,8 +371,9 @@ void process_dialing(call_t * c, guint keyval, gchar * key)
//screen_set_call(c); //screen_set_call(c);
update_call_tree(c); update_call_tree(c);
} }
else if(strlen(c->to) == 1) else if(strlen(c->to) == 0)
{ {
if(c->state != CALL_STATE_TRANSFERT)
dbus_hang_up(c); dbus_hang_up(c);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment