[gnome-commander] gnome_cmd_main_win_keypressed() -> GnomeCmdMainWin::key_pressed()
- From: Piotr Eljasiak <epiotr src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-commander] gnome_cmd_main_win_keypressed() -> GnomeCmdMainWin::key_pressed()
- Date: Thu, 23 Jul 2009 21:19:01 +0000 (UTC)
commit 64c33083182ed5fb1c26cfe84aab9ea6a86cf752
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Thu Jul 23 23:14:48 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 90f81f0..aa2c69b 100644
--- a/src/gnome-cmd-cmdline.cc
+++ b/src/gnome-cmd-cmdline.cc
@@ -131,7 +131,7 @@ static gboolean on_key_pressed (GtkWidget *entry, GdkEventKey *event, GnomeCmdCm
break;
}
- return gnome_cmd_cmdline_keypressed (cmdline, event) || gnome_cmd_main_win_keypressed (main_win, event);
+ return gnome_cmd_cmdline_keypressed (cmdline, event) || main_win->key_pressed(event);
}
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index 823ec06..c3b24fe 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 8aa2338..21d1091 100644
--- a/src/gnome-cmd-main-win.cc
+++ b/src/gnome-cmd-main-win.cc
@@ -958,7 +958,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))
{
@@ -966,23 +966,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;
}
}
@@ -994,7 +994,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;
}
@@ -1007,20 +1007,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);
@@ -1044,7 +1044,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;
}
@@ -1056,51 +1056,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 f385175..3f63581 100644
--- a/src/gnome-cmd-main-win.h
+++ b/src/gnome-cmd-main-win.h
@@ -48,9 +48,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);
};
@@ -72,8 +73,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]