diff options
author | Bastien Nocera <hadess@hadess.net> | 2007-02-23 11:10:12 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@src.gnome.org> | 2007-02-23 11:10:12 +0000 |
commit | 051e235dde2ac827deb351797f054a5673168e1e (patch) | |
tree | 574f1aec25f5306bbf64a4d1476f08fe2964c39f | |
parent | 317a09c014e899f929afb29b0afa798be7d8a47f (diff) | |
download | totem-051e235dde2ac827deb351797f054a5673168e1e.tar.gz |
Move _new stuff to _init Fix first-time sidebar resize, as pointed out by
2007-02-23 Bastien Nocera <hadess@hadess.net>
* src/totem-playlist.c: (totem_playlist_init),
(totem_playlist_new): Move _new stuff to _init
* src/totem-sidebar.c: (totem_sidebar_setup): Fix first-time sidebar
resize, as pointed out by Eric Anderson <ejona86@gmail.com>
(Closes: #379742)
svn path=/trunk/; revision=4064
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/totem-playlist.c | 62 | ||||
-rw-r--r-- | src/totem-sidebar.c | 1 |
3 files changed, 41 insertions, 30 deletions
@@ -1,3 +1,11 @@ +2007-02-23 Bastien Nocera <hadess@hadess.net> + + * src/totem-playlist.c: (totem_playlist_init), + (totem_playlist_new): Move _new stuff to _init + * src/totem-sidebar.c: (totem_sidebar_setup): Fix first-time sidebar + resize, as pointed out by Eric Anderson <ejona86@gmail.com> + (Closes: #379742) + ============ Version 2.17.92 2007-02-20 Bastien Nocera <hadess@hadess.net> diff --git a/src/totem-playlist.c b/src/totem-playlist.c index bed486d8b..f86d0ab93 100644 --- a/src/totem-playlist.c +++ b/src/totem-playlist.c @@ -1458,23 +1458,6 @@ totem_playlist_entry_parsed (TotemPlParser *parser, } static void -totem_playlist_init (TotemPlaylist *playlist) -{ - playlist->_priv = g_new0 (TotemPlaylistPrivate, 1); - playlist->_priv->parser = totem_pl_parser_new (); - - totem_pl_parser_add_ignored_scheme (playlist->_priv->parser, "dvd:"); - totem_pl_parser_add_ignored_scheme (playlist->_priv->parser, "cdda:"); - totem_pl_parser_add_ignored_scheme (playlist->_priv->parser, "vcd:"); - totem_pl_parser_add_ignored_scheme (playlist->_priv->parser, "cd:"); - - g_signal_connect (G_OBJECT (playlist->_priv->parser), - "entry", - G_CALLBACK (totem_playlist_entry_parsed), - playlist); -} - -static void totem_playlist_finalize (GObject *object) { TotemPlaylist *playlist = TOTEM_PLAYLIST (object); @@ -1494,23 +1477,30 @@ totem_playlist_finalize (GObject *object) G_OBJECT_CLASS (totem_playlist_parent_class)->finalize (object); } -GtkWidget* -totem_playlist_new (void) +static void +totem_playlist_init (TotemPlaylist *playlist) { - TotemPlaylist *playlist; GtkWidget *container, *item; char *filename; - playlist = TOTEM_PLAYLIST (g_object_new (TOTEM_TYPE_PLAYLIST, NULL)); + playlist->_priv = g_new0 (TotemPlaylistPrivate, 1); + playlist->_priv->parser = totem_pl_parser_new (); - playlist->_priv->xml = totem_interface_load ("playlist.glade", - _("playlist"), TRUE, NULL); + totem_pl_parser_add_ignored_scheme (playlist->_priv->parser, "dvd:"); + totem_pl_parser_add_ignored_scheme (playlist->_priv->parser, "cdda:"); + totem_pl_parser_add_ignored_scheme (playlist->_priv->parser, "vcd:"); + totem_pl_parser_add_ignored_scheme (playlist->_priv->parser, "cd:"); + + g_signal_connect (G_OBJECT (playlist->_priv->parser), + "entry", + G_CALLBACK (totem_playlist_entry_parsed), + playlist); + + playlist->_priv->xml = totem_interface_load_with_root ("playlist.glade", + "vbox4", _("playlist"), TRUE, NULL); if (playlist->_priv->xml == NULL) - { - totem_playlist_finalize (G_OBJECT (playlist)); - return NULL; - } + return; /* popup menu */ playlist->_priv->action_group = @@ -1527,7 +1517,7 @@ totem_playlist_new (void) filename = totem_interface_get_full_path ("playlist-ui.xml"); if (!gtk_ui_manager_add_ui_from_file (playlist->_priv->ui_manager, filename, NULL)) { totem_playlist_finalize (G_OBJECT (playlist)); - return NULL; + return; } g_free (filename); @@ -1558,10 +1548,8 @@ totem_playlist_new (void) G_CALLBACK (totem_playlist_key_press), playlist); /* Reparent the vbox */ - item = glade_xml_get_widget (playlist->_priv->xml, "dialog-vbox1"); container = glade_xml_get_widget (playlist->_priv->xml, "vbox4"); g_object_ref (container); - gtk_container_remove (GTK_CONTAINER (item), container); gtk_box_pack_start (GTK_BOX (playlist), container, TRUE, /* expand */ @@ -1580,6 +1568,20 @@ totem_playlist_new (void) gtk_widget_show_all (GTK_WIDGET (playlist)); + +} + +GtkWidget* +totem_playlist_new (void) +{ + TotemPlaylist *playlist; + + playlist = TOTEM_PLAYLIST (g_object_new (TOTEM_TYPE_PLAYLIST, NULL)); + if (playlist->_priv->xml == NULL || playlist->_priv->ui_manager == NULL) { + totem_playlist_finalize (G_OBJECT (playlist)); + return NULL; + } + return GTK_WIDGET (playlist); } diff --git a/src/totem-sidebar.c b/src/totem-sidebar.c index 2960074c5..3fa6ea9c7 100644 --- a/src/totem-sidebar.c +++ b/src/totem-sidebar.c @@ -129,6 +129,7 @@ totem_sidebar_setup (Totem *totem, gboolean visible, const char *page_id) G_CALLBACK (toggle_sidebar_from_sidebar), totem); gtk_widget_show_all (totem->sidebar); + gtk_widget_realize (totem->sidebar); if (!visible) gtk_widget_hide (totem->sidebar); |