summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2014-08-17 19:45:36 +0200
committerBastien Nocera <hadess@hadess.net>2014-08-17 21:19:03 +0200
commit11af15829345b6baea8db1af99aa0f4ac20e6ca4 (patch)
treec543fdd6f28f49e2bb55e58508f19ff9be7cc240 /src
parent3a7b7db040045338c4881ab08eb9c18b8dca3aef (diff)
downloadtotem-11af15829345b6baea8db1af99aa0f4ac20e6ca4.tar.gz
main: Postpone loading library after playback
https://bugzilla.gnome.org/show_bug.cgi?id=728716
Diffstat (limited to 'src')
-rw-r--r--src/totem-grilo.c15
-rw-r--r--src/totem-grilo.h1
-rw-r--r--src/totem-object.c6
-rw-r--r--src/totem.c2
4 files changed, 22 insertions, 2 deletions
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index ba1236468..26616b5fb 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -63,6 +63,8 @@ struct _TotemGriloPrivate {
Totem *totem;
GtkWindow *main_window;
+ gboolean plugins_loaded;
+
GrlSource *local_metadata_src;
GrlSource *metadata_store_src;
GrlSource *bookmarks_src;
@@ -2488,6 +2490,18 @@ totem_grilo_finalize (GObject *object)
G_OBJECT_CLASS (totem_grilo_parent_class)->finalize (object);
}
+void
+totem_grilo_start (TotemGrilo *self)
+{
+ if (self->priv->plugins_loaded)
+ return;
+
+ g_debug ("TotemGrilo: Loading plugins");
+
+ load_grilo_plugins (self);
+ self->priv->plugins_loaded = TRUE;
+}
+
static void
totem_grilo_constructed (GObject *object)
{
@@ -2498,7 +2512,6 @@ totem_grilo_constructed (GObject *object)
setup_ui (self);
grl_init (0, NULL);
setup_config (self);
- load_grilo_plugins (self);
}
gboolean
diff --git a/src/totem-grilo.h b/src/totem-grilo.h
index dcabc2df0..693511bec 100644
--- a/src/totem-grilo.h
+++ b/src/totem-grilo.h
@@ -65,6 +65,7 @@ typedef enum{
GType totem_grilo_get_type (void) G_GNUC_CONST;
GtkWidget* totem_grilo_new (TotemObject *totem,
GtkWidget *header);
+void totem_grilo_start (TotemGrilo *self);
void totem_grilo_back_button_clicked (TotemGrilo *self);
gboolean totem_grilo_get_show_back_button (TotemGrilo *self);
void totem_grilo_set_current_page (TotemGrilo *self,
diff --git a/src/totem-object.c b/src/totem-object.c
index 2be564b52..59929b3a6 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -914,8 +914,11 @@ void
totem_object_set_main_page (TotemObject *totem,
const char *page_id)
{
- if (g_strcmp0 (page_id, gtk_stack_get_visible_child_name (GTK_STACK (totem->stack))) == 0)
+ if (g_strcmp0 (page_id, gtk_stack_get_visible_child_name (GTK_STACK (totem->stack))) == 0) {
+ if (g_strcmp0 (page_id, "grilo") == 0)
+ totem_grilo_start (TOTEM_GRILO (totem->grilo));
return;
+ }
gtk_stack_set_visible_child_full (GTK_STACK (totem->stack), page_id, GTK_STACK_TRANSITION_TYPE_NONE);
@@ -961,6 +964,7 @@ totem_object_set_main_page (TotemObject *totem,
gtk_widget_hide (totem->gear_button);
if (totem_grilo_get_current_page (TOTEM_GRILO (totem->grilo)) == TOTEM_GRILO_PAGE_RECENT)
gtk_widget_show (totem->add_button);
+ totem_grilo_start (TOTEM_GRILO (totem->grilo));
}
}
diff --git a/src/totem.c b/src/totem.c
index 8c4df1e99..7d1f68731 100644
--- a/src/totem.c
+++ b/src/totem.c
@@ -152,9 +152,11 @@ app_init (Totem *totem, char **argv)
totem_object_plugins_init (totem);
if (optionstate.filenames == NULL) {
+ totem_object_set_main_page (totem, "grilo");
if (totem_session_try_restore (totem) == FALSE)
totem_object_set_mrl (totem, NULL, NULL);
} else {
+ totem_object_set_main_page (totem, "player");
if (totem_object_open_files (totem, optionstate.filenames))
totem_object_play_pause (totem);
else