gnome-commander r1534 - in trunk: . doc/C src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r1534 - in trunk: . doc/C src
- Date: Sun, 20 Jan 2008 23:04:14 +0000 (GMT)
Author: epiotr
Date: Sun Jan 20 23:04:14 2008
New Revision: 1534
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1534&view=rev
Log:
Fixed problem #345314 (cursor not staying on file while renaming)
Modified:
trunk/ChangeLog
trunk/NEWS
trunk/doc/C/gnome-commander.xml
trunk/src/gnome-cmd-dir.cc
trunk/src/gnome-cmd-dir.h
trunk/src/gnome-cmd-file-list.cc
trunk/src/gnome-cmd-file-list.h
trunk/src/gnome-cmd-file-selector.cc
trunk/src/gnome-cmd-file.cc
trunk/src/gnome-cmd-rename-dialog.cc
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sun Jan 20 23:04:14 2008
@@ -3,6 +3,7 @@
---------------
Bug fixes:
+ * Fixed problem #345314 (cursor not staying on file while renaming)
* Fixed problem #353889 (disappearing files after failed move (F6))
* Fixed problems #346286, #424447, #447882, #467058 (crash when using regex in renaming tool)
* Fixed problems #365227 and #446361 (build issues on Solaris)
Modified: trunk/doc/C/gnome-commander.xml
==============================================================================
--- trunk/doc/C/gnome-commander.xml (original)
+++ trunk/doc/C/gnome-commander.xml Sun Jan 20 23:04:14 2008
@@ -5781,7 +5781,10 @@
<para>
<itemizedlist>
<listitem>
- <para>Fixed problem #353889 (disappearing files after failed move (F6)))</para>
+ <para>Fixed problem #345314 (cursor not staying on file while renaming)</para>
+ </listitem>
+ <listitem>
+ <para>Fixed problem #353889 (disappearing files after failed move (F6))</para>
</listitem>
<listitem>
<para>Fixed problems #346286, #424447, #447882, #467058 (crash when using regex in renaming tool)</para>
Modified: trunk/src/gnome-cmd-dir.cc
==============================================================================
--- trunk/src/gnome-cmd-dir.cc (original)
+++ trunk/src/gnome-cmd-dir.cc Sun Jan 20 23:04:14 2008
@@ -45,6 +45,7 @@
FILE_CREATED,
FILE_DELETED,
FILE_CHANGED,
+ FILE_RENAMED,
LIST_OK,
LIST_FAILED,
LAST_SIGNAL
@@ -143,7 +144,7 @@
parent_class = (GnomeCmdFileClass *) gtk_type_class (gnome_cmd_file_get_type ());
dir_signals[FILE_CREATED] =
- gtk_signal_new ("file_created",
+ gtk_signal_new ("file-created",
GTK_RUN_LAST,
G_OBJECT_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GnomeCmdDirClass, file_created),
@@ -152,7 +153,7 @@
1, GTK_TYPE_POINTER);
dir_signals[FILE_DELETED] =
- gtk_signal_new ("file_deleted",
+ gtk_signal_new ("file-deleted",
GTK_RUN_LAST,
G_OBJECT_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GnomeCmdDirClass, file_deleted),
@@ -161,7 +162,7 @@
1, GTK_TYPE_POINTER);
dir_signals[FILE_CHANGED] =
- gtk_signal_new ("file_changed",
+ gtk_signal_new ("file-changed",
GTK_RUN_LAST,
G_OBJECT_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GnomeCmdDirClass, file_changed),
@@ -169,8 +170,17 @@
GTK_TYPE_NONE,
1, GTK_TYPE_POINTER);
+ dir_signals[FILE_RENAMED] =
+ gtk_signal_new ("file-renamed",
+ GTK_RUN_LAST,
+ G_OBJECT_CLASS_TYPE (object_class),
+ GTK_SIGNAL_OFFSET (GnomeCmdDirClass, file_renamed),
+ gtk_marshal_NONE__POINTER,
+ GTK_TYPE_NONE,
+ 1, GTK_TYPE_POINTER);
+
dir_signals[LIST_OK] =
- gtk_signal_new ("list_ok",
+ gtk_signal_new ("list-ok",
GTK_RUN_LAST,
G_OBJECT_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GnomeCmdDirClass, list_ok),
@@ -179,7 +189,7 @@
1, GTK_TYPE_POINTER);
dir_signals[LIST_FAILED] =
- gtk_signal_new ("list_failed",
+ gtk_signal_new ("list-failed",
GTK_RUN_LAST,
G_OBJECT_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GnomeCmdDirClass, list_failed),
@@ -191,6 +201,7 @@
klass->file_created = NULL;
klass->file_deleted = NULL;
klass->file_changed = NULL;
+ klass->file_renamed = NULL;
klass->list_ok = NULL;
klass->list_failed = NULL;
}
@@ -801,12 +812,15 @@
}
-void gnome_cmd_dir_file_renamed (GnomeCmdDir *dir, GnomeCmdFile *finfo)
+void gnome_cmd_dir_file_renamed (GnomeCmdDir *dir, GnomeCmdFile *finfo, const gchar *old_uri_str)
{
g_return_if_fail (GNOME_CMD_IS_DIR (dir));
g_return_if_fail (GNOME_CMD_IS_FILE (finfo));
+ g_return_if_fail (old_uri_str!=NULL);
- gtk_signal_emit (GTK_OBJECT (dir), dir_signals[FILE_CHANGED], finfo);
+ gnome_cmd_file_collection_remove_by_uri (dir->priv->file_collection, old_uri_str);
+ gnome_cmd_file_collection_add (dir->priv->file_collection, finfo);
+ gtk_signal_emit (GTK_OBJECT (dir), dir_signals[FILE_RENAMED], finfo);
}
Modified: trunk/src/gnome-cmd-dir.h
==============================================================================
--- trunk/src/gnome-cmd-dir.h (original)
+++ trunk/src/gnome-cmd-dir.h Sun Jan 20 23:04:14 2008
@@ -77,6 +77,7 @@
void (* file_created) (GnomeCmdDir *dir, GnomeCmdFile *file);
void (* file_deleted) (GnomeCmdDir *dir, GnomeCmdFile *file);
void (* file_changed) (GnomeCmdDir *dir, GnomeCmdFile *file);
+ void (* file_renamed) (GnomeCmdDir *dir, GnomeCmdFile *file);
void (* list_ok) (GnomeCmdDir *dir, GList *files);
void (* list_failed) (GnomeCmdDir *dir, GnomeVFSResult result);
};
@@ -117,7 +118,7 @@
void gnome_cmd_dir_file_created (GnomeCmdDir *dir, const gchar *uri_str);
void gnome_cmd_dir_file_deleted (GnomeCmdDir *dir, const gchar *uri_str);
void gnome_cmd_dir_file_changed (GnomeCmdDir *dir, const gchar *uri_str);
-void gnome_cmd_dir_file_renamed (GnomeCmdDir *dir, GnomeCmdFile *finfo);
+void gnome_cmd_dir_file_renamed (GnomeCmdDir *dir, GnomeCmdFile *finfo, const gchar *old_uri_str);
gboolean gnome_cmd_dir_uses_fam (GnomeCmdDir *dir);
void gnome_cmd_dir_start_monitoring (GnomeCmdDir *dir);
Modified: trunk/src/gnome-cmd-file-list.cc
==============================================================================
--- trunk/src/gnome-cmd-file-list.cc (original)
+++ trunk/src/gnome-cmd-file-list.cc Sun Jan 20 23:04:14 2008
@@ -1305,6 +1305,14 @@
}
+GnomeCmdFileListColumnID gnome_cmd_file_list_get_sort_column (GnomeCmdFileList *fl)
+{
+ g_return_val_if_fail (GNOME_CMD_IS_FILE_LIST (fl), FILE_LIST_COLUMN_ICON);
+
+ return (GnomeCmdFileListColumnID) fl->priv->current_col;
+}
+
+
void gnome_cmd_file_list_update_style (GnomeCmdFileList *fl)
{
gtk_clist_set_row_height (GTK_CLIST (fl), gnome_cmd_data_get_list_row_height ());
Modified: trunk/src/gnome-cmd-file-list.h
==============================================================================
--- trunk/src/gnome-cmd-file-list.h (original)
+++ trunk/src/gnome-cmd-file-list.h Sun Jan 20 23:04:14 2008
@@ -110,6 +110,7 @@
GtkWidget *gnome_cmd_file_list_new (void);
void gnome_cmd_file_list_show_column (GnomeCmdFileList *fl, GnomeCmdFileListColumnID col, gboolean value);
+GnomeCmdFileListColumnID gnome_cmd_file_list_get_sort_column (GnomeCmdFileList *fl);
void gnome_cmd_file_list_update_style (GnomeCmdFileList *fl);
Modified: trunk/src/gnome-cmd-file-selector.cc
==============================================================================
--- trunk/src/gnome-cmd-file-selector.cc (original)
+++ trunk/src/gnome-cmd-file-selector.cc Sun Jan 20 23:04:14 2008
@@ -887,6 +887,24 @@
}
+static void on_dir_file_renamed (GnomeCmdDir *dir, GnomeCmdFile *finfo, GnomeCmdFileSelector *fs)
+{
+ g_return_if_fail (GNOME_CMD_IS_DIR (dir));
+ g_return_if_fail (GNOME_CMD_IS_FILE (finfo));
+ g_return_if_fail (GNOME_CMD_IS_FILE_SELECTOR (fs));
+
+ if (file_is_in_list (fs, finfo))
+ {
+ gnome_cmd_file_list_update_file (GNOME_CMD_FILE_LIST (fs->list), finfo);
+
+ GnomeCmdFileListColumnID sort_col = gnome_cmd_file_list_get_sort_column (GNOME_CMD_FILE_LIST (fs->list));
+
+ if (sort_col==FILE_LIST_COLUMN_NAME || sort_col==FILE_LIST_COLUMN_EXT)
+ gnome_cmd_file_list_sort (GNOME_CMD_FILE_LIST (fs->list));
+ }
+}
+
+
static void on_con_combo_item_selected (GnomeCmdCombo *con_combo, GnomeCmdCon *con, GnomeCmdFileSelector *fs)
{
g_return_if_fail (GNOME_CMD_IS_FILE_SELECTOR (fs));
@@ -1059,11 +1077,14 @@
GTK_SIGNAL_FUNC (on_dir_file_deleted), fs);
gtk_signal_disconnect_by_func (GTK_OBJECT (fs->priv->connected_dir),
GTK_SIGNAL_FUNC (on_dir_file_changed), fs);
+ gtk_signal_disconnect_by_func (GTK_OBJECT (fs->priv->connected_dir),
+ GTK_SIGNAL_FUNC (on_dir_file_renamed), fs);
}
gtk_signal_connect (GTK_OBJECT (dir), "file-created", GTK_SIGNAL_FUNC (on_dir_file_created), fs);
gtk_signal_connect (GTK_OBJECT (dir), "file-deleted", GTK_SIGNAL_FUNC (on_dir_file_deleted), fs);
gtk_signal_connect (GTK_OBJECT (dir), "file-changed", GTK_SIGNAL_FUNC (on_dir_file_changed), fs);
+ gtk_signal_connect (GTK_OBJECT (dir), "file-renamed", GTK_SIGNAL_FUNC (on_dir_file_renamed), fs);
fs->priv->connected_dir = dir;
}
Modified: trunk/src/gnome-cmd-file.cc
==============================================================================
--- trunk/src/gnome-cmd-file.cc (original)
+++ trunk/src/gnome-cmd-file.cc Sun Jan 20 23:04:14 2008
@@ -271,6 +271,8 @@
g_return_val_if_fail (finfo, GNOME_VFS_ERROR_CORRUPTED_DATA);
g_return_val_if_fail (finfo->info, GNOME_VFS_ERROR_CORRUPTED_DATA);
+ gchar *old_uri_str = gnome_cmd_file_get_uri_str (finfo);
+
GnomeVFSFileInfo *new_info = gnome_vfs_file_info_dup (finfo->info);
g_return_val_if_fail (new_info, GNOME_VFS_ERROR_CORRUPTED_DATA);
@@ -284,7 +286,7 @@
if (result == GNOME_VFS_OK && has_parent_dir (finfo))
{
gnome_cmd_file_update_info (finfo, new_info);
- gnome_cmd_dir_file_renamed (get_parent_dir (finfo), finfo);
+ gnome_cmd_dir_file_renamed (get_parent_dir (finfo), finfo, old_uri_str);
if (GNOME_CMD_IS_DIR (finfo))
gnome_cmd_dir_update_path (GNOME_CMD_DIR (finfo));
}
Modified: trunk/src/gnome-cmd-rename-dialog.cc
==============================================================================
--- trunk/src/gnome-cmd-rename-dialog.cc (original)
+++ trunk/src/gnome-cmd-rename-dialog.cc Sun Jan 20 23:04:14 2008
@@ -54,7 +54,8 @@
case GDK_KP_Enter:
{
const gchar *new_fname = gtk_entry_get_text (dialog->priv->textbox);
- GnomeVFSResult ret = gnome_cmd_file_rename (dialog->priv->finfo, new_fname);
+ 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);
gnome_cmd_file_unref (dialog->priv->finfo);
gtk_widget_destroy (widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]