Commit d81ef28a authored by James Liggett's avatar James Liggett

Fix Bug 564988 – Subversion context menu should have a Revert command

* plugins/subversion/anjuta-subversion.ui:
* plugins/subversion/plugin.c:
* plugins/subversion/subversion-revert-dialog.c
(on_subversion_revert_response), (on_fm_subversion_revert):
* plugins/subversion/subversion-revert-dialog.h:
* plugins/subversion/svn-revert-command.c
(svn_revert_command_new_list), (svn_revert_command_new_path):
* plugins/subversion/svn-revert-command.h:
Fix Bug 564988 – Subversion context menu should have a Revert command

svn path=/trunk/; revision=4592
parent fe864ee1
2009-01-16 James Liggett <jrliggett@cox.net>
* plugins/subversion/anjuta-subversion.ui:
* plugins/subversion/plugin.c:
* plugins/subversion/subversion-revert-dialog.c
(on_subversion_revert_response), (on_fm_subversion_revert):
* plugins/subversion/subversion-revert-dialog.h:
* plugins/subversion/svn-revert-command.c
(svn_revert_command_new_list), (svn_revert_command_new_path):
* plugins/subversion/svn-revert-command.h:
Fix Bug 564988 – Subversion context menu should have a Revert command
2008-01-15 Sébastien Granjoux <seb.sfo@free.fr>
* plugins/project-manager/plugin.c,
......@@ -27,6 +27,7 @@
<placeholder name="PlaceholderPopupFileVCS">
<menu name="PopupFileSubversion" action="ActionPopupSubversion">
<menuitem name="Update..." action="ActionPopupSubversionUpdate" />
<menuitem name="Revert..." action="ActionPopupSubversionRevert" />
<menuitem name="Add..." action="ActionPopupSubversionAdd" />
<menuitem name="Remove..." action="ActionPopupSubversionRemove" />
<menuitem name="Copy..." action="ActionPopupSubversionCopy" />
......
......@@ -161,6 +161,14 @@ static GtkActionEntry popup_actions_subversion[] = {
N_("Sync your local copy with the Subversion tree"), /* Tooltip */
G_CALLBACK (on_fm_subversion_update) /* action callback */
},
{
"ActionPopupSubversionRevert", /* Action name */
GTK_STOCK_UNDO, /* Stock icon, if any */
N_("_Revert..."), /* Display label */
NULL, /* short-cut */
N_("Revert changes to your working copy."), /* Tooltip */
G_CALLBACK (on_fm_subversion_revert) /* action callback */
},
{
"ActionPopupSubversionAdd", /* Action name */
GTK_STOCK_ADD, /* Stock icon, if any */
......
......@@ -53,7 +53,7 @@ on_subversion_revert_response (GtkDialog *dialog, gint response,
revert_status_view = glade_xml_get_widget (data->gxml,
"revert_status_view");
selected_paths = anjuta_vcs_status_tree_view_get_selected (ANJUTA_VCS_STATUS_TREE_VIEW (revert_status_view));
revert_command = svn_revert_command_new (selected_paths, TRUE);
revert_command = svn_revert_command_new_list (selected_paths, TRUE);
svn_command_free_path_list (selected_paths);
......@@ -148,3 +148,23 @@ on_menu_subversion_revert (GtkAction *action, Subversion *plugin)
{
subversion_revert_dialog (action, plugin);
}
void
on_fm_subversion_revert (GtkAction *action, Subversion *plugin)
{
SvnRevertCommand *revert_command;
revert_command = svn_revert_command_new_path (plugin->fm_current_filename, TRUE);
g_signal_connect (G_OBJECT (revert_command), "data-arrived",
G_CALLBACK (on_command_info_arrived),
plugin);
g_signal_connect (G_OBJECT (revert_command), "command-finished",
G_CALLBACK (on_revert_command_finished),
plugin);
create_message_view (plugin);
anjuta_command_start (ANJUTA_COMMAND (revert_command));
}
......@@ -29,5 +29,6 @@
#include "svn-revert-command.h"
void on_menu_subversion_revert (GtkAction *action, Subversion *plugin);
void on_fm_subversion_revert (GtkAction *action, Subversion *plugin);
#endif
......@@ -100,7 +100,7 @@ svn_revert_command_class_init (SvnRevertCommandClass *klass)
SvnRevertCommand *
svn_revert_command_new (GList *paths, gboolean recursive)
svn_revert_command_new_list (GList *paths, gboolean recursive)
{
SvnRevertCommand *self;
......@@ -111,6 +111,20 @@ svn_revert_command_new (GList *paths, gboolean recursive)
return self;
}
SvnRevertCommand *
svn_revert_command_new_path (gchar *path, gboolean recursive)
{
SvnRevertCommand *self;
self = g_object_new (SVN_TYPE_REVERT_COMMAND, NULL);
self->priv->paths = g_list_append (self->priv->paths,
svn_command_make_canonical_path (SVN_COMMAND (self),
path));
self->priv->recursive = recursive;
return self;
}
void
svn_revert_command_destroy (SvnRevertCommand *self)
{
......
......@@ -54,7 +54,9 @@ struct _SvnRevertCommand
};
GType svn_revert_command_get_type (void) G_GNUC_CONST;
SvnRevertCommand * svn_revert_command_new (GList *paths, gboolean recursive);
SvnRevertCommand *svn_revert_command_new_list (GList *paths,
gboolean recursive);
SvnRevertCommand *svn_revert_command_new_path (gchar *path, gboolean recursive);
void svn_revert_command_destroy (SvnRevertCommand *self);
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment