Use output pane

master
Yevgen Muntyan 2006-04-16 22:06:13 -05:00
parent 2e51f71df3
commit a045aed039
1 changed files with 31 additions and 0 deletions

View File

@ -14,6 +14,7 @@
#include "mooedit/moousertools.h"
#include "mooedit/mooeditwindow.h"
#include "mooedit/mooedit-script.h"
#include "mooedit/moocmdview.h"
#include "mooutils/mooutils-misc.h"
#include "mooutils/mooconfig.h"
#include "mooutils/moocommand.h"
@ -455,6 +456,26 @@ G_DEFINE_TYPE (MooToolAction, _moo_tool_action, MOO_TYPE_ACTION);
#define MOO_TOOL_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, _moo_tool_action_get_type(), MooToolAction))
static gboolean
run_exe (MooToolAction *action,
const char *cmd_line)
{
GtkWidget *cmd_view;
g_return_val_if_fail (MOO_IS_TOOL_ACTION (action), FALSE);
g_return_val_if_fail (MOO_IS_EDIT_WINDOW (action->window), FALSE);
g_return_val_if_fail (cmd_line != NULL, FALSE);
cmd_view = moo_edit_window_get_output (action->window);
g_return_val_if_fail (MOO_IS_CMD_VIEW (cmd_view), FALSE);
moo_big_paned_present_pane (action->window->paned,
moo_edit_window_get_output_pane (action->window));
return moo_cmd_view_run_command (MOO_CMD_VIEW (cmd_view), cmd_line,
moo_action_get_name (MOO_ACTION (action)));
}
static void
moo_tool_action_activate (MooAction *_action)
{
@ -479,7 +500,17 @@ moo_tool_action_activate (MooAction *_action)
return;
moo_edit_setup_command (action->data->cmd, doc, action->window);
if (action->window)
g_signal_connect_swapped (action->data->cmd, "run-exe",
G_CALLBACK (run_exe), action);
moo_command_run (action->data->cmd);
if (action->window)
g_signal_handlers_disconnect_by_func (action->data->cmd,
(gpointer) run_exe,
action);
}