aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-02-07 08:55:39 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-02-07 08:55:39 +0000
commit137bb6ca6d3ab290a1847d0848d8c83a07fe4aca (patch)
tree5e82a9b8c349ef85ec783017806ee22dd7f4b60a /src/mainwindow.c
parent52d975fe1a17757787567a7f215dcaad6c4cda2d (diff)
made the help window of command line options singleton.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@985 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/mainwindow.c')
-rw-r--r--src/mainwindow.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c
index e8230209..83b54dee 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -3491,6 +3491,8 @@ static void faq_open_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
faq_open((ManualLang)action);
}
+static GtkWidget *help_cmdline_window;
+
static void help_cmdline_ok(GtkWidget *button)
{
gtk_widget_destroy(gtk_widget_get_toplevel(button));
@@ -3512,6 +3514,11 @@ static gboolean help_cmdline_deleted(GtkWidget *widget, GdkEventAny *event,
return FALSE;
}
+static void help_cmdline_destroyed(GtkWidget *widget, gpointer data)
+{
+ help_cmdline_window = NULL;
+}
+
static void help_command_line_show(void)
{
GtkWidget *window;
@@ -3522,11 +3529,17 @@ static void help_command_line_show(void)
GtkWidget *hbbox;
GtkWidget *ok_btn;
+ if (help_cmdline_window) {
+ gtk_window_present(GTK_WINDOW(help_cmdline_window));
+ return;
+ }
+
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), _("Command line options"));
gtk_container_set_border_width(GTK_CONTAINER(window), 8);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
+ help_cmdline_window = window;
vbox = gtk_vbox_new(FALSE, 8);
gtk_container_add(GTK_CONTAINER(window), vbox);
@@ -3586,6 +3599,8 @@ static void help_command_line_show(void)
G_CALLBACK(help_cmdline_key_pressed), NULL);
g_signal_connect(G_OBJECT(window), "delete_event",
G_CALLBACK(help_cmdline_deleted), NULL);
+ g_signal_connect(G_OBJECT(window), "destroy",
+ G_CALLBACK(help_cmdline_destroyed), NULL);
gtk_widget_show_all(window);
}