gtkhtml r8780 - in branches/mbarnes-composer: . components/editor



Author: mbarnes
Date: Wed Mar 12 13:16:45 2008
New Revision: 8780
URL: http://svn.gnome.org/viewvc/gtkhtml?rev=8780&view=rev

Log:
Finish context menu actions.


Removed:
   branches/mbarnes-composer/README.spell
Modified:
   branches/mbarnes-composer/components/editor/gtkhtml-editor-actions.c

Modified: branches/mbarnes-composer/components/editor/gtkhtml-editor-actions.c
==============================================================================
--- branches/mbarnes-composer/components/editor/gtkhtml-editor-actions.c	(original)
+++ branches/mbarnes-composer/components/editor/gtkhtml-editor-actions.c	Wed Mar 12 13:16:45 2008
@@ -111,8 +111,6 @@
  * "context-delete-column"
  * "context-delete-row"
  * "context-delete-table"
- * "context-spell-add"
- * "context-spell-ignore"
  *
  * Context Menu Actions (HTML only)
  * --------------------------------
@@ -132,6 +130,11 @@
  * "context-properties-text"
  * "context-remove-link"
  *
+ * Context Menu Actions (spell check only)
+ * ---------------------------------------
+ * "context-spell-add"
+ * "context-spell-ignore"
+ *
  *****************************************************************************/
 
 static void
@@ -364,60 +367,94 @@
 action_context_delete_cell_cb (GtkAction *action,
                                GtkhtmlEditor *editor)
 {
+	GtkHTML *html;
+
+	html = gtkhtml_editor_get_html (editor);
+	gtk_html_command (html, "delete-cell-contents");
 }
 
 static void
 action_context_delete_column_cb (GtkAction *action,
                                  GtkhtmlEditor *editor)
 {
+	GtkHTML *html;
+
+	html = gtkhtml_editor_get_html (editor);
+	gtk_html_command (html, "delete-table-column");
 }
 
 static void
 action_context_delete_row_cb (GtkAction *action,
                               GtkhtmlEditor *editor)
 {
+	GtkHTML *html;
+
+	html = gtkhtml_editor_get_html (editor);
+	gtk_html_command (html, "delete-table-row");
 }
 
 static void
 action_context_delete_table_cb (GtkAction *action,
                                 GtkhtmlEditor *editor)
 {
+	GtkHTML *html;
+
+	html = gtkhtml_editor_get_html (editor);
+	gtk_html_command (html, "delete-table");
 }
 
 static void
 action_context_insert_column_after_cb (GtkAction *action,
                                        GtkhtmlEditor *editor)
 {
+	GtkHTML *html;
+
+	html = gtkhtml_editor_get_html (editor);
+	html_engine_insert_table_column (html->engine, TRUE);
 }
 
 static void
 action_context_insert_column_before_cb (GtkAction *action,
                                         GtkhtmlEditor *editor)
 {
+	GtkHTML *html;
+
+	html = gtkhtml_editor_get_html (editor);
+	html_engine_insert_table_column (html->engine, FALSE);
 }
 
 static void
 action_context_insert_row_above_cb (GtkAction *action,
                                     GtkhtmlEditor *editor)
 {
+	GtkHTML *html;
+
+	html = gtkhtml_editor_get_html (editor);
+	html_engine_insert_table_row (html->engine, FALSE);
 }
 
 static void
 action_context_insert_row_below_cb (GtkAction *action,
                                     GtkhtmlEditor *editor)
 {
-}
+	GtkHTML *html;
 
-static void
-action_context_insert_table_cb (GtkAction *action,
-                                GtkhtmlEditor *editor)
-{
+	html = gtkhtml_editor_get_html (editor);
+	html_engine_insert_table_row (html->engine, TRUE);
 }
 
 static void
 action_context_remove_link_cb (GtkAction *action,
                                GtkhtmlEditor *editor)
 {
+	GtkHTML *html;
+
+	html = gtkhtml_editor_get_html (editor);
+	html_engine_selection_push (html->engine);
+	if (!html_engine_is_selection_active (html->engine))
+		html_engine_select_word_editable (html->engine);
+	html_engine_set_link (html->engine, NULL);
+	html_engine_selection_pop (html->engine);
 }
 
 static void
@@ -438,8 +475,6 @@
 	html = gtkhtml_editor_get_html (editor);
 	action_name = gtk_action_get_name (action);
 	active_spell_checkers = editor->priv->active_spell_checkers;
-
-	g_return_if_fail (g_str_has_prefix (action_name, "context-spell-add"));
 	g_return_if_fail (active_spell_checkers != NULL);
 
 	/* Note: len("context-spell-add-") == 18 */
@@ -916,6 +951,10 @@
 action_paste_quote_cb (GtkAction *action,
                        GtkhtmlEditor *editor)
 {
+	GtkHTML *html;
+
+	html = gtkhtml_editor_get_html (editor);
+	gtk_html_paste (html, TRUE);
 }
 
 static void
@@ -1928,7 +1967,7 @@
 	  N_("Table"),
 	  NULL,
 	  NULL,
-	  G_CALLBACK (action_context_insert_table_cb) },
+	  G_CALLBACK (action_insert_table_cb) },
 
 	{ "context-properties-cell",
 	  NULL,



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