Skip to content
Snippets Groups Projects
Commit 0b4610f5 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3233] Handle invalid drag n drop

parent 8cac3792
Branches
Tags
No related merge requests found
...@@ -1425,23 +1425,55 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d ...@@ -1425,23 +1425,55 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
// Make sure that drag n drop does not imply a dialing call // Make sure that drag n drop does not imply a dialing call
if(selected_type == A_CALL && selected_call->_state == CALL_STATE_DIALING) { if(selected_type == A_CALL) {
DEBUG("Dragged a call on a dialing call"); DEBUG("Selected a call");
if(selected_call->_state == CALL_STATE_DIALING ||
selected_call->_state == CALL_STATE_INVALID ||
selected_call->_state == CALL_STATE_FAILURE ||
selected_call->_state == CALL_STATE_BUSY ||
selected_call->_state == CALL_STATE_TRANSFERT) {
DEBUG("Selected an invalid call");
calltree_remove_call(current_calls, selected_call, NULL); calltree_remove_call(current_calls, selected_call, NULL);
calltree_add_call(current_calls, selected_call, NULL); calltree_add_call(current_calls, selected_call, NULL);
return; return;
} }
if(dragged_type == A_CALL) {
DEBUG("Dragged on a call");
if(dragged_call->_state == CALL_STATE_DIALING ||
dragged_call->_state == CALL_STATE_INVALID ||
dragged_call->_state == CALL_STATE_FAILURE ||
dragged_call->_state == CALL_STATE_BUSY ||
dragged_call->_state == CALL_STATE_TRANSFERT) {
DEBUG("Dragged on an invalid call");
if(selected_call->_confID != NULL) {
}
else {
calltree_remove_call(current_calls, selected_call, NULL);
calltree_add_call(current_calls, selected_call, NULL);
}
return;
}
}
}
/*
else if(selected_type == A_CALL) { else if(selected_type == A_CALL) {
// user may have dragged it outside the conference // user may have dragged it outside the conference
if(dragged_call && dragged_call->_state == CALL_STATE_DIALING) { if(dragged_call && dragged_call->_state == CALL_STATE_DIALING) {
calltree_remove_call(current_calls, dragged_call, NULL); calltree_remove_call(current_calls, dragged_call, NULL);
DEBUG("Dragged a call on a dialing call"); DEBUG("-------------------------------------- Dragged a call on a dialing call");
// test if call participate to a conference // test if call participate to a conference
if(selected_call->_confID) { if(selected_call->_confID) {
...@@ -1460,12 +1492,25 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d ...@@ -1460,12 +1492,25 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
} }
} }
else if(selected_type == A_CONFERENCE) { */
DEBUG("Dragged a conference on a dialing call"); if(selected_type == A_CONFERENCE) {
if(dragged_call && dragged_call->_state == CALL_STATE_DIALING) { DEBUG("Selected a conference");
if(dragged_type == A_CALL) {
DEBUG("Dragged on a call");
if(dragged_call->_state == CALL_STATE_DIALING ||
dragged_call->_state == CALL_STATE_INVALID ||
dragged_call->_state == CALL_STATE_FAILURE ||
dragged_call->_state == CALL_STATE_BUSY ||
dragged_call->_state == CALL_STATE_TRANSFERT) {
DEBUG("Dragged on an invalid call");
conf = selected_conf; conf = selected_conf;
...@@ -1474,6 +1519,7 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d ...@@ -1474,6 +1519,7 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
return; return;
} }
} }
}
if(selected_path_depth == 1) { if(selected_path_depth == 1) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment