]> git.pld-linux.org Git - packages/gg.git/blame - gg-save-window-size.patch
- outdated
[packages/gg.git] / gg-save-window-size.patch
CommitLineData
106e8527 1diff -Nur gg-0.2.1.orig/src/gg-types.h gg-0.2.1/src/gg-types.h
2--- gg-0.2.1.orig/src/gg-types.h Thu Jan 10 00:53:44 2002
3+++ gg-0.2.1/src/gg-types.h Thu Jan 17 17:10:00 2002
4@@ -45,6 +45,8 @@
5 gchar *proxy_host;
6 guint connect_on_start;
7 guint last_sysmsg;
8+ guint width;
9+ guint height;
10 } GGConfig;
11
12 typedef struct {
13diff -Nur gg-0.2.1.orig/src/gg.h gg-0.2.1/src/gg.h
14--- gg-0.2.1.orig/src/gg.h Mon Jan 14 22:43:05 2002
15+++ gg-0.2.1/src/gg.h Thu Jan 17 17:09:25 2002
16@@ -160,6 +160,9 @@
17 #define GG_SEARCH 0x0004
18 #define GG_REGISTER 0x0005
19
20+#define GG_MIN_WIDTH 160
21+#define GG_MIN_HEIGHT 300
22+
23 //unsigned int gg_hash_passwd(unsigned char *passwd, unsigned int seed);
24
25 void gg_connect_to_server(void);
26diff -Nur gg-0.2.1.orig/src/interface.c gg-0.2.1/src/interface.c
27--- gg-0.2.1.orig/src/interface.c Mon Jan 14 22:49:11 2002
28+++ gg-0.2.1/src/interface.c Thu Jan 17 17:11:24 2002
29@@ -145,7 +145,7 @@
30 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
31 #endif
32 gtk_object_set_data(GTK_OBJECT(window), "window", window);
33- gtk_widget_set_usize(window, 160, 300);
34+ gtk_widget_set_usize(window, GG_MIN_WIDTH, GG_MIN_HEIGHT);
35 gtk_window_set_title(GTK_WINDOW(window), _(TITLE));
36
37 #ifdef USE_APPLET
38@@ -452,6 +452,7 @@
39 gtk_window_add_accel_group(GTK_WINDOW(window), accel_group);
40 #endif
41 window_set_icon(window, NULL, GG_ONLINE_MAIN);
42+ gtk_window_set_default_size (GTK_WINDOW (window), config.width, config.height);
43 return window;
44 }
45
46diff -Nur gg-0.2.1.orig/src/main.c gg-0.2.1/src/main.c
47--- gg-0.2.1.orig/src/main.c Mon Jan 14 22:52:31 2002
48+++ gg-0.2.1/src/main.c Thu Jan 17 17:14:37 2002
49@@ -259,6 +259,8 @@
50 config.proxy_port = 8080;
51 config.connect_on_start = 1;
52 config.last_sysmsg = 0;
53+ config.width = GG_MIN_WIDTH;
54+ config.height = GG_MIN_HEIGHT;
55
56 path = g_strconcat(getenv("HOME"), "/.gg/config", NULL);
57
58@@ -353,6 +355,12 @@
59 if (g_strncasecmp(line, "last_sysmsg ", 12) == 0) {
60 config.last_sysmsg = atoi(line + 12);
61 }
62+ if (g_strncasecmp(line, "width ", 6) == 0) {
63+ config.width = atoi(line + 6);
64+ }
65+ if (g_strncasecmp(line, "height ", 7) == 0) {
66+ config.height = atoi(line + 7);
67+ }
68 }
69 #ifdef DEBUG
70 printf("read_config(): config: %d ********\n", config.uin);
71@@ -366,6 +374,9 @@
72 gchar *path;
73 GList *tmp_ignore;
74
75+ config.width=window->allocation.width;
76+ config.height=window->allocation.height;
77+
78 path = g_strconcat(getenv("HOME"), "/.gg/config", NULL);
79
80 fp = fopen(path, "w");
81@@ -407,7 +418,9 @@
82
83 fprintf(fp, "connect_on_start %d\n", config.connect_on_start);
84 fprintf(fp, "last_sysmsg %d\n", config.last_sysmsg);
85-
86+ fprintf(fp, "width %d\n", config.width);
87+ fprintf(fp, "height %d\n", config.height);
88+
89 tmp_ignore = ignore;
90 while (tmp_ignore) {
91 fprintf(fp, "ignore %d\n", *(guint *) tmp_ignore->data);
This page took 0.120042 seconds and 4 git commands to generate.