aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorJason Leach <jasonleach@usa.net>2001-01-24 19:28:04 +0800
committerJacob Leach <jleach@src.gnome.org>2001-01-24 19:28:04 +0800
commitb021ce42a73dd30a262789073c8dfd2904c9b7bd (patch)
tree77041341c74e3f9c16ffc32cf3f3cdb7412bf79b /addressbook
parentdea4c72b4e46801849bd721f058ec7cdcb121885 (diff)
downloadgsoc2013-evolution-b021ce42a73dd30a262789073c8dfd2904c9b7bd.tar
gsoc2013-evolution-b021ce42a73dd30a262789073c8dfd2904c9b7bd.tar.gz
gsoc2013-evolution-b021ce42a73dd30a262789073c8dfd2904c9b7bd.tar.bz2
gsoc2013-evolution-b021ce42a73dd30a262789073c8dfd2904c9b7bd.tar.lz
gsoc2013-evolution-b021ce42a73dd30a262789073c8dfd2904c9b7bd.tar.xz
gsoc2013-evolution-b021ce42a73dd30a262789073c8dfd2904c9b7bd.tar.zst
gsoc2013-evolution-b021ce42a73dd30a262789073c8dfd2904c9b7bd.zip
(Fix #1225: advanced search cancel/close)
2001-01-23 Jason Leach <jasonleach@usa.net> (Fix #1225: advanced search cancel/close) * gui/search/e-addressbook-search-dialog.c (e_addressbook_search_dialog_init): Set it up with Search and a Cancel button, Search is still the default. svn path=/trunk/; revision=7775
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog8
-rw-r--r--addressbook/gui/search/e-addressbook-search-dialog.c72
2 files changed, 48 insertions, 32 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 863b3b6870..890e170f19 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,11 @@
+2001-01-23 Jason Leach <jasonleach@usa.net>
+
+ (Fix #1225: advanced search cancel/close)
+
+ * gui/search/e-addressbook-search-dialog.c
+ (e_addressbook_search_dialog_init): Set it up with Search and a
+ Cancel button, Search is still the default.
+
2001-01-23 JP Rosevear <jpr@ximian.com>
* conduit/address-conduit.c (local_record_from_ecard): properly ref
diff --git a/addressbook/gui/search/e-addressbook-search-dialog.c b/addressbook/gui/search/e-addressbook-search-dialog.c
index c1cce6301a..94ba32644d 100644
--- a/addressbook/gui/search/e-addressbook-search-dialog.c
+++ b/addressbook/gui/search/e-addressbook-search-dialog.c
@@ -46,26 +46,26 @@ enum {
GtkType
e_addressbook_search_dialog_get_type (void)
{
- static GtkType type = 0;
-
- if (!type)
- {
- static const GtkTypeInfo info =
- {
- "EAddressbookSearchDialog",
- sizeof (EAddressbookSearchDialog),
- sizeof (EAddressbookSearchDialogClass),
- (GtkClassInitFunc) e_addressbook_search_dialog_class_init,
- (GtkObjectInitFunc) e_addressbook_search_dialog_init,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- type = gtk_type_unique (PARENT_TYPE, &info);
- }
-
- return type;
+ static GtkType type = 0;
+
+ if (!type)
+ {
+ static const GtkTypeInfo info =
+ {
+ "EAddressbookSearchDialog",
+ sizeof (EAddressbookSearchDialog),
+ sizeof (EAddressbookSearchDialogClass),
+ (GtkClassInitFunc) e_addressbook_search_dialog_class_init,
+ (GtkObjectInitFunc) e_addressbook_search_dialog_init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
+ };
+
+ type = gtk_type_unique (PARENT_TYPE, &info);
+ }
+
+ return type;
}
static void
@@ -120,16 +120,20 @@ get_query (EAddressbookSearchDialog *view)
}
static void
-button_press (GtkWidget *widget, EAddressbookSearchDialog *dialog)
+button_press (GtkWidget *widget, int button, EAddressbookSearchDialog *dialog)
{
char *query;
- gtk_widget_show(dialog->scrolled_window);
- query = get_query(dialog);
- gtk_object_set(GTK_OBJECT(dialog->view),
- "query", query,
- NULL);
- g_free(query);
+ if (button == 0) {
+ gtk_widget_show(dialog->scrolled_window);
+ query = get_query(dialog);
+ gtk_object_set(GTK_OBJECT(dialog->view),
+ "query", query,
+ NULL);
+ g_free(query);
+ }
+ else
+ gnome_dialog_close(GNOME_DIALOG (dialog));
}
static void
@@ -144,17 +148,21 @@ e_addressbook_search_dialog_init (EAddressbookSearchDialog *view)
gtk_box_pack_start(GTK_BOX(dialog->vbox), view->search, FALSE, FALSE, 0);
gtk_widget_show(view->search);
- button = gtk_button_new_with_label(_("Search"));
- gtk_box_pack_start(GTK_BOX(dialog->vbox), button, FALSE, FALSE, 0);
- gtk_signal_connect(GTK_OBJECT(button), "clicked",
+ gnome_dialog_append_buttons(dialog,
+ _("Search"),
+ GNOME_STOCK_BUTTON_CANCEL, NULL);
+
+ gnome_dialog_set_default(dialog, 0);
+
+ gtk_signal_connect(GTK_OBJECT(dialog), "clicked",
GTK_SIGNAL_FUNC(button_press), view);
- gtk_widget_show(button);
view->view = e_minicard_view_widget_new();
gtk_widget_show(view->view);
view->scrolled_window = e_scroll_frame_new(NULL, NULL);
- e_scroll_frame_set_policy(E_SCROLL_FRAME(view->scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);
+ e_scroll_frame_set_policy(E_SCROLL_FRAME(view->scrolled_window),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);
gtk_container_add(GTK_CONTAINER(view->scrolled_window), view->view);
gtk_box_pack_start(GTK_BOX(dialog->vbox), view->scrolled_window, TRUE, TRUE, 0);