aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Bordoley <bordoley@msu.edu>2003-05-14 21:41:46 +0800
committerDave Bordoley <Bordoley@src.gnome.org>2003-05-14 21:41:46 +0800
commit9d573dc9d9f047d1ec4bbb0776f3c7bc5e83768e (patch)
tree7c21262dfeb545257f7882a76c27bc7a090cf49b
parentab4fc64696bd1f23bc41943b91939b77a86e164a (diff)
downloadgsoc2013-epiphany-9d573dc9d9f047d1ec4bbb0776f3c7bc5e83768e.tar
gsoc2013-epiphany-9d573dc9d9f047d1ec4bbb0776f3c7bc5e83768e.tar.gz
gsoc2013-epiphany-9d573dc9d9f047d1ec4bbb0776f3c7bc5e83768e.tar.bz2
gsoc2013-epiphany-9d573dc9d9f047d1ec4bbb0776f3c7bc5e83768e.tar.lz
gsoc2013-epiphany-9d573dc9d9f047d1ec4bbb0776f3c7bc5e83768e.tar.xz
gsoc2013-epiphany-9d573dc9d9f047d1ec4bbb0776f3c7bc5e83768e.tar.zst
gsoc2013-epiphany-9d573dc9d9f047d1ec4bbb0776f3c7bc5e83768e.zip
Add some flags so that we can choose to save position or size or both.
2003-05-14 David Bordoley <bordoley@msu.edu> * lib/ephy-state.c: (ephy_state_add_window): * lib/ephy-state.h: (EphyStateWindowFlags): Add some flags so that we can choose to save position or size or both. * lib/ephy-dialog.c: (setup_default_size): * src/ephy-window.c: (ephy_window_show): * src/window-commands.c: (window_cmd_edit_toolbar): * src/bookmarks/ephy-bookmark-properties.c: (build_ui): * src/bookmarks/ephy-new-bookmark.c: (ephy_new_bookmark_construct): Only save size for dialogs and main windows. * src/ephy-history-window.c: (ephy_history_window_construct): * src/bookmarks/ephy-bookmarks-editor.c: (ephy_bookmarks_editor_construct): Save size and position.
-rw-r--r--ChangeLog22
-rw-r--r--lib/ephy-dialog.c3
-rw-r--r--lib/ephy-state.c14
-rw-r--r--lib/ephy-state.h9
-rw-r--r--src/bookmarks/ephy-bookmark-properties.c3
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c3
-rw-r--r--src/bookmarks/ephy-new-bookmark.c3
-rw-r--r--src/ephy-history-window.c3
-rw-r--r--src/ephy-window.c3
-rw-r--r--src/window-commands.c3
10 files changed, 55 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index e6e4752d4..62f07f0bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2003-05-14 David Bordoley <bordoley@msu.edu>
+
+ * lib/ephy-state.c: (ephy_state_add_window):
+ * lib/ephy-state.h: (EphyStateWindowFlags):
+
+ Add some flags so that we can choose to save
+ position or size or both.
+
+ * lib/ephy-dialog.c: (setup_default_size):
+ * src/ephy-window.c: (ephy_window_show):
+ * src/window-commands.c: (window_cmd_edit_toolbar):
+ * src/bookmarks/ephy-bookmark-properties.c: (build_ui):
+ * src/bookmarks/ephy-new-bookmark.c: (ephy_new_bookmark_construct):
+
+ Only save size for dialogs and main windows.
+
+ * src/ephy-history-window.c: (ephy_history_window_construct):
+ * src/bookmarks/ephy-bookmarks-editor.c:
+ (ephy_bookmarks_editor_construct):
+
+ Save size and position.
+
2003-05-14 Xan Lopez <xan@masilla.org>
* src/bookmarks/ephy-new-bookmark.c: (duplicate_dialog_construct):
diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c
index 7262bc59c..8bdfc5330 100644
--- a/lib/ephy-dialog.c
+++ b/lib/ephy-dialog.c
@@ -841,7 +841,8 @@ static void
setup_default_size (EphyDialog *dialog)
{
ephy_state_add_window (dialog->priv->dialog,
- dialog->priv->name, -1, -1);
+ dialog->priv->name, -1, -1,
+ EPHY_STATE_WINDOW_SAVE_SIZE);
}
static gint
diff --git a/lib/ephy-state.c b/lib/ephy-state.c
index bfab0e916..d6413ff76 100644
--- a/lib/ephy-state.c
+++ b/lib/ephy-state.c
@@ -303,7 +303,8 @@ void
ephy_state_add_window (GtkWidget *window,
const char *name,
int default_width,
- int default_height)
+ int default_height,
+ EphyStateWindowFlags flags)
{
EphyNode *node;
@@ -358,8 +359,15 @@ ephy_state_add_window (GtkWidget *window,
g_value_unset (&value);
}
- ephy_state_window_set_size (window, node);
- ephy_state_window_set_position (window, node);
+ if (flags & EPHY_STATE_WINDOW_SAVE_SIZE)
+ {
+ ephy_state_window_set_size (window, node);
+ }
+
+ if (flags & EPHY_STATE_WINDOW_SAVE_POSITION)
+ {
+ ephy_state_window_set_position (window, node);
+ }
g_signal_connect_object (window, "configure_event",
G_CALLBACK (window_configure_event_cb), node, 0);
diff --git a/lib/ephy-state.h b/lib/ephy-state.h
index 9d6388ac4..0604ea0d5 100644
--- a/lib/ephy-state.h
+++ b/lib/ephy-state.h
@@ -26,10 +26,17 @@
G_BEGIN_DECLS
+typedef enum
+{
+ EPHY_STATE_WINDOW_SAVE_SIZE = 1 << 0,
+ EPHY_STATE_WINDOW_SAVE_POSITION = 1 << 1
+} EphyStateWindowFlags;
+
void ephy_state_add_window (GtkWidget *window,
const char *name,
int default_width,
- int default_heigth);
+ int default_heigth,
+ EphyStateWindowFlags flags);
void ephy_state_add_paned (GtkWidget *paned,
const char *name,
diff --git a/src/bookmarks/ephy-bookmark-properties.c b/src/bookmarks/ephy-bookmark-properties.c
index 95b956e67..5445a7bfe 100644
--- a/src/bookmarks/ephy-bookmark-properties.c
+++ b/src/bookmarks/ephy-bookmark-properties.c
@@ -325,7 +325,8 @@ build_ui (EphyBookmarkProperties *editor)
ephy_state_add_window (GTK_WIDGET(editor),
"bookmark_properties",
- 290, 280);
+ 290, 280,
+ EPHY_STATE_WINDOW_SAVE_SIZE);
update_window_title (editor);
set_window_icon (editor);
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 964fd301c..de9520d2e 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -1272,7 +1272,8 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
ephy_state_add_window (GTK_WIDGET(editor),
"bookmarks_editor",
- 450, 400);
+ 450, 400,
+ EPHY_STATE_WINDOW_SAVE_SIZE | EPHY_STATE_WINDOW_SAVE_POSITION);
ephy_state_add_paned (GTK_WIDGET (hpaned),
"bookmarks_paned",
130);
diff --git a/src/bookmarks/ephy-new-bookmark.c b/src/bookmarks/ephy-new-bookmark.c
index 973cb489d..b6fd1dcdf 100644
--- a/src/bookmarks/ephy-new-bookmark.c
+++ b/src/bookmarks/ephy-new-bookmark.c
@@ -256,7 +256,8 @@ ephy_new_bookmark_construct (EphyNewBookmark *editor)
ephy_state_add_window (GTK_WIDGET(editor),
"new_bookmark",
- 280, 240);
+ 280, 240,
+ EPHY_STATE_WINDOW_SAVE_SIZE);
gtk_window_set_title (GTK_WINDOW (editor),
_("New Bookmark"));
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c
index 8fd0115e1..8183cda73 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-window.c
@@ -1085,7 +1085,8 @@ ephy_history_window_construct (EphyHistoryWindow *editor)
ephy_state_add_window (GTK_WIDGET (editor),
"history_window",
- 450, 400);
+ 450, 400,
+ EPHY_STATE_WINDOW_SAVE_SIZE | EPHY_STATE_WINDOW_SAVE_POSITION);
ephy_state_add_paned (GTK_WIDGET (hpaned),
"history_paned",
130);
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 7aa87e8e7..e6e17c12b 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -968,7 +968,8 @@ ephy_window_show (GtkWidget *widget)
{
ephy_state_add_window (widget,
"main_window",
- 600, 500);
+ 600, 500,
+ EPHY_STATE_WINDOW_SAVE_SIZE);
}
if ((window->priv->chrome_mask & EMBED_CHROME_OPENASPOPUP) &&
diff --git a/src/window-commands.c b/src/window-commands.c
index 1647d8fd2..727429106 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -711,7 +711,8 @@ window_cmd_edit_toolbar (EggAction *action,
G_CALLBACK (toolbar_editor_response_cb), NULL);
ephy_state_add_window (dialog,
"toolbar_editor",
- 500, 330);
+ 500, 330,
+ EPHY_STATE_WINDOW_SAVE_SIZE);
gtk_widget_show (dialog);
egg_editable_toolbar_set_edit_mode (EGG_EDITABLE_TOOLBAR (t), TRUE);