[totem] main: Remove all the sidebar handling code
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] main: Remove all the sidebar handling code
- Date: Fri, 24 Jan 2014 16:27:38 +0000 (UTC)
commit 125dfb175bf496ad223700bfbb8b107fed9690c6
Author: Bastien Nocera <hadess hadess net>
Date: Fri Jan 24 16:59:26 2014 +0100
main: Remove all the sidebar handling code
data/icons/scalable/Makefile.am | 5 +-
data/icons/scalable/view-sidebar-symbolic.svg | 88 ----------
data/totem.ui | 18 +--
po/POTFILES.in | 1 -
src/Makefile.am | 2 -
src/totem-menu.c | 11 --
src/totem-object.c | 83 +--------
src/totem-private.h | 7 +-
src/totem-sidebar.c | 233 -------------------------
src/totem-sidebar.h | 52 ------
src/totem.c | 6 +-
11 files changed, 10 insertions(+), 496 deletions(-)
---
diff --git a/data/icons/scalable/Makefile.am b/data/icons/scalable/Makefile.am
index d04ca16..a2eefb3 100644
--- a/data/icons/scalable/Makefile.am
+++ b/data/icons/scalable/Makefile.am
@@ -1,9 +1,6 @@
tvicondir = $(datadir)/icons/hicolor/scalable/devices/
tvicon_DATA = totem-tv.svg
-sidebaricondir = $(datadir)/icons/hicolor/scalable/actions/
-sidebaricon_DATA = view-sidebar-symbolic.svg
-
-EXTRA_DIST = $(tvicon_DATA) $(sidebaricon_DATA)
+EXTRA_DIST = $(tvicon_DATA)
-include $(top_srcdir)/git.mk
diff --git a/data/totem.ui b/data/totem.ui
index 5c4f92e..6c216cb 100644
--- a/data/totem.ui
+++ b/data/totem.ui
@@ -212,12 +212,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkHPaned" id="tmw_main_pane">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <signal name="size-allocate" handler="main_pane_size_allocated" swapped="no"/>
- <child>
- <object class="GtkStack" id="tmw_main_stack">
+ <object class="GtkStack" id="tmw_main_stack">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<child>
@@ -242,19 +237,10 @@
</packing>
</child>
</object>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">False</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">0</property>
</packing>
</child>
</object>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index cfecc58..4917712 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -27,7 +27,6 @@ src/totem-playlist.c
src/totem-preferences.c
src/totem-properties-main.c
src/totem-properties-view.c
-src/totem-sidebar.c
src/totem-subtitle-encoding.c
src/totem-time-label.c
src/totem-uri.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 87f28b4..990a83b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -67,8 +67,6 @@ libtotem_la_SOURCES = \
totem-playlist.h \
totem-session.c \
totem-session.h \
- totem-sidebar.c \
- totem-sidebar.h \
totem-open-location.c \
totem-open-location.h \
totem-menu.c \
diff --git a/src/totem-menu.c b/src/totem-menu.c
index 6aff5db..7b0010b 100644
--- a/src/totem-menu.c
+++ b/src/totem-menu.c
@@ -32,7 +32,6 @@
#include "totem.h"
#include "totem-interface.h"
#include "totem-private.h"
-#include "totem-sidebar.h"
#include "bacon-video-widget.h"
#include "totem-uri.h"
@@ -42,7 +41,6 @@
G_MODULE_EXPORT void play_action_callback (GtkAction *action, Totem *totem);
G_MODULE_EXPORT void next_chapter_action_callback (GtkAction *action, Totem *totem);
G_MODULE_EXPORT void previous_chapter_action_callback (GtkAction *action, Totem *totem);
-G_MODULE_EXPORT void show_sidebar_action_callback (GtkToggleAction *action, Totem *totem);
G_MODULE_EXPORT void clear_playlist_action_callback (GtkAction *action, Totem *totem);
static void
@@ -519,15 +517,6 @@ previous_chapter_action_callback (GtkAction *action, Totem *totem)
}
void
-show_sidebar_action_callback (GtkToggleAction *action, Totem *totem)
-{
- if (totem_object_is_fullscreen (totem))
- return;
-
- totem_sidebar_toggle (totem, gtk_toggle_action_get_active (action));
-}
-
-void
clear_playlist_action_callback (GtkAction *action, Totem *totem)
{
totem_playlist_clear (totem->playlist);
diff --git a/src/totem-object.c b/src/totem-object.c
index 1cdb633..b0eda84 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -56,7 +56,6 @@
#include "bacon-video-widget.h"
#include "bacon-time-label.h"
#include "totem-time-label.h"
-#include "totem-sidebar.h"
#include "totem-menu.h"
#include "totem-uri.h"
#include "totem-interface.h"
@@ -106,7 +105,6 @@ G_MODULE_EXPORT gboolean seek_slider_released_cb (GtkWidget *widget, GdkEventBut
G_MODULE_EXPORT void volume_button_value_changed_cb (GtkScaleButton *button, gdouble value, TotemObject
*totem);
G_MODULE_EXPORT gboolean window_key_press_event_cb (GtkWidget *win, GdkEventKey *event, TotemObject *totem);
G_MODULE_EXPORT int window_scroll_event_cb (GtkWidget *win, GdkEvent *event, TotemObject *totem);
-G_MODULE_EXPORT void main_pane_size_allocated (GtkWidget *main_pane, GtkAllocation *allocation, TotemObject
*totem);
G_MODULE_EXPORT void fs_exit1_activate_cb (GtkButton *button, TotemObject *totem);
enum {
@@ -834,11 +832,7 @@ totem_object_add_sidebar_page (TotemObject *totem,
const char *title,
GtkWidget *main_widget)
{
- totem_sidebar_add_page (totem,
- page_id,
- title,
- NULL,
- main_widget);
+ g_warning ("totem_object_add_sidebar_page is obsolete");
}
/**
@@ -854,7 +848,7 @@ void
totem_object_remove_sidebar_page (TotemObject *totem,
const char *page_id)
{
- totem_sidebar_remove_page (totem, page_id);
+ /* Empty */
}
void
@@ -1117,8 +1111,6 @@ totem_object_show_error_and_exit (const char *title,
static void
totem_object_save_size (TotemObject *totem)
{
- GtkPaned *item;
-
if (totem->bvw == NULL)
return;
@@ -1126,11 +1118,7 @@ totem_object_save_size (TotemObject *totem)
return;
/* Save the size of the video widget */
- item = GTK_PANED (gtk_builder_get_object (totem->xml, "tmw_main_pane"));
- gtk_window_get_size (GTK_WINDOW (totem->win), &totem->window_w,
- &totem->window_h);
- totem->sidebar_w = totem->window_w
- - gtk_paned_get_position (item);
+ gtk_window_get_size (GTK_WINDOW (totem->win), &totem->window_w, &totem->window_h);
}
static void
@@ -1152,8 +1140,6 @@ totem_object_save_state (TotemObject *totem, const char *page_id)
"window_h", totem->window_h);
g_key_file_set_boolean (keyfile, "State",
"maximised", totem->maximised);
- g_key_file_set_integer (keyfile, "State",
- "sidebar_w", totem->sidebar_w);
contents = g_key_file_to_data (keyfile, NULL, NULL);
g_key_file_free (keyfile);
@@ -1181,11 +1167,6 @@ void
totem_object_exit (TotemObject *totem)
{
GdkDisplay *display = NULL;
- char *page_id;
-
- /* Save the page ID before we close the plugins, otherwise
- * we'll never save it properly */
- page_id = totem_sidebar_get_current_page (totem);
/* Shut down the plugins first, allowing them to display modal dialogues (etc.) without threat of
being killed from another thread */
if (totem != NULL && totem->engine != NULL)
@@ -1220,9 +1201,6 @@ totem_object_exit (TotemObject *totem)
if (totem->bvw)
bacon_video_widget_close (totem->bvw);
- totem_object_save_state (totem, page_id);
- g_free (page_id);
-
totem_sublang_exit (totem);
totem_destroy_file_filters ();
@@ -3380,8 +3358,6 @@ totem_object_handle_scroll (TotemObject *totem,
gboolean
window_key_press_event_cb (GtkWidget *win, GdkEventKey *event, TotemObject *totem)
{
- gboolean sidebar_handles_kbd;
-
/* Shortcuts disabled? */
if (totem->disable_kbd_shortcuts != FALSE)
return FALSE;
@@ -3390,20 +3366,6 @@ window_key_press_event_cb (GtkWidget *win, GdkEventKey *event, TotemObject *tote
if (!g_str_equal (totem_object_get_main_page (totem), "player"))
return FALSE;
- /* Check whether the sidebar needs the key events */
- if (event->type == GDK_KEY_PRESS) {
- if (totem_sidebar_is_focused (totem, &sidebar_handles_kbd) != FALSE) {
- /* Make Escape pass the focus to the video widget */
- if (sidebar_handles_kbd == FALSE &&
- event->keyval == GDK_KEY_Escape)
- gtk_widget_grab_focus (GTK_WIDGET (totem->bvw));
- return FALSE;
- }
- } else {
- if (totem_sidebar_is_focused (totem, NULL) != FALSE)
- return FALSE;
- }
-
/* Special case Eject, Open, Open URI,
* seeking and zoom keyboard shortcuts */
if (event->state != 0
@@ -3509,27 +3471,11 @@ update_buttons (TotemObject *totem)
}
void
-main_pane_size_allocated (GtkWidget *main_pane, GtkAllocation *allocation, TotemObject *totem)
-{
- gulong handler_id;
-
- if (!totem->maximised || gtk_widget_get_mapped (totem->win)) {
- handler_id = g_signal_handler_find (main_pane,
- G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
- 0, 0, NULL,
- main_pane_size_allocated, totem);
- g_signal_handler_disconnect (main_pane, handler_id);
-
- gtk_paned_set_position (GTK_PANED (main_pane), allocation->width - totem->sidebar_w);
- }
-}
-
-char *
totem_setup_window (TotemObject *totem)
{
GKeyFile *keyfile;
int w, h;
- char *filename, *page_id;
+ char *filename;
GError *err = NULL;
GtkWidget *vbox;
GdkRGBA black;
@@ -3538,10 +3484,8 @@ totem_setup_window (TotemObject *totem)
keyfile = g_key_file_new ();
if (g_key_file_load_from_file (keyfile, filename,
G_KEY_FILE_NONE, NULL) == FALSE) {
- totem->sidebar_w = 0;
w = DEFAULT_WINDOW_W;
h = DEFAULT_WINDOW_H;
- page_id = NULL;
g_free (filename);
} else {
g_free (filename);
@@ -3566,22 +3510,6 @@ totem_setup_window (TotemObject *totem)
g_error_free (err);
err = NULL;
}
-
- page_id = g_key_file_get_string (keyfile, "State",
- "sidebar_page", &err);
- if (err != NULL) {
- g_error_free (err);
- page_id = NULL;
- err = NULL;
- }
-
- totem->sidebar_w = g_key_file_get_integer (keyfile, "State",
- "sidebar_w", &err);
- if (err != NULL) {
- g_error_free (err);
- totem->sidebar_w = 0;
- }
- g_key_file_free (keyfile);
}
if (w > 0 && h > 0 && totem->maximised == FALSE) {
@@ -3598,8 +3526,7 @@ totem_setup_window (TotemObject *totem)
gdk_rgba_parse (&black, "Black");
gtk_widget_override_background_color (vbox, (GTK_STATE_FLAG_FOCUSED << 1), &black);
- totem_sidebar_setup (totem, FALSE);
- return page_id;
+ return;
}
static gboolean
diff --git a/src/totem-private.h b/src/totem-private.h
index 160060d..cc1ffe4 100644
--- a/src/totem-private.h
+++ b/src/totem-private.h
@@ -104,11 +104,6 @@ struct _TotemObject {
GtkWidget *plugins;
TotemPluginsEngine *engine;
- /* Sidebar */
- GtkWidget *sidebar;
- gboolean sidebar_shown;
- int sidebar_w;
-
/* Seek */
GtkWidget *seek;
GtkAdjustment *seekadj;
@@ -182,7 +177,7 @@ G_GNUC_NORETURN void totem_object_show_error_and_exit (const char *title, const
void show_controls (Totem *totem, gboolean was_fullscreen);
-char *totem_setup_window (Totem *totem);
+void totem_setup_window (Totem *totem);
void totem_callback_connect (Totem *totem);
void playlist_widget_setup (Totem *totem);
void video_widget_create (Totem *totem);
diff --git a/src/totem.c b/src/totem.c
index 87f7658..8f02971 100644
--- a/src/totem.c
+++ b/src/totem.c
@@ -47,7 +47,6 @@
#include "totem-menu.h"
#include "totem-uri.h"
#include "totem-preferences.h"
-#include "totem-sidebar.h"
#include "totem-session.h"
#include "video-utils.h"
#include "totem-rtl-helpers.h"
@@ -86,7 +85,6 @@ static void
app_init (Totem *totem, char **argv)
{
GtkSettings *gtk_settings;
- char *sidebar_pageid;
if (gtk_clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
g_warning ("gtk-clutter failed to initialise, expect problems from here on.");
@@ -126,7 +124,7 @@ app_init (Totem *totem, char **argv)
totem_app_menu_setup (totem);
/* totem_callback_connect (totem); XXX we do this later now, so it might look ugly for a short while
*/
- sidebar_pageid = totem_setup_window (totem);
+ totem_setup_window (totem);
/* Show ! (again) the video widget this time. */
video_widget_create (totem);
@@ -165,8 +163,6 @@ app_init (Totem *totem, char **argv)
/* Initialise all the plugins, and set the default page, in case
* it comes from a plugin */
totem_object_plugins_init (totem);
- totem_sidebar_set_current_page (totem, sidebar_pageid, FALSE);
- g_free (sidebar_pageid);
if (optionstate.filenames == NULL) {
if (totem_session_try_restore (totem) == FALSE)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]