[Xfce4-commits] <mousepad:matt/gtksourceview> Make Filetype separate in the Document menu.
Matthew Brush
noreply at xfce.org
Fri Oct 7 14:56:03 CEST 2011
Updating branch refs/heads/matt/gtksourceview
to ab93fe61fe7317e61ee6ec804e3d266bc1e50980 (commit)
from 4777a405afb12e26853328a9131c2c3f131014ec (commit)
commit ab93fe61fe7317e61ee6ec804e3d266bc1e50980
Author: Matthew Brush <matt at xfce.org>
Date: Fri Oct 7 02:15:21 2011 -0700
Make Filetype separate in the Document menu.
mousepad/mousepad-window-ui.xml | 7 ++-
mousepad/mousepad-window.c | 78 +++++++++++++++++++-------------------
2 files changed, 43 insertions(+), 42 deletions(-)
diff --git a/mousepad/mousepad-window-ui.xml b/mousepad/mousepad-window-ui.xml
index bf49fd5..f960bc6 100644
--- a/mousepad/mousepad-window-ui.xml
+++ b/mousepad/mousepad-window-ui.xml
@@ -102,9 +102,6 @@
<menu action="document-menu">
<menuitem action="auto-indent" />
- <menu action="language-menu">
- <placeholder name="placeholder-language-section-items" />
- </menu>
<menu action="eol-menu">
<menuitem action="unix" />
<menuitem action="mac" />
@@ -118,6 +115,10 @@
<menuitem action="word-wrap" />
<separator />
<menuitem action="write-bom" />
+ <separator />
+ <menu action="language-menu">
+ <placeholder name="placeholder-language-section-items" />
+ </menu>
</menu>
<menu action="navigation-menu">
diff --git a/mousepad/mousepad-window.c b/mousepad/mousepad-window.c
index 1ababb9..db3a69e 100644
--- a/mousepad/mousepad-window.c
+++ b/mousepad/mousepad-window.c
@@ -317,8 +317,6 @@ static void mousepad_window_action_decrease_indent (GtkAction
MousepadWindow *window);
static void mousepad_window_action_auto_indent (GtkToggleAction *action,
MousepadWindow *window);
-static void mousepad_window_action_language (GtkToggleAction *action,
- MousepadWindow *window);
static void mousepad_window_action_line_ending (GtkRadioAction *action,
GtkRadioAction *current,
MousepadWindow *window);
@@ -328,6 +326,8 @@ static void mousepad_window_action_word_wrap (GtkToggle
MousepadWindow *window);
static void mousepad_window_action_write_bom (GtkToggleAction *action,
MousepadWindow *window);
+static void mousepad_window_action_language (GtkToggleAction *action,
+ MousepadWindow *window);
static void mousepad_window_action_insert_spaces (GtkToggleAction *action,
MousepadWindow *window);
static void mousepad_window_action_prev_tab (GtkAction *action,
@@ -450,9 +450,9 @@ static const GtkActionEntry action_entries[] =
{ "decrease-indent", GTK_STOCK_UNINDENT, N_("_Decrease Indent"), NULL, N_("Decrease the indentation of the selection or current line"), G_CALLBACK (mousepad_window_action_decrease_indent), },
{ "document-menu", NULL, N_("_Document"), NULL, NULL, NULL, },
- { "language-menu", NULL, N_("_Filetype"), NULL, NULL, NULL, },
{ "eol-menu", NULL, N_("Line E_nding"), NULL, NULL, NULL, },
{ "tab-size-menu", NULL, N_("Tab _Size"), NULL, NULL, NULL, },
+ { "language-menu", NULL, N_("_Filetype"), NULL, NULL, NULL, },
{ "navigation-menu", NULL, N_("_Navigation"), NULL, },
{ "back", GTK_STOCK_GO_BACK, N_("_Previous Tab"), "<control>Page_Up", N_("Select the previous tab"), G_CALLBACK (mousepad_window_action_prev_tab), },
@@ -4722,42 +4722,6 @@ mousepad_window_action_auto_indent (GtkToggleAction *action,
static void
-mousepad_window_action_language (GtkToggleAction *action,
- MousepadWindow *window)
-{
- guint lang_hash;
- const gchar *const *lang_id;
- GtkSourceLanguage *language;
- GtkSourceLanguageManager *manager;
- GtkSourceBuffer *buffer;
-
- lang_hash = (guint) gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
- buffer = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (window->active->textview)));
-
- if (lang_hash == g_str_hash ("none"))
- {
- gtk_source_buffer_set_language (buffer, NULL);
- return;
- }
-
- manager = gtk_source_language_manager_get_default ();
- lang_id = gtk_source_language_manager_get_language_ids (manager);
-
- while (*lang_id)
- {
- if (g_str_hash (*lang_id) == lang_hash)
- {
- language = gtk_source_language_manager_get_language (manager, *lang_id);
- gtk_source_buffer_set_language (buffer, language);
- break;
- }
- lang_id++;
- }
-}
-
-
-
-static void
mousepad_window_action_line_ending (GtkRadioAction *action,
GtkRadioAction *current,
MousepadWindow *window)
@@ -4875,6 +4839,42 @@ mousepad_window_action_write_bom (GtkToggleAction *action,
static void
+mousepad_window_action_language (GtkToggleAction *action,
+ MousepadWindow *window)
+{
+ guint lang_hash;
+ const gchar *const *lang_id;
+ GtkSourceLanguage *language;
+ GtkSourceLanguageManager *manager;
+ GtkSourceBuffer *buffer;
+
+ lang_hash = (guint) gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
+ buffer = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (window->active->textview)));
+
+ if (lang_hash == g_str_hash ("none"))
+ {
+ gtk_source_buffer_set_language (buffer, NULL);
+ return;
+ }
+
+ manager = gtk_source_language_manager_get_default ();
+ lang_id = gtk_source_language_manager_get_language_ids (manager);
+
+ while (*lang_id)
+ {
+ if (g_str_hash (*lang_id) == lang_hash)
+ {
+ language = gtk_source_language_manager_get_language (manager, *lang_id);
+ gtk_source_buffer_set_language (buffer, language);
+ break;
+ }
+ lang_id++;
+ }
+}
+
+
+
+static void
mousepad_window_action_insert_spaces (GtkToggleAction *action,
MousepadWindow *window)
{
More information about the Xfce4-commits
mailing list