aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog11
-rw-r--r--mail/subscribe-control-factory.c38
-rw-r--r--mail/subscribe-control.c18
-rw-r--r--mail/subscribe-control.h1
4 files changed, 61 insertions, 7 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 5c2f20dc25..9afa70433f 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,14 @@
+2000-09-28 Chris Toshok <toshok@helixcode.com>
+
+ * subscribe-control.h (subscribe_search): added prototype.
+
+ * subscribe-control.c (subscribe_search): new function.
+
+ * subscribe-control-factory.c (make_folder_search_widget): new
+ function, to add search widget to toolbar.
+ (control_activate): create the search widget and add it to the
+ toolbar.
+
2000-09-28 Jeffrey Stedfast <fejj@helixcode.com>
* mail-ops.c (do_send_queue): Messages should be appended to Sent
diff --git a/mail/subscribe-control-factory.c b/mail/subscribe-control-factory.c
index 9d1cbb9caa..9ab6748d46 100644
--- a/mail/subscribe-control-factory.c
+++ b/mail/subscribe-control-factory.c
@@ -77,13 +77,38 @@ update_pixmaps (Bonobo_UIContainer container)
set_pixmap (container, "/Toolbar/RefreshList", "forward.png"); /* XXX */
}
+static GtkWidget*
+make_folder_search_widget (GtkSignalFunc start_search_func,
+ gpointer user_data_for_search)
+{
+ GtkWidget *search_vbox = gtk_vbox_new (FALSE, 0);
+ GtkWidget *search_entry = gtk_entry_new ();
+
+ if (start_search_func) {
+ gtk_signal_connect (GTK_OBJECT (search_entry), "activate",
+ start_search_func,
+ user_data_for_search);
+ }
+
+ /* add the search entry to the our search_vbox */
+ gtk_box_pack_start (GTK_BOX (search_vbox), search_entry,
+ FALSE, TRUE, 3);
+ gtk_box_pack_start (GTK_BOX (search_vbox),
+ gtk_label_new(_("Display Folders containing")),
+ FALSE, TRUE, 0);
+
+ return search_vbox;
+}
+
static void
control_activate (BonoboControl *control, BonoboUIHandler *uih,
- SubscribeControl *fb)
+ SubscribeControl *sc)
{
GtkWidget *subscribe_control;
BonoboUIComponent *component;
Bonobo_UIContainer container;
+ GtkWidget *folder_search_widget;
+ BonoboControl *search_control;
container = bonobo_control_get_remote_ui_handler (control);
bonobo_ui_handler_set_container (uih, container);
@@ -107,6 +132,15 @@ control_activate (BonoboControl *control, BonoboUIHandler *uih,
update_pixmaps (container);
+ folder_search_widget = make_folder_search_widget (subscribe_search, sc);
+ gtk_widget_show_all (folder_search_widget);
+ search_control = bonobo_control_new (folder_search_widget);
+
+ bonobo_ui_container_object_set (container,
+ "/Toolbar/FolderSearch",
+ bonobo_object_corba_objref (BONOBO_OBJECT (search_control)),
+ NULL);
+
bonobo_ui_container_thaw (container, NULL);
}
@@ -152,7 +186,7 @@ control_destroy_cb (BonoboControl *control,
BonoboControl *
subscribe_control_factory_new_control (const char *uri,
- const Evolution_Shell shell)
+ const Evolution_Shell shell)
{
BonoboControl *control;
GtkWidget *subscribe_control;
diff --git a/mail/subscribe-control.c b/mail/subscribe-control.c
index 4e1f85eff2..f3cb52f284 100644
--- a/mail/subscribe-control.c
+++ b/mail/subscribe-control.c
@@ -13,6 +13,7 @@
#include "e-util/e-html-utils.h"
#include <gtkhtml/gtkhtml.h>
#include <gal/util/e-util.h>
+#include <gal/widgets/e-unicode.h>
#include <gal/e-table/e-cell-text.h>
#include <gal/e-table/e-cell-tree.h>
#include <gal/e-table/e-cell-toggle.h>
@@ -92,8 +93,6 @@ subscribe_folder (GtkWidget *widget, gpointer user_data)
{
SubscribeControl *sc = SUBSCRIBE_CONTROL (user_data);
- printf ("subscribe_folder called\n");
-
e_table_selected_row_foreach (E_TABLE_SCROLLED(sc->table)->table,
subscribe_folder_foreach, sc);
}
@@ -119,8 +118,6 @@ unsubscribe_folder (GtkWidget *widget, gpointer user_data)
{
SubscribeControl *sc = SUBSCRIBE_CONTROL (user_data);
- printf ("unsubscribe_folder called\n");
-
e_table_selected_row_foreach (E_TABLE_SCROLLED(sc->table)->table,
unsubscribe_folder_foreach, sc);
}
@@ -131,6 +128,16 @@ subscribe_refresh_list (GtkWidget *widget, gpointer user_data)
printf ("subscribe_refresh_list\n");
}
+void
+subscribe_search (GtkWidget *widget, gpointer user_data)
+{
+ char* search_pattern = e_utf8_gtk_entry_get_text(GTK_ENTRY(widget));
+
+ printf ("subscribe_search (%s)\n", search_pattern);
+
+ g_free (search_pattern);
+}
+
gboolean
subscribe_control_set_uri (SubscribeControl *subscribe_control,
const char *uri)
@@ -367,7 +374,8 @@ subscribe_control_gui_init (SubscribeControl *sc)
GTK_FILL | GTK_EXPAND,
0, 0);
- gtk_widget_show_all (GTK_WIDGET(sc));
+ gtk_widget_show (GTK_WIDGET (sc->table));
+ gtk_widget_show (GTK_WIDGET(sc));
}
static void
diff --git a/mail/subscribe-control.h b/mail/subscribe-control.h
index 164dea57dc..1822f32980 100644
--- a/mail/subscribe-control.h
+++ b/mail/subscribe-control.h
@@ -57,5 +57,6 @@ void subscribe_unselect_all (BonoboUIHandler *uih, void *user_data, const char *
void subscribe_folder (GtkWidget *widget, gpointer user_data);
void unsubscribe_folder (GtkWidget *widget, gpointer user_data);
void subscribe_refresh_list (GtkWidget *widget, gpointer user_data);
+void subscribe_search (GtkWidget *widget, gpointer user_data);
#endif /* _SUBSCRIBE_CONTROL_H_ */