diff options
author | Rodney Dawes <dobey@novell.com> | 2004-06-22 05:10:47 +0800 |
---|---|---|
committer | Rodney Dawes <dobey@src.gnome.org> | 2004-06-22 05:10:47 +0800 |
commit | 176a9fed3f97941eebbb56e6cd2a8d977e084ad4 (patch) | |
tree | 4c8e98cecbef3825973e87990e06a46573f74aba /calendar/gui | |
parent | 0730f269f01a5ecd12eaa465d0fd05ca4e5589ba (diff) | |
download | gsoc2013-evolution-176a9fed3f97941eebbb56e6cd2a8d977e084ad4.tar gsoc2013-evolution-176a9fed3f97941eebbb56e6cd2a8d977e084ad4.tar.gz gsoc2013-evolution-176a9fed3f97941eebbb56e6cd2a8d977e084ad4.tar.bz2 gsoc2013-evolution-176a9fed3f97941eebbb56e6cd2a8d977e084ad4.tar.lz gsoc2013-evolution-176a9fed3f97941eebbb56e6cd2a8d977e084ad4.tar.xz gsoc2013-evolution-176a9fed3f97941eebbb56e6cd2a8d977e084ad4.tar.zst gsoc2013-evolution-176a9fed3f97941eebbb56e6cd2a8d977e084ad4.zip |
Fixes #56892
2004-06-21 Rodney Dawes <dobey@novell.com>
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
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/dialogs/select-source-dialog.c | 18 |
1 files changed, 15 insertions, 3 deletions
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 @@ -31,6 +31,13 @@ #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) { ESource **our_selection = 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); |