1
=== modified file 'data/totem.ui'
2
Index: totem-3.8.0/data/totem.ui
3
===================================================================
4
--- totem-3.8.0.orig/data/totem.ui 2013-05-25 23:02:46.490386347 -0400
5
+++ totem-3.8.0/data/totem.ui 2013-05-25 23:02:46.486386347 -0400
8
<requires lib="gtk+" version="3.0"/>
13
- <attribute name="label" translatable="yes">_Open</attribute>
14
- <attribute name="action">app.open</attribute>
15
- <attribute name="accel"><Ctrl>O</attribute>
18
- <attribute name="label" translatable="yes">Open _Location</attribute>
19
- <attribute name="action">app.open-location</attribute>
20
- <attribute name="accel"><Ctrl>L</attribute>
25
- <attribute name="label" translatable="yes">_Fullscreen</attribute>
26
- <attribute name="action">app.fullscreen</attribute>
27
- <attribute name="accel">F11</attribute>
32
- <attribute name="label" translatable="yes">Prefere_nces</attribute>
33
- <attribute name="action">app.preferences</attribute>
38
- <attribute name="label" translatable="yes">Shuff_le</attribute>
39
- <attribute name="action">app.shuffle</attribute>
42
- <attribute name="label" translatable="yes">_Repeat</attribute>
43
- <attribute name="action">app.repeat</attribute>
48
- <attribute name="label" translatable="yes">_Quit</attribute>
49
- <attribute name="action">app.quit</attribute>
50
- <attribute name="accel"><Ctrl>Q</attribute>
55
<object class="GtkUIManager" id="totem-ui-manager">
57
<object class="GtkActionGroup" id="main-action-group">
62
+ <object class="GtkAction" id="open">
63
+ <property name="label" translatable="yes">_Open...</property>
64
+ <property name="stock-id">gtk-open</property>
65
+ <property name="tooltip" translatable="yes">Open a file</property>
66
+ <signal name="activate" handler="open_action_callback"/>
68
+ <accelerator key="O" modifiers="GDK_CONTROL_MASK"/>
71
+ <object class="GtkAction" id="open-location">
72
+ <property name="label" translatable="yes">Open _Location...</property>
73
+ <property name="tooltip" translatable="yes">Open a non-local file</property>
74
+ <signal name="activate" handler="open_location_action_callback"/>
76
+ <accelerator key="L" modifiers="GDK_CONTROL_MASK"/>
79
<object class="GtkAction" id="eject">
80
<property name="label" translatable="yes">_Eject</property>
81
<property name="icon-name">media-eject-symbolic</property>
84
<accelerator key="space" modifiers="GDK_CONTROL_MASK"/>
87
+ <object class="GtkAction" id="quit">
88
+ <property name="label" translatable="yes">_Quit</property>
89
+ <property name="stock-id">gtk-quit</property>
90
+ <property name="tooltip" translatable="yes">Quit the program</property>
91
+ <signal name="activate" handler="quit_action_callback"/>
93
+ <accelerator key="Q" modifiers="GDK_CONTROL_MASK"/>
97
<object class="GtkAction" id="edit-menu">
102
+ <object class="GtkAction" id="preferences">
103
+ <property name="label" translatable="yes">Prefere_nces</property>
104
+ <property name="stock-id">gtk-preferences</property>
105
+ <property name="tooltip" translatable="yes">Configure the application</property>
106
+ <signal name="activate" handler="preferences_action_callback"/>
110
<object class="GtkAction" id="plugins">
111
<property name="label" translatable="yes">Plugins...</property>
112
<property name="tooltip" translatable="yes">Configure plugins to extend the application</property>
117
+ <object class="GtkAction" id="fullscreen">
118
+ <property name="label" translatable="yes">_Fullscreen</property>
119
+ <property name="icon-name">view-fullscreen-symbolic</property>
120
+ <property name="tooltip" translatable="yes">Switch to fullscreen</property>
121
+ <signal name="activate" handler="fullscreen_action_callback"/>
123
+ <accelerator key="F11"/>
126
<object class="GtkAction" id="zoom-window-menu">
127
<property name="label" translatable="yes">Fit Window to Movie</property>
133
+ <object class="GtkToggleAction" id="repeat-mode">
134
+ <property name="label" translatable="yes">_Repeat Mode</property>
135
+ <property name="tooltip" translatable="yes">Set the repeat mode</property>
136
+ <property name="active">False</property>
137
+ <signal name="activate" handler="repeat_mode_action_callback"/>
141
+ <object class="GtkToggleAction" id="shuffle-mode">
142
+ <property name="label" translatable="yes">Shuff_le Mode</property>
143
+ <property name="tooltip" translatable="yes">Set the shuffle mode</property>
144
+ <property name="active">False</property>
145
+ <signal name="activate" handler="shuffle_mode_action_callback"/>
149
<object class="GtkToggleAction" id="show-controls">
150
<property name="label" translatable="yes">Show _Controls</property>
151
<property name="tooltip" translatable="yes">Show controls</property>
154
<menubar name="tmw-menubar">
155
<menu name="movie" action="movie-menu">
156
+ <menuitem name="open" action="open"/>
157
+ <menuitem name="open-location" action="open-location"/>
158
<placeholder name="save-placeholder"/>
159
<separator name="recent-separator"/>
160
<placeholder name="recent-placeholder"/>
161
@@ -395,13 +411,20 @@
162
<menuitem name="eject" action="eject"/>
164
<menuitem name="play" action="play"/>
166
+ <menuitem name="quit" action="quit"/>
168
<menu name="edit" action="edit-menu">
169
+ <menuitem name="repeat-mode" action="repeat-mode"/>
170
+ <menuitem name="shuffle-mode" action="shuffle-mode"/>
172
<menuitem name="clear-playlist" action="clear-playlist"/>
174
<menuitem name="plugins" action="plugins"/>
175
+ <menuitem name="preferences" action="preferences"/>
177
<menu name="view" action="view-menu">
178
+ <menuitem name="fullscreen" action="fullscreen"/>
179
<menu name="zoom-window" action="zoom-window-menu">
180
<menuitem name="zoom-1-2" action="zoom-1-2"/>
181
<menuitem name="zoom-1-1" action="zoom-1-1"/>
183
<menuitem name="skip-forward" action="skip-forward"/>
184
<menuitem name="skip-backwards" action="skip-backwards"/>
185
<menuitem name="show-controls" action="show-controls"/>
186
+ <menuitem name="fullscreen" action="fullscreen"/>
187
<menuitem name="select-subtitle" action="select-subtitle"/>
189
<placeholder name="save-placeholder"/>
191
<signal name="value-changed" handler="seek_slider_changed_cb"/>
194
-<object class="GtkApplicationWindow" id="totem_main_window">
195
+<object class="GtkWindow" id="totem_main_window">
196
<property name="title" translatable="yes">Videos</property>
197
<property name="type">GTK_WINDOW_TOPLEVEL</property>
198
<property name="window_position">GTK_WIN_POS_NONE</property>
199
Index: totem-3.8.0/src/totem-menu.c
200
===================================================================
201
--- totem-3.8.0.orig/src/totem-menu.c 2013-05-25 23:02:46.490386347 -0400
202
+++ totem-3.8.0/src/totem-menu.c 2013-05-25 23:02:46.486386347 -0400
204
#define TOTEM_MAX_RECENT_ITEM_LEN 40
206
/* Callback functions for GtkBuilder */
207
+G_MODULE_EXPORT void open_action_callback (GtkAction *action, Totem *totem);
208
+G_MODULE_EXPORT void open_location_action_callback (GtkAction *action, Totem *totem);
209
G_MODULE_EXPORT void eject_action_callback (GtkAction *action, Totem *totem);
210
G_MODULE_EXPORT void properties_action_callback (GtkAction *action, Totem *totem);
211
G_MODULE_EXPORT void play_action_callback (GtkAction *action, Totem *totem);
212
G_MODULE_EXPORT void quit_action_callback (GtkAction *action, Totem *totem);
213
+G_MODULE_EXPORT void preferences_action_callback (GtkAction *action, Totem *totem);
214
+G_MODULE_EXPORT void fullscreen_action_callback (GtkAction *action, Totem *totem);
215
G_MODULE_EXPORT void zoom_1_2_action_callback (GtkAction *action, Totem *totem);
216
G_MODULE_EXPORT void zoom_1_1_action_callback (GtkAction *action, Totem *totem);
217
G_MODULE_EXPORT void zoom_2_1_action_callback (GtkAction *action, Totem *totem);
219
G_MODULE_EXPORT void contents_action_callback (GtkAction *action, Totem *totem);
220
G_MODULE_EXPORT void about_action_callback (GtkAction *action, Totem *totem);
221
G_MODULE_EXPORT void plugins_action_callback (GtkAction *action, Totem *totem);
222
+G_MODULE_EXPORT void repeat_mode_action_callback (GtkToggleAction *action, Totem *totem);
223
+G_MODULE_EXPORT void shuffle_mode_action_callback (GtkToggleAction *action, Totem *totem);
224
G_MODULE_EXPORT void show_controls_action_callback (GtkToggleAction *action, Totem *totem);
225
G_MODULE_EXPORT void show_sidebar_action_callback (GtkToggleAction *action, Totem *totem);
226
G_MODULE_EXPORT void aspect_ratio_changed_callback (GtkRadioAction *action, GtkRadioAction *current, Totem *totem);
227
G_MODULE_EXPORT void select_subtitle_action_callback (GtkAction *action, Totem *totem);
228
G_MODULE_EXPORT void clear_playlist_action_callback (GtkAction *action, Totem *totem);
231
-open_action_cb (GSimpleAction *action,
232
- GVariant *parameter,
233
- gpointer user_data)
235
- totem_action_open (TOTEM_OBJECT (user_data));
239
-open_location_action_cb (GSimpleAction *action,
240
- GVariant *parameter,
241
- gpointer user_data)
243
- totem_action_open_location (TOTEM_OBJECT (user_data));
247
-preferences_action_cb (GSimpleAction *action,
248
- GVariant *parameter,
249
- gpointer user_data)
251
- gtk_widget_show (TOTEM_OBJECT (user_data)->prefs);
255
-fullscreen_change_state (GSimpleAction *action,
257
- gpointer user_data)
261
- param = g_variant_get_boolean (value);
262
- totem_action_fullscreen (TOTEM_OBJECT (user_data), param);
264
- g_simple_action_set_state (action, value);
268
-shuffle_change_state (GSimpleAction *action,
270
- gpointer user_data)
274
- param = g_variant_get_boolean (value);
275
- totem_playlist_set_shuffle (TOTEM_OBJECT (user_data)->playlist, param);
277
- g_simple_action_set_state (action, value);
281
-repeat_change_state (GSimpleAction *action,
283
- gpointer user_data)
287
- param = g_variant_get_boolean (value);
288
- totem_playlist_set_repeat (TOTEM_OBJECT (user_data)->playlist, param);
290
- g_simple_action_set_state (action, value);
294
-toggle_action_cb (GSimpleAction *action,
295
- GVariant *parameter,
296
- gpointer user_data)
300
- state = g_action_get_state (G_ACTION (action));
301
- g_action_change_state (G_ACTION (action), g_variant_new_boolean (!g_variant_get_boolean (state)));
302
- g_variant_unref (state);
306
-quit_action_cb (GSimpleAction *action,
307
- GVariant *parameter,
308
- gpointer user_data)
310
- totem_action_exit (TOTEM_OBJECT (user_data));
313
-static GActionEntry app_entries[] = {
314
- { "open", open_action_cb, NULL, NULL, NULL },
315
- { "open-location", open_location_action_cb, NULL, NULL, NULL },
316
- { "fullscreen", toggle_action_cb, NULL, "false", fullscreen_change_state },
317
- { "preferences", preferences_action_cb, NULL, NULL, NULL },
318
- { "shuffle", toggle_action_cb, NULL, "false", shuffle_change_state },
319
- { "repeat", toggle_action_cb, NULL, "false", repeat_change_state },
320
- { "quit", quit_action_cb, NULL, NULL, NULL },
324
-totem_app_menu_setup (Totem *totem)
326
- GMenuModel *appmenu;
328
- g_action_map_add_action_entries (G_ACTION_MAP (totem), app_entries, G_N_ELEMENTS (app_entries), totem);
330
- appmenu = (GMenuModel *)gtk_builder_get_object (totem->xml, "appmenu");
331
- gtk_application_set_app_menu (GTK_APPLICATION (totem), appmenu);
333
- gtk_window_set_application (GTK_WINDOW (totem->win), GTK_APPLICATION (totem));
336
/* Helper function to escape underscores in labels
337
* before putting them in menu items */
343
+open_action_callback (GtkAction *action, Totem *totem)
345
+ totem_action_open (totem);
349
+open_location_action_callback (GtkAction *action, Totem *totem)
351
+ totem_action_open_location (totem);
355
eject_action_callback (GtkAction *action, Totem *totem)
357
totem_action_eject (totem);
362
+preferences_action_callback (GtkAction *action, Totem *totem)
364
+ gtk_widget_show (totem->prefs);
368
+fullscreen_action_callback (GtkAction *action, Totem *totem)
370
+ totem_action_fullscreen_toggle (totem);
374
zoom_1_2_action_callback (GtkAction *action, Totem *totem)
376
totem_action_set_scale_ratio (totem, 0.5);
381
+repeat_mode_action_callback (GtkToggleAction *action, Totem *totem)
383
+ totem_playlist_set_repeat (totem->playlist,
384
+ gtk_toggle_action_get_active (action));
388
+shuffle_mode_action_callback (GtkToggleAction *action, Totem *totem)
390
+ totem_playlist_set_shuffle (totem->playlist,
391
+ gtk_toggle_action_get_active (action));
395
show_controls_action_callback (GtkToggleAction *action, Totem *totem)
398
Index: totem-3.8.0/src/totem-menu.h
399
===================================================================
400
--- totem-3.8.0.orig/src/totem-menu.h 2013-05-25 23:02:46.490386347 -0400
401
+++ totem-3.8.0/src/totem-menu.h 2013-05-25 23:02:46.486386347 -0400
406
-void totem_app_menu_setup (Totem *totem);
408
void totem_ui_manager_setup (Totem *totem);
410
void totem_sublang_update (Totem *totem);
411
Index: totem-3.8.0/src/totem-object.c
412
===================================================================
413
--- totem-3.8.0.orig/src/totem-object.c 2013-05-25 23:02:46.490386347 -0400
414
+++ totem-3.8.0/src/totem-object.c 2013-05-25 23:02:46.486386347 -0400
415
@@ -1430,8 +1430,6 @@
416
window_state_event_cb (GtkWidget *window, GdkEventWindowState *event,
421
if (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) {
422
totem->maximised = (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0;
423
totem_action_set_sensitivity ("zoom-1-2", !totem->maximised);
424
@@ -1450,6 +1448,7 @@
426
totem->controls_visibility = TOTEM_CONTROLS_FULLSCREEN;
427
show_controls (totem, FALSE);
428
+ totem_action_set_sensitivity ("fullscreen", FALSE);
432
@@ -1464,12 +1463,9 @@
433
totem->controls_visibility = TOTEM_CONTROLS_HIDDEN;
435
show_controls (totem, TRUE);
436
+ totem_action_set_sensitivity ("fullscreen", TRUE);
439
- action = g_action_map_lookup_action (G_ACTION_MAP (totem), "fullscreen");
440
- g_simple_action_set_state (G_SIMPLE_ACTION (action),
441
- g_variant_new_boolean (totem->controls_visibility == TOTEM_CONTROLS_FULLSCREEN));
443
g_object_notify (G_OBJECT (totem), "fullscreen");
446
@@ -1510,10 +1506,7 @@
448
fs_exit1_activate_cb (GtkButton *button, TotemObject *totem)
452
- action = g_action_map_lookup_action (G_ACTION_MAP (totem), "fullscreen");
453
- g_action_change_state (action, g_variant_new_boolean (FALSE));
454
+ totem_action_fullscreen (totem, FALSE);
458
@@ -1723,6 +1716,9 @@
459
/* Subtitle selection */
460
totem_action_set_sensitivity ("select-subtitle", FALSE);
463
+ totem_action_set_sensitivity ("fullscreen", FALSE);
466
bacon_video_widget_set_logo_mode (totem->bvw, TRUE);
467
update_mrl_label (totem, NULL);
468
@@ -1736,6 +1732,7 @@
472
+ GdkWindowState window_state;
475
bacon_video_widget_set_logo_mode (totem->bvw, FALSE);
476
@@ -1775,6 +1772,10 @@
477
/* Subtitle selection */
478
totem_action_set_sensitivity ("select-subtitle", !totem_is_special_mrl (mrl) && retval);
481
+ window_state = gdk_window_get_state (gtk_widget_get_window (totem->win));
482
+ totem_action_set_sensitivity ("fullscreen", !(window_state & GDK_WINDOW_STATE_FULLSCREEN));
484
/* Set the playlist */
485
play_pause_set_label (totem, retval ? STATE_PAUSED : STATE_STOPPED);
487
@@ -3268,21 +3269,33 @@
489
playlist_repeat_toggle_cb (TotemPlaylist *playlist, gboolean repeat, TotemObject *totem)
494
+ action = gtk_action_group_get_action (totem->main_action_group, "repeat-mode");
496
+ g_signal_handlers_block_matched (G_OBJECT (action), G_SIGNAL_MATCH_DATA, 0, 0,
497
+ NULL, NULL, totem);
499
- action = g_action_map_lookup_action (G_ACTION_MAP (totem), "repeat");
500
- g_simple_action_set_state (G_SIMPLE_ACTION (action),
501
- g_variant_new_boolean (repeat));
502
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), repeat);
504
+ g_signal_handlers_unblock_matched (G_OBJECT (action), G_SIGNAL_MATCH_DATA, 0, 0,
505
+ NULL, NULL, totem);
509
playlist_shuffle_toggle_cb (TotemPlaylist *playlist, gboolean shuffle, TotemObject *totem)
514
+ action = gtk_action_group_get_action (totem->main_action_group, "shuffle-mode");
516
+ g_signal_handlers_block_matched (G_OBJECT (action), G_SIGNAL_MATCH_DATA, 0, 0,
517
+ NULL, NULL, totem);
519
- action = g_action_map_lookup_action (G_ACTION_MAP (totem), "shuffle");
520
- g_simple_action_set_state (G_SIMPLE_ACTION (action),
521
- g_variant_new_boolean (shuffle));
522
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), shuffle);
524
+ g_signal_handlers_unblock_matched (G_OBJECT (action), G_SIGNAL_MATCH_DATA, 0, 0,
525
+ NULL, NULL, totem);
529
@@ -3999,15 +4012,14 @@
531
GtkActionGroup *action_group;
536
- gaction = g_action_map_lookup_action (G_ACTION_MAP (totem), "repeat");
537
- g_simple_action_set_state (G_SIMPLE_ACTION (gaction),
538
- g_variant_new_boolean (totem_playlist_get_repeat (totem->playlist)));
539
- gaction = g_action_map_lookup_action (G_ACTION_MAP (totem), "shuffle");
540
- g_simple_action_set_state (G_SIMPLE_ACTION (gaction),
541
- g_variant_new_boolean (totem_playlist_get_shuffle (totem->playlist)));
542
+ action = gtk_action_group_get_action (totem->main_action_group, "repeat-mode");
543
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
544
+ totem_playlist_get_repeat (totem->playlist));
545
+ action = gtk_action_group_get_action (totem->main_action_group, "shuffle-mode");
546
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
547
+ totem_playlist_get_shuffle (totem->playlist));
550
box = GTK_BOX (gtk_builder_get_object (totem->xml, "tmw_buttons_hbox"));
551
@@ -4046,14 +4058,13 @@
552
gtk_box_pack_start (box, item, FALSE, FALSE, 0);
554
/* Fullscreen button */
555
+ action = gtk_action_group_get_action (totem->main_action_group,
557
+ item = gtk_action_create_tool_item (action);
558
/* Translators: this is the tooltip text for the fullscreen button in the controls box in Totem's main window. */
559
- item = GTK_WIDGET (gtk_toggle_tool_button_new ());
560
- gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "view-fullscreen-symbolic");
561
gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (item), _("Fullscreen"));
562
/* Translators: this is the accessibility text for the fullscreen button in the controls box in Totem's main window. */
563
atk_object_set_name (gtk_widget_get_accessible (item), _("Fullscreen"));
564
- gtk_actionable_set_action_name (GTK_ACTIONABLE (item), "app.fullscreen");
565
- gtk_widget_show (item);
566
gtk_box_pack_start (box, item, FALSE, FALSE, 0);
568
/* Sidebar button (Drag'n'Drop) */
569
@@ -4128,6 +4139,7 @@
570
* and skip-* are back in the main action group. */
571
/*totem_action_set_sensitivity ("skip-forward", FALSE);
572
totem_action_set_sensitivity ("skip-backwards", FALSE);*/
573
+ totem_action_set_sensitivity ("fullscreen", FALSE);
575
action_group = GTK_ACTION_GROUP (gtk_builder_get_object (totem->xml, "skip-action-group"));
577
Index: totem-3.8.0/src/totem.c
578
===================================================================
579
--- totem-3.8.0.orig/src/totem.c 2013-05-25 23:02:46.490386347 -0400
580
+++ totem-3.8.0/src/totem.c 2013-05-25 23:03:03.810385623 -0400
583
totem->win = GTK_WIDGET (gtk_builder_get_object (totem->xml, "totem_main_window"));
584
gtk_window_set_hide_titlebar_when_maximized (GTK_WINDOW (totem->win), TRUE);
585
- g_object_bind_property (G_OBJECT (totem), "fullscreen",
586
- G_OBJECT (totem->win), "show-menubar",
587
- G_BINDING_INVERT_BOOLEAN);
590
totem_ui_manager_setup (totem);
592
totem_session_setup (totem, argv);
593
totem_setup_file_monitoring (totem);
594
totem_setup_file_filters ();
595
- totem_app_menu_setup (totem);
596
totem_callback_connect (totem);
598
sidebar_pageid = totem_setup_window (totem);