aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/select-source-dialog.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2004-03-19 03:18:00 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2004-03-19 03:18:00 +0800
commit3e3ddfa5fc7e10ba2f8c011db9e0c0d974980c92 (patch)
tree7debdba6dee9f8de01963b8350d54aed33a0fd29 /calendar/gui/dialogs/select-source-dialog.c
parent183bd21ccde9ed13968fc26644ab5a297522a873 (diff)
downloadgsoc2013-evolution-3e3ddfa5fc7e10ba2f8c011db9e0c0d974980c92.tar
gsoc2013-evolution-3e3ddfa5fc7e10ba2f8c011db9e0c0d974980c92.tar.gz
gsoc2013-evolution-3e3ddfa5fc7e10ba2f8c011db9e0c0d974980c92.tar.bz2
gsoc2013-evolution-3e3ddfa5fc7e10ba2f8c011db9e0c0d974980c92.tar.lz
gsoc2013-evolution-3e3ddfa5fc7e10ba2f8c011db9e0c0d974980c92.tar.xz
gsoc2013-evolution-3e3ddfa5fc7e10ba2f8c011db9e0c0d974980c92.tar.zst
gsoc2013-evolution-3e3ddfa5fc7e10ba2f8c011db9e0c0d974980c92.zip
create an ESourceSelector instead of a ESourceOptionMenu, to be consistent
2004-03-18 Rodrigo Moya <rodrigo@ximian.com> * gui/dialogs/select-source-dialog.c (select_source_dialog): create an ESourceSelector instead of a ESourceOptionMenu, to be consistent with the other components, and create a scrolled window to hold the source selector. (primary_selection_changed_cb): callback for "primary_selection_changed" signal in the ESourceSelector. svn path=/trunk/; revision=25120
Diffstat (limited to 'calendar/gui/dialogs/select-source-dialog.c')
-rw-r--r--calendar/gui/dialogs/select-source-dialog.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/calendar/gui/dialogs/select-source-dialog.c b/calendar/gui/dialogs/select-source-dialog.c
index 978b151d86..fb068b5232 100644
--- a/calendar/gui/dialogs/select-source-dialog.c
+++ b/calendar/gui/dialogs/select-source-dialog.c
@@ -22,18 +22,19 @@
#include <gtk/gtkbox.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtklabel.h>
+#include <gtk/gtkscrolledwindow.h>
#include <gtk/gtkstock.h>
-#include "widgets/misc/e-source-option-menu.h"
+#include "widgets/misc/e-source-selector.h"
#include "select-source-dialog.h"
static void
-source_selected_cb (ESourceOptionMenu *menu, ESource *selected_source, gpointer user_data)
+primary_selection_changed_cb (ESourceSelector *selector, gpointer user_data)
{
ESource **our_selection = user_data;
if (*our_selection)
g_object_unref (*our_selection);
- *our_selection = g_object_ref (selected_source);
+ *our_selection = g_object_ref (e_source_selector_peek_primary_selection (selector));
}
/**
@@ -44,7 +45,7 @@ source_selected_cb (ESourceOptionMenu *menu, ESource *selected_source, gpointer
ESource *
select_source_dialog (GtkWindow *parent, ECalSourceType obj_type)
{
- GtkWidget *dialog, *label, *source_selector;
+ GtkWidget *dialog, *label, *scroll, *source_selector;
ESourceList *source_list;
ESource *selected_source = NULL;
const char *gconf_key;
@@ -75,15 +76,24 @@ select_source_dialog (GtkWindow *parent, ECalSourceType obj_type)
conf_client = gconf_client_get_default ();
source_list = e_source_list_new_for_gconf (conf_client, gconf_key);
- source_selector = e_source_option_menu_new (source_list);
- g_signal_connect (G_OBJECT (source_selector), "source_selected",
- G_CALLBACK (source_selected_cb), &selected_source);
+
+ scroll = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
+ 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), "primary_selection_changed",
+ G_CALLBACK (primary_selection_changed_cb), &selected_source);
gtk_widget_show (source_selector);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), source_selector, FALSE, FALSE, 6);
+ gtk_container_add (GTK_CONTAINER (scroll), source_selector);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), scroll, TRUE, TRUE, 12);
if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_OK) {
if (selected_source)
g_object_unref (selected_source);
+ selected_source = NULL;
}
g_object_unref (conf_client);