aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-shell.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-11-27 01:58:50 +0800
committerChristian Persch <chpe@src.gnome.org>2003-11-27 01:58:50 +0800
commited7795be783b4f49314834b9c71813ce37f17280 (patch)
treeb00e0f526fe87bca28205ba05376e02f4a56843b /src/ephy-shell.c
parenta80d75f2179aba2078b0d042fec4c24b4e01f729 (diff)
downloadgsoc2013-epiphany-ed7795be783b4f49314834b9c71813ce37f17280.tar.gz
gsoc2013-epiphany-ed7795be783b4f49314834b9c71813ce37f17280.tar.zst
gsoc2013-epiphany-ed7795be783b4f49314834b9c71813ce37f17280.zip
Make PDM dialogue a singleton.
2003-11-26 Christian Persch <chpe@cvs.gnome.org> * src/ephy-shell.c: (ephy_shell_init), (ephy_shell_finalize), (ephy_shell_get_history_window), (ephy_shell_get_pdm_dialog): * src/ephy-shell.h: * src/pdm-dialog.c: (pdm_dialog_response_cb): * src/pdm-dialog.h: * src/window-commands.c: (window_cmd_edit_personal_data): Make PDM dialogue a singleton.
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r--src/ephy-shell.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index a0d14b4f6..a759d0133 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -32,6 +32,7 @@
#include "ephy-bookmarks-import.h"
#include "ephy-bookmarks-editor.h"
#include "ephy-history-window.h"
+#include "pdm-dialog.h"
#include "ephy-debug.h"
#include "ephy-extensions-manager.h"
#include "toolbar.h"
@@ -71,6 +72,7 @@ struct EphyShellPrivate
EphyExtensionsManager *extensions_manager;
GtkWidget *bme;
GtkWidget *history_window;
+ GObject *pdm_dialog;
GList *del_on_exit;
guint server_timeout;
};
@@ -205,6 +207,7 @@ ephy_shell_init (EphyShell *gs)
gs->priv->bookmarks = NULL;
gs->priv->bme = NULL;
gs->priv->history_window = NULL;
+ gs->priv->pdm_dialog = NULL;
gs->priv->toolbars_model = NULL;
gs->priv->fs_toolbars_model = NULL;
gs->priv->extensions_manager = NULL;
@@ -494,6 +497,12 @@ ephy_shell_finalize (GObject *object)
gtk_widget_destroy (GTK_WIDGET (gs->priv->history_window));
}
+ LOG ("Unref PDM Dialog")
+ if (gs->priv->pdm_dialog)
+ {
+ g_object_unref (gs->priv->pdm_dialog);
+ }
+
LOG ("Unref bookmarks")
if (gs->priv->bookmarks)
{
@@ -787,6 +796,20 @@ ephy_shell_get_history_window (EphyShell *gs)
return gs->priv->history_window;
}
+GObject *
+ephy_shell_get_pdm_dialog (EphyShell *shell)
+{
+ if (shell->priv->pdm_dialog == NULL)
+ {
+ shell->priv->pdm_dialog = g_object_new (EPHY_TYPE_PDM_DIALOG, NULL);
+
+ g_object_add_weak_pointer (shell->priv->pdm_dialog,
+ (gpointer *) &shell->priv->pdm_dialog);
+ }
+
+ return shell->priv->pdm_dialog;
+}
+
void
ephy_shell_delete_on_exit (EphyShell *gs, const char *path)
{