Revision: 3643 http://geany.svn.sourceforge.net/geany/?rev=3643&view=rev Author: frlan Date: 2009-03-20 17:22:18 +0000 (Fri, 20 Mar 2009)
Log Message: ----------- Extend htmlchars plugin with some replacment functions.
Modified Paths: -------------- trunk/ChangeLog trunk/plugins/htmlchars.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-03-20 16:41:12 UTC (rev 3642) +++ trunk/ChangeLog 2009-03-20 17:22:18 UTC (rev 3643) @@ -1,3 +1,10 @@ +2009-03-20 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + + * plugins/htmlchars.c: + Extend plugin by feature to bulk replace and replace on input for + special characters to their HTML entities. + + 2009-03-19 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/build.c:
Modified: trunk/plugins/htmlchars.c =================================================================== --- trunk/plugins/htmlchars.c 2009-03-20 16:41:12 UTC (rev 3642) +++ trunk/plugins/htmlchars.c 2009-03-20 17:22:18 UTC (rev 3643) @@ -1,6 +1,7 @@ /* * htmlchars.c - this file is part of Geany, a fast and lightweight IDE * + * Copyright 2009 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> * Copyright 2006-2009 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> * Copyright 2007-2009 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> * @@ -49,6 +50,8 @@ enum { KB_INSERT_HTML_CHARS, + KB_REPLACE_HTML_ENTITIES, + KB_HTMLTOGGLE_ACTIVE, KB_COUNT };
@@ -62,12 +65,306 @@ N_COLUMNS };
- static GtkWidget *main_menu_item = NULL; +static GtkWidget *main_menu = NULL; +static GtkWidget *main_menu_submenu = NULL; +static GtkWidget *menu_bulk_replace = NULL; static GtkWidget *sc_dialog = NULL; static GtkTreeStore *sc_store = NULL; static GtkTreeView *sc_tree = NULL; +static GtkWidget *menu_htmltoggle = NULL; +static gboolean plugin_active = FALSE;
+const gchar *chars[][2] ={ + { N_("HTML characters"), NULL }, + { """, """ }, + { "&", "&" }, + { "<", "<" }, + { ">", ">" }, + + { N_("ISO 8859-1 characters"), NULL }, + { " ", " " }, + { "¡", "¡" }, + { "¢", "¢" }, + { "£", "£" }, + { "¤", "¤" }, + { "¥", "¥" }, + { "¦", "¦" }, + { "§", "§" }, + { "¨", "¨" }, + { "©", "©" }, + { "®", "®" }, + { "«", "«" }, + { "»", "»" }, + { "¬", "¬" }, + { " ", "­" }, + { "¯", "¯" }, + { "°", "°" }, + { "±", "±" }, + { "¹", "¹" }, + { "²", "²" }, + { "³", "³" }, + { "¼", "¼" }, + { "½", "½" }, + { "¾", "¾" }, + { "×", "×" }, + { "÷", "÷" }, + { "´", "´" }, + { "µ", "µ" }, + { "¶", "¶" }, + { "·", "·" }, + { "¸", "¸" }, + { "ª", "ª" }, + { "º", "º" }, + { "¿", "¿" }, + { "À", "À" }, + { "Á", "Á" }, + { "Â", "Â" }, + { "Ã", "Ã" }, + { "Ä", "Ä" }, + { "Å", "Å" }, + { "Æ", "Æ" }, + { "Ç", "Ç" }, + { "È", "È" }, + { "É", "É" }, + { "Ê", "Ê" }, + { "Ë", "Ë" }, + { "Ì", "Ì" }, + { "Í", "Í" }, + { "Î", "Î" }, + { "Ï", "Ï" }, + { "Ð", "Ð" }, + { "Ñ", "Ñ" }, + { "Ò", "Ò" }, + { "Ó", "Ó" }, + { "Ô", "Ô" }, + { "Õ", "Õ" }, + { "Ö", "Ö" }, + { "Ø", "Ø" }, + { "Ù", "Ù" }, + { "Ú", "Ú" }, + { "Û", "Û" }, + { "Ü", "Ü" }, + { "Ý", "Ý" }, + { "Þ", "Þ" }, + { "ß", "ß" }, + { "à", "à" }, + { "á", "á" }, + { "â", "â" }, + { "ã", "ã" }, + { "ä", "ä" }, + { "å", "å" }, + { "æ", "æ" }, + { "ç", "ç" }, + { "è", "è" }, + { "é", "é" }, + { "ê", "ê" }, + { "ë", "ë" }, + { "ì", "ì" }, + { "í", "í" }, + { "î", "î" }, + { "ï", "ï" }, + { "ð", "ð" }, + { "ñ", "ñ" }, + { "ò", "ò" }, + { "ó", "ó" }, + { "ô", "ô" }, + { "õ", "õ" }, + { "ö", "ö" }, + { "ø", "ø" }, + { "ù", "ù" }, + { "ú", "ú" }, + { "û", "û" }, + { "ü", "ü" }, + { "ý", "ý" }, + { "þ", "þ" }, + { "ÿ", "ÿ" }, + + { N_("Greek characters"), NULL }, + { "Α", "Α" }, + { "α", "α" }, + { "Β", "Β" }, + { "β", "β" }, + { "Γ", "Γ" }, + { "γ", "γ" }, + { "Δ", "Δ" }, + { "δ", "Δ" }, + { "δ", "δ" }, + { "Ε", "Ε" }, + { "ε", "ε" }, + { "Ζ", "Ζ" }, + { "ζ", "ζ" }, + { "Η", "Η" }, + { "η", "η" }, + { "Θ", "Θ" }, + { "θ", "θ" }, + { "Ι", "Ι" }, + { "ι", "ι" }, + { "Κ", "Κ" }, + { "κ", "κ" }, + { "Λ", "Λ" }, + { "λ", "λ" }, + { "Μ", "Μ" }, + { "μ", "μ" }, + { "Ν", "Ν" }, + { "ν", "ν" }, + { "Ξ", "Ξ" }, + { "ξ", "ξ" }, + { "Ο", "Ο" }, + { "ο", "ο" }, + { "Π", "Π" }, + { "π", "π" }, + { "Ρ", "Ρ" }, + { "ρ", "ρ" }, + { "Σ", "Σ" }, + { "ς", "ς" }, + { "σ", "σ" }, + { "Τ", "Τ" }, + { "τ", "τ" }, + { "Υ", "Υ" }, + { "υ", "υ" }, + { "Φ", "Φ" }, + { "φ", "φ" }, + { "Χ", "Χ" }, + { "χ", "χ" }, + { "Ψ", "Ψ" }, + { "ψ", "ψ" }, + { "Ω", "Ω" }, + { "ω", "ω" }, + { "ϑ", "ϑ" }, + { "ϒ", "ϒ" }, + { "ϖ", "ϖ" }, + + { N_("Mathematical characters"), NULL }, + { "∀", "∀" }, + { "∂", "∂" }, + { "∃", "∃" }, + { "∅", "∅" }, + { "∇", "∇" }, + { "∈", "∈" }, + { "∉", "∉" }, + { "∋", "∋" }, + { "∏", "∏" }, + { "∑", "∑" }, + { "−", "−" }, + { "∗", "∗" }, + { "√", "√" }, + { "∝", "∝" }, + { "∞", "∞" }, + { "∠", "∠" }, + { "∧", "∧" }, + { "∨", "∨" }, + { "∩", "∩" }, + { "∪", "∪" }, + { "∫", "∫" }, + { "∴", "∴" }, + { "∼", "∼" }, + { "≅", "≅" }, + { "≈", "≈" }, + { "≠", "≠" }, + { "≡", "≡" }, + { "≤", "≤" }, + { "≥", "≥" }, + { "⊂", "⊂" }, + { "⊃", "⊃" }, + { "⊄", "⊄" }, + { "⊆", "⊆" }, + { "⊇", "⊇" }, + { "⊕", "⊕" }, + { "⊗", "⊗" }, + { "⊥", "⊥" }, + { "⋅", "⋅" }, + { "◊", "◊" }, + + { N_("Technical characters"), NULL }, + { "⌈", "⌈" }, + { "⌉", "⌉" }, + { "⌊", "⌊" }, + { "⌋", "⌋" }, + { "〈", "⟨" }, + { "〉", "⟩" }, + + { N_("Arrow characters"), NULL }, + { "←", "←" }, + { "↑", "↑" }, + { "→", "→" }, + { "↓", "↓" }, + { "↔", "↔" }, + { "↵", "↵" }, + { "⇐", "⇐" }, + { "⇑", "⇑" }, + { "⇒", "⇒" }, + { "⇓", "⇓" }, + { "⇔", "⇔" }, + + { N_("Punctuation characters"), NULL }, + { "–", "–" }, + { "—", "—" }, + { "‘", "‘" }, + { "’", "’" }, + { "‚", "‚" }, + { "“", "“" }, + { "”", "”" }, + { "„", "„" }, + { "†", "†" }, + { "‡", "‡" }, + { "…", "…" }, + { "‰", "‰" }, + { "‹", "‹" }, + { "›", "›" }, + + { N_("Miscellaneous characters"), NULL }, + { "•", "•" }, + { "′", "′" }, + { "″", "″" }, + { "‾", "‾" }, + { "⁄", "⁄" }, + { "℘", "℘" }, + { "ℑ", "ℑ" }, + { "ℜ", "ℜ" }, + { "™", "™" }, + { "€", "€" }, + { "ℵ", "ℵ" }, + { "♠", "♠" }, + { "♣", "♣" }, + { "♥", "♥" }, + { "♦", "♦" }, + { "Œ", "Œ" }, + { "œ", "œ" }, + { "Š", "Š" }, + { "š", "š" }, + { "Ÿ", "Ÿ" }, + { "ƒ", "ƒ" }, +}; + +static gboolean ht_editor_notify_cb(GObject *object, GeanyEditor *editor, + SCNotification *nt, gpointer data); + + +PluginCallback plugin_callbacks[] = +{ + { "editor-notify", (GCallback) &ht_editor_notify_cb, FALSE, NULL }, + { NULL, NULL, FALSE, NULL } +}; + + +/* Functions to toggle the status of plugin */ +void set_status(gboolean new_status) +{ + /* No more function at the moment.*/ + if (plugin_active != new_status) + plugin_active = new_status; +} + +static void toggle_status(G_GNUC_UNUSED GtkMenuItem * menuitem) +{ + if (plugin_active == TRUE) + set_status(FALSE); + else + set_status(TRUE); +} + + static void sc_on_tools_show_dialog_insert_special_chars_response (GtkDialog *dialog, gint response, gpointer user_data); static void sc_on_tree_row_activated @@ -76,6 +373,74 @@ static gboolean sc_insert(GtkTreeModel *model, GtkTreeIter *iter);
+/* Function takes over value of key which was pressed and returns + * HTML/SGML entity if any */ +const gchar *get_entity(gchar *letter) +{ + guint i, len; + + len = G_N_ELEMENTS(chars); + + /* Ignore tags marking caracters as well as spaces*/ + for (i = 7; i < len; i++) + { + if (utils_str_equal(chars[i][0], letter) && + !utils_str_equal(" ", letter)) + { + return chars[i][1]; + } + } + + /* if the char is not in the list */ + return NULL; +} + + +static gboolean ht_editor_notify_cb(GObject *object, GeanyEditor *editor, + SCNotification *nt, gpointer data) +{ + g_return_val_if_fail(editor != NULL, FALSE); + + if (plugin_active != TRUE) + return FALSE; + + if (nt->nmhdr.code == SCN_CHARADDED) + { + gchar buf[7]; + gint len; + + len = g_unichar_to_utf8(nt->ch, buf); + if (len > 0) + { + const gchar *entity; + buf[len] = '\0'; + entity = get_entity(buf); + + if (entity != NULL) + { + gint pos = sci_get_current_position(editor->sci); + + sci_set_selection_start(editor->sci, pos - len); + sci_set_selection_end(editor->sci, pos); + + sci_replace_sel(editor->sci, entity); + } + } + } + + return FALSE; +} + + +/* Called when keys were pressed */ +static void kbhtmltoggle_toggle(G_GNUC_UNUSED guint key_id) +{ + if (plugin_active == TRUE) + set_status(FALSE); + else + set_status(TRUE); +} + static void tools_show_dialog_insert_special_chars(void) { if (sc_dialog == NULL) @@ -153,269 +518,6 @@ GtkTreeIter *parent_iter = NULL; guint i, len;
- gchar *chars[][2] = - { - { _("HTML characters"), NULL }, - { """, """ }, - { "&", "&" }, - { "<", "<" }, - { ">", ">" }, - - { _("ISO 8859-1 characters"), NULL }, - { " ", " " }, - { "¡", "¡" }, - { "¢", "¢" }, - { "£", "£" }, - { "¤", "¤" }, - { "¥", "¥" }, - { "¦", "¦" }, - { "§", "§" }, - { "¨", "¨" }, - { "©", "©" }, - { "®", "®" }, - { "«", "«" }, - { "»", "»" }, - { "¬", "¬" }, - { " ", "­" }, - { "¯", "¯" }, - { "°", "°" }, - { "±", "±" }, - { "¹", "¹" }, - { "²", "²" }, - { "³", "³" }, - { "¼", "¼" }, - { "½", "½" }, - { "¾", "¾" }, - { "×", "×" }, - { "÷", "÷" }, - { "´", "´" }, - { "µ", "µ" }, - { "¶", "¶" }, - { "·", "·" }, - { "¸", "¸" }, - { "ª", "ª" }, - { "º", "º" }, - { "¿", "¿" }, - { "À", "À" }, - { "Á", "Á" }, - { "Â", "Â" }, - { "Ã", "Ã" }, - { "Ä", "Ä" }, - { "Å", "Å" }, - { "Æ", "Æ" }, - { "Ç", "Ç" }, - { "È", "È" }, - { "É", "É" }, - { "Ê", "Ê" }, - { "Ë", "Ë" }, - { "Ì", "Ì" }, - { "Í", "Í" }, - { "Î", "Î" }, - { "Ï", "Ï" }, - { "Ð", "Ð" }, - { "Ñ", "Ñ" }, - { "Ò", "Ò" }, - { "Ó", "Ó" }, - { "Ô", "Ô" }, - { "Õ", "Õ" }, - { "Ö", "Ö" }, - { "Ø", "Ø" }, - { "Ù", "Ù" }, - { "Ú", "Ú" }, - { "Û", "Û" }, - { "Ü", "Ü" }, - { "Ý", "Ý" }, - { "Þ", "Þ" }, - { "ß", "ß" }, - { "à", "à" }, - { "á", "á" }, - { "â", "â" }, - { "ã", "ã" }, - { "ä", "ä" }, - { "å", "å" }, - { "æ", "æ" }, - { "ç", "ç" }, - { "è", "è" }, - { "é", "é" }, - { "ê", "ê" }, - { "ë", "ë" }, - { "ì", "ì" }, - { "í", "í" }, - { "î", "î" }, - { "ï", "ï" }, - { "ð", "ð" }, - { "ñ", "ñ" }, - { "ò", "ò" }, - { "ó", "ó" }, - { "ô", "ô" }, - { "õ", "õ" }, - { "ö", "ö" }, - { "ø", "ø" }, - { "ù", "ù" }, - { "ú", "ú" }, - { "û", "û" }, - { "ü", "ü" }, - { "ý", "ý" }, - { "þ", "þ" }, - { "ÿ", "ÿ" }, - - { _("Greek characters"), NULL }, - { "Α", "Α" }, - { "α", "α" }, - { "Β", "Β" }, - { "β", "β" }, - { "Γ", "Γ" }, - { "γ", "γ" }, - { "Δ", "Δ" }, - { "δ", "Δ" }, - { "δ", "δ" }, - { "Ε", "Ε" }, - { "ε", "ε" }, - { "Ζ", "Ζ" }, - { "ζ", "ζ" }, - { "Η", "Η" }, - { "η", "η" }, - { "Θ", "Θ" }, - { "θ", "θ" }, - { "Ι", "Ι" }, - { "ι", "ι" }, - { "Κ", "Κ" }, - { "κ", "κ" }, - { "Λ", "Λ" }, - { "λ", "λ" }, - { "Μ", "Μ" }, - { "μ", "μ" }, - { "Ν", "Ν" }, - { "ν", "ν" }, - { "Ξ", "Ξ" }, - { "ξ", "ξ" }, - { "Ο", "Ο" }, - { "ο", "ο" }, - { "Π", "Π" }, - { "π", "π" }, - { "Ρ", "Ρ" }, - { "ρ", "ρ" }, - { "Σ", "Σ" }, - { "ς", "ς" }, - { "σ", "σ" }, - { "Τ", "Τ" }, - { "τ", "τ" }, - { "Υ", "Υ" }, - { "υ", "υ" }, - { "Φ", "Φ" }, - { "φ", "φ" }, - { "Χ", "Χ" }, - { "χ", "χ" }, - { "Ψ", "Ψ" }, - { "ψ", "ψ" }, - { "Ω", "Ω" }, - { "ω", "ω" }, - { "ϑ", "ϑ" }, - { "ϒ", "ϒ" }, - { "ϖ", "ϖ" }, - - { _("Mathematical characters"), NULL }, - { "∀", "∀" }, - { "∂", "∂" }, - { "∃", "∃" }, - { "∅", "∅" }, - { "∇", "∇" }, - { "∈", "∈" }, - { "∉", "∉" }, - { "∋", "∋" }, - { "∏", "∏" }, - { "∑", "∑" }, - { "−", "−" }, - { "∗", "∗" }, - { "√", "√" }, - { "∝", "∝" }, - { "∞", "∞" }, - { "∠", "∠" }, - { "∧", "∧" }, - { "∨", "∨" }, - { "∩", "∩" }, - { "∪", "∪" }, - { "∫", "∫" }, - { "∴", "∴" }, - { "∼", "∼" }, - { "≅", "≅" }, - { "≈", "≈" }, - { "≠", "≠" }, - { "≡", "≡" }, - { "≤", "≤" }, - { "≥", "≥" }, - { "⊂", "⊂" }, - { "⊃", "⊃" }, - { "⊄", "⊄" }, - { "⊆", "⊆" }, - { "⊇", "⊇" }, - { "⊕", "⊕" }, - { "⊗", "⊗" }, - { "⊥", "⊥" }, - { "⋅", "⋅" }, - { "◊", "◊" }, - - { _("Technical characters"), NULL }, - { "⌈", "⌈" }, - { "⌉", "⌉" }, - { "⌊", "⌊" }, - { "⌋", "⌋" }, - { "〈", "⟨" }, - { "〉", "⟩" }, - - { _("Arrow characters"), NULL }, - { "←", "←" }, - { "↑", "↑" }, - { "→", "→" }, - { "↓", "↓" }, - { "↔", "↔" }, - { "↵", "↵" }, - { "⇐", "⇐" }, - { "⇑", "⇑" }, - { "⇒", "⇒" }, - { "⇓", "⇓" }, - { "⇔", "⇔" }, - - { _("Punctuation characters"), NULL }, - { "–", "–" }, - { "—", "—" }, - { "‘", "‘" }, - { "’", "’" }, - { "‚", "‚" }, - { "“", "“" }, - { "”", "”" }, - { "„", "„" }, - { "†", "†" }, - { "‡", "‡" }, - { "…", "…" }, - { "‰", "‰" }, - { "‹", "‹" }, - { "›", "›" }, - - { _("Miscellaneous characters"), NULL }, - { "•", "•" }, - { "′", "′" }, - { "″", "″" }, - { "‾", "‾" }, - { "⁄", "⁄" }, - { "℘", "℘" }, - { "ℑ", "ℑ" }, - { "ℜ", "ℜ" }, - { "™", "™" }, - { "€", "€" }, - { "ℵ", "ℵ" }, - { "♠", "♠" }, - { "♣", "♣" }, - { "♥", "♥" }, - { "♦", "♦" }, - { "Œ", "Œ" }, - { "œ", "œ" }, - { "Š", "Š" }, - { "š", "š" }, - { "Ÿ", "Ÿ" }, - { "ƒ", "ƒ" }, - }; - len = G_N_ELEMENTS(chars); for (i = 0; i < len; i++) { @@ -435,7 +537,6 @@ } }
- /* just inserts the HTML_NAME coloumn of the selected row at current position * returns only TRUE if a valid selection(i.e. no category) could be found */ static gboolean sc_insert(GtkTreeModel *model, GtkTreeIter *iter) @@ -505,28 +606,86 @@ }
-/* Callback when the menu item is clicked */ +static void replace_special_character() +{ + GeanyDocument *doc = NULL; + doc = document_get_current(); + + if (doc != NULL && sci_has_selection(doc->editor->sci)) + { + gint selection_len = sci_get_selected_text_length(doc->editor->sci); + gchar *selection = g_malloc(selection_len + 1); + GString *replacement = g_string_new(NULL); + gint i; + gchar *new = NULL; + const gchar *entity = NULL; + gchar buf[7]; + gint len; + + sci_get_selected_text(doc->editor->sci, selection); + + selection_len = sci_get_selected_text_length(doc->editor->sci) - 1; + for (i = 0; i < selection_len; i++) + { + len = g_unichar_to_utf8(g_utf8_get_char(selection + i), buf); + i = len - 1 + i; + + buf[len] = '\0'; + entity = get_entity(buf); + + if (entity != NULL) + { + replacement = g_string_append(replacement, entity); + } + else + { + replacement = g_string_append(replacement, buf); + } + + } + new = g_string_free(replacement, FALSE); + sci_replace_sel(doc->editor->sci, new); + g_free(selection); + g_free(new); + } +} + + +/* Callback for special chars menu */ static void item_activate(GtkMenuItem *menuitem, gpointer gdata) { tools_show_dialog_insert_special_chars(); }
- static void kb_activate(G_GNUC_UNUSED guint key_id) { item_activate(NULL, NULL); }
+/* Callback for bulk replacement of selected text */ +static void +replace_special_character_activated(GtkMenuItem *menuitem, gpointer gdata) +{ + replace_special_character(); +} + + + +static void kb_special_chars_replacement(G_GNUC_UNUSED guint key_id) +{ + replace_special_character(); +} + + /* Called by Geany to initialize the plugin */ void plugin_init(GeanyData *data) { GtkWidget *menu_item; const gchar *menu_text = _("_Insert Special HTML Characters"); - gchar *kb_label = _("Insert Special HTML Characters");
- /* Add an item to the Tools menu */ + /* Add an item to the Tools menu for html chars dialog*/ menu_item = gtk_menu_item_new_with_mnemonic(menu_text); gtk_widget_show(menu_item); gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), menu_item); @@ -534,11 +693,46 @@
/* disable menu_item when there are no documents open */ ui_add_document_sensitive(menu_item); + + /* Add menuitem for html replacement functions*/ + main_menu = gtk_menu_item_new_with_mnemonic(_("HTML Replacement")); + gtk_widget_show_all(main_menu); + gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), main_menu); + + main_menu_submenu = gtk_menu_new(); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(main_menu), main_menu_submenu); + + menu_htmltoggle = gtk_check_menu_item_new_with_mnemonic(_("_HTMLToggle")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_htmltoggle), + plugin_active); + gtk_container_add(GTK_CONTAINER(main_menu_submenu), menu_htmltoggle); + + g_signal_connect((gpointer) menu_htmltoggle, "activate", + G_CALLBACK(toggle_status), NULL); + + menu_bulk_replace = gtk_menu_item_new_with_mnemonic( + _("Bulk replacement of special chars")); + g_signal_connect((gpointer) menu_bulk_replace, "activate", + G_CALLBACK(replace_special_character_activated), NULL); + + gtk_container_add(GTK_CONTAINER(main_menu_submenu), menu_bulk_replace); + + ui_add_document_sensitive(main_menu); + gtk_widget_show(menu_bulk_replace); + gtk_widget_show(menu_htmltoggle); + main_menu_item = menu_item;
/* setup keybindings */ - keybindings_set_item(plugin_key_group, KB_INSERT_HTML_CHARS, kb_activate, - 0, 0, "insert_html_chars", kb_label, menu_item); + keybindings_set_item(plugin_key_group, KB_INSERT_HTML_CHARS, + kb_activate, 0, 0, "insert_html_chars", + _("Insert Special HTML Characters"), menu_item); + keybindings_set_item(plugin_key_group, KB_REPLACE_HTML_ENTITIES, + kb_special_chars_replacement, 0, 0, "replace_special_characters", + _("Replace special characters"), NULL); + keybindings_set_item(plugin_key_group, KB_HTMLTOGGLE_ACTIVE, + kbhtmltoggle_toggle, 0, 0, "htmltoogle_toggle_plugin_status", + _("Toggle plugin status"), menu_htmltoggle); }
@@ -546,6 +740,7 @@ void plugin_cleanup(void) { gtk_widget_destroy(main_menu_item); + gtk_widget_destroy(main_menu);
if (sc_dialog != NULL) gtk_widget_destroy(sc_dialog);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.