Revision: 2338 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=2338&view=re... Author: frlan Date: 2011-11-14 19:50:12 +0000 (Mon, 14 Nov 2011) Log Message: ----------- GeanyVC: Adding VC menu direct into menubar
Modified Paths: -------------- trunk/geany-plugins/geanyvc/src/geanyvc.c
Modified: trunk/geany-plugins/geanyvc/src/geanyvc.c =================================================================== --- trunk/geany-plugins/geanyvc/src/geanyvc.c 2011-11-14 09:48:27 UTC (rev 2337) +++ trunk/geany-plugins/geanyvc/src/geanyvc.c 2011-11-14 19:50:12 UTC (rev 2338) @@ -375,7 +375,7 @@ /* name should be in UTF-8, and can have a path. */ static void show_output(const gchar * std_output, const gchar * name, - const gchar * force_encoding, GeanyFiletype * ftype, + const gchar * force_encoding, GeanyFiletype * ftype, gint line) { gint page; @@ -389,7 +389,7 @@ if (doc == NULL) { doc = document_new_file(name, ftype, std_output); - /* To due the given line is Scintilla's line number, but + /* To due the given line is Scintilla's line number, but * we need the view line number in this case. */ line = line + 1; if (line < 1) @@ -713,7 +713,7 @@ execute_command(vc, &text, NULL, doc->file_name, VC_COMMAND_BLAME, NULL, NULL); if (text) { - show_output(text, "*VC-BLAME*", NULL, + show_output(text, "*VC-BLAME*", NULL, doc->file_type, sci_get_current_line(doc->editor->sci)); g_free(text); } @@ -2224,6 +2224,7 @@ GtkWidget *menu_vc_file = NULL; GtkWidget *menu_vc_dir = NULL; GtkWidget *menu_vc_basedir = NULL; + GtkMenuShell *menubar;
config_file = g_strconcat(geany->app->configdir, G_DIR_SEPARATOR_S, "plugins", G_DIR_SEPARATOR_S, @@ -2232,9 +2233,14 @@ load_config(); registrate();
- menu_vc = gtk_image_menu_item_new_with_mnemonic(_("_Version Control")); - gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), menu_vc);
+ menubar = GTK_MENU_SHELL( + ui_lookup_widget(geany->main_widgets->window, "menubar1")); + + menu_vc = gtk_menu_item_new_with_mnemonic(_("_Version Control")); + gtk_menu_shell_insert( + menubar, menu_vc, g_list_length(menubar->children)-1); + g_signal_connect(menu_vc, "activate", G_CALLBACK(update_menu_items), NULL);
menu_vc_menu = gtk_menu_new();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org