[gnome-commander/gcmd-1-3] gnome_cmd_main_win_keypressed() -> GnomeCmdMainWin::key_pressed()



commit b1ce9e7962c6d61db42ca6ac962b086dfa85a6f3
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Thu Jul 23 23:17:41 2009 +0200

    gnome_cmd_main_win_keypressed() -> GnomeCmdMainWin::key_pressed()

 src/gnome-cmd-cmdline.cc           |    2 +-
 src/gnome-cmd-file-selector.cc     |    2 +-
 src/gnome-cmd-main-win.cc          |   50 ++++++++++++++++++------------------
 src/gnome-cmd-main-win.h           |    7 ++---
 src/gnome-cmd-quicksearch-popup.cc |    2 +-
 5 files changed, 31 insertions(+), 32 deletions(-)
---
diff --git a/src/gnome-cmd-cmdline.cc b/src/gnome-cmd-cmdline.cc
index ec41eaf..acd6500 100644
--- a/src/gnome-cmd-cmdline.cc
+++ b/src/gnome-cmd-cmdline.cc
@@ -203,7 +203,7 @@ static gboolean on_key_pressed (GtkWidget *entry, GdkEventKey *event, GnomeCmdCm
             break;
     }
 
-    return gnome_cmd_cmdline_keypressed (cmdline, event) || !gnome_cmd_data.terminal_visibility && gnome_cmd_main_win_keypressed (main_win, event);
+    return gnome_cmd_cmdline_keypressed (cmdline, event) || !gnome_cmd_data.terminal_visibility && main_win->key_pressed(event);
 }
 
 
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index ec06701..9b37b83 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -1099,7 +1099,7 @@ static gboolean on_list_key_pressed (GtkCList *clist, GdkEventKey *event, GnomeC
         ret = TRUE;
     else if (fs->key_pressed(event))
         ret = TRUE;
-    else if (gnome_cmd_main_win_keypressed (main_win, event))
+    else if (main_win->key_pressed(event))
         ret = TRUE;
     else if (gcmd_user_actions.handle_key_event(main_win, fs->file_list(), event))
         ret = TRUE;
diff --git a/src/gnome-cmd-main-win.cc b/src/gnome-cmd-main-win.cc
index 7935986..d7fefd2 100644
--- a/src/gnome-cmd-main-win.cc
+++ b/src/gnome-cmd-main-win.cc
@@ -1148,7 +1148,7 @@ void gnome_cmd_main_win_refocus (GnomeCmdMainWin *mw)
 }
 
 
-gboolean gnome_cmd_main_win_keypressed (GnomeCmdMainWin *mw, GdkEventKey *event)
+gboolean GnomeCmdMainWin::key_pressed(GdkEventKey *event)
 {
     if (state_is_alt (event->state))
     {
@@ -1156,23 +1156,23 @@ gboolean gnome_cmd_main_win_keypressed (GnomeCmdMainWin *mw, GdkEventKey *event)
         {
             case GDK_1:
                 {
-                    GnomeCmdFileSelector *fs = mw->fs(LEFT);
-                    gnome_cmd_main_win_switch_fs (mw, fs);
+                    GnomeCmdFileSelector *fs = this->fs(LEFT);
+                    gnome_cmd_main_win_switch_fs (this, fs);
                     gnome_cmd_combo_popup_list (GNOME_CMD_COMBO (fs->con_combo));
                 }
                 return TRUE;
 
             case GDK_2:
                 {
-                    GnomeCmdFileSelector *fs = mw->fs(RIGHT);
-                    gnome_cmd_main_win_switch_fs (mw, fs);
+                    GnomeCmdFileSelector *fs = this->fs(RIGHT);
+                    gnome_cmd_main_win_switch_fs (this, fs);
                     gnome_cmd_combo_popup_list (GNOME_CMD_COMBO (fs->con_combo));
                 }
                 return TRUE;
 
             case GDK_F8:
                 if (gnome_cmd_data.cmdline_visibility)
-                    gnome_cmd_cmdline_show_history (GNOME_CMD_CMDLINE (mw->priv->cmdline));
+                    gnome_cmd_cmdline_show_history (GNOME_CMD_CMDLINE (priv->cmdline));
                 return TRUE;
         }
     }
@@ -1184,7 +1184,7 @@ gboolean gnome_cmd_main_win_keypressed (GnomeCmdMainWin *mw, GdkEventKey *event)
             case GDK_h:
                 gnome_cmd_data.filter_settings.hidden = !gnome_cmd_data.filter_settings.hidden;
                 gnome_cmd_style_create ();
-                gnome_cmd_main_win_update_style (main_win);
+                gnome_cmd_main_win_update_style (this);
                 gnome_cmd_data.save();
                 return TRUE;
         }
@@ -1197,20 +1197,20 @@ gboolean gnome_cmd_main_win_keypressed (GnomeCmdMainWin *mw, GdkEventKey *event)
             case GDK_E:
             case GDK_Down:
                 if (gnome_cmd_data.cmdline_visibility)
