summaryrefslogtreecommitdiff
path: root/components/websearch
diff options
context:
space:
mode:
authorRebecca Schulman <rebecka@eazel.com>2000-04-27 00:08:02 +0000
committerRebecca Schulman <rebecka@src.gnome.org>2000-04-27 00:08:02 +0000
commit54aeb2838a6339f548791f8f8068472686dbe050 (patch)
treef9462efaa7bdad863ea53b438558185eed6396ac /components/websearch
parent27acf68ff3b24882c59ce04e298f88fa72abdc6e (diff)
downloadnautilus-54aeb2838a6339f548791f8f8068472686dbe050.tar.gz
Fixed bug #99: Implemented copy, paste, clear, and cut for text Added new
2000-04-26 Rebecca Schulman <rebecka@eazel.com> Fixed bug #99: Implemented copy, paste, clear, and cut for text Added new files nautilus-clipboard.c,h which contains clipboard functionality. All components with text widgets should use this code. It can just be copied from any existing sample code (see ntl-notes.c in the notes component) The frame cut, copy and paste stuff is now happy when there is a widget in focus. Added * libnautilus/nautilus-clipboard.c * libnautilus/nautilus-clipboard.h Modified * src/nautilus-window-menus.c (turned on clear, fixed up callbacks for cut, copy, and paste buttons) * components/notes/ntl-notes.c (Clipboard activated notes text box) * components/websearch/ntl-web-search.c (Clipboard activated the search box)
Diffstat (limited to 'components/websearch')
-rw-r--r--components/websearch/ntl-web-search.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/components/websearch/ntl-web-search.c b/components/websearch/ntl-web-search.c
index e3d333a95..160e88a05 100644
--- a/components/websearch/ntl-web-search.c
+++ b/components/websearch/ntl-web-search.c
@@ -30,6 +30,7 @@
#include <liboaf/liboaf.h>
#include <limits.h>
#include <ctype.h>
+#include <libnautilus/nautilus-clipboard.h>
typedef struct {
char *name, *url_head, *url_tail;
@@ -165,6 +166,7 @@ make_obj(BonoboGenericFactory *Factory, const char *goad_id, gpointer closure)
{
GtkWidget *vbox;
WebSearchView *hview;
+ NautilusClipboardInfo *info;
g_return_val_if_fail(!strcmp(goad_id, "OAFIID:ntl_websearch_view:8216e1e4-6b01-4a28-82d9-5df30ed7d044"), NULL);
@@ -218,7 +220,18 @@ make_obj(BonoboGenericFactory *Factory, const char *goad_id, gpointer closure)
/* handle events */
gtk_signal_connect(GTK_OBJECT(hview->view), "notify_location_change", web_search_notify_location_change, hview);
-
+
+ /* handle selections */
+ info = nautilus_clipboard_info_new ();
+ nautilus_clipboard_info_set_view_frame (info, hview->view);
+ nautilus_clipboard_info_set_clipboard_owner (info, GTK_WIDGET (hview->ent_params));
+ nautilus_clipboard_info_set_component_name (info, "WebSearch");
+ gtk_signal_connect (GTK_OBJECT (hview->ent_params), "focus_in_event",
+ GTK_SIGNAL_FUNC (nautilus_component_merge_bonobo_items_cb), info);
+ gtk_signal_connect (GTK_OBJECT (hview->ent_params), "focus_out_event",
+ GTK_SIGNAL_FUNC (nautilus_component_unmerge_bonobo_items_cb), info);
+ gtk_signal_connect (GTK_OBJECT (hview->ent_params), "destroy", nautilus_clipboard_info_destroy, info);
+
/* set description */
nautilus_meta_view_frame_set_label (NAUTILUS_META_VIEW_FRAME (hview->view),
_("WebSearch"));