Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
aad7b3c8
Commit
aad7b3c8
authored
Oct 22, 2015
by
François Grisez
Browse files
Automatically select a friend when right clicking in the friend list
parent
b13fab13
Changes
2
Hide whitespace changes
Inline
Side-by-side
gtk/friendlist.c
View file @
aad7b3c8
...
...
@@ -911,32 +911,35 @@ static void select_row(GtkTreeView *treeview, GtkTreePath *path) {
gtk_tree_selection_select_path
(
selection
,
path
);
}
gboolean
linphone_gtk_contact_list_button_pressed
(
Gtk
Widget
*
widge
t
,
GdkEventButton
*
event
){
gboolean
linphone_gtk_contact_list_button_pressed
(
Gtk
TreeView
*
friendlis
t
,
GdkEventButton
*
event
){
/* Ignore double-clicks and triple-clicks */
GtkTreeView
*
friendlist
=
GTK_TREE_VIEW
(
widget
);
gboolean
ret
=
FALSE
;
int
x_bin
,
y_bin
;
GtkTreePath
*
path
;
GtkTreeViewColumn
*
column
;
GtkTreeSelection
*
selection
=
gtk_tree_view_get_selection
(
friendlist
);
gtk_tree_view_convert_widget_to_bin_window_coords
(
friendlist
,
event
->
x
,
event
->
y
,
&
x_bin
,
&
y_bin
);
gtk_tree_view_get_path_at_pos
(
friendlist
,
x_bin
,
y_bin
,
&
path
,
&
column
,
NULL
,
NULL
);
if
(
event
->
button
==
3
&&
event
->
type
==
GDK_BUTTON_PRESS
)
{
return
linphone_gtk_popup_contact_menu
(
widget
,
event
);
if
(
path
)
gtk_tree_selection_select_path
(
selection
,
path
);
ret
=
linphone_gtk_popup_contact_menu
(
GTK_WIDGET
(
friendlist
),
event
);
}
else
if
(
event
->
button
==
1
&&
event
->
type
==
GDK_BUTTON_PRESS
){
int
x_bin
,
y_bin
;
GtkTreePath
*
path
;
GtkTreeViewColumn
*
column
;
gtk_tree_view_convert_widget_to_bin_window_coords
(
friendlist
,
event
->
x
,
event
->
y
,
&
x_bin
,
&
y_bin
);
gtk_tree_view_get_path_at_pos
(
friendlist
,
x_bin
,
y_bin
,
&
path
,
&
column
,
NULL
,
NULL
);
if
(
path
&&
column
)
{
int
numcol
=
get_column_index
(
friendlist
,
column
);
if
(
numcol
==
2
)
{
select_row
(
friendlist
,
path
);
linphone_gtk_call_selected
(
GTK_TREE_VIEW
(
widget
)
);
linphone_gtk_call_selected
(
friendlist
);
ret
=
TRUE
;
}
else
if
(
numcol
==
3
)
{
select_row
(
friendlist
,
path
);
linphone_gtk_chat_selected
(
widget
);
linphone_gtk_chat_selected
(
GTK_WIDGET
(
friendlist
)
);
ret
=
TRUE
;
}
}
if
(
path
)
gtk_tree_path_free
(
path
);
}
if
(
path
)
gtk_tree_path_free
(
path
);
return
ret
;
}
...
...
gtk/linphone.h
View file @
aad7b3c8
...
...
@@ -234,7 +234,7 @@ LINPHONE_PUBLIC void linphone_gtk_remove_button_clicked(GtkWidget *button);
LINPHONE_PUBLIC
void
linphone_gtk_my_presence_clicked
(
GtkWidget
*
button
);
LINPHONE_PUBLIC
void
linphone_gtk_directory_search_button_clicked
(
GtkWidget
*
button
);
LINPHONE_PUBLIC
gboolean
linphone_gtk_popup_contact_menu
(
GtkWidget
*
list
,
GdkEventButton
*
event
);
gboolean
linphone_gtk_contact_list_button_pressed
(
Gtk
Widget
*
firendlist
,
GdkEventButton
*
event
);
LINPHONE_PUBLIC
gboolean
linphone_gtk_contact_list_button_pressed
(
Gtk
TreeView
*
firendlist
,
GdkEventButton
*
event
);
LINPHONE_PUBLIC
void
linphone_gtk_auth_token_verified_clicked
(
GtkButton
*
button
);
LINPHONE_PUBLIC
void
linphone_gtk_hold_clicked
(
GtkButton
*
button
);
LINPHONE_PUBLIC
void
linphone_gtk_record_call_toggled
(
GtkWidget
*
button
);
...
...
Write
Preview
Markdown
is supported
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