[gnome-commander/gcmd-1-2-8] Fixed debian problem #438884 (wrong device label when switching panels with CTRL+U)
- From: Piotr Eljasiak <epiotr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-commander/gcmd-1-2-8] Fixed debian problem #438884 (wrong device label when switching panels with CTRL+U)
- Date: Tue, 22 Sep 2009 20:55:58 +0000 (UTC)
commit 21407e8ed96af645b4c54c504e009e9e0aef4e6d
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Tue Sep 22 22:15:52 2009 +0200
Fixed debian problem #438884 (wrong device label when switching panels with CTRL+U)
NEWS | 1 +
doc/C/gnome-commander.xml | 3 +++
src/gnome-cmd-main-win.cc | 35 ++++++++++++++++++++++++-----------
3 files changed, 28 insertions(+), 11 deletions(-)
---
diff --git a/NEWS b/NEWS
index bc2f711..c519375 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ gnome-commander 1.2.8.2
Bug fixes:
* Fixed problem #591944 (permissions set to 000 after chmod)
* Fixed problem #595097 (build error for poppler >= 0.11.3)
+ * Fixed debian problem #438884 (wrong device label when switching panels with CTRL+U)
* Fixed problem with broken file icon after renaming a symbolic link
diff --git a/doc/C/gnome-commander.xml b/doc/C/gnome-commander.xml
index 8d7e1b5..946d5bf 100644
--- a/doc/C/gnome-commander.xml
+++ b/doc/C/gnome-commander.xml
@@ -5998,6 +5998,9 @@
<para>Fixed problem #595097 (build error for poppler >= 0.11.3)</para>
</listitem>
<listitem>
+ <para>Fixed debian problem #438884 (wrong device label when switching panels with CTRL+U)</para>
+ </listitem>
+ <listitem>
<para>Fixed problem with broken file icon after renaming a symbolic link</para>
</listitem>
</itemizedlist>
diff --git a/src/gnome-cmd-main-win.cc b/src/gnome-cmd-main-win.cc
index 4fbd8b5..58b47f9 100644
--- a/src/gnome-cmd-main-win.cc
+++ b/src/gnome-cmd-main-win.cc
@@ -1013,17 +1013,30 @@ gboolean gnome_cmd_main_win_keypressed (GnomeCmdMainWin *mw, GdkEventKey *event)
case GDK_u:
case GDK_U:
{
- GnomeCmdDir *dir1 = gnome_cmd_main_win_get_fs (mw, LEFT)->get_directory();
- GnomeCmdDir *dir2 = gnome_cmd_main_win_get_fs (mw, RIGHT)->get_directory();
-
- gnome_cmd_dir_ref (dir1);
- gnome_cmd_dir_ref (dir2);
-
- gnome_cmd_main_win_get_fs (mw, LEFT)->set_directory(dir2);
- gnome_cmd_main_win_get_fs (mw, RIGHT)->set_directory(dir1);
-
- gnome_cmd_dir_unref (dir1);
- gnome_cmd_dir_unref (dir2);
+ GnomeCmdFileSelector *fs1 = gnome_cmd_main_win_get_fs (mw, LEFT);
+ GnomeCmdFileSelector *fs2 = gnome_cmd_main_win_get_fs (mw, RIGHT);
+
+ // swap widgets
+ g_object_ref (fs1);
+ g_object_ref (fs2);
+ gtk_container_remove (GTK_CONTAINER (mw->priv->paned), *fs1);
+ gtk_container_remove (GTK_CONTAINER (mw->priv->paned), *fs2);
+ gtk_paned_pack1 (GTK_PANED (mw->priv->paned), *fs2, TRUE, TRUE);
+ gtk_paned_pack2 (GTK_PANED (mw->priv->paned), *fs1, TRUE, TRUE);
+ g_object_unref (fs1);
+ g_object_unref (fs2);
+
+ // update priv->file_selector[]
+ GtkWidget *swap = mw->priv->file_selector[LEFT];
+ mw->priv->file_selector[LEFT] = mw->priv->file_selector[RIGHT];
+ mw->priv->file_selector[RIGHT] = swap;
+
+ // refocus ACTIVE fs
+ gnome_cmd_main_win_focus_file_lists (mw);
+
+ // update cmdline only for different directories
+ if (fs1->get_directory()!=fs2->get_directory())
+ gnome_cmd_main_win_switch_fs (mw, gnome_cmd_main_win_get_fs (mw, ACTIVE));
clear_event_key (event);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]