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-client-gnome
Commits
763c25a0
Commit
763c25a0
authored
Mar 26, 2015
by
Stepan Salenikovich
Browse files
gnome: add choose file to right click
Refs #66538 Change-Id: I3d67b018d8f4cec881db6041f6c97b529e18d0c2
parent
bb382631
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/video/video_widget.cpp
View file @
763c25a0
...
...
@@ -313,13 +313,41 @@ switch_video_input_screen(G_GNUC_UNUSED GtkWidget *widget, G_GNUC_UNUSED gpointe
Video
::
SourceModel
::
instance
()
->
setDisplay
(
display
,
QRect
(
x
,
y
,
width
,
height
));
}
static
void
switch_video_input_file
(
GtkWidget
*
parent
)
{
if
(
parent
&&
GTK_IS_WIDGET
(
parent
))
{
/* get parent window */
parent
=
gtk_widget_get_toplevel
(
GTK_WIDGET
(
parent
));
}
gchar
*
uri
=
NULL
;
GtkWidget
*
dialog
=
gtk_file_chooser_dialog_new
(
"Choose File"
,
GTK_WINDOW
(
parent
),
GTK_FILE_CHOOSER_ACTION_OPEN
,
"_Cancel"
,
GTK_RESPONSE_CANCEL
,
"_Open"
,
GTK_RESPONSE_ACCEPT
,
NULL
);
if
(
gtk_dialog_run
(
GTK_DIALOG
(
dialog
))
==
GTK_RESPONSE_ACCEPT
)
{
uri
=
gtk_file_chooser_get_uri
(
GTK_FILE_CHOOSER
(
dialog
));
}
gtk_widget_destroy
(
dialog
);
Video
::
SourceModel
::
instance
()
->
setFile
(
QUrl
(
uri
));
g_free
(
uri
);
}
/*
* on_button_press_in_screen_event()
*
* Handle button event in the video screen.
*/
static
gboolean
on_button_press_in_screen_event
(
G_GNUC_UNUSED
GtkWidget
*
widge
t
,
on_button_press_in_screen_event
(
GtkWidget
*
paren
t
,
GdkEventButton
*
event
,
G_GNUC_UNUSED
gpointer
data
)
{
...
...
@@ -348,6 +376,11 @@ on_button_press_in_screen_event(G_GNUC_UNUSED GtkWidget *widget,
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
menu
),
item
);
g_signal_connect
(
item
,
"activate"
,
G_CALLBACK
(
switch_video_input_screen
),
NULL
);
/* add file as an input */
item
=
gtk_check_menu_item_new_with_mnemonic
(
"Share file"
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
menu
),
item
);
g_signal_connect
(
item
,
"activate"
,
G_CALLBACK
(
switch_video_input_file
),
parent
);
/* show menu */
gtk_widget_show_all
(
menu
);
gtk_menu_popup
(
GTK_MENU
(
menu
),
NULL
,
NULL
,
NULL
,
NULL
,
event
->
button
,
event
->
time
);
...
...
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