diff options
author | Xan Lopez <xan@src.gnome.org> | 2003-04-09 07:13:37 +0800 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2003-04-09 07:13:37 +0800 |
commit | 6869072199d751b46f6f7757aee792a9f0eca7fe (patch) | |
tree | c693ac5274c53a931337a1df812a32a2fb50336f /src/ephy-shell.c | |
parent | b934ed62cfeb93b86c0f655eff39ff0de63ef7df (diff) | |
download | gsoc2013-epiphany-6869072199d751b46f6f7757aee792a9f0eca7fe.tar.gz gsoc2013-epiphany-6869072199d751b46f6f7757aee792a9f0eca7fe.tar.zst gsoc2013-epiphany-6869072199d751b46f6f7757aee792a9f0eca7fe.zip |
Allow to launch the BME alone, rework some CORBA code, add a .desktop file
Allow to launch the BME alone, rework some CORBA code, add a .desktop
file for the BME. Fixes #102477.
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r-- | src/ephy-shell.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c index 4fc7e26f3..1fa250e66 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -31,6 +31,7 @@ #include "ephy-file-helpers.h" #include "ephy-thread-helpers.h" #include "ephy-bookmarks-import.h" +#include "ephy-bookmarks-editor.h" #include "ephy-debug.h" #include "toolbar.h" @@ -56,6 +57,7 @@ struct EphyShellPrivate Session *session; EphyAutocompletion *autocompletion; EphyBookmarks *bookmarks; + GtkWidget *bme; }; enum @@ -257,6 +259,7 @@ ephy_shell_init (EphyShell *gs) gs->priv = g_new0 (EphyShellPrivate, 1); gs->priv->session = NULL; gs->priv->bookmarks = NULL; + gs->priv->bme = NULL; ephy_shell = gs; g_object_add_weak_pointer (G_OBJECT(ephy_shell), @@ -315,6 +318,12 @@ ephy_shell_finalize (GObject *object) g_object_unref (gs->priv->autocompletion); } + LOG ("Unref Bookmarks Editor"); + if (gs->priv->bme) + { + gtk_widget_destroy (GTK_WIDGET (gs->priv->bme)); + } + LOG ("Unref bookmarks") if (gs->priv->bookmarks) { @@ -614,3 +623,34 @@ ephy_shell_get_bookmarks (EphyShell *gs) return gs->priv->bookmarks; } + +static void +bookmarks_hide_cb (GtkWidget *widget, gpointer data) +{ + LOG ("Unref shell for bookmarks editor") + g_object_unref (ephy_shell); +} + +void +ephy_shell_show_bookmarks_editor (EphyShell *gs) +{ + EphyBookmarks *bookmarks; + + if (gs->priv->bme == NULL) + { + bookmarks = ephy_shell_get_bookmarks (ephy_shell); + g_assert (bookmarks != NULL); + gs->priv->bme = ephy_bookmarks_editor_new (bookmarks); + g_signal_connect (gs->priv->bme, "hide", + G_CALLBACK (bookmarks_hide_cb), NULL); + } + + if (!GTK_WIDGET_VISIBLE (gs->priv->bme)) + { + LOG ("Ref shell for bookmarks editor") + g_object_ref (ephy_shell); + } + + gtk_window_present (GTK_WINDOW (gs->priv->bme)); +} + |