Revision: 425 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=425&view=rev Author: frlan Date: 2009-02-02 16:55:48 +0000 (Mon, 02 Feb 2009)
Log Message: ----------- GeanyVC: Merged GeanyVC_menu_redesign into trunk: * Moving file, dir and basedir (working copy) specific stuff into seperate sub menu * Rework of plugin_init() and some cleanup * Added feature to show original file * Extend revert to dir and basedir of working copy
Modified Paths: -------------- trunk/geanyvc/geanyvc.c trunk/geanyvc/geanyvc.h trunk/geanyvc/po/ChangeLog trunk/geanyvc/po/de.po trunk/geanyvc/vc_bzr.c trunk/geanyvc/vc_cvs.c trunk/geanyvc/vc_git.c trunk/geanyvc/vc_hg.c trunk/geanyvc/vc_svk.c trunk/geanyvc/vc_svn.c
Modified: trunk/geanyvc/geanyvc.c =================================================================== --- trunk/geanyvc/geanyvc.c 2009-02-01 19:16:54 UTC (rev 424) +++ trunk/geanyvc/geanyvc.c 2009-02-02 16:55:48 UTC (rev 425) @@ -126,14 +126,14 @@ VC_COMMIT, VC_STATUS, VC_UPDATE, - VC_REVERT, + VC_REVERT_FILE, + VC_REVERT_DIR, + VC_REVERT_BASEDIR, COUNT_KB };
PLUGIN_KEY_GROUP(geanyvc, COUNT_KB) - -GSList * -get_commit_files_null(G_GNUC_UNUSED const gchar * dir) +GSList *get_commit_files_null(G_GNUC_UNUSED const gchar * dir) { return NULL; } @@ -374,7 +374,8 @@
/* 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) +show_output(const gchar * std_output, const gchar * name, + const gchar * force_encoding, GeanyFiletype *ftype) { gint page; GtkNotebook *book; @@ -386,11 +387,13 @@ doc = document_find_by_filename(name); if (doc == NULL) { - doc = document_new_file(name, NULL, std_output); + doc = document_new_file(name, ftype, std_output); } else { sci_set_text(doc->editor->sci, std_output); + if(ftype) + document_set_filetype(doc, ftype); book = GTK_NOTEBOOK(geany->main_widgets->notebook); page = gtk_notebook_page_num(book, GTK_WIDGET(doc->editor->sci)); gtk_notebook_set_current_page(book, page); @@ -439,30 +442,29 @@ { return 0; } - for (cur = largv; cur != NULL; cur = g_slist_next(cur)) { argv = cur->data; if (cur != g_slist_last(largv)) { utils_spawn_sync(dir, cur->data, (gchar **) env, - G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL | - G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, NULL, NULL, - &exit_code, &error); + G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL | + G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, NULL, NULL, + &exit_code, &error); } else { utils_spawn_sync(dir, cur->data, (gchar **) env, - G_SPAWN_SEARCH_PATH | (std_out ? 0 : - G_SPAWN_STDOUT_TO_DEV_NULL) | - (std_err ? 0 : G_SPAWN_STDERR_TO_DEV_NULL), NULL, NULL, - std_out, std_err, &exit_code, &error); + G_SPAWN_SEARCH_PATH | (std_out ? 0 : + G_SPAWN_STDOUT_TO_DEV_NULL) | + (std_err ? 0 : G_SPAWN_STDERR_TO_DEV_NULL), NULL, NULL, + std_out, std_err, &exit_code, &error); } if (error) { g_warning("geanyvc: s_spawn_sync error: %s", error->message); ui_set_statusbar(FALSE, _("geanyvc: s_spawn_sync error: %s"), - error->message); + error->message); g_error_free(error); }
@@ -478,8 +480,7 @@ if (!g_utf8_validate(*std_out, -1, NULL)) { setptr(*std_out, encodings_convert_to_utf8(*std_out, - strlen(*std_out), - NULL)); + strlen(*std_out), NULL)); } if (!NZV(*std_out)) { @@ -497,8 +498,7 @@ if (!g_utf8_validate(*std_err, -1, NULL)) { setptr(*std_err, encodings_convert_to_utf8(*std_err, - strlen(*std_err), - NULL)); + strlen(*std_err), NULL)); } if (!NZV(*std_err)) { @@ -626,7 +626,7 @@ else { name = g_strconcat(doc->file_name, ".vc.diff", NULL); - show_output(text, name, doc->encoding); + show_output(text, name, doc->encoding, NULL); g_free(text); g_free(name); } @@ -638,52 +638,14 @@ } }
-/* Make a diff from the current directory */ -static void -vcdiff_dir_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) -{ - gchar *base_name = NULL; - gchar *text = NULL; - const VC_RECORD *vc; - GeanyDocument *doc;
- doc = document_get_current(); - g_return_if_fail(doc != NULL && doc->file_name != NULL);
- if (doc->changed) - { - document_save_file(doc, FALSE); - } - - base_name = g_path_get_dirname(doc->file_name); - - vc = find_vc(base_name); - g_return_if_fail(vc); - - execute_command(vc, &text, NULL, base_name, VC_COMMAND_DIFF_DIR, NULL, NULL); - if (text) - { - setptr(base_name, g_strconcat(base_name, ".vc.diff", NULL)); - show_output(text, base_name, NULL); - g_free(text); - } - else - { - ui_set_statusbar(FALSE, _("No changes were made.")); - } - - g_free(base_name); -} - - /* Callback if menu item for the base directory was activated */ static void -vcdiff_basedir_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) +vcdiff_dir_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, gint flags) { gchar *text = NULL; - gchar *name; - gchar *basedir; - gchar *base_name; + gchar *dir; const VC_RECORD *vc; GeanyDocument *doc;
@@ -698,16 +660,24 @@ vc = find_vc(doc->file_name); g_return_if_fail(vc);
- basedir = vc->get_base_dir(doc->file_name); - g_return_if_fail(basedir); + if (flags & FLAG_BASEDIR) + { + dir = vc->get_base_dir(doc->file_name); + } + else if (flags & FLAG_DIR) + { + dir = g_path_get_dirname(doc->file_name); + } + else + return; + g_return_if_fail(dir);
- execute_command(vc, &text, NULL, basedir, VC_COMMAND_DIFF_DIR, NULL, NULL); + execute_command(vc, &text, NULL, dir, VC_COMMAND_DIFF_DIR, NULL, NULL); if (text) { - base_name = g_path_get_dirname(doc->file_name); - name = g_strconcat(base_name, ".vc.diff", NULL); - show_output(text, name, NULL); - g_free(base_name); + gchar *name; + name = g_strconcat(dir, ".vc.diff", NULL); + show_output(text, name, doc->encoding, NULL); g_free(text); g_free(name); } @@ -715,7 +685,7 @@ { ui_set_statusbar(FALSE, _("No changes were made.")); } - g_free(basedir); + g_free(dir); }
static void @@ -734,7 +704,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); g_free(text); } else @@ -760,7 +730,7 @@ execute_command(vc, &output, NULL, doc->file_name, VC_COMMAND_LOG_FILE, NULL, NULL); if (output) { - show_output(output, "*VC-LOG*", NULL); + show_output(output, "*VC-LOG*", NULL, NULL); g_free(output); } } @@ -784,7 +754,7 @@ execute_command(vc, &text, NULL, base_name, VC_COMMAND_LOG_DIR, NULL, NULL); if (text) { - show_output(text, "*VC-LOG*", NULL); + show_output(text, "*VC-LOG*", NULL, NULL); g_free(text); }
@@ -811,7 +781,7 @@ execute_command(vc, &text, NULL, basedir, VC_COMMAND_LOG_DIR, NULL, NULL); if (text) { - show_output(text, "*VC-LOG*", NULL); + show_output(text, "*VC-LOG*", NULL, NULL); g_free(text); } g_free(basedir); @@ -842,15 +812,39 @@ execute_command(vc, &text, NULL, base_name, VC_COMMAND_STATUS, NULL, NULL); if (text) { - show_output(text, "*VC-STATUS*", NULL); + show_output(text, "*VC-STATUS*", NULL, NULL); g_free(text); }
g_free(base_name); }
+static void +vcshow_file_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) +{ + gchar *output = NULL; + const VC_RECORD *vc; + GeanyDocument *doc; + + doc = document_get_current(); + g_return_if_fail(doc != NULL && doc->file_name != NULL); + + vc = find_vc(doc->file_name); + g_return_if_fail(vc); + + execute_command(vc, &output, NULL, doc->file_name, VC_COMMAND_SHOW, NULL, NULL); + if (output) + { + gchar *name; + name = g_strconcat(doc->file_name, ".vc.orig", NULL); + show_output(output, name, doc->encoding, doc->file_type); + g_free(name); + g_free(output); + } +} + static gboolean -command_with_question_activated(gchar ** text, gint cmd, const gchar * question, gboolean ask) +command_with_question_activated(gchar ** text, gint cmd, const gchar * question, gint flags) { GtkWidget *dialog; gint result; @@ -861,17 +855,27 @@ doc = document_get_current(); g_return_val_if_fail(doc != NULL && doc->file_name != NULL, FALSE);
+ dir = g_path_get_dirname(doc->file_name); + vc = find_vc(dir); + g_return_val_if_fail(vc, FALSE); + + if (flags & FLAG_BASEDIR) + { + dir = vc->get_base_dir(dir); + } + if (doc->changed) { document_save_file(doc, FALSE); }
- if (ask) + if ((flags & FLAG_FORCE_ASK) || set_add_confirmation) { dialog = gtk_message_dialog_new(GTK_WINDOW(geany->main_widgets->window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, - GTK_BUTTONS_YES_NO, question, doc->file_name); + GTK_BUTTONS_YES_NO, question, + (flags & (FLAG_DIR|FLAG_BASEDIR) ? dir : doc->file_name)); result = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); } @@ -882,52 +886,49 @@
if (result == GTK_RESPONSE_YES) { - dir = g_path_get_dirname(doc->file_name); - vc = find_vc(dir); - g_return_val_if_fail(vc, FALSE); - - execute_command(vc, text, NULL, doc->file_name, cmd, NULL, NULL); - g_free(dir); + if (flags & FLAG_FILE) + execute_command(vc, text, NULL, doc->file_name, cmd, NULL, NULL); + if (flags & (FLAG_DIR|FLAG_BASEDIR)) + execute_command(vc, text, NULL, dir, cmd, NULL, NULL); + if (flags & FLAG_RELOAD) + document_reload_file(doc, NULL); } - return (result == GTK_RESPONSE_YES) ? TRUE : FALSE; + g_free(dir); + return (result == GTK_RESPONSE_YES); }
static void vcrevert_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) { - gboolean ret; - GeanyDocument *doc; + command_with_question_activated(NULL, VC_COMMAND_REVERT_FILE, + _("Do you really want to revert: %s?"), + FLAG_RELOAD | FLAG_FILE | FLAG_FORCE_ASK); +}
- doc = document_get_current(); - g_return_if_fail(doc != NULL && doc->file_name != NULL); - - ret = command_with_question_activated(NULL, VC_COMMAND_REVERT_FILE, - _("Do you really want to revert: %s?"), TRUE); - if (ret) - { - document_reload_file(doc, NULL); - } +static void +vcrevert_dir_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, gint flags) +{ + command_with_question_activated(NULL, VC_COMMAND_REVERT_DIR, + _("Do you really want to revert: %s?"), + FLAG_RELOAD | flags | FLAG_FORCE_ASK); }
- static void vcadd_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) { command_with_question_activated(NULL, VC_COMMAND_ADD, - _("Do you really want to add: %s?"), set_add_confirmation); + _("Do you really want to add: %s?"), FLAG_FILE); }
static void vcremove_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) { - gboolean ret; - - ret = command_with_question_activated(NULL, VC_COMMAND_REMOVE, - _("Do you really want to remove: %s?"), TRUE); - if (ret) + if (command_with_question_activated(NULL, VC_COMMAND_REMOVE, + _("Do you really want to remove: %s?"), + FLAG_FORCE_ASK | FLAG_FILE)) { document_remove_page(gtk_notebook_get_current_page - (GTK_NOTEBOOK(geany->main_widgets->notebook))); + (GTK_NOTEBOOK(geany->main_widgets->notebook))); } }
@@ -946,17 +947,14 @@ document_save_file(doc, FALSE); }
- ret = command_with_question_activated(&text, VC_COMMAND_UPDATE, - _("Do you really want to update?"), - set_add_confirmation); - if (ret) + if (command_with_question_activated(&text, VC_COMMAND_UPDATE, + _("Do you really want to update?"), FLAG_FILE)) { document_reload_file(doc, NULL);
if (NZV(text)) - show_output(text, "*VC-UPDATE*", NULL); - if (text) - g_free(text); + show_output(text, "*VC-UPDATE*", NULL, NULL); + g_free(text); } }
@@ -1430,7 +1428,7 @@ if (speller == NULL) { ui_set_statusbar(FALSE, _("Error initializing spell checking: %s"), - spellcheck_error->message); + spellcheck_error->message); g_error_free(spellcheck_error); spellcheck_error = NULL; } @@ -1440,9 +1438,9 @@ if (spellcheck_error != NULL) { ui_set_statusbar(TRUE, - _ - ("Error while setting up language for spellchecking. Please check configuration. Error message was: %s"), - spellcheck_error->message); + _ + ("Error while setting up language for spellchecking. Please check configuration. Error message was: %s"), + spellcheck_error->message); g_error_free(spellcheck_error); spellcheck_error = NULL; } @@ -1484,10 +1482,13 @@ static GtkWidget *menu_vc_log_basedir = NULL; static GtkWidget *menu_vc_status = NULL; static GtkWidget *menu_vc_revert_file = NULL; +static GtkWidget *menu_vc_revert_dir = NULL; +static GtkWidget *menu_vc_revert_basedir = NULL; static GtkWidget *menu_vc_add_file = NULL; static GtkWidget *menu_vc_remove_file = NULL; static GtkWidget *menu_vc_update = NULL; static GtkWidget *menu_vc_commit = NULL; +static GtkWidget *menu_vc_show_file = NULL;
static void update_menu_items() @@ -1527,47 +1528,70 @@ gtk_widget_set_sensitive(menu_vc_status, d_have_vc);
gtk_widget_set_sensitive(menu_vc_revert_file, f_have_vc); + gtk_widget_set_sensitive(menu_vc_revert_dir, f_have_vc); + gtk_widget_set_sensitive(menu_vc_revert_basedir, f_have_vc);
gtk_widget_set_sensitive(menu_vc_remove_file, f_have_vc); gtk_widget_set_sensitive(menu_vc_add_file, d_have_vc && !f_have_vc);
gtk_widget_set_sensitive(menu_vc_update, d_have_vc); gtk_widget_set_sensitive(menu_vc_commit, d_have_vc); + + gtk_widget_set_sensitive(menu_vc_show_file, f_have_vc); }
-static void kbdiff_file(G_GNUC_UNUSED guint key_id) +static void +kbdiff_file(G_GNUC_UNUSED guint key_id) { vcdiff_file_activated(NULL, NULL); }
-static void kbdiff_dir(G_GNUC_UNUSED guint key_id) +static void +kbdiff_dir(G_GNUC_UNUSED guint key_id) { - vcdiff_dir_activated(NULL, NULL); + vcdiff_dir_activated(NULL, FLAG_DIR); }
-static void kbdiff_basedir(G_GNUC_UNUSED guint key_id) +static void +kbdiff_basedir(G_GNUC_UNUSED guint key_id) { - vcdiff_basedir_activated(NULL, NULL); + vcdiff_dir_activated(NULL, FLAG_BASEDIR); }
-static void kbstatus(G_GNUC_UNUSED guint key_id) +static void +kbstatus(G_GNUC_UNUSED guint key_id) { vcstatus_activated(NULL, NULL); }
-static void kbcommit(G_GNUC_UNUSED guint key_id) +static void +kbcommit(G_GNUC_UNUSED guint key_id) { vccommit_activated(NULL, NULL); }
-static void kbrevert(G_GNUC_UNUSED guint key_id) +static void +kbrevert_file(G_GNUC_UNUSED guint key_id) { vcrevert_activated(NULL, NULL); }
-static void kbupdate(G_GNUC_UNUSED guint key_id) +static void +kbrevert_dir(G_GNUC_UNUSED guint key_id) { + vcrevert_dir_activated(NULL, FLAG_DIR); +} + +static void +kbrevert_basedir(G_GNUC_UNUSED guint key_id) +{ + vcrevert_dir_activated(NULL, FLAG_BASEDIR); +} + +static void +kbupdate(G_GNUC_UNUSED guint key_id) +{ vcupdate_activated(NULL, NULL); }
@@ -1645,8 +1669,8 @@ && utils_mkdir(config_dir, TRUE) != 0) { dialogs_show_msgbox(GTK_MESSAGE_ERROR, - _ - ("Plugin configuration directory could not be created.")); + _ + ("Plugin configuration directory could not be created.")); } else { @@ -1889,141 +1913,250 @@ REGISTER_VC(HG, enable_hg); }
-/* Called by Geany to initialize the plugin */ -void -plugin_init(G_GNUC_UNUSED GeanyData * data) +static void +do_current_file_menu(GtkWidget ** parent_menu, GtkTooltips ** tooltips) { - GtkWidget *menu_vc = NULL; - GtkWidget *menu_vc_menu = NULL; - GtkTooltips *tooltips = NULL; + GtkWidget *cur_file_menu = NULL; + /* Menu which will hold the items in the current file menu */ + cur_file_menu = gtk_menu_new();
- main_locale_init(LOCALEDIR, GETTEXT_PACKAGE); + *parent_menu = gtk_image_menu_item_new_with_mnemonic(_("Current _File")); + g_signal_connect((gpointer) * parent_menu, "activate", G_CALLBACK(update_menu_items), NULL);
- config_file = - g_strconcat(geany->app->configdir, G_DIR_SEPARATOR_S, "plugins", G_DIR_SEPARATOR_S, - "VC", G_DIR_SEPARATOR_S, "VC.conf", NULL); - - load_config(); - registrate(); - - tooltips = gtk_tooltips_new(); - - menu_vc = gtk_image_menu_item_new_with_mnemonic(_("_VC")); - gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), menu_vc); - - g_signal_connect((gpointer) menu_vc, "activate", G_CALLBACK(update_menu_items), NULL); - - menu_vc_menu = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_vc), menu_vc_menu); - - // Single file - menu_vc_diff_file = gtk_menu_item_new_with_mnemonic(_("Diff From Current File")); - gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_diff_file); - gtk_tooltips_set_tip(tooltips, menu_vc_diff_file, + /* Diff of current file */ + menu_vc_diff_file = gtk_menu_item_new_with_mnemonic(_("_Diff")); + gtk_container_add(GTK_CONTAINER(cur_file_menu), menu_vc_diff_file); + gtk_tooltips_set_tip(*tooltips, menu_vc_diff_file, _("Make a diff from the current active file"), NULL);
g_signal_connect((gpointer) menu_vc_diff_file, "activate", G_CALLBACK(vcdiff_file_activated), NULL);
- // Directory - menu_vc_diff_dir = gtk_menu_item_new_with_mnemonic(_("Diff From Current Directory")); - gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_diff_dir); - gtk_tooltips_set_tip(tooltips, menu_vc_diff_dir, - _("Make a diff from the directory of the current active file"), NULL); + /* Revert current file */ + menu_vc_revert_file = gtk_menu_item_new_with_mnemonic(_("_Revert")); + gtk_container_add(GTK_CONTAINER(cur_file_menu), menu_vc_revert_file); + gtk_tooltips_set_tip(*tooltips, menu_vc_revert_file, + _("Restore pristine working copy file (undo local edits)."), NULL);
- g_signal_connect((gpointer) menu_vc_diff_dir, "activate", - G_CALLBACK(vcdiff_dir_activated), NULL); + g_signal_connect((gpointer) menu_vc_revert_file, "activate", + G_CALLBACK(vcrevert_activated), NULL);
- // Base directory - menu_vc_diff_basedir = gtk_menu_item_new_with_mnemonic(_("Diff From Base Directory")); - gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_diff_basedir); - gtk_tooltips_set_tip(tooltips, menu_vc_diff_basedir, - _("Make a diff from the top VC directory"), NULL);
- g_signal_connect((gpointer) menu_vc_diff_basedir, "activate", - G_CALLBACK(vcdiff_basedir_activated), NULL); + gtk_container_add(GTK_CONTAINER(cur_file_menu), gtk_separator_menu_item_new());
- gtk_container_add(GTK_CONTAINER(menu_vc_menu), gtk_separator_menu_item_new());
- // Blame for current file - menu_vc_blame = gtk_menu_item_new_with_mnemonic(_("Blame From Current File")); - gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_blame); - gtk_tooltips_set_tip(tooltips, menu_vc_blame, + /* Blame for current file */ + menu_vc_blame = gtk_menu_item_new_with_mnemonic(_("_Blame")); + gtk_container_add(GTK_CONTAINER(cur_file_menu), menu_vc_blame); + gtk_tooltips_set_tip(*tooltips, menu_vc_blame, _("Shows the changes made at one file per revision and author."), NULL);
g_signal_connect((gpointer) menu_vc_blame, "activate", G_CALLBACK(vcblame_activated), NULL);
- gtk_container_add(GTK_CONTAINER(menu_vc_menu), gtk_separator_menu_item_new()); + gtk_container_add(GTK_CONTAINER(cur_file_menu), gtk_separator_menu_item_new());
- // Log - menu_vc_log_file = gtk_menu_item_new_with_mnemonic(_("Log Of Current File")); - gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_log_file); - gtk_tooltips_set_tip(tooltips, menu_vc_log_file, + /* History/log of current file */ + menu_vc_log_file = gtk_menu_item_new_with_mnemonic(_("_History")); + gtk_container_add(GTK_CONTAINER(cur_file_menu), menu_vc_log_file); + gtk_tooltips_set_tip(*tooltips, menu_vc_log_file, _("Shows the log of the current file"), NULL);
g_signal_connect((gpointer) menu_vc_log_file, "activate", G_CALLBACK(vclog_file_activated), NULL);
- menu_vc_log_dir = gtk_menu_item_new_with_mnemonic(_("Log Of Current Directory")); - gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_log_dir); - gtk_tooltips_set_tip(tooltips, menu_vc_log_dir, + /* base version of the current file */ + menu_vc_show_file = gtk_menu_item_new_with_mnemonic(_("_Original")); + gtk_container_add(GTK_CONTAINER(cur_file_menu), menu_vc_show_file); + gtk_tooltips_set_tip(*tooltips, menu_vc_log_file, + _("Shows the orignal of the current file"), NULL); + + g_signal_connect((gpointer) menu_vc_show_file, "activate", + G_CALLBACK(vcshow_file_activated), NULL); + + + gtk_container_add(GTK_CONTAINER(cur_file_menu), gtk_separator_menu_item_new()); + + /* add current file */ + menu_vc_add_file = gtk_menu_item_new_with_mnemonic(_("_Add to Version Control")); + gtk_container_add(GTK_CONTAINER(cur_file_menu), menu_vc_add_file); + gtk_tooltips_set_tip(*tooltips, menu_vc_add_file, _("Add file to repository."), NULL); + + g_signal_connect((gpointer) menu_vc_add_file, "activate", + G_CALLBACK(vcadd_activated), NULL); + + /* remove current file */ + menu_vc_remove_file = gtk_menu_item_new_with_mnemonic(_("_Remove from Version Control")); + gtk_container_add(GTK_CONTAINER(cur_file_menu), menu_vc_remove_file); + gtk_tooltips_set_tip(*tooltips, menu_vc_remove_file, + _("Remove file from repository."), NULL); + + g_signal_connect((gpointer) menu_vc_remove_file, "activate", + G_CALLBACK(vcremove_activated), NULL); + + /* connect to parent menu */ + gtk_menu_item_set_submenu(GTK_MENU_ITEM(*parent_menu), cur_file_menu); +} + +static void +do_current_dir_menu(GtkWidget ** parent_menu, GtkTooltips ** tooltips) +{ + GtkWidget *cur_dir_menu = NULL; + /* Menu which will hold the items in the current file menu */ + cur_dir_menu = gtk_menu_new(); + + *parent_menu = gtk_image_menu_item_new_with_mnemonic(_("Current _Directory")); + g_signal_connect((gpointer) * parent_menu, "activate", G_CALLBACK(update_menu_items), NULL); + /* Diff of the current dir */ + menu_vc_diff_dir = gtk_menu_item_new_with_mnemonic(_("_Diff")); + gtk_container_add(GTK_CONTAINER(cur_dir_menu), menu_vc_diff_dir); + gtk_tooltips_set_tip(*tooltips, menu_vc_diff_dir, + _("Make a diff from the directory of the current active file"), NULL); + + g_signal_connect((gpointer) menu_vc_diff_dir, "activate", + G_CALLBACK(vcdiff_dir_activated), (gpointer)FLAG_DIR); + + /* Revert current dir */ + menu_vc_revert_dir = gtk_menu_item_new_with_mnemonic(_("_Revert")); + gtk_container_add(GTK_CONTAINER(cur_dir_menu), menu_vc_revert_dir); + gtk_tooltips_set_tip(*tooltips, menu_vc_revert_dir, + _("Restore original files in the current folder (undo local edits)."), NULL); + + g_signal_connect((gpointer) menu_vc_revert_dir, "activate", + G_CALLBACK(vcrevert_dir_activated), (gpointer)FLAG_DIR); + + gtk_container_add(GTK_CONTAINER(cur_dir_menu), gtk_separator_menu_item_new()); + /* History/log of the current dir */ + menu_vc_log_dir = gtk_menu_item_new_with_mnemonic(_("_History")); + gtk_container_add(GTK_CONTAINER(cur_dir_menu), menu_vc_log_dir); + gtk_tooltips_set_tip(*tooltips, menu_vc_log_dir, _("Shows the log of the current directory"), NULL);
+ + /* connect to parent menu */ + gtk_menu_item_set_submenu(GTK_MENU_ITEM(*parent_menu), cur_dir_menu); +} + +static void +do_basedir_menu(GtkWidget ** parent_menu, GtkTooltips ** tooltips) +{ + GtkWidget *basedir_menu = NULL; + /* Menu which will hold the items in the current file menu */ + basedir_menu = gtk_menu_new(); + + *parent_menu = gtk_image_menu_item_new_with_mnemonic(_("Current _Basedirectory")); + g_signal_connect((gpointer) * parent_menu, "activate", G_CALLBACK(update_menu_items), NULL); + + /* Complete diff of base directory */ + menu_vc_diff_basedir = gtk_menu_item_new_with_mnemonic(_("_Diff")); + gtk_container_add(GTK_CONTAINER(basedir_menu), menu_vc_diff_basedir); + gtk_tooltips_set_tip(*tooltips, menu_vc_diff_basedir, + _("Make a diff from the top VC directory"), NULL); + + g_signal_connect((gpointer) menu_vc_diff_basedir, "activate", + G_CALLBACK(vcdiff_dir_activated), (gpointer)FLAG_BASEDIR); + + /* Revert everything */ + menu_vc_revert_basedir = gtk_menu_item_new_with_mnemonic(_("_Revert")); + gtk_container_add(GTK_CONTAINER(basedir_menu), menu_vc_revert_basedir); + gtk_tooltips_set_tip(*tooltips, menu_vc_revert_basedir, + _("Revert any local edits."), NULL); + + g_signal_connect((gpointer) menu_vc_revert_basedir, "activate", + G_CALLBACK(vcrevert_dir_activated), (gpointer)FLAG_BASEDIR); + + gtk_container_add(GTK_CONTAINER(basedir_menu), gtk_separator_menu_item_new()); g_signal_connect((gpointer) menu_vc_log_dir, "activate", G_CALLBACK(vclog_dir_activated), NULL);
- menu_vc_log_basedir = gtk_menu_item_new_with_mnemonic(_("Log Of Base Directory")); - gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_log_basedir); - gtk_tooltips_set_tip(tooltips, menu_vc_log_basedir, + /* Complete History/Log of base directory */ + menu_vc_log_basedir = gtk_menu_item_new_with_mnemonic(_("_History")); + gtk_container_add(GTK_CONTAINER(basedir_menu), menu_vc_log_basedir); + gtk_tooltips_set_tip(*tooltips, menu_vc_log_basedir, _("Shows the log of the top VC directory"), NULL);
g_signal_connect((gpointer) menu_vc_log_basedir, "activate", G_CALLBACK(vclog_basedir_activated), NULL);
- gtk_container_add(GTK_CONTAINER(menu_vc_menu), gtk_separator_menu_item_new()); + /* connect to parent menu */ + gtk_menu_item_set_submenu(GTK_MENU_ITEM(*parent_menu), basedir_menu); +}
- // Status - menu_vc_status = gtk_menu_item_new_with_mnemonic(_("_Status")); - gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_status); - gtk_tooltips_set_tip(tooltips, menu_vc_status, _("Show status."), NULL); +static void +init_keybindings(void) +{ + /* init keybindins */ + keybindings_set_item(plugin_key_group, VC_DIFF_FILE, kbdiff_file, 0, 0, + "vc_show_diff_of_file", _("Show diff of file"), menu_vc_diff_file); + keybindings_set_item(plugin_key_group, VC_DIFF_DIR, kbdiff_dir, 0, 0, + "vc_show_diff_of_dir", _("Show diff of diretory"), menu_vc_diff_dir); + keybindings_set_item(plugin_key_group, VC_DIFF_BASEDIR, kbdiff_basedir, 0, 0, + "vc_show_diff_of_basedir", _("Show diff of basedir"), menu_vc_diff_basedir); + keybindings_set_item(plugin_key_group, VC_COMMIT, kbcommit, 0, 0, + "vc_commit", _("Commit changes"), menu_vc_commit); + keybindings_set_item(plugin_key_group, VC_STATUS, kbstatus, 0, 0, + "vc_status", _("Show status"), menu_vc_status); + keybindings_set_item(plugin_key_group, VC_REVERT_FILE, kbrevert_file, 0, 0, + "vc_revert_file", _("Revert single file"), menu_vc_revert_file); + keybindings_set_item(plugin_key_group, VC_REVERT_DIR, kbrevert_dir, 0, 0, + "vc_revert_dir", _("Revert whole directory"),menu_vc_revert_dir); + keybindings_set_item(plugin_key_group, VC_REVERT_BASEDIR, kbrevert_basedir, 0, 0, + "vc_revert_basedir", _("Revert whole tree"), menu_vc_revert_basedir); + keybindings_set_item(plugin_key_group, VC_UPDATE, kbupdate, 0, 0, + "vc_update", _("Update file"), menu_vc_update); +}
- g_signal_connect((gpointer) menu_vc_status, "activate", - G_CALLBACK(vcstatus_activated), NULL); +/* Called by Geany to initialize the plugin */ +void +plugin_init(G_GNUC_UNUSED GeanyData * data) +{ + GtkWidget *menu_vc = NULL; + GtkWidget *menu_vc_menu = NULL; + GtkWidget *menu_vc_file = NULL; + GtkWidget *menu_vc_dir = NULL; + GtkWidget *menu_vc_basedir = NULL; + GtkTooltips *tooltips = NULL;
- gtk_container_add(GTK_CONTAINER(menu_vc_menu), gtk_separator_menu_item_new()); + main_locale_init(LOCALEDIR, GETTEXT_PACKAGE);
- // Revert file - menu_vc_revert_file = gtk_menu_item_new_with_mnemonic(_("_Revert File")); - gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_revert_file); - gtk_tooltips_set_tip(tooltips, menu_vc_revert_file, - _("Restore pristine working copy file (undo local edits)."), NULL); + config_file = + g_strconcat(geany->app->configdir, G_DIR_SEPARATOR_S, "plugins", G_DIR_SEPARATOR_S, + "VC", G_DIR_SEPARATOR_S, "VC.conf", NULL);
- g_signal_connect((gpointer) menu_vc_revert_file, "activate", - G_CALLBACK(vcrevert_activated), NULL); + load_config(); + registrate();
- gtk_container_add(GTK_CONTAINER(menu_vc_menu), gtk_separator_menu_item_new()); + tooltips = gtk_tooltips_new();
- // Add file - menu_vc_add_file = gtk_menu_item_new_with_mnemonic(_("_Add File")); - gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_add_file); - gtk_tooltips_set_tip(tooltips, menu_vc_add_file, _("Add file to repository."), NULL); + menu_vc = gtk_image_menu_item_new_with_mnemonic(_("_VC")); + gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), menu_vc);
- g_signal_connect((gpointer) menu_vc_add_file, "activate", - G_CALLBACK(vcadd_activated), NULL); + g_signal_connect((gpointer) menu_vc, "activate", G_CALLBACK(update_menu_items), NULL);
- // Remove file - menu_vc_remove_file = gtk_menu_item_new_with_mnemonic(_("Remove File")); - gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_remove_file); - gtk_tooltips_set_tip(tooltips, menu_vc_remove_file, - _("Remove file from repository."), NULL); + menu_vc_menu = gtk_menu_new(); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_vc), menu_vc_menu);
- g_signal_connect((gpointer) menu_vc_remove_file, "activate", - G_CALLBACK(vcremove_activated), NULL); + /* Create the current file Submenu */ + do_current_file_menu(&menu_vc_file, &tooltips); + gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_file); + /* Create the current directory Submenu */ + do_current_dir_menu(&menu_vc_dir, &tooltips); + gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_dir); + /* Create the current base directory Submenu */ + do_basedir_menu(&menu_vc_basedir, &tooltips); + gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_basedir);
gtk_container_add(GTK_CONTAINER(menu_vc_menu), gtk_separator_menu_item_new()); + /* Status of basedir */ + menu_vc_status = gtk_menu_item_new_with_mnemonic(_("_Status")); + gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_status); + gtk_tooltips_set_tip(tooltips, menu_vc_status, _("Show status."), NULL);
- // Update + g_signal_connect((gpointer) menu_vc_status, "activate", + G_CALLBACK(vcstatus_activated), NULL); + + + /* complete update */ menu_vc_update = gtk_menu_item_new_with_mnemonic(_("Update")); gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_update); gtk_tooltips_set_tip(tooltips, menu_vc_update, _("Update from remote repositary."), NULL); @@ -2031,7 +2164,8 @@ g_signal_connect((gpointer) menu_vc_update, "activate", G_CALLBACK(vcupdate_activated), NULL);
- // Commit + + /* Commit all changes */ menu_vc_commit = gtk_menu_item_new_with_mnemonic(_("_Commit")); gtk_container_add(GTK_CONTAINER(menu_vc_menu), menu_vc_commit); gtk_tooltips_set_tip(tooltips, menu_vc_commit, _("Commit changes."), NULL); @@ -2039,27 +2173,17 @@ g_signal_connect((gpointer) menu_vc_commit, "activate", G_CALLBACK(vccommit_activated), NULL);
+ gtk_widget_show_all(menu_vc); + gtk_widget_show_all(menu_vc_file); + gtk_widget_show_all(menu_vc_dir); + gtk_widget_show_all(menu_vc_basedir);
- /* init keybindins */ - keybindings_set_item(plugin_key_group, VC_DIFF_FILE, kbdiff_file, - 0, 0, "vc_show_diff_of_file", _("Show diff of file"), menu_vc_diff_file); - keybindings_set_item(plugin_key_group, VC_DIFF_DIR, kbdiff_dir, - 0, 0, "vc_show_diff_of_dir", _("Show diff of diretory"), menu_vc_diff_dir); - keybindings_set_item(plugin_key_group, VC_DIFF_BASEDIR, kbdiff_basedir, - 0, 0, "vc_show_diff_of_basedir", _("Show diff of basedir"), menu_vc_diff_basedir); - keybindings_set_item(plugin_key_group, VC_COMMIT, kbcommit, - 0, 0, "vc_commit", _("Commit changes"), menu_vc_commit); - keybindings_set_item(plugin_key_group, VC_STATUS, kbstatus, - 0, 0, "vc_status", _("Show status") , menu_vc_status); - keybindings_set_item(plugin_key_group, VC_REVERT, kbrevert, - 0, 0, "vc_revert", _("Revert changes"), menu_vc_revert_file); - keybindings_set_item(plugin_key_group, VC_UPDATE, kbupdate, - 0, 0, "vc_update", _("Update file"), menu_vc_update); + /* initialize keybindings */ + init_keybindings();
plugin_fields->menu_item = menu_vc; plugin_fields->flags = PLUGIN_IS_DOCUMENT_SENSITIVE; - }
Modified: trunk/geanyvc/geanyvc.h =================================================================== --- trunk/geanyvc/geanyvc.h 2009-02-01 19:16:54 UTC (rev 424) +++ trunk/geanyvc/geanyvc.h 2009-02-02 16:55:48 UTC (rev 425) @@ -27,6 +27,7 @@ VC_COMMAND_DIFF_FILE, VC_COMMAND_DIFF_DIR, VC_COMMAND_REVERT_FILE, + VC_COMMAND_REVERT_DIR, VC_COMMAND_STATUS, VC_COMMAND_ADD, VC_COMMAND_REMOVE, @@ -51,10 +52,16 @@ VC_COMMAND_STARTDIR_FILE };
-#define P_ABS_DIRNAME "*<?geanyvcDIRNAME>*" -#define P_ABS_FILENAME "*<?geanyvcFILENAME>*" -#define P_BASENAME "*<?geanyvcBASE_FILENAME>*" +#define FLAG_RELOAD (1<<0) +#define FLAG_FORCE_ASK (1<<1) +#define FLAG_FILE (1<<2) +#define FLAG_DIR (1<<3) +#define FLAG_BASEDIR (1<<4)
+#define P_ABS_DIRNAME "*<?geanyvcDIRNAME>*" +#define P_ABS_FILENAME "*<?geanyvcFILENAME>*" +#define P_BASENAME "*<?geanyvcBASE_FILENAME>*" + /* The addresses of these strings act as enums, their contents are not used. */
Modified: trunk/geanyvc/po/ChangeLog =================================================================== --- trunk/geanyvc/po/ChangeLog 2009-02-01 19:16:54 UTC (rev 424) +++ trunk/geanyvc/po/ChangeLog 2009-02-02 16:55:48 UTC (rev 425) @@ -1,3 +1,8 @@ +2009-01-27 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + + * de.po: Translation of new strings. + + 2008-11-07 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* de.po: Update of German translation.
Modified: trunk/geanyvc/po/de.po =================================================================== --- trunk/geanyvc/po/de.po 2009-02-01 19:16:54 UTC (rev 424) +++ trunk/geanyvc/po/de.po 2009-02-02 16:55:48 UTC (rev 425) @@ -8,9 +8,9 @@ msgstr "" "Project-Id-Version: geanyvc 0.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-11-07 20:48+0100\n" -"PO-Revision-Date: 2008-11-07 20:53+0100\n" -"Last-Translator: Enrico Tröger enrico@xfce.org\n" +"POT-Creation-Date: 2009-01-27 23:32+0100\n" +"PO-Revision-Date: 2009-01-27 23:37+0100\n" +"Last-Translator: Frank Lanitz frank@frank.uvena.de\n" "Language-Team: German geany-i18n@uvena.de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -35,70 +35,70 @@ msgstr "" "Yura Siamashka yurand2@gmail.com, Frank Lanitz frank@frank.uvena.de"
-#: ../geanyvc.c:404 +#: ../geanyvc.c:402 msgid "Could not parse the output of command" msgstr "Kann die Ausgabe des Befehls nicht einlesen."
-#: ../geanyvc.c:464 +#: ../geanyvc.c:462 #, c-format msgid "geanyvc: s_spawn_sync error: %s" msgstr "geanyvc: s_spawn_sync error: %s"
-#: ../geanyvc.c:600 ../geanyvc.c:611 +#: ../geanyvc.c:596 ../geanyvc.c:607 #, c-format msgid "geanyvc: vcdiff_file_activated: Unable to rename '%s' to '%s'" msgstr "geanyvc: vcdiff_file_activated: Kann »%s« nicht in »%s« umbenennen."
-#: ../geanyvc.c:637 ../geanyvc.c:672 ../geanyvc.c:716 +#: ../geanyvc.c:633 ../geanyvc.c:668 ../geanyvc.c:712 msgid "No changes were made." msgstr "Es wurden keine Änderungen vorgenommen."
-#: ../geanyvc.c:742 +#: ../geanyvc.c:738 msgid "No history avaible" msgstr "Keine Historie verfügbar"
-#: ../geanyvc.c:907 +#: ../geanyvc.c:900 #, c-format msgid "Do you really want to revert: %s?" msgstr "Möchten Sie wirklich »%s« zurücksetzen?"
-#: ../geanyvc.c:919 +#: ../geanyvc.c:908 #, c-format msgid "Do you really want to add: %s?" msgstr "Möchten Sie wirklich »%s« hinzufügen?"
-#: ../geanyvc.c:928 +#: ../geanyvc.c:915 #, c-format msgid "Do you really want to remove: %s?" msgstr "Möchten Sie wirklich »%s« entfernen?"
-#: ../geanyvc.c:953 +#: ../geanyvc.c:939 msgid "Do you really want to update?" msgstr "Möchten Sie wirklich »%s« aktualisieren?"
-#: ../geanyvc.c:1235 +#: ../geanyvc.c:1218 msgid "Commit" msgstr "Übertragen"
-#: ../geanyvc.c:1306 +#: ../geanyvc.c:1289 msgid "<b>Commit message:</b>" msgstr "<b>Commitnachricht:</b>"
-#. Commit -#: ../geanyvc.c:1319 ../geanyvc.c:2038 +#. Commit all changes +#: ../geanyvc.c:1302 ../geanyvc.c:2109 msgid "_Commit" msgstr "Ü_bertragen"
-#: ../geanyvc.c:1389 +#: ../geanyvc.c:1372 msgid "Nothing to commit." msgstr "Nichts zum Übertragen."
-#: ../geanyvc.c:1435 +#: ../geanyvc.c:1418 #, c-format msgid "Error initializing spell checking: %s" msgstr "Fehler beim Initialisieren der Rechtschreibprüfung: %s"
-#: ../geanyvc.c:1447 +#: ../geanyvc.c:1430 #, c-format msgid "" "Error while setting up language for spellchecking. Please check " @@ -107,15 +107,15 @@ "Fehler beim Auswählen der Sprache für die Rechtschreibprüfung. Bitte " "überprüfen Sie Ihre Konfiguration. Fehlermeldung: %s"
-#: ../geanyvc.c:1652 +#: ../geanyvc.c:1642 msgid "Plugin configuration directory could not be created." msgstr "Plugin-Konfigurationsverzeichnis konnte nicht erstellt werden."
-#: ../geanyvc.c:1685 +#: ../geanyvc.c:1675 msgid "Set Changed-flag for document tabs created by the plugin" msgstr "Markiere vom Plugin erstelle Dokumente als geändert"
-#: ../geanyvc.c:1688 +#: ../geanyvc.c:1678 msgid "" "If this option is activated, every new by the VC-plugin created document tab " "will be marked as changed. Even this option is useful in some cases, it " @@ -126,203 +126,222 @@ "der Speichern Dialog geöffnet wird. Auch wenn diese Option von Zeit zu Zeit " "sehr nützlich sein kann, kann Sie ab und an einfach nur stören."
-#: ../geanyvc.c:1696 +#: ../geanyvc.c:1686 msgid "Confirm adding new files to a VCS" msgstr "Hinzufügen von Dateien zur Versionsverwaltung immer bestätigen"
-#: ../geanyvc.c:1699 +#: ../geanyvc.c:1689 msgid "Shows a confirmation dialog on adding a new (created) file to VCS." msgstr "" "Zeigt einen Bestätigungsdialog wenn Dateien zu einem Versionskontrollsystem " "hinzugefügt werden sollen."
-#: ../geanyvc.c:1706 +#: ../geanyvc.c:1696 msgid "Maximize commit dialog" msgstr "Commit-Dialog maximieren"
-#: ../geanyvc.c:1707 +#: ../geanyvc.c:1697 msgid "Show commit dialog maximize." msgstr "Commit-Dialog beim Anzeigen maximieren"
-#: ../geanyvc.c:1714 +#: ../geanyvc.c:1704 msgid "Use external diff viewer" msgstr "Externes Diff-Programm benutzen"
-#: ../geanyvc.c:1716 +#: ../geanyvc.c:1706 msgid "Use external diff viewer for file diff." msgstr "Externes Diff-Programm benutzen zum Vergleich von zwei Dateien."
-#: ../geanyvc.c:1722 +#: ../geanyvc.c:1712 msgid "Enable CVS" msgstr "CVS aktivieren"
-#: ../geanyvc.c:1727 +#: ../geanyvc.c:1717 msgid "Enable GIT" msgstr "GIT aktivieren"
-#: ../geanyvc.c:1732 +#: ../geanyvc.c:1722 msgid "Enable SVN" msgstr "SVN aktivieren"
-#: ../geanyvc.c:1737 +#: ../geanyvc.c:1727 msgid "Enable SVK" msgstr "SVK aktivieren"
-#: ../geanyvc.c:1742 +#: ../geanyvc.c:1732 msgid "Enable Bazaar" msgstr "Bazaar aktivieren"
-#: ../geanyvc.c:1747 +#: ../geanyvc.c:1737 msgid "Enable Mercurial" msgstr "Mercurial aktivieren"
-#: ../geanyvc.c:1753 +#: ../geanyvc.c:1743 msgid "Spellcheck language" msgstr "Sprache"
-#: ../geanyvc.c:1914 -msgid "_VC" -msgstr "_VC" +#: ../geanyvc.c:1892 +msgid "Current _File" +msgstr "_Aktuelle Datei"
-#. Single file -#: ../geanyvc.c:1923 -msgid "Diff From Current File" -msgstr "Diff von der aktuellen Datei" +#. Diff of current file +#. Diff of the current dir +#. Complete diff of base directory +#: ../geanyvc.c:1896 ../geanyvc.c:1971 ../geanyvc.c:2002 +msgid "_Diff" +msgstr "_Unterscheide anzeigen"
-#: ../geanyvc.c:1926 +#: ../geanyvc.c:1899 msgid "Make a diff from the current active file" msgstr "Erstellt ein Diff für die aktuelle Datei."
-#. Directory -#: ../geanyvc.c:1932 -msgid "Diff From Current Directory" -msgstr "Diff vom aktuellen Verzeichnis" +#. Revert current file +#: ../geanyvc.c:1905 +msgid "_Revert" +msgstr "_Zurücksetzen"
-#: ../geanyvc.c:1935 -msgid "Make a diff from the directory of the current active file" -msgstr "Erstellt ein Diff für das Verzeichnis der aktuellen Datei." +#: ../geanyvc.c:1908 +msgid "Restore pristine working copy file (undo local edits)." +msgstr "" +"Stellt den ursprünglichen Zustand der Datei wieder her (verwirft lokale " +"Änderungen)."
-#. Base directory -#: ../geanyvc.c:1941 -msgid "Diff From Base Directory" -msgstr "Diff vom Grundverzeichnis" - -#: ../geanyvc.c:1944 -msgid "Make a diff from the top VC directory" -msgstr "Erstellt ein Diff für die gesamte Arbeitskopie" - #. Blame for current file -#: ../geanyvc.c:1952 -msgid "Blame From Current File" -msgstr "Blame von aktueller Datei" +#: ../geanyvc.c:1918 +msgid "_Blame" +msgstr "Ä_nderungsverfolgung"
-#: ../geanyvc.c:1955 +#: ../geanyvc.c:1921 msgid "Shows the changes made at one file per revision and author." msgstr "Zeigt alle Änderungen einer Datei nach Autor und Revision."
-#. Log -#: ../geanyvc.c:1963 -msgid "Log Of Current File" -msgstr "Historie der aktuellen Datei" +#. History/log of current file +#. History/log of the current dir +#. Complete History/Log of base directory +#: ../geanyvc.c:1929 ../geanyvc.c:1981 ../geanyvc.c:2015 +msgid "_History" +msgstr "_Versionsgeschichte"
-#: ../geanyvc.c:1966 +#: ../geanyvc.c:1932 msgid "Shows the log of the current file" msgstr "Zeigt die Versionshistorie der aktuellen Datei an."
-#: ../geanyvc.c:1971 -msgid "Log Of Current Directory" -msgstr "Historie vom aktuellen Verzeichnis" +#. add current file +#: ../geanyvc.c:1941 +msgid "_Add to Version Control" +msgstr "Zur _Versionskontrolle hinzufügen"
+#: ../geanyvc.c:1943 +msgid "Add file to repository." +msgstr "Fügt eine Datei zum Repositorium _hinzu." + +#. revert current file +#: ../geanyvc.c:1949 +msgid "_Remove from Version Control" +msgstr "Aus Versionskontrolle entfernen" + +#: ../geanyvc.c:1952 +msgid "Remove file from repository." +msgstr "Entfernt eine Datei aus dem Repositorium." + +#: ../geanyvc.c:1968 +msgid "Current _Directory" +msgstr "Aktueller _Dokumentenordner" + #: ../geanyvc.c:1974 +msgid "Make a diff from the directory of the current active file" +msgstr "Erstellt ein Diff für das Verzeichnis der aktuellen Datei." + +#: ../geanyvc.c:1984 msgid "Shows the log of the current directory" msgstr "Zeigt die Versionshistorie für das aktuelle Verzeichnis."
-#: ../geanyvc.c:1979 -msgid "Log Of Base Directory" -msgstr "Historie vom aktuellen Grundverzeichnis" +#: ../geanyvc.c:1998 +msgid "Current _Basedirectory" +msgstr "Aktuelles _Basisverzeichnis"
-#: ../geanyvc.c:1982 +#: ../geanyvc.c:2005 +msgid "Make a diff from the top VC directory" +msgstr "Erstellt ein Diff für die gesamte Arbeitskopie" + +#: ../geanyvc.c:2018 msgid "Shows the log of the top VC directory" msgstr "Zeigt die Versionsgeschichte für die gesamte Arbeitskopie"
-#. Status -#: ../geanyvc.c:1990 -msgid "_Status" -msgstr "_Status" +#: ../geanyvc.c:2032 +msgid "Show diff of file" +msgstr "Diff von der aktuellen Datei"
-#: ../geanyvc.c:1992 -msgid "Show status." -msgstr "Zeigt den Status der Arbeitskopie." +#: ../geanyvc.c:2035 +msgid "Show diff of diretory" +msgstr "Diff vom aktuellen Verzeichnis"
-#. Revert file -#: ../geanyvc.c:2000 -msgid "_Revert File" -msgstr "Änderungen _verwerfen" +#: ../geanyvc.c:2037 +msgid "Show diff of basedir" +msgstr "Diff vom Grundverzeichnis"
-#: ../geanyvc.c:2003 -msgid "Restore pristine working copy file (undo local edits)." -msgstr "" -"Stellt den ursprünglichen Zustand der Datei wieder her (verwirft lokale " -"Änderungen)." +#: ../geanyvc.c:2040 +msgid "Commit changes" +msgstr "Änderungen übertragen"
-#. Add file -#: ../geanyvc.c:2011 -msgid "_Add File" -msgstr "Datei _hinzufügen" +#: ../geanyvc.c:2042 +msgid "Show status" +msgstr "Status der Arbeitskopie anzeigen"
-#: ../geanyvc.c:2013 -msgid "Add file to repository." -msgstr "Fügt eine Datei zum Repositorium _hinzu." +#: ../geanyvc.c:2044 +msgid "Revert changes" +msgstr "Änderungen verwerfen"
-#. Remove file -#: ../geanyvc.c:2019 -msgid "Remove File" -msgstr "Datei entfernen" +#: ../geanyvc.c:2046 +msgid "Update file" +msgstr "Datei aktualisieren"
-#: ../geanyvc.c:2022 -msgid "Remove file from repository." -msgstr "Entfernt eine Datei aus dem Repositorium." +#: ../geanyvc.c:2071 +msgid "_VC" +msgstr "_VC"
-#. Update -#: ../geanyvc.c:2030 +#. Status of basedir +#: ../geanyvc.c:2091 +msgid "_Status" +msgstr "_Status" + +#: ../geanyvc.c:2093 +msgid "Show status." +msgstr "Zeigt den Status der Arbeitskopie." + +#. complete update +#: ../geanyvc.c:2100 msgid "Update" msgstr "Aktualisieren"
-#: ../geanyvc.c:2032 +#: ../geanyvc.c:2102 msgid "Update from remote repositary." msgstr "Aus dem Repository aktualisieren"
-#: ../geanyvc.c:2040 +#: ../geanyvc.c:2111 msgid "Commit changes." msgstr "Änderungen übertragen."
-#: ../geanyvc.c:2049 -msgid "Show diff of file" -msgstr "Diff von der aktuellen Datei" +#~ msgid "Diff From Current File" +#~ msgstr "Diff von der aktuellen Datei"
-#: ../geanyvc.c:2051 -msgid "Show diff of diretory" -msgstr "Diff vom aktuellen Verzeichnis" +#~ msgid "Diff From Current Directory" +#~ msgstr "Diff vom aktuellen Verzeichnis"
-#: ../geanyvc.c:2053 -msgid "Show diff of basedir" -msgstr "Diff vom Grundverzeichnis" +#~ msgid "Diff From Base Directory" +#~ msgstr "Diff vom Grundverzeichnis"
-#: ../geanyvc.c:2055 -msgid "Commit changes" -msgstr "Änderungen übertragen" +#~ msgid "Blame From Current File" +#~ msgstr "Blame von aktueller Datei"
-#: ../geanyvc.c:2057 -msgid "Show status" -msgstr "Status der Arbeitskopie anzeigen" +#~ msgid "Log Of Base Directory" +#~ msgstr "Historie vom aktuellen Grundverzeichnis"
-#: ../geanyvc.c:2059 -msgid "Revert changes" -msgstr "Änderungen verwerfen" +#~ msgid "_Add File" +#~ msgstr "Datei _hinzufügen"
-#: ../geanyvc.c:2061 -msgid "Update file" -msgstr "Datei aktualisieren" +#~ msgid "Remove File" +#~ msgstr "Datei entfernen"
#~ msgid "Diff From Current Project" #~ msgstr "Diff vom aktuellen Projekt"
Modified: trunk/geanyvc/vc_bzr.c =================================================================== --- trunk/geanyvc/vc_bzr.c 2009-02-01 19:16:54 UTC (rev 424) +++ trunk/geanyvc/vc_bzr.c 2009-02-02 16:55:48 UTC (rev 425) @@ -37,6 +37,7 @@ static const gchar *BZR_CMD_DIFF_FILE[] = { "bzr", "diff", BASENAME, NULL }; static const gchar *BZR_CMD_DIFF_DIR[] = { "bzr", "diff", ABS_DIRNAME, NULL }; static const gchar *BZR_CMD_REVERT_FILE[] = { "bzr", "revert", BASENAME, NULL }; +static const gchar *BZR_CMD_REVERT_DIR[] = { "bzr", NULL }; static const gchar *BZR_CMD_STATUS[] = { "bzr", "status", NULL }; static const gchar *BZR_CMD_ADD[] = { "bzr", "add", BASENAME, NULL }; static const gchar *BZR_CMD_REMOVE[] = { "bzr", "remove", BASENAME, NULL }; @@ -65,6 +66,11 @@ .function = NULL}, { .startdir = VC_COMMAND_STARTDIR_FILE, + .command = BZR_CMD_REVERT_DIR, + .env = NULL, + .function = NULL}, + { + .startdir = VC_COMMAND_STARTDIR_FILE, .command = BZR_CMD_STATUS, .env = NULL, .function = NULL},
Modified: trunk/geanyvc/vc_cvs.c =================================================================== --- trunk/geanyvc/vc_cvs.c 2009-02-01 19:16:54 UTC (rev 424) +++ trunk/geanyvc/vc_cvs.c 2009-02-02 16:55:48 UTC (rev 425) @@ -34,6 +34,7 @@ static const gchar *CVS_CMD_DIFF_FILE[] = { "cvs", "diff", "-u", BASE_FILENAME, NULL }; static const gchar *CVS_CMD_DIFF_DIR[] = { "cvs", "diff", "-u", NULL }; static const gchar *CVS_CMD_REVERT_FILE[] = { "cvs", "update", "-C", BASE_FILENAME, NULL }; +static const gchar *CVS_CMD_REVERT_DIR[] = { "cvs", NULL }; static const gchar *CVS_CMD_STATUS[] = { "cvs", "status", NULL }; static const gchar *CVS_CMD_ADD[] = { "cvs", "add", BASE_FILENAME, NULL }; static const gchar *CVS_CMD_REMOVE[] = { "cvs", "remove", BASE_FILENAME, NULL }; @@ -62,6 +63,11 @@ .function = NULL}, { .startdir = VC_COMMAND_STARTDIR_FILE, + .command = CVS_CMD_REVERT_DIR, + .env = NULL, + .function = NULL}, + { + .startdir = VC_COMMAND_STARTDIR_FILE, .command = CVS_CMD_STATUS, .env = NULL, .function = NULL},
Modified: trunk/geanyvc/vc_git.c =================================================================== --- trunk/geanyvc/vc_git.c 2009-02-01 19:16:54 UTC (rev 424) +++ trunk/geanyvc/vc_git.c 2009-02-02 16:55:48 UTC (rev 425) @@ -89,6 +89,7 @@ static const gchar *GIT_CMD_DIFF_FILE[] = { "git", "diff", "HEAD", "--", BASENAME, NULL }; static const gchar *GIT_CMD_DIFF_DIR[] = { "git", "diff", "HEAD", NULL }; static const gchar *GIT_CMD_REVERT_FILE[] = { "git", "checkout", "--", BASENAME, NULL }; +static const gchar *GIT_CMD_REVERT_DIR[] = { "git", NULL }; static const gchar *GIT_CMD_STATUS[] = { "git", "status", NULL }; static const gchar *GIT_CMD_ADD[] = { "git", "add", "--", BASENAME, NULL }; static const gchar *GIT_CMD_REMOVE[] = @@ -103,6 +104,7 @@ static const gchar *GIT_ENV_DIFF_FILE[] = { "PAGER=cat", NULL }; static const gchar *GIT_ENV_DIFF_DIR[] = { "PAGER=cat", NULL }; static const gchar *GIT_ENV_REVERT_FILE[] = { "PAGER=cat", NULL }; +static const gchar *GIT_ENV_REVERT_DIR[] = { "PAGER=cat", NULL }; static const gchar *GIT_ENV_STATUS[] = { "PAGER=cat", NULL }; static const gchar *GIT_ENV_ADD[] = { "PAGER=cat", NULL }; static const gchar *GIT_ENV_REMOVE[] = { "PAGER=cat", NULL }; @@ -111,7 +113,7 @@ static const gchar *GIT_ENV_BLAME[] = { "PAGER=cat", NULL }; static const gchar *GIT_ENV_UPDATE[] = { "PAGER=cat", NULL };
-static const VC_COMMAND commands[] = { +static const VC_COMMAND commands[VC_COMMAND_COUNT] = { { .startdir = VC_COMMAND_STARTDIR_FILE, .command = GIT_CMD_DIFF_FILE, @@ -129,6 +131,11 @@ .function = NULL}, { .startdir = VC_COMMAND_STARTDIR_FILE, + .command = GIT_CMD_REVERT_DIR, + .env = GIT_ENV_REVERT_DIR, + .function = NULL}, + { + .startdir = VC_COMMAND_STARTDIR_FILE, .command = GIT_CMD_STATUS, .env = GIT_ENV_STATUS, .function = NULL},
Modified: trunk/geanyvc/vc_hg.c =================================================================== --- trunk/geanyvc/vc_hg.c 2009-02-01 19:16:54 UTC (rev 424) +++ trunk/geanyvc/vc_hg.c 2009-02-02 16:55:48 UTC (rev 425) @@ -37,6 +37,7 @@ static const gchar *HG_CMD_DIFF_FILE[] = { "hg", "diff", ABS_FILENAME, NULL }; static const gchar *HG_CMD_DIFF_DIR[] = { "hg", "diff", ABS_DIRNAME, NULL }; static const gchar *HG_CMD_REVERT_FILE[] = { "hg", "revert", BASENAME, NULL }; +static const gchar *HG_CMD_REVERT_DIR[] = { "hg", NULL }; static const gchar *HG_CMD_STATUS[] = { "hg", "status", NULL }; static const gchar *HG_CMD_ADD[] = { "hg", "add", BASENAME, NULL }; static const gchar *HG_CMD_REMOVE[] = { "hg", "remove", BASENAME, NULL }; @@ -65,6 +66,11 @@ .function = NULL}, { .startdir = VC_COMMAND_STARTDIR_FILE, + .command = HG_CMD_REVERT_DIR, + .env = NULL, + .function = NULL}, + { + .startdir = VC_COMMAND_STARTDIR_FILE, .command = HG_CMD_STATUS, .env = NULL, .function = NULL},
Modified: trunk/geanyvc/vc_svk.c =================================================================== --- trunk/geanyvc/vc_svk.c 2009-02-01 19:16:54 UTC (rev 424) +++ trunk/geanyvc/vc_svk.c 2009-02-02 16:55:48 UTC (rev 425) @@ -37,6 +37,7 @@ static const gchar *SVK_CMD_DIFF_FILE[] = { "svk", "diff", ABS_FILENAME, NULL }; static const gchar *SVK_CMD_DIFF_DIR[] = { "svk", "diff", ABS_DIRNAME, NULL }; static const gchar *SVK_CMD_REVERT_FILE[] = { "svk", "revert", BASENAME, NULL }; +static const gchar *SVK_CMD_REVERT_DIR[] = { "svk", NULL }; static const gchar *SVK_CMD_STATUS[] = { "svk", "status", NULL }; static const gchar *SVK_CMD_ADD[] = { "svk", "add", BASENAME, NULL }; static const gchar *SVK_CMD_REMOVE[] = { "svk", "remove", BASENAME, NULL }; @@ -65,6 +66,11 @@ .function = NULL}, { .startdir = VC_COMMAND_STARTDIR_FILE, + .command = SVK_CMD_REVERT_DIR, + .env = NULL, + .function = NULL}, + { + .startdir = VC_COMMAND_STARTDIR_FILE, .command = SVK_CMD_STATUS, .env = NULL, .function = NULL},
Modified: trunk/geanyvc/vc_svn.c =================================================================== --- trunk/geanyvc/vc_svn.c 2009-02-01 19:16:54 UTC (rev 424) +++ trunk/geanyvc/vc_svn.c 2009-02-02 16:55:48 UTC (rev 425) @@ -38,6 +38,7 @@ { "svn", "diff", "--non-interactive", BASE_FILENAME, NULL }; static const gchar *SVN_CMD_DIFF_DIR[] = { "svn", "diff", "--non-interactive", BASE_DIRNAME, NULL }; static const gchar *SVN_CMD_REVERT_FILE[] = { "svn", "revert", BASENAME, NULL }; +static const gchar *SVN_CMD_REVERT_DIR[] = { "svn", "revert", BASE_DIRNAME, "-R", NULL }; static const gchar *SVN_CMD_STATUS[] = { "svn", "status", NULL }; static const gchar *SVN_CMD_ADD[] = { "svn", "add", BASENAME, NULL }; static const gchar *SVN_CMD_REMOVE[] = { "svn", "rm", BASENAME, NULL }; @@ -46,7 +47,7 @@ static const gchar *SVN_CMD_COMMIT[] = { "svn", "commit", "--non-interactive", "-m", MESSAGE, FILE_LIST, NULL }; static const gchar *SVN_CMD_BLAME[] = { "svn", "blame", BASENAME, NULL }; -static const gchar *SVN_CMD_SHOW[] = { "svn", "cat", BASENAME, NULL }; +static const gchar *SVN_CMD_SHOW[] = { "svn", "cat", "-rBASE", BASENAME, NULL }; static const gchar *SVN_CMD_UPDATE[] = { "svn", "up", NULL };
static const VC_COMMAND commands[] = { @@ -67,6 +68,11 @@ .function = NULL}, { .startdir = VC_COMMAND_STARTDIR_FILE, + .command = SVN_CMD_REVERT_DIR, + .env = NULL, + .function = NULL}, + { + .startdir = VC_COMMAND_STARTDIR_FILE, .command = SVN_CMD_STATUS, .env = NULL, .function = NULL},
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.