aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component
diff options
context:
space:
mode:
authorChris Toshok <toshok@src.gnome.org>2000-04-11 07:22:28 +0800
committerChris Toshok <toshok@src.gnome.org>2000-04-11 07:22:28 +0800
commit3a9e9c65460375d9f8145513404d7e6ed8adc182 (patch)
tree5d57eaa616bfcd49f15a1abf2bf063fca7b4942a /addressbook/gui/component
parent8635e2775b2a74fc612be56cd0af91e3a2ed2dfa (diff)
downloadgsoc2013-evolution-3a9e9c65460375d9f8145513404d7e6ed8adc182.tar
gsoc2013-evolution-3a9e9c65460375d9f8145513404d7e6ed8adc182.tar.gz
gsoc2013-evolution-3a9e9c65460375d9f8145513404d7e6ed8adc182.tar.bz2
gsoc2013-evolution-3a9e9c65460375d9f8145513404d7e6ed8adc182.tar.lz
gsoc2013-evolution-3a9e9c65460375d9f8145513404d7e6ed8adc182.tar.xz
gsoc2013-evolution-3a9e9c65460375d9f8145513404d7e6ed8adc182.tar.zst
gsoc2013-evolution-3a9e9c65460375d9f8145513404d7e6ed8adc182.zip
implement braindead dialog to input the query string for the view.
* addressbook/gui/component/addressbook.c (find_contact_cb): implement braindead dialog to input the query string for the view. also, change all callbacks to get the EMinicardView instead of the EBook. * addressbook/gui/minicard/e-minicard-view.c (e_minicard_view_get_arg): add missing break. svn path=/trunk/; revision=2384
Diffstat (limited to 'addressbook/gui/component')
-rw-r--r--addressbook/gui/component/addressbook.c51
1 files changed, 42 insertions, 9 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 064b29b7f8..71095d6aeb 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -77,10 +77,13 @@ new_contact_cb (BonoboUIHandler *uih, void *user_data, const char *path)
gint result;
GtkWidget* contact_editor =
e_contact_editor_new(e_card_new(""));
- EBook *book = E_BOOK (user_data);
-
+ EMinicardView *minicard_view = E_MINICARD_VIEW (user_data);
+ EBook *book;
+
GtkWidget* dlg = gnome_dialog_new ("Contact Editor", "Save", "Cancel", NULL);
+ gtk_object_get(GTK_OBJECT(minicard_view), "book", &book, NULL);
+
g_assert (E_IS_BOOK (book));
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dlg)->vbox),
@@ -111,13 +114,43 @@ new_contact_cb (BonoboUIHandler *uih, void *user_data, const char *path)
}
+static void
+find_contact_cb (BonoboUIHandler *uih, void *user_data, const char *path)
+{
+ gint result;
+ GtkWidget* search_entry = gtk_entry_new();
+ EMinicardView *minicard_view = E_MINICARD_VIEW (user_data);
+ gchar* search_text;
+
+ GtkWidget* dlg = gnome_dialog_new ("Search Contacts", "Find", "Cancel", NULL);
+
+ gtk_object_get (GTK_OBJECT(minicard_view), "query", &search_text, NULL);
+ gtk_entry_set_text(GTK_ENTRY(search_entry), search_text);
+ g_free (search_text);
+
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dlg)->vbox),
+ search_entry, TRUE, TRUE, 0);
+
+ gtk_widget_show_all (dlg);
+
+ gnome_dialog_close_hides (GNOME_DIALOG (dlg), TRUE);
+ result = gnome_dialog_run_and_close (GNOME_DIALOG (dlg));
+
+
+ /* If the user clicks "okay"...*/
+ if (result == 0) {
+ search_text = gtk_entry_get_text(GTK_ENTRY(search_entry));
+ gtk_object_set (GTK_OBJECT(minicard_view), "query", search_text, NULL);
+ }
+
+}
static GnomeUIInfo gnome_toolbar [] = {
GNOMEUIINFO_ITEM_STOCK (N_("New"), N_("Create a new contact"), new_contact_cb, GNOME_STOCK_PIXMAP_NEW),
GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_ITEM_STOCK (N_("Find"), N_("Find a contact"), do_nothing_cb, GNOME_STOCK_PIXMAP_SEARCH),
+ GNOMEUIINFO_ITEM_STOCK (N_("Find"), N_("Find a contact"), find_contact_cb, GNOME_STOCK_PIXMAP_SEARCH),
GNOMEUIINFO_ITEM_STOCK (N_("Print"), N_("Print contacts"), do_nothing_cb, GNOME_STOCK_PIXMAP_PRINT),
GNOMEUIINFO_ITEM_STOCK (N_("Delete"), N_("Delete a contact"), do_nothing_cb, GNOME_STOCK_PIXMAP_TRASH),
@@ -127,7 +160,7 @@ static GnomeUIInfo gnome_toolbar [] = {
static void
-control_activate (BonoboControl *control, BonoboUIHandler *uih, EBook *book)
+control_activate (BonoboControl *control, BonoboUIHandler *uih, EMinicardView *minicard_view)
{
Bonobo_UIHandler remote_uih;
GtkWidget *toolbar;
@@ -140,14 +173,14 @@ control_activate (BonoboControl *control, BonoboUIHandler *uih, EBook *book)
N_("_New Contact"),
NULL, -1,
BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0, new_contact_cb, (gpointer)book);
+ 0, 0, new_contact_cb, (gpointer)minicard_view);
toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL,
GTK_TOOLBAR_BOTH);
gnome_app_fill_toolbar_with_data (GTK_TOOLBAR (toolbar),
gnome_toolbar,
- NULL, book);
+ NULL, minicard_view);
gtk_widget_show_all (toolbar);
@@ -164,7 +197,7 @@ control_activate (BonoboControl *control, BonoboUIHandler *uih, EBook *book)
static void
control_activate_cb (BonoboControl *control,
gboolean activate,
- EBook* book)
+ EMinicardView* minicard_view)
{
BonoboUIHandler *uih;
@@ -172,7 +205,7 @@ control_activate_cb (BonoboControl *control,
g_assert (uih);
if (activate)
- control_activate (control, uih, book);
+ control_activate (control, uih, minicard_view);
else
control_deactivate (control, uih);
}
@@ -329,7 +362,7 @@ addressbook_factory (BonoboGenericFactory *Factory, void *closure)
control = bonobo_control_new(vbox);
gtk_signal_connect (GTK_OBJECT (control), "activate",
- control_activate_cb, book);
+ control_activate_cb, view->view);
gtk_widget_pop_visual ();
gtk_widget_pop_colormap ();