[gnome-commander] Fixed debian problem #438884 (wrong device label when switching panels with CTRL+U)



commit 65f1404e93f729dcd01d685e16d416fe91410d7b
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Tue Sep 22 21:58:54 2009 +0200

    Fixed debian problem #438884 (wrong device label when switching panels with CTRL+U)

 NEWS                      |    3 ++-
 doc/C/gnome-commander.xml |    3 +++
 src/gnome-cmd-main-win.cc |   35 ++++++++++++++++++++++++-----------
 3 files changed, 29 insertions(+), 12 deletions(-)
---
diff --git a/NEWS b/NEWS
index 42b5ecf..5d6c524 100644
--- a/NEWS
+++ b/NEWS
@@ -12,13 +12,14 @@ New features:
       ...            ...
 
 
-=======
+===================================
 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 019c2ce..43f500f 100644
--- a/doc/C/gnome-commander.xml
+++ b/doc/C/gnome-commander.xml
@@ -6014,6 +6014,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 25fa8a8..8e4c9d1 100644
--- a/src/gnome-cmd-main-win.cc
+++ b/src/gnome-cmd-main-win.cc
@@ -1012,17 +1012,30 @@ gboolean GnomeCmdMainWin::key_pressed(GdkEventKey *event)
             case GDK_u:
             case GDK_U:
                 {
-                    GnomeCmdDir *dir1 = fs(LEFT)->get_directory();
-                    GnomeCmdDir *dir2 = fs(RIGHT)->get_directory();
-
-                    gnome_cmd_dir_ref (dir1);
-                    gnome_cmd_dir_ref (dir2);
-
-                    fs(LEFT)->set_directory(dir2);
-                    fs(RIGHT)->set_directory(dir1);
-
-                    gnome_cmd_dir_unref (dir1);
-                    gnome_cmd_dir_unref (dir2);
+                    GnomeCmdFileSelector *fs1 = fs(LEFT);
+                    GnomeCmdFileSelector *fs2 = fs(RIGHT);
+
+                    // swap widgets
+                    g_object_ref (fs1);
+                    g_object_ref (fs2);
+                    gtk_container_remove (GTK_CONTAINER (priv->paned), *fs1);
+                    gtk_container_remove (GTK_CONTAINER (priv->paned), *fs2);
+                    gtk_paned_pack1 (GTK_PANED (priv->paned), *fs2, TRUE, TRUE);
+                    gtk_paned_pack2 (GTK_PANED (priv->paned), *fs1, TRUE, TRUE);
+                    g_object_unref (fs1);
+                    g_object_unref (fs2);
+
+                    // update priv->file_selector[]
+                    GtkWidget *swap = priv->file_selector[LEFT];
+                    priv->file_selector[LEFT] = priv->file_selector[RIGHT];
+                    priv->file_selector[RIGHT] = swap;
+
+                    // refocus ACTIVE fs
+                    gnome_cmd_main_win_focus_file_lists (this);
+
+                    // update cmdline only for different directories
+                    if (fs1->get_directory()!=fs2->get_directory())
+                        switch_fs(fs(ACTIVE));
 
                     clear_event_key (event);
                 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]