aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-03-19 03:13:23 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-03-19 03:13:23 +0800
commitd012141a9d6dc6e0b374b4e992e18239b21501dd (patch)
tree430ad3fc3ab6fdda82d91afe2acaadc081ac8c1a /src
parentd248386941ce108b1e99d1a553682d5af791a628 (diff)
downloadgsoc2013-epiphany-d012141a9d6dc6e0b374b4e992e18239b21501dd.tar
gsoc2013-epiphany-d012141a9d6dc6e0b374b4e992e18239b21501dd.tar.gz
gsoc2013-epiphany-d012141a9d6dc6e0b374b4e992e18239b21501dd.tar.bz2
gsoc2013-epiphany-d012141a9d6dc6e0b374b4e992e18239b21501dd.tar.lz
gsoc2013-epiphany-d012141a9d6dc6e0b374b4e992e18239b21501dd.tar.xz
gsoc2013-epiphany-d012141a9d6dc6e0b374b4e992e18239b21501dd.tar.zst
gsoc2013-epiphany-d012141a9d6dc6e0b374b4e992e18239b21501dd.zip
Reimplement ephystate using xml and make it easier to use. -> remove some
2003-03-18 Marco Pesenti Gritti <marco@it.gnome.org> * lib/ephy-dialog.c: (setup_default_size): * lib/ephy-state.c: (ephy_states_load), (ephy_states_save), (find_by_name), (ensure_states), (ephy_state_window_set_size), (ephy_state_window_save_size), (window_configure_event_cb), (window_state_event_cb), (ephy_state_add_window), (ephy_state_save): * lib/ephy-state.h: * lib/ephy-types.h: * src/ephy-shell.c: (ephy_shell_finalize): * src/ephy-window.c: (setup_window), (ephy_window_init), (ephy_window_show): * src/prefs-dialog.c: (prefs_dialog_init): Reimplement ephystate using xml and make it easier to use. -> remove some duplicate code
Diffstat (limited to 'src')
-rw-r--r--src/ephy-shell.c2
-rw-r--r--src/ephy-window.c45
-rw-r--r--src/prefs-dialog.c19
3 files changed, 9 insertions, 57 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 69af9e562..4fc7e26f3 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -21,6 +21,7 @@
#endif
#include "ephy-shell.h"
+#include "ephy-state.h"
#include "ephy-embed-shell.h"
#include "eel-gconf-extensions.h"
#include "ephy-prefs.h"
@@ -324,6 +325,7 @@ ephy_shell_finalize (GObject *object)
g_free (gs->priv);
+ ephy_state_save ();
ephy_file_helpers_shutdown ();
ephy_node_system_shutdown ();
diff --git a/src/ephy-window.c b/src/ephy-window.c
index c0df5980f..5355d75f9 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -268,7 +268,6 @@ struct EphyWindowPrivate
EphyDialog *history_dialog;
EphyDialog *history_sidebar;
EmbedChromeMask chrome_mask;
- gboolean has_default_size;
gboolean closing;
};
@@ -378,36 +377,6 @@ ephy_window_selection_received_cb (GtkWidget *widget,
}
static void
-save_window_state (GtkWidget *win)
-{
- EphyWindow *window = EPHY_WINDOW (win);
-
- if (!(window->priv->chrome_mask & EMBED_CHROME_OPENASPOPUP) &&
- !(window->priv->chrome_mask & EMBED_CHROME_OPENASFULLSCREEN))
- {
- ephy_state_save_window (win, "main_window");
- }
-}
-
-static gboolean
-ephy_window_configure_event_cb (GtkWidget *widget,
- GdkEventConfigure *event,
- gpointer data)
-{
- save_window_state (widget);
- return FALSE;
-}
-
-static gboolean
-ephy_window_state_event_cb (GtkWidget *widget,
- GdkEventWindowState *event,
- gpointer data)
-{
- save_window_state (widget);
- return FALSE;
-}
-
-static void
add_widget (EggMenuMerge *merge, GtkWidget *widget, EphyWindow *window)
{
if (GTK_IS_MENU_SHELL (widget))
@@ -478,10 +447,6 @@ setup_window (EphyWindow *window)
"key-press-event",
G_CALLBACK(ephy_window_key_press_event_cb),
window);
- g_signal_connect (window, "configure_event",
- G_CALLBACK (ephy_window_configure_event_cb), NULL);
- g_signal_connect (window, "window_state_event",
- G_CALLBACK (ephy_window_state_event_cb), NULL);
g_signal_connect (window,
"selection-received",
G_CALLBACK (ephy_window_selection_received_cb),
@@ -530,7 +495,6 @@ ephy_window_init (EphyWindow *window)
window->priv->active_tab = NULL;
window->priv->chrome_mask = 0;
window->priv->closing = FALSE;
- window->priv->has_default_size = FALSE;
window->priv->ppview_toolbar = NULL;
window->priv->toolbars = NULL;
@@ -973,12 +937,13 @@ ephy_window_show (GtkWidget *widget)
tab = ephy_window_get_active_tab (window);
if (tab) ephy_tab_get_size (tab, &w, &h);
- if (!window->priv->has_default_size && w == -1 && h == -1)
+ if (!(window->priv->chrome_mask & EMBED_CHROME_OPENASPOPUP) &&
+ !(window->priv->chrome_mask & EMBED_CHROME_OPENASFULLSCREEN) &&
+ !GTK_WIDGET_VISIBLE (widget))
{
- ephy_state_load_window (GTK_WIDGET(window),
+ ephy_state_add_window (GTK_WIDGET(window),
"main_window",
- 600, 500, TRUE);
- window->priv->has_default_size = TRUE;
+ 600, 500);
}
GTK_WIDGET_CLASS (parent_class)->show (widget);
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 813821cb6..c94998d60 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -298,16 +298,6 @@ prefs_build_notebook (PrefsDialog *pd)
}
}
-static gboolean
-prefs_dialog_configure_event_cb (GtkWidget *widget,
- GdkEventConfigure *event,
- gpointer data)
-{
- ephy_state_save_window (widget, "prefs_dialog");
-
- return FALSE;
-}
-
static void
prefs_dialog_init (PrefsDialog *pd)
{
@@ -316,13 +306,8 @@ prefs_dialog_init (PrefsDialog *pd)
gtk_window_set_title (GTK_WINDOW(pd), _("Preferences"));
gtk_dialog_set_has_separator (GTK_DIALOG(pd), FALSE);
- ephy_state_load_window (GTK_WIDGET(pd),
- "prefs_dialog", -1, -1, FALSE);
-
- g_signal_connect (pd,
- "configure_event",
- G_CALLBACK (prefs_dialog_configure_event_cb),
- NULL);
+ ephy_state_add_window (GTK_WIDGET(pd),
+ "prefs_dialog", -1, -1);
prefs_build_notebook (pd);
}