From 176a9fed3f97941eebbb56e6cd2a8d977e084ad4 Mon Sep 17 00:00:00 2001 From: Rodney Dawes Date: Mon, 21 Jun 2004 21:10:47 +0000 Subject: Fixes #56892 2004-06-21 Rodney Dawes Fixes #56892 * gui/dialogs/select-source-dialog.c (row_activated_cb): Add this callback to activate the OK button when we double-click or press the Enter key on a row (select_source_dialog): Change the default size to be reasonable Use ensure_style instead of realize on the dialog Set the default response for the dialog to OK Fix the packing of the group label to not have extraneous padding Connect up the callback for row_activated svn path=/trunk/; revision=26444 --- calendar/gui/dialogs/select-source-dialog.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'calendar/gui/dialogs/select-source-dialog.c') diff --git a/calendar/gui/dialogs/select-source-dialog.c b/calendar/gui/dialogs/select-source-dialog.c index 35e45b3c5e..04f6ab228a 100644 --- a/calendar/gui/dialogs/select-source-dialog.c +++ b/calendar/gui/dialogs/select-source-dialog.c @@ -30,6 +30,13 @@ #include "widgets/misc/e-source-selector.h" #include "select-source-dialog.h" +static void +row_activated_cb (GtkTreeView *tree_view, GtkTreePath *path, + GtkTreeViewColumn *column, GtkWidget *dialog) +{ + gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); +} + static void primary_selection_changed_cb (ESourceSelector *selector, gpointer user_data) { @@ -77,10 +84,10 @@ select_source_dialog (GtkWindow *parent, ECalSourceType obj_type) gtk_window_set_title (GTK_WINDOW (dialog), _("Select destination")); gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent)); - gtk_window_set_default_size (GTK_WINDOW (dialog), 300, 520); + gtk_window_set_default_size (GTK_WINDOW (dialog), 320, 240); gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); - gtk_widget_realize (dialog); + gtk_widget_ensure_style (dialog); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 0); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 12); @@ -88,6 +95,7 @@ select_source_dialog (GtkWindow *parent, ECalSourceType obj_type) GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); + gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE); vbox = gtk_vbox_new (FALSE, 12); @@ -103,7 +111,7 @@ select_source_dialog (GtkWindow *parent, ECalSourceType obj_type) gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); g_free (label_text); gtk_widget_show (label); - gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 6); + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); hbox = gtk_hbox_new (FALSE, 12); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); @@ -125,6 +133,10 @@ select_source_dialog (GtkWindow *parent, ECalSourceType obj_type) gtk_widget_show (scroll); source_selector = e_source_selector_new (source_list); e_source_selector_show_selection (E_SOURCE_SELECTOR (source_selector), FALSE); + + g_signal_connect (G_OBJECT (source_selector), "row_activated", + G_CALLBACK (row_activated_cb), dialog); + g_signal_connect (G_OBJECT (source_selector), "primary_selection_changed", G_CALLBACK (primary_selection_changed_cb), &selected_source); gtk_widget_show (source_selector); -- cgit v1.2.3