-                    gnome_cmd_cmdline_show_history (GNOME_CMD_CMDLINE (mw->priv->cmdline));
+                    gnome_cmd_cmdline_show_history (GNOME_CMD_CMDLINE (priv->cmdline));
                 return TRUE;
 
             case GDK_u:
             case GDK_U:
                 {
-                    GnomeCmdDir *dir1 = mw->fs(LEFT)->get_directory();
-                    GnomeCmdDir *dir2 = mw->fs(RIGHT)->get_directory();
+                    GnomeCmdDir *dir1 = fs(LEFT)->get_directory();
+                    GnomeCmdDir *dir2 = fs(RIGHT)->get_directory();
 
                     gnome_cmd_dir_ref (dir1);
                     gnome_cmd_dir_ref (dir2);
 
-                    mw->fs(LEFT)->set_directory(dir2);
-                    mw->fs(RIGHT)->set_directory(dir1);
+                    fs(LEFT)->set_directory(dir2);
+                    fs(RIGHT)->set_directory(dir1);
 
                     gnome_cmd_dir_unref (dir1);
                     gnome_cmd_dir_unref (dir2);
@@ -1234,7 +1234,7 @@ gboolean gnome_cmd_main_win_keypressed (GnomeCmdMainWin *mw, GdkEventKey *event)
             {
                 GnomeCmdConFtp *con = GNOME_CMD_CON_FTP (gnome_cmd_con_list_get_all_ftp (gnome_cmd_con_list_get ())->data);
 
-                main_win->fs(ACTIVE)->set_connection(GNOME_CMD_CON (con));
+                fs(ACTIVE)->set_connection(GNOME_CMD_CON (con));
             }
             break;
         }
@@ -1246,51 +1246,51 @@ gboolean gnome_cmd_main_win_keypressed (GnomeCmdMainWin *mw, GdkEventKey *event)
                 case GDK_Tab:
                     // hack to avoid the default handling of the tab-key
                     clear_event_key (event);
-                    gnome_cmd_main_win_switch_fs (mw, mw->fs(INACTIVE));
+                    gnome_cmd_main_win_switch_fs (this, fs(INACTIVE));
                     return TRUE;
 
                 case GDK_F1:
-                    on_help_clicked (NULL, mw);
+                    on_help_clicked (NULL, this);
                     return TRUE;
 
                 case GDK_F2:
-                    on_rename_clicked (NULL, mw);
+                    on_rename_clicked (NULL, this);
                     return TRUE;
 
                 case GDK_F3:
-                    on_view_clicked (NULL, mw);
+                    on_view_clicked (NULL, this);
                     return TRUE;
 
                 case GDK_F4:
-                    on_edit_clicked (NULL, mw);
+                    on_edit_clicked (NULL, this);
                     return TRUE;
 
                 case GDK_F5:
-                    on_copy_clicked (NULL, mw);
+                    on_copy_clicked (NULL, this);
                     return TRUE;
 
                 case GDK_F6:
-                    on_move_clicked (NULL, mw);
+                    on_move_clicked (NULL, this);
                     return TRUE;
 
                 case GDK_F7:
-                    on_mkdir_clicked (NULL, mw);
+                    on_mkdir_clicked (NULL, this);
                     return TRUE;
 
                 case GDK_F8:
-                    on_delete_clicked (NULL, mw);
+                    on_delete_clicked (NULL, this);
                     return TRUE;
 
                 case GDK_F9:
-                    on_search_clicked (NULL, mw);
+                    on_search_clicked (NULL, this);
                     return TRUE;
 
                 case GDK_F10:
-                    on_quit_clicked (NULL, mw);
+                    on_quit_clicked (NULL, this);
                     return TRUE;
             }
 
-    if (mw->fs(ACTIVE)->key_pressed(event))
+    if (fs(ACTIVE)->key_pressed(event))
         return TRUE;
 
     return FALSE;
diff --git a/src/gnome-cmd-main-win.h b/src/gnome-cmd-main-win.h
index 1fa1a4a..a036b24 100644
--- a/src/gnome-cmd-main-win.h
+++ b/src/gnome-cmd-main-win.h
@@ -50,9 +50,10 @@ struct GnomeCmdMainWin
     GnomeCmdAdvrenameDialog *advrename_dlg;
 
     GnomeCmdFileSelector *fs(FileSelectorID id);
-    
-    void set_equal_panes();
 
+    gboolean key_pressed (GdkEventKey *event);
+
+    void set_equal_panes();
     void set_cap_state(gboolean state);
 };
 
@@ -79,8 +80,6 @@ void gnome_cmd_main_win_focus_cmdline (GnomeCmdMainWin *mw);
 void gnome_cmd_main_win_focus_file_lists (GnomeCmdMainWin *mw);
 void gnome_cmd_main_win_refocus (GnomeCmdMainWin *mw);
 
-gboolean gnome_cmd_main_win_keypressed (GnomeCmdMainWin *mw, GdkEventKey *event);
-
 void gnome_cmd_main_win_update_bookmarks (GnomeCmdMainWin *mw);
 void gnome_cmd_main_win_update_toolbar_visibility (GnomeCmdMainWin *mw);
 void gnome_cmd_main_win_update_cmdline_visibility (GnomeCmdMainWin *mw);
diff --git a/src/gnome-cmd-quicksearch-popup.cc b/src/gnome-cmd-quicksearch-popup.cc
index bedf7c0..cd8efc8 100644
--- a/src/gnome-cmd-quicksearch-popup.cc
+++ b/src/gnome-cmd-quicksearch-popup.cc
@@ -151,7 +151,7 @@ static gboolean on_key_pressed (GtkWidget *entry, GdkEventKey *event, GnomeCmdQu
         case GDK_F8:
             popup->priv->fl->select_row(GNOME_CMD_CLIST (popup->priv->fl)->drag_motion_row);
             hide_popup (popup);
-            gnome_cmd_main_win_keypressed (main_win, event);
+            main_win->key_pressed(event);
             return TRUE;
 
         default:



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