Index: gossip.schemas.in
===================================================================
RCS file: /cvs/gnome/gossip/gossip.schemas.in,v
retrieving revision 1.16
diff -u -3 -p -r1.16 gossip.schemas.in
--- gossip.schemas.in 22 Jan 2004 23:04:59 -0000 1.16
+++ gossip.schemas.in 14 Nov 2004 08:06:16 -0000
@@ -73,6 +73,34 @@
+ /schemas/apps/gossip/ui/chat_window_width
+ /apps/gossip/ui/chat_window_width
+ gossip
+ int
+ 350
+
+ Width of the chat window
+
+ The width of the chat window.
+
+
+
+
+
+ /schemas/apps/gossip/ui/chat_window_height
+ /apps/gossip/ui/chat_window_height
+ gossip
+ int
+ 250
+
+ Height of chat window
+
+ The height of the chat window.
+
+
+
+
+
/schemas/apps/gossip/ui/main_window_width
/apps/gossip/ui/main_window_width
gossip
Index: src/gossip-chat-window.c
===================================================================
RCS file: /cvs/gnome/gossip/src/gossip-chat-window.c,v
retrieving revision 1.44
diff -u -3 -p -r1.44 gossip-chat-window.c
--- src/gossip-chat-window.c 16 Sep 2004 14:18:34 -0000 1.44
+++ src/gossip-chat-window.c 14 Nov 2004 08:06:17 -0000
@@ -24,6 +24,7 @@
#include
#include
#include
+#include
#include
#include
#include "gossip-app.h"
@@ -59,6 +60,7 @@ static void chat_window_update_status
GossipChat *chat);
static void chat_window_update_title (GossipChatWindow *window);
static void chat_window_update_menu (GossipChatWindow *window);
+static void chat_window_save_size (GossipChatWindow *window);
static void chat_window_clear_activate_cb (GtkWidget *menuitem,
GossipChatWindow *window);
static void chat_window_info_activate_cb (GtkWidget *menuitem,
@@ -131,6 +133,8 @@ static void chat_window_drag_data_rec
/* Called from Glade, so it shouldn't be static */
GtkWidget * chat_window_create_notebook (gpointer data);
+extern GConfClient *gconf_client;
+
struct _GossipChatWindowPriv {
GList *chats;
GList *chats_new_msg;
@@ -636,6 +640,30 @@ chat_window_update_menu (GossipChatWindo
}
static void
+chat_window_save_size (GossipChatWindow *window)
+{
+ GossipChatWindowPriv *priv;
+
+ if (GOSSIP_IS_CHAT_WINDOW (window)) {
+ gint width, height;
+
+ priv = window->priv;
+ gtk_window_get_size (GTK_WINDOW(priv->dialog), &width, &height);
+
+ gconf_client_set_int (gconf_client,
+ GCONF_PATH "/ui/chat_window_width",
+ width,
+ NULL);
+
+ gconf_client_set_int (gconf_client,
+ GCONF_PATH "/ui/chat_window_height",
+ height,
+ NULL);
+ }
+
+}
+
+static void
chat_window_clear_activate_cb (GtkWidget *menuitem, GossipChatWindow *window)
{
GossipChatWindowPriv *priv = window->priv;
@@ -694,7 +722,9 @@ chat_window_close_activate_cb (GtkWidget
GossipChatWindow *window)
{
g_return_if_fail (window->priv->current_chat != NULL);
-
+
+ chat_window_save_size (window);
+
gossip_chat_window_remove_chat (window, window->priv->current_chat);
}
@@ -1057,6 +1087,7 @@ chat_window_close_clicked_cb (GtkWidget
GossipChatWindow *window;
window = gossip_chat_get_window (chat);
+ chat_window_save_size (window);
gossip_chat_window_remove_chat (window, chat);
}
@@ -1152,8 +1183,14 @@ gossip_chat_window_add_chat (GossipChatW
if (g_list_length (window->priv->chats) == 0) {
gint width, height;
- /* first chat, resize the window to its preferred size */
- gossip_chat_get_geometry (chat, &width, &height);
+ /* first chat, read the chat window size from gconf */
+ width = gconf_client_get_int (gconf_client,
+ GCONF_PATH "/ui/chat_window_width",
+ NULL);
+ height = gconf_client_get_int (gconf_client,
+ GCONF_PATH "/ui/chat_window_height",
+ NULL);
+
gtk_window_resize (GTK_WINDOW (window->priv->dialog), width, height);
}