Revision: 2341 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=2341&view=re... Author: frlan Date: 2011-11-15 17:36:39 +0000 (Tue, 15 Nov 2011) Log Message: ----------- GeanyVC: Add an option to switch between menubar und tools menu.
(Currently as a hidden pref)
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-15 13:37:47 UTC (rev 2340) +++ trunk/geany-plugins/geanyvc/src/geanyvc.c 2011-11-15 17:36:39 UTC (rev 2341) @@ -61,6 +61,7 @@ static gboolean set_maximize_commit_dialog; static gboolean set_external_diff; static gboolean set_editor_menu_entries; +static gboolean set_menubar_entry;
static gchar *config_file;
@@ -1948,6 +1949,8 @@ TRUE); enable_hg = utils_get_setting_boolean(config, "VC", "enable_hg", TRUE); + set_menubar_entry = utils_get_setting_boolean(config, "VC", "attach_to_menubar", + TRUE);
#ifdef USE_GTKSPELL lang = g_key_file_get_string(config, "VC", "spellchecking_language", &error); @@ -2224,8 +2227,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, "VC", G_DIR_SEPARATOR_S, "VC.conf", NULL); @@ -2234,12 +2236,22 @@ registrate();
- menubar = GTK_MENU_SHELL( + if (set_menubar_entry == TRUE) + { + GtkMenuShell *menubar; + + 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( + menu_vc = gtk_menu_item_new_with_mnemonic(_("_Version Control")); + gtk_menu_shell_insert( menubar, menu_vc, g_list_length(menubar->children)-1); + } + else + { + menu_vc = gtk_image_menu_item_new_with_mnemonic(_("_Version Control")); + gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), menu_vc); + }
g_signal_connect(menu_vc, "activate", G_CALLBACK(update_menu_items), NULL);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.