[Epiphany] [patch] Add clipboard items to the bme edit menu



ok to commit?

dave
Index: data/ui/epiphany-bookmark-editor-ui.xml.in
===================================================================
RCS file: /cvs/gnome/epiphany/data/ui/epiphany-bookmark-editor-ui.xml.in,v
retrieving revision 1.6
diff -u -p -r1.6 epiphany-bookmark-editor-ui.xml.in
--- data/ui/epiphany-bookmark-editor-ui.xml.in	24 Mar 2003 14:08:24 -0000	1.6
+++ data/ui/epiphany-bookmark-editor-ui.xml.in	25 Mar 2003 17:13:08 -0000
@@ -12,9 +12,14 @@
 </submenu>
 
 <submenu name="EditMenu" verb="Edit">
+	<menuitem name="EditCut" verb="Cut"/>
+	<menuitem name="EditCopy" verb="Copy"/>
+	<menuitem name="EditPaste" verb="Paste"/>
+	<menuitem name="EditSelectAll" verb="SelectAll"/>
+	<separator name="EditSep1"/>
 	<menuitem name="EditRenameBookmark" verb="RenameBookmark"/>
 	<menuitem name="EditRenameTopic" verb="RenameTopic"/>
-	<separator name="FileSep1"/>
+	<separator name="EditSep2"/>
 	<menuitem name="FileRemoveBookmark" verb="RemoveBookmark"/>
 	<menuitem name="FileRemoveTopic" verb="RemoveTopic"/>
 </submenu>
Index: src/bookmarks/ephy-bookmarks-editor.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/bookmarks/ephy-bookmarks-editor.c,v
retrieving revision 1.29
diff -u -p -r1.29 ephy-bookmarks-editor.c
--- src/bookmarks/ephy-bookmarks-editor.c	24 Mar 2003 20:56:19 -0000	1.29
+++ src/bookmarks/ephy-bookmarks-editor.c	25 Mar 2003 17:13:16 -0000
@@ -72,6 +73,14 @@ static void cmd_rename_topic		  (EggActi
 					   EphyBookmarksEditor *editor);
 static void cmd_close			  (EggAction *action,
 					   EphyBookmarksEditor *editor);
+static void cmd_cut			(EggAction *action,
+					   EphyBookmarksEditor *editor);
+static void cmd_copy			(EggAction *action,
+					   EphyBookmarksEditor *editor);
+static void cmd_paste		(EggAction *action,
+					   EphyBookmarksEditor *editor);
+static void cmd_select_all		(EggAction *action,
+					   EphyBookmarksEditor *editor);
 
 struct EphyBookmarksEditorPrivate
 {
@@ -115,6 +124,18 @@ static EggActionGroupEntry ephy_bookmark
 	{ "OpenInTab", N_("Open In New _Tab"), NULL, "<shift><control>O",
 	  NULL, G_CALLBACK (cmd_open_bookmarks_in_tabs), NULL },
 
+	{ "Cut", N_("Cu_t"), GTK_STOCK_CUT, "<control>X",
+	 NULL, G_CALLBACK (cmd_cut), NULL },
+	
+	{ "Copy", N_("_Copy"), GTK_STOCK_COPY, "<control>C",
+	 NULL, G_CALLBACK (cmd_copy), NULL },
+
+	{ "Paste", N_("_Paste"), GTK_STOCK_PASTE, "<control>V",
+	 NULL, G_CALLBACK (cmd_paste), NULL },
+
+	{ "SelectAll", N_("Select _All"), NULL, "<control>A",
+	 NULL, G_CALLBACK (cmd_select_all), NULL },
+
 	{ "RenameBookmark", N_("_Rename Bookmark"), NULL, NULL,
 	  NULL, G_CALLBACK (cmd_rename_bookmark), NULL },
 
@@ -284,6 +305,61 @@ cmd_bookmark_properties (EggAction *acti
 	}
 }
 
+static void
+cmd_cut (EggAction *action,
+		    EphyBookmarksEditor *editor)
+{
+	GtkWidget *widget = gtk_window_get_focus (GTK_WINDOW (editor));
+
+	if (GTK_IS_EDITABLE (widget))
+	{
+		gtk_editable_cut_clipboard (GTK_EDITABLE (widget));
+	}
+}
+
+static void
+cmd_copy (EggAction *action,
+		    EphyBookmarksEditor *editor)
+{
+	GtkWidget *widget = gtk_window_get_focus (GTK_WINDOW (editor));
+
+	if (GTK_IS_EDITABLE (widget))
+	{
+		gtk_editable_copy_clipboard (GTK_EDITABLE (widget));
+	}
+}
+
+static void
+cmd_paste (EggAction *action,
+		    EphyBookmarksEditor *editor)
+{
+	GtkWidget *widget = gtk_window_get_focus (GTK_WINDOW (editor));
+
+	if (GTK_IS_EDITABLE (widget))
+	{
+		gtk_editable_paste_clipboard (GTK_EDITABLE (widget));
+	}
+}
+
+static void
+cmd_select_all (EggAction *action,
+		    EphyBookmarksEditor *editor)
+{
+	GtkWidget *widget = gtk_window_get_focus (GTK_WINDOW (editor));
+
+	if (GTK_IS_EDITABLE (widget))
+	{
+		gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1);
+	}
+	
+	else if (GTK_IS_TREE_VIEW (widget)) 
+	{
+		GtkTreeSelection *sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
+		gtk_tree_selection_select_all (sel);
+	}
+}
+
+
 GType
 ephy_bookmarks_editor_get_type (void)
 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]