Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
6f057999
Commit
6f057999
authored
May 9, 2012
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #10320: calltree: added more logging, renamed drag-and-drop elements to source and dest
parent
fd4619aa
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
gnome/src/contacts/calltree.c
+168
-174
168 additions, 174 deletions
gnome/src/contacts/calltree.c
with
168 additions
and
174 deletions
gnome/src/contacts/calltree.c
+
168
−
174
View file @
6f057999
...
@@ -62,26 +62,26 @@ static GtkTreeSelection *calltree_sel = NULL;
...
@@ -62,26 +62,26 @@ static GtkTreeSelection *calltree_sel = NULL;
static
GtkWidget
*
calltree_popupmenu
=
NULL
;
static
GtkWidget
*
calltree_popupmenu
=
NULL
;
static
GtkWidget
*
calltree_menu_items
=
NULL
;
static
GtkWidget
*
calltree_menu_items
=
NULL
;
static
CallType
calltree_d
ragged
_type
=
A_INVALID
;
static
CallType
calltree_d
est
_type
=
A_INVALID
;
static
CallType
calltree_s
elected
_type
=
A_INVALID
;
static
CallType
calltree_s
ource
_type
=
A_INVALID
;
static
const
gchar
*
calltree_d
ragged
_call_id
=
NULL
;
static
const
gchar
*
calltree_d
est
_call_id
=
NULL
;
static
const
gchar
*
calltree_s
elected
_call_id
=
NULL
;
static
const
gchar
*
calltree_s
ource
_call_id
=
NULL
;
static
const
gchar
*
calltree_s
elected
_call_id_for_drag
=
NULL
;
static
const
gchar
*
calltree_s
ource
_call_id_for_drag
=
NULL
;
static
const
gchar
*
calltree_d
ragged
_path
=
NULL
;
static
const
gchar
*
calltree_d
est
_path
=
NULL
;
static
const
gchar
*
calltree_s
elected
_path
=
NULL
;
static
const
gchar
*
calltree_s
ource
_path
=
NULL
;
static
const
gchar
*
calltree_s
elected
_path_for_drag
=
NULL
;
static
const
gchar
*
calltree_s
ource
_path_for_drag
=
NULL
;
static
gint
calltree_d
ragged
_path_depth
=
-
1
;
static
gint
calltree_d
est
_path_depth
=
-
1
;
static
gint
calltree_s
elected
_path_depth
=
-
1
;
static
gint
calltree_s
ource
_path_depth
=
-
1
;
static
gint
calltree_s
elected
_path_depth_for_drag
=
-
1
;
static
gint
calltree_s
ource
_path_depth_for_drag
=
-
1
;
static
callable_obj_t
*
calltree_d
ragged
_call
=
NULL
;
static
callable_obj_t
*
calltree_d
est
_call
=
NULL
;
static
callable_obj_t
*
calltree_s
elected
_call
=
NULL
;
static
callable_obj_t
*
calltree_s
ource
_call
=
NULL
;
static
callable_obj_t
*
calltree_s
elected
_call_for_drag
=
NULL
;
static
callable_obj_t
*
calltree_s
ource
_call_for_drag
=
NULL
;
static
conference_obj_t
*
calltree_d
ragged
_conf
=
NULL
;
static
conference_obj_t
*
calltree_d
est
_conf
=
NULL
;
static
conference_obj_t
*
calltree_s
elected
_conf
=
NULL
;
static
conference_obj_t
*
calltree_s
ource
_conf
=
NULL
;
static
void
drag_data_get_cb
(
GtkTreeDragSource
*
drag_source
,
GtkTreePath
*
path
,
GtkSelectionData
*
selection_data
,
gpointer
data
);
static
void
drag_data_get_cb
(
GtkTreeDragSource
*
drag_source
,
GtkTreePath
*
path
,
GtkSelectionData
*
selection_data
,
gpointer
data
);
static
void
drag_end_cb
(
GtkWidget
*
,
GdkDragContext
*
,
gpointer
);
static
void
drag_end_cb
(
GtkWidget
*
,
GdkDragContext
*
,
gpointer
);
...
@@ -149,7 +149,7 @@ call_selected_cb(GtkTreeSelection *sel, void* data UNUSED)
...
@@ -149,7 +149,7 @@ call_selected_cb(GtkTreeSelection *sel, void* data UNUSED)
// store info for dragndrop
// store info for dragndrop
GtkTreePath
*
path
=
gtk_tree_model_get_path
(
model
,
&
iter
);
GtkTreePath
*
path
=
gtk_tree_model_get_path
(
model
,
&
iter
);
gchar
*
string_path
=
gtk_tree_path_to_string
(
path
);
gchar
*
string_path
=
gtk_tree_path_to_string
(
path
);
calltree_s
elected
_path_depth
=
gtk_tree_path_get_depth
(
path
);
calltree_s
ource
_path_depth
=
gtk_tree_path_get_depth
(
path
);
DEBUG
(
"Selected path: %s"
,
string_path
);
DEBUG
(
"Selected path: %s"
,
string_path
);
GValue
val
=
G_VALUE_INIT
;
GValue
val
=
G_VALUE_INIT
;
...
@@ -158,41 +158,41 @@ call_selected_cb(GtkTreeSelection *sel, void* data UNUSED)
...
@@ -158,41 +158,41 @@ call_selected_cb(GtkTreeSelection *sel, void* data UNUSED)
if
(
is_conference
(
model
,
&
iter
))
{
if
(
is_conference
(
model
,
&
iter
))
{
DEBUG
(
"CallTree: Selected a conference"
);
DEBUG
(
"CallTree: Selected a conference"
);
calltree_s
elected
_type
=
A_CONFERENCE
;
calltree_s
ource
_type
=
A_CONFERENCE
;
calltree_s
elected
_conf
=
(
conference_obj_t
*
)
g_value_get_pointer
(
&
val
);
calltree_s
ource
_conf
=
(
conference_obj_t
*
)
g_value_get_pointer
(
&
val
);
g_value_unset
(
&
val
);
g_value_unset
(
&
val
);
if
(
calltree_s
elected
_conf
)
{
if
(
calltree_s
ource
_conf
)
{
calltab_select_conf
(
active_calltree_tab
,
calltree_s
elected
_conf
);
calltab_select_conf
(
active_calltree_tab
,
calltree_s
ource
_conf
);
calltree_s
elected
_call_id
=
calltree_s
elected
_conf
->
_confID
;
calltree_s
ource
_call_id
=
calltree_s
ource
_conf
->
_confID
;
calltree_s
elected
_path
=
string_path
;
calltree_s
ource
_path
=
string_path
;
calltree_s
elected
_call
=
NULL
;
calltree_s
ource
_call
=
NULL
;
if
(
calltree_s
elected
_conf
->
_im_widget
)
if
(
calltree_s
ource
_conf
->
_im_widget
)
im_window_show_tab
(
calltree_s
elected
_conf
->
_im_widget
);
im_window_show_tab
(
calltree_s
ource
_conf
->
_im_widget
);
DEBUG
(
"CallTree: s
elected
_path %s, s
elected
_conf_id %s, s
elected
_path_depth %d"
,
DEBUG
(
"CallTree: s
ource
_path %s, s
ource
_conf_id %s, s
ource
_path_depth %d"
,
calltree_s
elected
_path
,
calltree_s
elected
_call_id
,
calltree_s
elected
_path_depth
);
calltree_s
ource
_path
,
calltree_s
ource
_call_id
,
calltree_s
ource
_path_depth
);
}
}
}
else
{
}
else
{
DEBUG
(
"CallTree: Selected a call"
);
DEBUG
(
"CallTree: Selected a call"
);
calltree_s
elected
_type
=
A_CALL
;
calltree_s
ource
_type
=
A_CALL
;
calltree_s
elected
_call
=
g_value_get_pointer
(
&
val
);
calltree_s
ource
_call
=
g_value_get_pointer
(
&
val
);
g_value_unset
(
&
val
);
g_value_unset
(
&
val
);
if
(
calltree_s
elected
_call
)
{
if
(
calltree_s
ource
_call
)
{
calltab_select_call
(
active_calltree_tab
,
calltree_s
elected
_call
);
calltab_select_call
(
active_calltree_tab
,
calltree_s
ource
_call
);
calltree_s
elected
_call_id
=
calltree_s
elected
_call
->
_callID
;
calltree_s
ource
_call_id
=
calltree_s
ource
_call
->
_callID
;
calltree_s
elected
_path
=
string_path
;
calltree_s
ource
_path
=
string_path
;
calltree_s
elected
_conf
=
NULL
;
calltree_s
ource
_conf
=
NULL
;
if
(
calltree_s
elected
_call
->
_im_widget
)
if
(
calltree_s
ource
_call
->
_im_widget
)
im_window_show_tab
(
calltree_s
elected
_call
->
_im_widget
);
im_window_show_tab
(
calltree_s
ource
_call
->
_im_widget
);
DEBUG
(
"CallTree: s
elected
_path %s, s
elected
_call_id %s, s
elected
_path_depth %d"
,
DEBUG
(
"CallTree: s
ource
_path %s, s
ource
_call_id %s, s
ource
_path_depth %d"
,
calltree_s
elected
_path
,
calltree_s
elected
_call_id
,
calltree_s
elected
_path_depth
);
calltree_s
ource
_path
,
calltree_s
ource
_call_id
,
calltree_s
ource
_path_depth
);
}
}
}
}
...
@@ -1239,19 +1239,19 @@ static void drag_data_get_cb(GtkTreeDragSource *drag_source UNUSED, GtkTreePath
...
@@ -1239,19 +1239,19 @@ static void drag_data_get_cb(GtkTreeDragSource *drag_source UNUSED, GtkTreePath
static
void
drag_begin_cb
(
GtkWidget
*
widget
UNUSED
,
GdkDragContext
*
context
UNUSED
,
gpointer
data
UNUSED
)
static
void
drag_begin_cb
(
GtkWidget
*
widget
UNUSED
,
GdkDragContext
*
context
UNUSED
,
gpointer
data
UNUSED
)
{
{
DEBUG
(
"CallTree: Source Drag Begin callback"
);
DEBUG
(
"CallTree: Source Drag Begin callback"
);
DEBUG
(
"CallTreeS: s
elected
_path %s, s
elected
_call_id %s, s
elected
_path_depth %d"
,
DEBUG
(
"CallTreeS: s
ource
_path %s, s
ource
_call_id %s, s
ource
_path_depth %d"
,
calltree_s
elected
_path
,
calltree_s
elected
_call_id
,
calltree_s
elected
_path_depth
);
calltree_s
ource
_path
,
calltree_s
ource
_call_id
,
calltree_s
ource
_path_depth
);
calltree_s
elected
_path_for_drag
=
calltree_s
elected
_path
;
calltree_s
ource
_path_for_drag
=
calltree_s
ource
_path
;
calltree_s
elected
_call_id_for_drag
=
calltree_s
elected
_call_id
;
calltree_s
ource
_call_id_for_drag
=
calltree_s
ource
_call_id
;
calltree_s
elected
_path_depth_for_drag
=
calltree_s
elected
_path_depth
;
calltree_s
ource
_path_depth_for_drag
=
calltree_s
ource
_path_depth
;
calltree_s
elected
_call_for_drag
=
calltree_s
elected
_call
;
calltree_s
ource
_call_for_drag
=
calltree_s
ource
_call
;
}
}
static
void
undo_drag_call_action
(
callable_obj_t
*
c
,
GtkTreePath
*
spath
)
static
void
undo_drag_call_action
(
callable_obj_t
*
c
,
GtkTreePath
*
spath
)
{
{
calltree_remove_call
(
current_calls_tab
,
c
);
calltree_remove_call
(
current_calls_tab
,
c
);
if
(
spath
&&
calltree_s
elected
_call_for_drag
->
_confID
)
{
if
(
spath
&&
calltree_s
ource
_call_for_drag
->
_confID
)
{
gtk_tree_path_up
(
spath
);
gtk_tree_path_up
(
spath
);
// conference for which this call is attached
// conference for which this call is attached
GtkTreeIter
parent_conference
;
GtkTreeIter
parent_conference
;
...
@@ -1262,177 +1262,172 @@ static void undo_drag_call_action(callable_obj_t *c, GtkTreePath *spath)
...
@@ -1262,177 +1262,172 @@ static void undo_drag_call_action(callable_obj_t *c, GtkTreePath *spath)
calltree_add_call
(
current_calls_tab
,
c
,
NULL
);
calltree_add_call
(
current_calls_tab
,
c
,
NULL
);
}
}
calltree_d
ragged
_call
=
NULL
;
calltree_d
est
_call
=
NULL
;
}
}
static
void
drag_end_cb
(
GtkWidget
*
widget
UNUSED
,
GdkDragContext
*
context
UNUSED
,
gpointer
data
UNUSED
)
static
void
drag_end_cb
(
GtkWidget
*
widget
,
GdkDragContext
*
context
UNUSED
,
gpointer
data
UNUSED
)
{
{
if
(
active_calltree_tab
==
history_tab
)
if
(
active_calltree_tab
==
history_tab
)
return
;
return
;
DEBUG
(
"CallTree:
Source
Drag End callback"
);
DEBUG
(
"CallTree: Drag End callback"
);
DEBUG
(
"CallTreeS: s
elected
_path %s, s
elected
_call_id %s, s
elected
_path_depth %d"
,
DEBUG
(
"CallTreeS: s
ource
_path %s, s
ource
_call_id %s, s
ource
_path_depth %d"
,
calltree_s
elected
_path_for_drag
,
calltree_s
elected
_call_id_for_drag
,
calltree_s
elected
_path_depth_for_drag
);
calltree_s
ource
_path_for_drag
,
calltree_s
ource
_call_id_for_drag
,
calltree_s
ource
_path_depth_for_drag
);
DEBUG
(
"CallTree: d
ragged
path %s, d
ragged_call_id %s, dragged
_path_depth %d"
,
DEBUG
(
"CallTree: d
est
path %s, d
est %s, dest
_path_depth %d"
,
calltree_s
elected
_path
,
calltree_s
elected
_call_id
,
calltree_s
elected
_path_depth
);
calltree_s
ource
_path
,
calltree_s
ource
_call_id
,
calltree_s
ource
_path_depth
);
GtkTreeView
*
treeview
=
GTK_TREE_VIEW
(
widget
);
GtkTreeView
*
treeview
=
GTK_TREE_VIEW
(
widget
);
GtkTreeModel
*
model
=
gtk_tree_view_get_model
(
treeview
);
GtkTreeModel
*
model
=
gtk_tree_view_get_model
(
treeview
);
calltree_d
ragged
_path
=
calltree_s
elected
_path
;
calltree_d
est
_path
=
calltree_s
ource
_path
;
calltree_d
ragged
_call_id
=
calltree_s
elected
_call_id
;
calltree_d
est
_call_id
=
calltree_s
ource
_call_id
;
calltree_d
ragged
_path_depth
=
calltree_s
elected
_path_depth
;
calltree_d
est
_path_depth
=
calltree_s
ource
_path_depth
;
GtkTreePath
*
path
=
gtk_tree_path_new_from_string
(
calltree_d
ragged
_path
);
GtkTreePath
*
path
=
gtk_tree_path_new_from_string
(
calltree_d
est
_path
);
GtkTreePath
*
dpath
=
gtk_tree_path_new_from_string
(
calltree_d
ragged
_path
);
GtkTreePath
*
dpath
=
gtk_tree_path_new_from_string
(
calltree_d
est
_path
);
GtkTreePath
*
spath
=
gtk_tree_path_new_from_string
(
calltree_s
elected
_path_for_drag
);
GtkTreePath
*
spath
=
gtk_tree_path_new_from_string
(
calltree_s
ource
_path_for_drag
);
GtkTreeIter
iter
;
GtkTreeIter
iter
;
// Make sure drag n drop does not imply a dialing call for either s
elected and dragged
call
// Make sure drag n drop does not imply a dialing call for either s
ource and dest
call
if
(
calltree_s
elected
_call
&&
(
calltree_s
elected
_type
==
A_CALL
))
{
if
(
calltree_s
ource
_call
&&
(
calltree_s
ource
_type
==
A_CALL
))
{
DEBUG
(
"CallTree: Selected a call"
);
DEBUG
(
"CallTree: Selected a call"
);
if
(
non_draggable_call
(
calltree_s
elected
_call
))
{
if
(
non_draggable_call
(
calltree_s
ource
_call
))
{
DEBUG
(
"CallTree: Selected an invalid call"
);
DEBUG
(
"CallTree: Selected an invalid call"
);
undo_drag_call_action
(
calltree_s
elected
_call_for_drag
,
NULL
);
undo_drag_call_action
(
calltree_s
ource
_call_for_drag
,
NULL
);
return
;
return
;
}
}
if
(
calltree_d
ragged
_call
&&
(
calltree_d
ragged
_type
==
A_CALL
))
{
if
(
calltree_d
est
_call
&&
(
calltree_d
est
_type
==
A_CALL
))
{
DEBUG
(
"CallTree: Dragged on a call"
);
DEBUG
(
"CallTree: Dragged on a call"
);
if
(
non_draggable_call
(
calltree_d
ragged
_call
))
{
if
(
non_draggable_call
(
calltree_d
est
_call
))
{
DEBUG
(
"CallTree: Dragged on an invalid call"
);
DEBUG
(
"CallTree: Dragged on an invalid call"
);
undo_drag_call_action
(
calltree_s
elected
_call_for_drag
,
spath
);
undo_drag_call_action
(
calltree_s
ource
_call_for_drag
,
spath
);
return
;
return
;
}
}
}
}
}
}
// Make sure a conference is only dragged on another conference
// Make sure a conference is only dragged on another conference
if
(
calltree_selected_conf
&&
(
calltree_selected_type
==
A_CONFERENCE
))
{
if
(
calltree_source_conf
&&
(
calltree_source_type
==
A_CONFERENCE
))
{
DEBUG
(
"Selected a conference"
);
if
(
!
calltree_dest_conf
&&
(
calltree_dest_type
==
A_CALL
))
{
DEBUG
(
"CallTree: Selected a conference"
);
ERROR
(
"Dragged a conference on a call, destination conference is NULL"
);
conference_obj_t
*
conf
=
calltree_source_conf
;
if
(
!
calltree_dragged_conf
&&
(
calltree_dragged_type
==
A_CALL
))
{
DEBUG
(
"CallTree: Dragged on a call"
);
conference_obj_t
*
conf
=
calltree_selected_conf
;
calltree_remove_conference
(
current_calls_tab
,
conf
);
calltree_remove_conference
(
current_calls_tab
,
conf
);
calltree_add_conference_to_current_calls
(
conf
);
calltree_add_conference_to_current_calls
(
conf
);
calltree_d
ragged
_call
=
NULL
;
calltree_d
est
_call
=
NULL
;
return
;
return
;
}
}
}
}
if
(
calltree_s
elected
_path_depth_for_drag
==
1
)
{
if
(
calltree_s
ource
_path_depth_for_drag
==
1
)
{
if
(
calltree_d
ragged
_path_depth
==
1
)
{
if
(
calltree_d
est
_path_depth
==
1
)
{
if
(
calltree_s
elected
_type
==
A_CALL
&&
calltree_d
ragged
_type
==
A_CALL
)
{
if
(
calltree_s
ource
_type
==
A_CALL
&&
calltree_d
est
_type
==
A_CALL
)
{
// d
ragged a
single
call on a
single
call
DEBUG
(
"D
ragged a call on a call
"
);
if
(
calltree_s
elected
_call_for_drag
&&
calltree_d
ragged
_call
)
{
if
(
calltree_s
ource
_call_for_drag
&&
calltree_d
est
_call
)
{
calltree_remove_call
(
current_calls_tab
,
calltree_s
elected
_call_for_drag
);
calltree_remove_call
(
current_calls_tab
,
calltree_s
ource
_call_for_drag
);
calltree_add_call
(
current_calls_tab
,
calltree_s
elected
_call_for_drag
,
NULL
);
calltree_add_call
(
current_calls_tab
,
calltree_s
ource
_call_for_drag
,
NULL
);
// pop menu to determine if we actually create a conference or do a call transfer
// pop menu to determine if we actually create a conference or do a call transfer
gtk_menu_popup
(
GTK_MENU
(
calltree_popupmenu
),
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
);
gtk_menu_popup
(
GTK_MENU
(
calltree_popupmenu
),
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
);
}
}
}
else
if
(
calltree_selected_type
==
A_CALL
&&
calltree_dragged_type
==
A_CONFERENCE
)
{
}
else
if
(
calltree_source_type
==
A_CALL
&&
calltree_dest_type
==
A_CONFERENCE
)
{
DEBUG
(
"Dragged a call on a conference"
);
// dragged a single call on a conference
if
(
!
calltree_source_call_for_drag
)
{
if
(
!
calltree_selected_call_for_drag
)
{
ERROR
(
"Dragged a NULL call on a conference"
);
DEBUG
(
"Error: call dragged on a conference is null"
);
return
;
return
;
}
}
g_free
(
calltree_s
elected
_call_for_drag
->
_confID
);
g_free
(
calltree_s
ource
_call_for_drag
->
_confID
);
calltree_s
elected
_call_for_drag
->
_confID
=
g_strdup
(
calltree_d
ragged
_call_id
);
calltree_s
ource
_call_for_drag
->
_confID
=
g_strdup
(
calltree_d
est
_call_id
);
g_free
(
calltree_selected_call_for_drag
->
_historyConfID
);
g_free
(
calltree_source_call_for_drag
->
_historyConfID
);
calltree_selected_call_for_drag
->
_historyConfID
=
g_strdup
(
calltree_dragged_call_id
);
calltree_source_call_for_drag
->
_historyConfID
=
g_strdup
(
calltree_dest_call_id
);
sflphone_add_participant
(
calltree_selected_call_id_for_drag
,
calltree_dragged_call_id
);
}
else
if
(
calltree_selected_type
==
A_CONFERENCE
&&
calltree_dragged_type
==
A_CALL
)
{
// dragged a conference on a single call
conference_obj_t
*
conf
=
calltree_selected_conf
;
sflphone_add_participant
(
calltree_source_call_id_for_drag
,
calltree_dest_call_id
);
}
else
if
(
calltree_source_type
==
A_CONFERENCE
&&
calltree_dest_type
==
A_CALL
)
{
#warning FIXME: didn't we say above that you can't drag a conference on a call?
DEBUG
(
"Dragged a conference on a call"
);
conference_obj_t
*
conf
=
calltree_source_conf
;
calltree_remove_conference
(
current_calls_tab
,
conf
);
calltree_remove_conference
(
current_calls_tab
,
conf
);
calltree_add_conference_to_current_calls
(
conf
);
calltree_add_conference_to_current_calls
(
conf
);
}
else
if
(
calltree_source_type
==
A_CONFERENCE
&&
calltree_dest_type
==
A_CONFERENCE
)
{
}
else
if
(
calltree_selected_type
==
A_CONFERENCE
&&
calltree_dragged_type
==
A_CONFERENCE
)
{
DEBUG
(
"Dragged a conference on a conference"
);
// dragged a conference on a conference
if
(
gtk_tree_path_compare
(
dpath
,
spath
)
==
0
)
{
if
(
gtk_tree_path_compare
(
dpath
,
spath
)
==
0
)
{
if
(
!
current_calls_tab
)
{
if
(
!
current_calls_tab
)
{
DEBUG
(
"Error while joining the same conference
\n
"
);
ERROR
(
"Error while joining the same conference"
);
return
;
return
;
}
}
DEBUG
(
"Joined the same conference!
\n
"
);
DEBUG
(
"Joined the same conference!"
);
gtk_tree_view_expand_row
(
GTK_TREE_VIEW
(
current_calls_tab
->
view
),
path
,
FALSE
);
gtk_tree_view_expand_row
(
GTK_TREE_VIEW
(
current_calls_tab
->
view
),
path
,
FALSE
);
}
else
{
}
else
{
if
(
!
calltree_selected_conf
)
if
(
!
calltree_source_conf
)
{
DEBUG
(
"Error: selected conference is null while joining 2 conference"
);
ERROR
(
"Source conference is null while joining conferences"
);
return
;
if
(
!
calltree_dragged_conf
)
DEBUG
(
"Error: dragged conference is null while joining 2 conference"
);
DEBUG
(
"Joined conferences %s and %s!
\n
"
,
calltree_dragged_path
,
calltree_selected_path
);
dbus_join_conference
(
calltree_selected_conf
->
_confID
,
calltree_dragged_conf
->
_confID
);
}
}
if
(
!
calltree_dest_conf
)
{
ERROR
(
"Dest conference is null while joining conferences"
);
return
;
}
}
DEBUG
(
"Joined conferences %s and %s!
\n
"
,
calltree_dest_path
,
calltree_source_path
);
dbus_join_conference
(
calltree_source_conf
->
_confID
,
calltree_dest_conf
->
_confID
);
}
}
else
{
ERROR
(
"Unexpected drag and drop scenario"
);
// TODO: dragged a single call on a NULL element (should do nothing)
// TODO: dragged a single call on a NULL element (should do nothing)
// TODO: dragged a conference on a NULL element (should do nothing)
// TODO: dragged a conference on a NULL element (should do nothing)
}
}
else
{
}
else
if
(
calltree_dest_path_depth
==
2
)
{
// dragged_path_depth == 2
if
(
calltree_source_type
==
A_CALL
&&
calltree_dest_type
==
A_CALL
)
{
if
(
calltree_selected_type
==
A_CALL
&&
calltree_dragged_type
==
A_CALL
)
{
// TODO: dragged a call on a conference call
// TODO: dragged a call on a conference call
calltree_remove_call
(
current_calls_tab
,
calltree_s
elected
_call
);
calltree_remove_call
(
current_calls_tab
,
calltree_s
ource
_call
);
calltree_add_call
(
current_calls_tab
,
calltree_s
elected
_call
,
NULL
);
calltree_add_call
(
current_calls_tab
,
calltree_s
ource
_call
,
NULL
);
}
else
if
(
calltree_s
elected
_type
==
A_CONFERENCE
&&
calltree_d
ragged
_type
==
A_CALL
)
{
}
else
if
(
calltree_s
ource
_type
==
A_CONFERENCE
&&
calltree_d
est
_type
==
A_CALL
)
{
// TODO: dragged a conference on a conference call
// TODO: dragged a conference on a conference call
calltree_remove_conference
(
current_calls_tab
,
calltree_s
elected
_conf
);
calltree_remove_conference
(
current_calls_tab
,
calltree_s
ource
_conf
);
calltree_add_conference_to_current_calls
(
calltree_s
elected
_conf
);
calltree_add_conference_to_current_calls
(
calltree_s
ource
_conf
);
}
}
else
{
ERROR
(
"Unexpected drag and drop scenario"
);
// TODO: dragged a single call on a NULL element
// TODO: dragged a single call on a NULL element
// TODO: dragged a conference on a NULL element
// TODO: dragged a conference on a NULL element
}
}
}
else
{
}
else
{
ERROR
(
"Unexpected calltree dest path depth %d"
,
calltree_dest_path_depth
);
}
}
else
{
if
(
calltree_dest_path_depth
==
1
)
{
if
(
calltree_source_type
==
A_CALL
&&
calltree_dest_type
==
A_CALL
)
{
DEBUG
(
"Dragged a conference call on a call"
);
sflphone_detach_participant
(
calltree_source_call_id
);
if
(
calltree_dragged_path_depth
==
1
)
{
if
(
calltree_source_call
&&
calltree_dest_call
)
if
(
calltree_selected_type
==
A_CALL
&&
calltree_dragged_type
==
A_CALL
)
{
gtk_menu_popup
(
GTK_MENU
(
calltree_popupmenu
),
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
);
// dragged a conference call on a call
sflphone_detach_participant
(
calltree_selected_call_id
);
if
(
calltree_selected_call
&&
calltree_dragged_call
)
gtk_menu_popup
(
GTK_MENU
(
calltree_popupmenu
),
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
);
}
else
if
(
calltree_s
elected
_type
==
A_CALL
&&
calltree_d
ragged
_type
==
A_CONFERENCE
)
{
}
else
if
(
calltree_s
ource
_type
==
A_CALL
&&
calltree_d
est
_type
==
A_CONFERENCE
)
{
// dragged a conference call on a conference
// dragged a conference call on a conference
sflphone_detach_participant
(
calltree_s
elected
_call_id
);
sflphone_detach_participant
(
calltree_s
ource
_call_id
);
if
(
calltree_s
elected
_call
&&
calltree_d
ragged
_conf
)
{
if
(
calltree_s
ource
_call
&&
calltree_d
est
_conf
)
{
DEBUG
(
"Adding a participant, since dragged call on a conference"
);
DEBUG
(
"Adding a participant, since dragged call on a conference"
);
sflphone_add_participant
(
calltree_s
elected
_call_id
,
calltree_d
ragged
_call_id
);
sflphone_add_participant
(
calltree_s
ource
_call_id
,
calltree_d
est
_call_id
);
}
}
}
else
{
}
else
{
// d
ragged a conference call on a NULL element
DEBUG
(
"D
ragged a conference call on a NULL element
"
);
sflphone_detach_participant
(
calltree_s
elected
_call_id
);
sflphone_detach_participant
(
calltree_s
ource
_call_id
);
}
}
}
else
if
(
calltree_dest_path_depth
==
2
)
{
}
else
{
DEBUG
(
"Dragged a conference call on another conference call (same conference"
);
// dragged_path_depth == 2
// dragged a conference call on another conference call (same conference)
// TODO: dragged a conference call on another conference call (different conference)
// TODO: dragged a conference call on another conference call (different conference)
gtk_tree_path_up
(
path
);
gtk_tree_path_up
(
path
);
...
@@ -1444,16 +1439,14 @@ static void drag_end_cb(GtkWidget * widget UNUSED, GdkDragContext * context UNUS
...
@@ -1444,16 +1439,14 @@ static void drag_end_cb(GtkWidget * widget UNUSED, GdkDragContext * context UNUS
gtk_tree_path_up
(
spath
);
gtk_tree_path_up
(
spath
);
if
(
gtk_tree_path_compare
(
dpath
,
spath
)
==
0
)
{
if
(
gtk_tree_path_compare
(
dpath
,
spath
)
==
0
)
{
DEBUG
(
"Dragged a call in the same conference"
);
DEBUG
(
"Dragged a call in the same conference"
);
calltree_remove_call
(
current_calls_tab
,
calltree_s
elected
_call
);
calltree_remove_call
(
current_calls_tab
,
calltree_s
ource
_call
);
calltree_add_call
(
current_calls_tab
,
calltree_s
elected
_call
,
&
parent_conference
);
calltree_add_call
(
current_calls_tab
,
calltree_s
ource
_call
,
&
parent_conference
);
gtk_widget_hide
(
calltree_menu_items
);
gtk_widget_hide
(
calltree_menu_items
);
gtk_menu_popup
(
GTK_MENU
(
calltree_popupmenu
),
NULL
,
NULL
,
NULL
,
NULL
,
gtk_menu_popup
(
GTK_MENU
(
calltree_popupmenu
),
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
);
0
,
0
);
}
else
{
}
else
{
DEBUG
(
"Dragged a conference call onto another conference call %s, %s"
,
gtk_tree_path_to_string
(
dpath
),
gtk_tree_path_to_string
(
spath
));
DEBUG
(
"Dragged a conference call onto another conference call %s, %s"
,
gtk_tree_path_to_string
(
dpath
),
gtk_tree_path_to_string
(
spath
));
conference_obj_t
*
conf
=
NULL
;
conference_obj_t
*
conf
=
NULL
;
if
(
gtk_tree_model_get_iter
(
model
,
&
iter
,
dpath
))
{
if
(
gtk_tree_model_get_iter
(
model
,
&
iter
,
dpath
))
{
...
@@ -1465,14 +1458,15 @@ static void drag_end_cb(GtkWidget * widget UNUSED, GdkDragContext * context UNUS
...
@@ -1465,14 +1458,15 @@ static void drag_end_cb(GtkWidget * widget UNUSED, GdkDragContext * context UNUS
}
}
}
}
sflphone_detach_participant
(
calltree_s
elected
_call_id
);
sflphone_detach_participant
(
calltree_s
ource
_call_id
);
if
(
conf
)
if
(
conf
)
sflphone_add_participant
(
calltree_s
elected
_call_id
,
conf
->
_confID
);
sflphone_add_participant
(
calltree_s
ource
_call_id
,
conf
->
_confID
);
else
else
DEBUG
(
"
d
idn't find a conf!"
);
ERROR
(
"
D
idn't find a conf
erence
!"
);
}
}
}
else
{
ERROR
(
"Unexpected calltree dragged path depth"
);
// TODO: dragged a conference call on another conference call (different conference)
// TODO: dragged a conference call on another conference call (different conference)
// TODO: dragged a conference call on a NULL element (same conference)
// TODO: dragged a conference call on a NULL element (same conference)
// TODO: dragged a conference call on a NULL element (different conference)
// TODO: dragged a conference call on a NULL element (different conference)
...
@@ -1508,12 +1502,12 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context UNUSED, gi
...
@@ -1508,12 +1502,12 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context UNUSED, gi
if
(
is_conference
(
tree_model
,
&
iter
))
{
if
(
is_conference
(
tree_model
,
&
iter
))
{
DEBUG
(
"CallTree: Dragging on a conference"
);
DEBUG
(
"CallTree: Dragging on a conference"
);
calltree_d
ragged
_type
=
A_CONFERENCE
;
calltree_d
est
_type
=
A_CONFERENCE
;
calltree_d
ragged
_call
=
NULL
;
calltree_d
est
_call
=
NULL
;
}
else
{
}
else
{
DEBUG
(
"CallTree: Dragging on a call"
);
DEBUG
(
"CallTree: Dragging on a call"
);
calltree_d
ragged
_type
=
A_CALL
;
calltree_d
est
_type
=
A_CALL
;
calltree_d
ragged
_conf
=
NULL
;
calltree_d
est
_conf
=
NULL
;
}
}
DEBUG
(
"Position %d"
,
position
);
DEBUG
(
"Position %d"
,
position
);
...
@@ -1522,25 +1516,25 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context UNUSED, gi
...
@@ -1522,25 +1516,25 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context UNUSED, gi
case
GTK_TREE_VIEW_DROP_AFTER
:
case
GTK_TREE_VIEW_DROP_AFTER
:
/* fallthrough */
/* fallthrough */
case
GTK_TREE_VIEW_DROP_BEFORE
:
case
GTK_TREE_VIEW_DROP_BEFORE
:
calltree_d
ragged
_path
=
gtk_tree_path_to_string
(
drop_path
);
calltree_d
est
_path
=
gtk_tree_path_to_string
(
drop_path
);
calltree_d
ragged
_path_depth
=
gtk_tree_path_get_depth
(
drop_path
);
calltree_d
est
_path_depth
=
gtk_tree_path_get_depth
(
drop_path
);
calltree_d
ragged
_call_id
=
NULL
;
calltree_d
est
_call_id
=
NULL
;
calltree_d
ragged
_call
=
NULL
;
calltree_d
est
_call
=
NULL
;
calltree_d
ragged
_conf
=
NULL
;
calltree_d
est
_conf
=
NULL
;
break
;
break
;
case
GTK_TREE_VIEW_DROP_INTO_OR_AFTER
:
case
GTK_TREE_VIEW_DROP_INTO_OR_AFTER
:
/* fallthrough */
/* fallthrough */
case
GTK_TREE_VIEW_DROP_INTO_OR_BEFORE
:
case
GTK_TREE_VIEW_DROP_INTO_OR_BEFORE
:
calltree_d
ragged
_path
=
gtk_tree_path_to_string
(
drop_path
);
calltree_d
est
_path
=
gtk_tree_path_to_string
(
drop_path
);
calltree_d
ragged
_path_depth
=
gtk_tree_path_get_depth
(
drop_path
);
calltree_d
est
_path_depth
=
gtk_tree_path_get_depth
(
drop_path
);
if
(
calltree_d
ragged
_type
==
A_CALL
)
{
if
(
calltree_d
est
_type
==
A_CALL
)
{
calltree_d
ragged
_call_id
=
((
callable_obj_t
*
)
g_value_get_pointer
(
&
val
))
->
_callID
;
calltree_d
est
_call_id
=
((
callable_obj_t
*
)
g_value_get_pointer
(
&
val
))
->
_callID
;
calltree_d
ragged
_call
=
(
callable_obj_t
*
)
g_value_get_pointer
(
&
val
);
calltree_d
est
_call
=
(
callable_obj_t
*
)
g_value_get_pointer
(
&
val
);
}
else
{
}
else
{
calltree_d
ragged
_call_id
=
((
conference_obj_t
*
)
g_value_get_pointer
(
&
val
))
->
_confID
;
calltree_d
est
_call_id
=
((
conference_obj_t
*
)
g_value_get_pointer
(
&
val
))
->
_confID
;
calltree_d
ragged
_conf
=
(
conference_obj_t
*
)
g_value_get_pointer
(
&
val
);
calltree_d
est
_conf
=
(
conference_obj_t
*
)
g_value_get_pointer
(
&
val
);
}
}
break
;
break
;
...
@@ -1556,16 +1550,16 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context UNUSED, gi
...
@@ -1556,16 +1550,16 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context UNUSED, gi
static
void
menuitem_response
(
gchar
*
string
)
static
void
menuitem_response
(
gchar
*
string
)
{
{
if
(
g_strcmp0
(
string
,
SFL_CREATE_CONFERENCE
)
==
0
)
if
(
g_strcmp0
(
string
,
SFL_CREATE_CONFERENCE
)
==
0
)
dbus_join_participant
(
calltree_s
elected
_call_for_drag
->
_callID
,
dbus_join_participant
(
calltree_s
ource
_call_for_drag
->
_callID
,
calltree_d
ragged
_call
->
_callID
);
calltree_d
est
_call
->
_callID
);
else
if
(
g_strcmp0
(
string
,
SFL_TRANSFER_CALL
)
==
0
)
{
else
if
(
g_strcmp0
(
string
,
SFL_TRANSFER_CALL
)
==
0
)
{
DEBUG
(
"Calltree: Transferring call %s, to %s"
,
DEBUG
(
"Calltree: Transferring call %s, to %s"
,
calltree_s
elected
_call
->
_peer_number
,
calltree_s
ource
_call
->
_peer_number
,
calltree_d
ragged
_call
->
_peer_number
);
calltree_d
est
_call
->
_peer_number
);
dbus_attended_transfer
(
calltree_s
elected
_call
,
calltree_d
ragged
_call
);
dbus_attended_transfer
(
calltree_s
ource
_call
,
calltree_d
est
_call
);
calltree_remove_call
(
current_calls_tab
,
calltree_s
elected
_call
);
calltree_remove_call
(
current_calls_tab
,
calltree_s
ource
_call
);
}
else
}
else
DEBUG
(
"CallTree: Error unknown option
selected
in menu %s"
,
string
);
DEBUG
(
"CallTree: Error unknown option in menu %s"
,
string
);
// Make sure the create conference option will appear next time the menu pops
// Make sure the create conference option will appear next time the menu pops
// The create conference option will hide if tow call from the same conference are draged on each other
// The create conference option will hide if tow call from the same conference are draged on each other
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment