[gnome-commander/gcmd-1-3] 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-3] Fixed debian problem #438884 (wrong device label when switching panels with CTRL+U)
- Date: Tue, 22 Sep 2009 20:56:08 +0000 (UTC)
commit 8eaca16d1481d62e897e1c6eea0ab8c8d9e75863
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Tue Sep 22 22:01:43 2009 +0200
Fixed debian problem #438884 (wrong device label when switching panels with CTRL+U)
src/gnome-cmd-main-win.cc | 35 ++++++++++++++++++++++++-----------
1 files changed, 24 insertions(+), 11 deletions(-)
---
diff --git a/src/gnome-cmd-main-win.cc b/src/gnome-cmd-main-win.cc
index b090acb..45d19e9 100644
--- a/src/gnome-cmd-main-win.cc
+++ b/src/gnome-cmd-main-win.cc
@@ -1202,17 +1202,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]