diff options
author | Xan Lopez <xan@gnome.org> | 2009-09-10 23:05:54 +0800 |
---|---|---|
committer | Xan Lopez <xan@gnome.org> | 2009-09-10 23:05:54 +0800 |
commit | b93c0ee2b3db46db54b6ae45909fb8b5f54d9f4c (patch) | |
tree | 17ddf4e087e8ab7bff4c89cf24da8097ca693119 /src | |
parent | b2dbd47c3f06203d4394c10599011734ad77ae32 (diff) | |
download | gsoc2013-epiphany-b93c0ee2b3db46db54b6ae45909fb8b5f54d9f4c.tar.gz gsoc2013-epiphany-b93c0ee2b3db46db54b6ae45909fb8b5f54d9f4c.tar.zst gsoc2013-epiphany-b93c0ee2b3db46db54b6ae45909fb8b5f54d9f4c.zip |
Get rid of EphyCommandManager
It was just another useless abstraction at this point.
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-window.c | 19 | ||||
-rw-r--r-- | src/epiphany.h.in | 1 | ||||
-rw-r--r-- | src/window-commands.c | 22 |
3 files changed, 17 insertions, 25 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c index d4d29c297..635a7798b 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -24,7 +24,6 @@ #include "ephy-window.h" #include "ephy-type-builtins.h" #include "ephy-embed-type-builtins.h" -#include "ephy-command-manager.h" #include "ephy-state.h" #include "ppview-toolbar.h" #include "window-commands.h" @@ -1179,20 +1178,18 @@ update_edit_actions_sensitivity (EphyWindow *window, gboolean hide) else { EphyEmbed *embed; + WebKitWebView *view; embed = window->priv->active_embed; g_return_if_fail (embed != NULL); - can_copy = ephy_command_manager_can_do_command - (EPHY_COMMAND_MANAGER (embed), "cmd_copy"); - can_cut = ephy_command_manager_can_do_command - (EPHY_COMMAND_MANAGER (embed), "cmd_cut"); - can_paste = ephy_command_manager_can_do_command - (EPHY_COMMAND_MANAGER (embed), "cmd_paste"); - can_undo = ephy_command_manager_can_do_command - (EPHY_COMMAND_MANAGER (embed), "cmd_undo"); - can_redo = ephy_command_manager_can_do_command - (EPHY_COMMAND_MANAGER (embed), "cmd_redo"); + view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed); + + can_copy = webkit_web_view_can_copy_clipboard (view); + can_cut = webkit_web_view_can_cut_clipboard (view); + can_paste = webkit_web_view_can_paste_clipboard (view); + can_undo = webkit_web_view_can_undo (view); + can_redo = webkit_web_view_can_redo (view); } action_group = window->priv->action_group; diff --git a/src/epiphany.h.in b/src/epiphany.h.in index 7618782c3..656037a40 100644 --- a/src/epiphany.h.in +++ b/src/epiphany.h.in @@ -37,7 +37,6 @@ #include <epiphany/ephy-adblock-manager.h> #include <epiphany/ephy-bookmarks.h> #include <epiphany/ephy-bookmarks-type-builtins.h> -#include <epiphany/ephy-command-manager.h> #include <epiphany/ephy-dialog.h> #include <epiphany/ephy-embed-container.h> #include <epiphany/ephy-embed-event.h> diff --git a/src/window-commands.c b/src/window-commands.c index c819ac559..e6790c754 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -28,7 +28,6 @@ #include "ephy-shell.h" #include "ephy-embed-persist.h" #include "ephy-debug.h" -#include "ephy-command-manager.h" #include "window-commands.h" #include "eel-gconf-extensions.h" #include "ephy-prefs.h" @@ -376,8 +375,7 @@ window_cmd_edit_undo (GtkAction *action, if (embed) { - ephy_command_manager_do_command (EPHY_COMMAND_MANAGER (embed), - "cmd_undo"); + webkit_web_view_undo (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed)); } } } @@ -402,8 +400,7 @@ window_cmd_edit_redo (GtkAction *action, embed = gtk_widget_get_ancestor (widget, EPHY_TYPE_EMBED); if (embed) { - ephy_command_manager_do_command (EPHY_COMMAND_MANAGER (embed), - "cmd_redo"); + webkit_web_view_redo (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed)); } } } @@ -423,8 +420,7 @@ window_cmd_edit_cut (GtkAction *action, embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window)); g_return_if_fail (embed != NULL); - ephy_command_manager_do_command (EPHY_COMMAND_MANAGER (embed), - "cmd_cut"); + webkit_web_view_cut_clipboard (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed)); } } @@ -445,8 +441,7 @@ window_cmd_edit_copy (GtkAction *action, embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window)); g_return_if_fail (embed != NULL); - ephy_command_manager_do_command (EPHY_COMMAND_MANAGER (embed), - "cmd_copy"); + webkit_web_view_copy_clipboard (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed)); } } @@ -467,8 +462,7 @@ window_cmd_edit_paste (GtkAction *action, embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window)); g_return_if_fail (embed != NULL); - ephy_command_manager_do_command (EPHY_COMMAND_MANAGER (embed), - "cmd_paste"); + webkit_web_view_paste_clipboard (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed)); } } @@ -489,8 +483,11 @@ window_cmd_edit_delete (GtkAction *action, embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window)); g_return_if_fail (embed != NULL); + /* FIXME: TODO */ +#if 0 ephy_command_manager_do_command (EPHY_COMMAND_MANAGER (embed), "cmd_delete"); +#endif } } @@ -512,8 +509,7 @@ window_cmd_edit_select_all (GtkAction *action, (EPHY_EMBED_CONTAINER (window)); g_return_if_fail (embed != NULL); - ephy_command_manager_do_command (EPHY_COMMAND_MANAGER (embed), - "cmd_selectAll"); + webkit_web_view_select_all (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed)); } } |