summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2010-01-13 16:05:44 +0000
committerJason Woodward2010-01-13 16:05:44 +0000
commit3e64243741e7afa7f66e2321769253fa01e72780 (patch)
treea1a3010b8289bac58d429dfbdedddfb0bef001ed
parent8ecb9616db7b29b6214c708e4d76448b59bfbddc (diff)
downloadgslapt-3e64243741e7afa7f66e2321769253fa01e72780.tar.gz
also save/restore the position and size of the summary window
-rw-r--r--src/callbacks.c13
-rw-r--r--src/interface.c3
-rw-r--r--src/settings.c11
-rw-r--r--src/settings.h1
4 files changed, 28 insertions, 0 deletions
diff --git a/src/callbacks.c b/src/callbacks.c
index df5d7a5..1002a97 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -121,6 +121,11 @@ gboolean gslapt_window_resized(GtkWindow *window, GdkEvent *event, gpointer data
gslapt_settings->cl_y = y;
gslapt_settings->cl_width = width;
gslapt_settings->cl_height = height;
+ } else if (strcmp(widget_name,"transaction_window") == 0) {
+ gslapt_settings->tran_x = x;
+ gslapt_settings->tran_y = y;
+ gslapt_settings->tran_width = width;
+ gslapt_settings->tran_height = height;
} else {
fprintf(stderr, "need to handle widget name: %s\n", widget_name);
}
@@ -174,6 +179,14 @@ void execute_callback (GtkObject *object, gpointer user_data)
) return;
trans_window = (GtkWidget *)create_transaction_window();
+
+ if ((gslapt_settings->tran_x == gslapt_settings->tran_y == gslapt_settings->tran_width == gslapt_settings->tran_height == 0)) {
+ gtk_window_set_default_size(GTK_WINDOW(trans_window),
+ gslapt_settings->tran_width, gslapt_settings->tran_height);
+ gtk_window_move(GTK_WINDOW(trans_window),
+ gslapt_settings->tran_x, gslapt_settings->tran_y);
+ }
+
if ( populate_transaction_window(trans_window) == 0 ) {
gtk_widget_show(trans_window);
} else {
diff --git a/src/interface.c b/src/interface.c
index 4ea63af..92ec0f2 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -1855,6 +1855,9 @@ create_transaction_window (void)
g_signal_connect ((gpointer) transaction_window, "destroy_event",
G_CALLBACK (gtk_widget_destroy),
NULL);
+ g_signal_connect ((gpointer) transaction_window, "configure-event",
+ G_CALLBACK (gslapt_window_resized),
+ NULL);
g_signal_connect_swapped ((gpointer) button2, "clicked",
G_CALLBACK (cancel_transaction),
GTK_OBJECT (transaction_window));
diff --git a/src/settings.c b/src/settings.c
index 687a43f..2ee0450 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -20,6 +20,7 @@ GslaptSettings *gslapt_new_rc (void)
g->x = g->y = g->width = g->height = 0;
g->cl_x = g->cl_y = g->cl_width = g->cl_height = 0;
g->pref_x = g->pref_y = g->pref_width = g->pref_height = 0;
+ g->tran_x = g->tran_y = g->tran_width = g->tran_height = 0;
return g;
}
@@ -81,6 +82,11 @@ GslaptSettings *gslapt_read_rc (void)
gslapt_settings->pref_width = g_key_file_get_integer (keyfile, "preferences window", "width", NULL);
gslapt_settings->pref_height = g_key_file_get_integer (keyfile, "preferences window", "height", NULL);
+ gslapt_settings->tran_x = g_key_file_get_integer (keyfile, "transaction window", "x", NULL);
+ gslapt_settings->tran_y = g_key_file_get_integer (keyfile, "transaction window", "y", NULL);
+ gslapt_settings->tran_width = g_key_file_get_integer (keyfile, "transaction window", "width", NULL);
+ gslapt_settings->tran_height = g_key_file_get_integer (keyfile, "transaction window", "height", NULL);
+
g_key_file_free(keyfile);
}
@@ -127,6 +133,11 @@ int gslapt_write_rc(GslaptSettings *gslapt_settings)
g_key_file_set_integer (keyfile, "preferences window", "width", gslapt_settings->pref_width);
g_key_file_set_integer (keyfile, "preferences window", "height", gslapt_settings->pref_height);
+ g_key_file_set_integer (keyfile, "transaction window", "x", gslapt_settings->tran_x);
+ g_key_file_set_integer (keyfile, "transaction window", "y", gslapt_settings->tran_y);
+ g_key_file_set_integer (keyfile, "transaction window", "width", gslapt_settings->tran_width);
+ g_key_file_set_integer (keyfile, "transaction window", "height", gslapt_settings->tran_height);
+
rc_data = g_key_file_to_data(keyfile, &length, NULL);
if (length != 0) {
char *file = g_build_path (G_DIR_SEPARATOR_S, dir, "rc", NULL);
diff --git a/src/settings.h b/src/settings.h
index ada847b..4917f88 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -10,6 +10,7 @@ typedef struct {
gint x; gint y; gint width; gint height;
gint cl_x; gint cl_y; gint cl_width; gint cl_height;
gint pref_x; gint pref_y; gint pref_width; gint pref_height;
+ gint tran_x; gint tran_y; gint tran_width; gint tran_height;
} GslaptSettings;
char *gslapt_init_rc_dir (void);