gnome-commander r1537 - in branches/gcmd-1-3: . src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r1537 - in branches/gcmd-1-3: . src
- Date: Mon, 21 Jan 2008 21:06:19 +0000 (GMT)
Author: epiotr
Date: Mon Jan 21 21:06:18 2008
New Revision: 1537
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1537&view=rev
Log:
Yet another fix for problem #345314
Modified:
branches/gcmd-1-3/ChangeLog
branches/gcmd-1-3/src/gnome-cmd-file-props-dialog.cc
branches/gcmd-1-3/src/gnome-cmd-rename-dialog.cc
Modified: branches/gcmd-1-3/src/gnome-cmd-file-props-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-file-props-dialog.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-file-props-dialog.cc Mon Jan 21 21:06:18 2008
@@ -21,6 +21,8 @@
#include <libgnomevfs/gnome-vfs-mime-monitor.h>
#include "gnome-cmd-includes.h"
#include "gnome-cmd-dir.h"
+#include "gnome-cmd-file-selector.h"
+#include "gnome-cmd-main-win.h"
#include "gnome-cmd-file-props-dialog.h"
#include "gnome-cmd-chown-component.h"
#include "gnome-cmd-chmod-component.h"
@@ -212,8 +214,13 @@
const gchar *filename = gtk_entry_get_text (GTK_ENTRY (data->filename_entry));
if (strcmp (filename, gnome_cmd_file_get_name (data->finfo)) != 0)
+ {
result = gnome_cmd_file_rename (data->finfo, filename);
+ if (result==GNOME_VFS_OK)
+ gnome_cmd_file_list_focus_file (gnome_cmd_main_win_get_fs (main_win, ACTIVE)->list, filename, TRUE);
+ }
+
if (result == GNOME_VFS_OK)
{
GnomeVFSFilePermissions perms = gnome_cmd_chmod_component_get_perms (GNOME_CMD_CHMOD_COMPONENT (data->chmod_component));
@@ -238,7 +245,7 @@
if (result != GNOME_VFS_OK)
{
- create_error_dialog (gnome_vfs_result_to_string (result));
+ gnome_cmd_show_message (NULL, filename, gnome_vfs_result_to_string (result));
return;
}
@@ -252,7 +259,7 @@
}
-static void on_copy_clipboard_help (GtkButton *button, GnomeCmdFilePropsDialogPrivate *data)
+static void on_copy_clipboard (GtkButton *button, GnomeCmdFilePropsDialogPrivate *data)
{
g_return_if_fail (data != NULL);
@@ -705,7 +712,7 @@
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 2), gtk_label_new (_("Metadata")));
gnome_cmd_dialog_add_button (GNOME_CMD_DIALOG (dialog), GTK_STOCK_HELP, GTK_SIGNAL_FUNC (on_dialog_help), data);
- data->copy_button = gnome_cmd_dialog_add_button (GNOME_CMD_DIALOG (dialog), GTK_STOCK_COPY, GTK_SIGNAL_FUNC (on_copy_clipboard_help), data);
+ data->copy_button = gnome_cmd_dialog_add_button (GNOME_CMD_DIALOG (dialog), GTK_STOCK_COPY, GTK_SIGNAL_FUNC (on_copy_clipboard), data);
gnome_cmd_dialog_add_button (GNOME_CMD_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_SIGNAL_FUNC (on_dialog_cancel), data);
gnome_cmd_dialog_add_button (GNOME_CMD_DIALOG (dialog), GTK_STOCK_OK, GTK_SIGNAL_FUNC (on_dialog_ok), data);
Modified: branches/gcmd-1-3/src/gnome-cmd-rename-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-rename-dialog.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-rename-dialog.cc Mon Jan 21 21:06:18 2008
@@ -53,13 +53,19 @@
case GDK_Return:
case GDK_KP_Enter:
{
- const gchar *new_fname = gtk_entry_get_text (dialog->priv->textbox);
+ gchar *new_fname = g_strdup (gtk_entry_get_text (dialog->priv->textbox));
GnomeVFSResult result = gnome_cmd_file_rename (dialog->priv->finfo, new_fname);
- gnome_cmd_file_list_focus_file (gnome_cmd_main_win_get_fs (main_win, ACTIVE)->list, new_fname, TRUE);
+
+ if (result==GNOME_VFS_OK)
+ gnome_cmd_file_list_focus_file (gnome_cmd_main_win_get_fs (main_win, ACTIVE)->list, new_fname, TRUE);
gnome_cmd_file_unref (dialog->priv->finfo);
gtk_widget_destroy (widget);
- // TODO: if (ret != GNOME_VFS_OK)
+
+ if (result!=GNOME_VFS_OK)
+ gnome_cmd_show_message (NULL, new_fname, gnome_vfs_result_to_string (result));
+
+ g_free (new_fname);
}
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]