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
323ce9f1
Commit
323ce9f1
authored
Jun 28, 2016
by
Erwan Croze
👋🏻
Browse files
Add shortcut for quickly accessing chatroom from the friendlist
parent
71cf2820
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
gtk/friendlist.c
gtk/friendlist.c
+30
-0
gtk/linphone.h
gtk/linphone.h
+2
-0
gtk/main.c
gtk/main.c
+1
-0
No files found.
gtk/friendlist.c
View file @
323ce9f1
...
...
@@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "linphone.h"
#include <bctoolbox/bc_vfs.h>
#include <gdk/gdkkeysyms.h>
static
GtkWidget
*
linphone_gtk_create_contact_menu
(
GtkWidget
*
contact_list
);
...
...
@@ -139,6 +140,35 @@ void linphone_gtk_remove_contact(GtkWidget *button){
}
}
gboolean
linphone_gtk_on_key_press
(
GtkWidget
*
widget
,
GdkEvent
*
event
,
gpointer
user_data
)
{
if
(
event
->
type
==
GDK_KEY_PRESS
&&
((
GdkEventKey
*
)
event
)
->
state
&
GDK_CONTROL_MASK
&&
((
GdkEventKey
*
)
event
)
->
hardware_keycode
>=
10
&&
((
GdkEventKey
*
)
event
)
->
hardware_keycode
<=
19
)
{
GtkWidget
*
main_window
=
linphone_gtk_get_main_window
();
GtkWidget
*
friendlist
=
linphone_gtk_get_widget
(
main_window
,
"contact_list"
);
GtkTreeModel
*
model
=
gtk_tree_view_get_model
(
GTK_TREE_VIEW
(
friendlist
));
int
key
=
((
GdkEventKey
*
)
event
)
->
hardware_keycode
-
10
;
GtkTreeIter
iter
;
if
(
gtk_tree_model_get_iter_first
(
model
,
&
iter
))
{
int
index
=
0
;
LinphoneFriend
*
lf
=
NULL
;
do
{
if
(
index
==
key
)
{
const
LinphoneAddress
*
uri
;
gtk_tree_model_get
(
model
,
&
iter
,
FRIEND_ID
,
&
lf
,
-
1
);
uri
=
linphone_friend_get_address
(
lf
);
linphone_gtk_friend_list_set_chat_conversation
(
uri
);
return
TRUE
;
}
index
++
;
}
while
(
gtk_tree_model_iter_next
(
model
,
&
iter
)
&&
index
<=
9
);
}
}
return
FALSE
;
}
void
linphone_gtk_delete_history
(
GtkWidget
*
button
){
GtkWidget
*
w
=
linphone_gtk_get_main_window
();
GtkTreeSelection
*
select
;
...
...
gtk/linphone.h
View file @
323ce9f1
...
...
@@ -371,3 +371,5 @@ LINPHONE_PUBLIC void linphone_gtk_mark_chat_read(LinphoneChatRoom *cr);
#ifdef __APPLE__
LINPHONE_PUBLIC
void
linphone_gtk_update_badge_count
();
#endif
LINPHONE_PUBLIC
gboolean
linphone_gtk_on_key_press
(
GtkWidget
*
widget
,
GdkEvent
*
event
,
gpointer
user_data
);
\ No newline at end of file
gtk/main.c
View file @
323ce9f1
...
...
@@ -2263,6 +2263,7 @@ core_start:
the_ui
=
linphone_gtk_create_window
(
"main"
,
NULL
);
g_object_set_data
(
G_OBJECT
(
the_ui
),
"is_created"
,
GINT_TO_POINTER
(
FALSE
));
g_signal_connect
(
G_OBJECT
(
the_ui
),
"key_press_event"
,
G_CALLBACK
(
linphone_gtk_on_key_press
),
NULL
);
linphone_gtk_create_log_window
();
linphone_core_enable_logs_with_cb
(
linphone_gtk_log_handler
);
...
...
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