Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
9d36298d
Commit
9d36298d
authored
Apr 19, 2010
by
Alexandre Savard
Browse files
[#3247] Fix gnome gui treeview misbehavior
parent
0b4610f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
sflphone-client-gnome/src/contacts/calltree.c
View file @
9d36298d
...
...
@@ -80,7 +80,7 @@ popup_menu (GtkWidget *widget,
call_selected_cb
(
GtkTreeSelection
*
sel
,
void
*
data
UNUSED
)
{
DEBUG
(
"Selection
C
allback"
);
DEBUG
(
"
CallTree:
Selection
c
allback"
);
GtkTreeIter
iter
;
GValue
val
;
...
...
@@ -90,9 +90,10 @@ call_selected_cb(GtkTreeSelection *sel, void* data UNUSED )
gchar
*
string_path
;
if
(
!
gtk_tree_selection_get_selected
(
sel
,
&
model
,
&
iter
))
if
(
!
gtk_tree_selection_get_selected
(
sel
,
&
model
,
&
iter
))
{
ERROR
(
"CallTree: Not a valid selection, returning"
);
return
;
}
// store info for dragndrop
path
=
gtk_tree_model_get_path
(
model
,
&
iter
);
...
...
@@ -101,7 +102,7 @@ call_selected_cb(GtkTreeSelection *sel, void* data UNUSED )
if
(
gtk_tree_model_iter_has_child
(
GTK_TREE_MODEL
(
model
),
&
iter
))
{
DEBUG
(
"
SELECTED A CONFERENCE
"
);
DEBUG
(
"
CallTree: Selected a conference
"
);
selected_type
=
A_CONFERENCE
;
val
.
g_type
=
0
;
...
...
@@ -119,14 +120,14 @@ call_selected_cb(GtkTreeSelection *sel, void* data UNUSED )
}
DEBUG
(
" selected_path %s, selected_call_id %s, selected_path_depth %i
\n
"
,
selected_path
,
selected_call_id
,
selected_path_depth
);
DEBUG
(
"CallTree: selected_path %s, selected_call_id %s, selected_path_depth %d"
,
selected_path
,
selected_call_id
,
selected_path_depth
);
}
else
{
DEBUG
(
"
SELECTED A CALL
"
);
DEBUG
(
"
CallTree: Selected a call
"
);
selected_type
=
A_CALL
;
// gtk_tree_model_iter_parent(GTK_TREE_MODEL(model), parent_conference, &iter);
val
.
g_type
=
0
;
gtk_tree_model_get_value
(
model
,
&
iter
,
COLUMN_ACCOUNT_PTR
,
&
val
);
...
...
@@ -142,16 +143,12 @@ call_selected_cb(GtkTreeSelection *sel, void* data UNUSED )
selected_conf
=
NULL
;
}
DEBUG
(
" selected_path %s, selected_call_id %s, selected_path_depth %i
\n
"
,
selected_path
,
selected_call_id
,
selected_path_depth
);
DEBUG
(
"CallTree: selected_path %s, selected_call_id %s, selected_path_depth %d"
,
selected_path
,
selected_call_id
,
selected_path_depth
);
}
// conferencelist_reset ();
// sflphone_fill_conference_list();
g_value_unset
(
&
val
);
update_actions
();
}
/* A row is activated when it is double clicked */
...
...
@@ -165,20 +162,19 @@ row_activated(GtkTreeView *tree_view UNUSED,
conference_obj_t
*
selectedConf
=
NULL
;
gchar
*
account_id
;
DEBUG
(
"
d
ouble click action"
);
DEBUG
(
"
CallTree: D
ouble click action"
);
if
(
calltab_get_selected_type
(
active_calltree
)
==
A_CALL
)
{
DEBUG
(
"Selected a call
\n
"
);
selectedCall
=
calltab_get_selected_call
(
active_calltree
);
if
(
selectedCall
)
{
DEBUG
(
"
there is a s
elected call
\n
"
);
DEBUG
(
"
CallTree: S
elected
a
call"
);
// Get the right event from the right calltree
if
(
active_calltree
==
current_calls
)
{
DEBUG
(
"
a
ctive tree is current calls"
);
DEBUG
(
"
CallTree: A
ctive tree is current calls"
);
switch
(
selectedCall
->
_state
)
{
case
CALL_STATE_INCOMING
:
...
...
@@ -205,7 +201,7 @@ row_activated(GtkTreeView *tree_view UNUSED,
// If history or contact: double click action places a new call
else
{
DEBUG
(
"
a
ctive tree is history or contact"
);
DEBUG
(
"
CallTree: A
ctive tree is history or contact"
);
account_id
=
g_strdup
(
selectedCall
->
_accountID
);
...
...
@@ -221,7 +217,7 @@ row_activated(GtkTreeView *tree_view UNUSED,
}
else
if
(
calltab_get_selected_type
(
current_calls
)
==
A_CONFERENCE
)
{
DEBUG
(
"Selected a conference
\n
"
);
DEBUG
(
"
CallTree:
Selected a conference"
);
if
(
active_calltree
==
current_calls
)
{
...
...
@@ -250,14 +246,21 @@ row_activated(GtkTreeView *tree_view UNUSED,
void
row_single_click
(
GtkTreeView
*
tree_view
UNUSED
,
void
*
data
UNUSED
)
{
DEBUG
(
"single click action"
);
callable_obj_t
*
selectedCall
=
NULL
;
account_t
*
account_details
=
NULL
;
callable_obj_t
*
selectedCall
=
NULL
;
account_t
*
account_details
=
NULL
;
gchar
*
displaySasOnce
=
""
;
DEBUG
(
"CallTree: Single click action"
);
selectedCall
=
calltab_get_selected_call
(
active_calltree
);
if
(
selectedCall
!=
NULL
)
{
/*
if(!selected_call) {
selected_call = selectedCall;
}
*/
if
(
selectedCall
)
{
account_details
=
account_list_get_by_id
(
selectedCall
->
_accountID
);
DEBUG
(
"AccountID %s"
,
selectedCall
->
_accountID
);
...
...
@@ -338,7 +341,7 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch
gchar
*
hostname
=
NULL
;
gchar
*
display_number
=
""
;
DEBUG
(
"Display call info"
);
DEBUG
(
"
CallTree:
Display call info"
);
// If call is outgoing, keep the hostname, strip it elsewhere
if
(
c
->
_type
==
CALL
&&
c
->
_history_state
==
OUTGOING
)
{
...
...
@@ -371,7 +374,7 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch
case
DISPLAY_TYPE_CALL
:
DEBUG
(
"
d
isplay a normal call"
);
DEBUG
(
"
CallTree: D
isplay a normal call"
);
if
(
c
->
_state_code
==
0
)
{
if
(
g_strcmp0
(
""
,
c
->
_peer_name
)
==
0
)
{
...
...
@@ -401,7 +404,7 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch
case
DISPLAY_TYPE_CALL_TRANSFER
:
DEBUG
(
"
d
isplay a call transfer"
)
DEBUG
(
"
CallTree: D
isplay a call transfer"
)
if
(
g_strcmp0
(
""
,
c
->
_peer_name
)
==
0
){
description
=
g_markup_printf_escaped
(
"<b>%s</b><i>%s</i>
\n
<i>Transfert to:%s</i> "
,
...
...
@@ -416,7 +419,7 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch
case
DISPLAY_TYPE_STATE_CODE
:
DEBUG
(
"
d
isplay a state code"
);
DEBUG
(
"
CallTree: D
isplay a state code"
);
if
(
g_strcmp0
(
""
,
c
->
_peer_name
)
==
0
){
...
...
@@ -446,7 +449,7 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch
case
DISPLAY_TYPE_SAS
:
DEBUG
(
"
d
isplay a call with sas"
);
DEBUG
(
"
CallTree: D
isplay a call with sas"
);
if
(
g_strcmp0
(
""
,
c
->
_peer_name
)
==
0
){
description
=
g_markup_printf_escaped
(
"<b>%s</b><i>%s</i>
\n
<i>Confirm SAS <b>%s</b> ?</i> "
,
...
...
@@ -460,7 +463,7 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch
case
DISPLAY_TYPE_HISTORY
:
DEBUG
(
"
d
isplay history entry"
);
DEBUG
(
"
CallTree: D
isplay history entry"
);
if
(
g_strcmp0
(
""
,
c
->
_peer_name
)
==
0
)
{
description
=
g_markup_printf_escaped
(
"<b>%s</b><i>%s</i>"
,
...
...
@@ -473,7 +476,7 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch
break
;
default
:
DEBUG
(
"Not an allowable type of display"
);
DEBUG
(
"
CallTree:
Not an allowable type of display"
);
break
;
}
...
...
@@ -631,13 +634,16 @@ calltree_create (calltab_t* tab, gboolean searchbar_type)
calltree_remove_call
(
calltab_t
*
tab
,
callable_obj_t
*
c
,
GtkTreeIter
*
parent
)
{
DEBUG
(
"calltree_remove_call %s"
,
c
->
_callID
);
GtkTreeIter
iter
;
GValue
val
;
callable_obj_t
*
iterCall
;
GtkTreeStore
*
store
=
tab
->
store
;
if
(
!
c
)
ERROR
(
"CallTree: Error: Not a valid call"
);
DEBUG
(
"CallTree: Remove call %s"
,
c
->
_callID
);
int
nbChild
=
gtk_tree_model_iter_n_children
(
GTK_TREE_MODEL
(
store
),
parent
);
int
i
;
for
(
i
=
0
;
i
<
nbChild
;
i
++
)
...
...
@@ -851,7 +857,7 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent)
void
calltree_add_call
(
calltab_t
*
tab
,
callable_obj_t
*
c
,
GtkTreeIter
*
parent
)
{
DEBUG
(
"
c
all
t
ree
_add_call
id: %s, peer name: %s"
,
c
->
_callID
,
c
->
_peer_name
);
DEBUG
(
"
C
all
T
ree
: Add call to calltree
id: %s, peer name: %s"
,
c
->
_callID
,
c
->
_peer_name
);
if
(
tab
==
history
)
{
...
...
@@ -1042,8 +1048,6 @@ void calltree_add_history_entry (callable_obj_t * c)
void
calltree_add_conference
(
calltab_t
*
tab
,
conference_obj_t
*
conf
)
{
DEBUG
(
"Calltree: Add conference %s"
,
conf
->
_confID
);
GdkPixbuf
*
pixbuf
=
NULL
;
GdkPixbuf
*
pixbuf_security
=
NULL
;
GtkTreeIter
iter
;
...
...
@@ -1070,6 +1074,8 @@ void calltree_add_conference (calltab_t* tab, conference_obj_t* conf)
return
;
}
DEBUG
(
"Calltree: Add conference %s"
,
conf
->
_confID
);
// description = g_markup_printf_escaped("<b>%s</b>", conf->_confID);
description
=
g_markup_printf_escaped
(
"<b>%s</b>"
,
""
);
...
...
@@ -1396,17 +1402,15 @@ static void drag_begin_cb(GtkWidget *widget, GdkDragContext *dc, gpointer data)
GtkTargetList
*
target_list
;
// DEBUG("drag_begin_cb %s\n", dragged_path);
if
((
target_list
=
gtk_drag_source_get_target_list
(
widget
))
!=
NULL
);
}
static
void
drag_end_cb
(
GtkWidget
*
widget
,
GdkDragContext
*
context
,
gpointer
data
)
{
DEBUG
(
"drag_end_cb
\n
"
);
DEBUG
(
" selected_path %s, selected_call_id %s, selected_path_depth %i
\n
"
,
selected_path
,
selected_call_id
,
selected_path_depth
);
DEBUG
(
" dragged path %s, dragged_call_id %s, dragged_path_depth %i
\n
"
,
selected_path
,
selected_call_id
,
dragged_path_depth
);
DEBUG
(
"CallTree: Drag end callback"
);
DEBUG
(
"CallTree: selected_path %s, selected_call_id %s, selected_path_depth %d"
,
selected_path
,
selected_call_id
,
selected_path_depth
);
DEBUG
(
"CallTree: dragged path %s, dragged_call_id %s, dragged_path_depth %d"
,
dragged_path
,
dragged_call_id
,
dragged_path_depth
);
GtkTreeModel
*
model
=
(
GtkTreeModel
*
)
current_calls
->
store
;
GtkTreePath
*
path
=
gtk_tree_path_new_from_string
(
dragged_path
);
...
...
@@ -1424,100 +1428,75 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
conference_obj_t
*
conf
;
// Make sure
that
drag n drop does not imply a dialing call
if
(
selected_type
==
A_CALL
)
{
// Make sure drag n drop does not imply a dialing call
for either selected and dragged call
if
(
selected_call
&&
(
selected_type
==
A_CALL
)
)
{
DEBUG
(
"Selected a call"
);
DEBUG
(
"
CallTree:
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"
);
DEBUG
(
"
CallTree:
Selected an invalid call"
);
calltree_remove_call
(
current_calls
,
selected_call
,
NULL
);
calltree_add_call
(
current_calls
,
selected_call
,
NULL
);
return
;
calltree_remove_call
(
current_calls
,
selected_call
,
NULL
);
calltree_add_call
(
current_calls
,
selected_call
,
NULL
);
dragged_call
=
NULL
;
return
;
}
if
(
dragged_type
==
A_CALL
)
{
if
(
dragged_call
&&
(
dragged_type
==
A_CALL
)
)
{
DEBUG
(
"Dragged on a call"
);
DEBUG
(
"
CallTree:
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"
);
DEBUG
(
"
CallTree:
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) {
// user may have dragged it outside the conference
if(dragged_call && dragged_call->_state == CALL_STATE_DIALING) {
calltree_remove_call(current_calls, dragged_call, NULL);
DEBUG("-------------------------------------- Dragged a call on a dialing call");
// test if call participate to a conference
if(selected_call->_confID) {
if
(
selected_call
->
_confID
)
{
gtk_tree_path_up(spath);
gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &parent_conference, path);
gtk_tree_path_up
(
spath
);
gtk_tree_model_get_iter
(
GTK_TREE_MODEL
(
model
),
&
parent_conference
,
s
path
);
calltree_add_call(current_calls, selected_call, &parent_conference);
}
else {
calltree_add_call(current_calls, selected_call, NULL);
}
calltree_add_call
(
current_calls
,
selected_call
,
&
parent_conference
);
}
else
{
calltree_add_call(current_calls, dragged_call, NULL);
return;
calltree_add_call
(
current_calls
,
selected_call
,
NULL
);
}
dragged_call
=
NULL
;
return
;
}
}
}
*/
if
(
selected_type
==
A_CONFERENCE
)
{
DEBUG
(
"Selected a conference"
);
// Make sure a conference is only dragged on another conference
if
(
selected_conf
&&
(
selected_type
==
A_CONFERENCE
))
{
if
(
dragged_type
==
A_CALL
)
{
DEBUG
(
"CallTree: Selected a conference"
);
DEBUG
(
"Dragged on a call"
);
if
(
!
dragged_conf
&&
(
dragged_type
==
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"
);
DEBUG
(
"CallTree: Dragged on a call"
);
conf
=
selected_conf
;
calltree_remove_conference
(
current_calls
,
conf
,
NULL
);
calltree_add_conference
(
current_calls
,
conf
);
return
;
}
dragged_call
=
NULL
;
return
;
}
}
...
...
@@ -1731,18 +1710,21 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context, gint x, g
if
(
gtk_tree_model_iter_has_child
(
tree_model
,
&
iter
))
{
DEBUG
(
"
DRAGGING ON A CONFERENCE
"
);
DEBUG
(
"
CallTree: Dragging on a conference
"
);
dragged_type
=
A_CONFERENCE
;
dragged_call
=
NULL
;
}
else
{
DEBUG
(
"
DRAGGING ON A CALL
"
);
DEBUG
(
"
CallTree: Dragging on a call
"
);
dragged_type
=
A_CALL
;
dragged_conf
=
NULL
;
}
switch
(
position
)
{
case
GTK_TREE_VIEW_DROP_AFTER
:
DEBUG
(
"CallTree: GTK_TREE_VIEW_DROP_AFTER"
);
dragged_path
=
gtk_tree_path_to_string
(
drop_path
);
dragged_path_depth
=
gtk_tree_path_get_depth
(
drop_path
);
dragged_call_id
=
"NULL"
;
...
...
@@ -1751,6 +1733,7 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context, gint x, g
break
;
case
GTK_TREE_VIEW_DROP_INTO_OR_AFTER
:
DEBUG
(
"CallTree: GTK_TREE_VIEW_DROP_INTO_OR_AFTER"
);
dragged_path
=
gtk_tree_path_to_string
(
drop_path
);
dragged_path_depth
=
gtk_tree_path_get_depth
(
drop_path
);
if
(
dragged_type
==
A_CALL
)
{
...
...
@@ -1766,6 +1749,7 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context, gint x, g
break
;
case
GTK_TREE_VIEW_DROP_BEFORE
:
DEBUG
(
"CallTree: GTK_TREE_VIEW_DROP_BEFORE"
);
dragged_path
=
gtk_tree_path_to_string
(
drop_path
);
dragged_path_depth
=
gtk_tree_path_get_depth
(
drop_path
);
dragged_call_id
=
"NULL"
;
...
...
@@ -1774,6 +1758,7 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context, gint x, g
break
;
case
GTK_TREE_VIEW_DROP_INTO_OR_BEFORE
:
DEBUG
(
"CallTree: GTK_TREE_VIEW_DROP_INTO_OR_BEFORE"
);
dragged_path
=
gtk_tree_path_to_string
(
drop_path
);
dragged_path_depth
=
gtk_tree_path_get_depth
(
drop_path
);
if
(
dragged_type
==
A_CALL
)
{
...
...
sflphone-common/src/sip/sdp.cpp
View file @
9d36298d
...
...
@@ -52,8 +52,8 @@ Sdp::Sdp (pj_pool_t *pool)
Sdp
::~
Sdp
()
{
clean_session_media
();
clean_local_media_capabilities
();
//
clean_session_media();
//
clean_local_media_capabilities();
}
void
Sdp
::
set_media_descriptor_line
(
sdpMedia
*
media
,
pjmedia_sdp_media
**
p_med
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment