N_("Rotate jpeg clockwise"), "%vif jpegtran -rotate 90 -copy all -outfile %p_tmp %p; then mv %p_tmp %p;else rm %p_tmp;fi",
N_("Rotate jpeg counterclockwise"), "%vif jpegtran -rotate 270 -copy all -outfile %p_tmp %p; then mv %p_tmp %p;else rm %p_tmp;fi",
/* special slots */
+#if 1
+ /* for testing */
+ "External Copy command", "%vset -x;cp %f",
+ "External Move command", "%vset -x;mv %f",
+ "External Rename command", "%vset -x;mv %f",
+ "External Delete command", "%vset -x;rm %f",
+ "External New Folder command", NULL
+#else
"External Copy command", NULL,
"External Move command", NULL,
"External Rename command", NULL,
"External Delete command", NULL,
"External New Folder command", NULL
+#endif
};
static void editor_verbose_window_progress(EditorVerboseData *vd, const gchar *text);
return ret;
}
+gint start_editor_from_pair(gint n, const gchar *source, const gchar *target)
+{
+ GList *list;
+ gint ret;
+
+ if (!source) return FALSE;
+ if (!target) return FALSE;
+
+ list = g_list_append(NULL, (gchar *)source);
+ list = g_list_append(list, (gchar *)target);
+ ret = start_editor_from_path_list(n, list);
+ g_list_free(list);
+ return ret;
+}
+
gint editor_window_flag_set(gint n)
{
if (n < 0 || n >= GQVIEW_EDITOR_SLOTS ||
*--------------------------------------------------------------------------
*/
+static gint copy_file_ext(const gchar *s, const gchar *t)
+{
+ if (editor_command[CMD_COPY])
+ return start_editor_from_pair(CMD_COPY, s, t);
+ return copy_file(s, t);
+}
+
+static gint move_file_ext(const gchar *s, const gchar *t)
+{
+ if (editor_command[CMD_MOVE])
+ return start_editor_from_pair(CMD_MOVE, s, t);
+ return move_file(s, t);
+}
+
+static gint rename_file_ext(const gchar *s, const gchar *t)
+{
+ if (editor_command[CMD_RENAME])
+ return start_editor_from_pair(CMD_RENAME, s, t);
+ return rename_file(s, t);
+}
+
+
/*
* Multi file move
*/
{
if (fdm->copy)
{
- if (copy_file(fdm->source, fdm->dest))
+ if (copy_file_ext(fdm->source, fdm->dest))
{
success = TRUE;
file_maint_copied(fdm->source, fdm->dest);
}
else
{
- if (move_file(fdm->source, fdm->dest))
+ if (move_file_ext(fdm->source, fdm->dest))
{
success = TRUE;
file_maint_moved(fdm->source, fdm->dest, fdm->source_list);
gint success = FALSE;
if (fds->copy)
{
- if (copy_file(fds->source, fds->dest))
+ if (copy_file_ext(fds->source, fds->dest))
{
success = TRUE;
file_maint_copied(fds->source, fds->dest);
}
else
{
- if (move_file(fds->source, fds->dest))
+ if (move_file_ext(fds->source, fds->dest))
{
success = TRUE;
file_maint_moved(fds->source, fds->dest, NULL);
}
else
{
- if (!rename_file(fd->source_path, fd->dest_path))
+ if (!rename_file_ext(fd->source_path, fd->dest_path))
{
gchar *text = g_strdup_printf(_("Unable to rename file:\n%s\n to:\n%s"),
filename_from_path(fd->source_path),
dest = g_strdup_printf("%s/%s%0*d%s", base, front, padding, n, end);
}
- if (!rename_file(path, dest))
+ if (!rename_file_ext(path, dest))
{
success = FALSE;
}
}
else
{
- if (!rename_file(fds->source, fds->dest))
+ if (!rename_file_ext(fds->source, fds->dest))
{
gchar *text = g_strdup_printf(_("Unable to rename file:\n%s\nto:\n%s"), filename_from_path(fds->source), filename_from_path(fds->dest));
file_util_warning_dialog(_("Error renaming file"), text, GTK_STOCK_DIALOG_ERROR, NULL);
return FALSE;
}
- if (!rename_file(old_path, new_path))
+ if (!rename_file_ext(old_path, new_path))
{
gchar *text = g_strdup_printf(_("Failed to rename %s to %s."), old_name, new_name);
file_util_warning_dialog(_("Rename failed"), text, GTK_STOCK_DIALOG_ERROR, parent);