diff options
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | src/anjuta-plugin-sdk.ui | 1 | ||||
-rw-r--r-- | src/beaver-target.c | 19 | ||||
-rw-r--r-- | src/beaver-target.h | 3 | ||||
-rw-r--r-- | src/plugin.c | 33 | ||||
-rw-r--r-- | src/plugin.h | 1 |
6 files changed, 68 insertions, 1 deletions
@@ -1,3 +1,15 @@ +2008-04-25 Rob Bradford,,, <rob@openedhand.com> + + * src/anjuta-plugin-sdk.ui: + * src/beaver-target.c: (beaver_target_class_init), + (beaver_target_remote_stop), (_beaver_target_run_remote_v), + (_beaver_target_remote_stop): + * src/beaver-target.h: + * src/plugin.c: (action_remote_stop_activate_cb), (update_state), + (anjuta_plugin_sdk_activate): + * src/plugin.h: + Add support for stopping the remote command. + 2008-04-09 Rob Bradford <rob@openedhand.com> * src/beaver-target.c: (_beaver_target_remote_debug), diff --git a/src/anjuta-plugin-sdk.ui b/src/anjuta-plugin-sdk.ui index c01b847..062daa9 100644 --- a/src/anjuta-plugin-sdk.ui +++ b/src/anjuta-plugin-sdk.ui @@ -10,6 +10,7 @@ <menuitem name="ShutdownQemuAction" action="ActionShutdownQemu" /> <separator name="separator3"/> <menuitem name="RunRemoteAction" action="ActionRunRemote" /> + <menuitem name="StopRemoteAction" action="ActionStopRemote" /> <menuitem name="DebugRemoteAction" action="ActionDebugRemote" /> <menuitem name="StopRemoteDebuggerAction" action="ActionStopRemoteDebugger" /> <separator name="separator4"/> diff --git a/src/beaver-target.c b/src/beaver-target.c index c341827..9a3f52e 100644 --- a/src/beaver-target.c +++ b/src/beaver-target.c @@ -57,6 +57,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; static const gchar *ssh_options[] = { "ssh", + "-t", "-l", "root", "-o", "CheckHostIP no", "-o", "StrictHostKeyChecking no", @@ -77,6 +78,7 @@ static gboolean _beaver_target_remote_debug (BeaverTarget *target, gchar *cmd, gchar *cmd_args, GError **out_err); static gboolean _beaver_target_remote_debug_stop (BeaverTarget *target, GError **out_err); +static void _beaver_target_remote_stop (BeaverTarget *target); static void beaver_target_get_property (GObject *object, guint property_id, @@ -156,6 +158,7 @@ beaver_target_class_init (BeaverTargetClass *klass) klass->run_remote = _beaver_target_run_remote; klass->remote_debug = _beaver_target_remote_debug; klass->remote_debug_stop = _beaver_target_remote_debug_stop; + klass->remote_stop = _beaver_target_remote_stop; signals[STATE_CHANGED] = g_signal_new ("state-changed", G_OBJECT_CLASS_TYPE (object_class), @@ -237,6 +240,12 @@ beaver_target_run_remote (BeaverTarget *target, gchar *cmd, GError **error) return BEAVER_TARGET_GET_CLASS (target)->run_remote (target, cmd, error); } +void +beaver_target_remote_stop (BeaverTarget *target) +{ + BEAVER_TARGET_GET_CLASS (target)->remote_stop (target); +} + gboolean beaver_target_remote_debug (BeaverTarget *target, gchar *cmd, gchar *cmd_args, GError **error) @@ -314,7 +323,7 @@ _beaver_target_run_remote_v (BeaverTarget *target, gchar **in_args, if (anjuta_launcher_execute_v (priv->launcher, args, launcher_data_cb, target)) { - beaver_target_set_state (target, TARGET_STATE_BUSY); + beaver_target_set_state (target, TARGET_STATE_REMOTE_RUNNING); return TRUE; } else { gchar *debug_str = NULL; @@ -427,6 +436,14 @@ _beaver_target_remote_debug_stop (BeaverTarget *target, GError **out_err) } static void +_beaver_target_remote_stop (BeaverTarget *target) +{ + BeaverTargetPrivate *priv = TARGET_PRIVATE (target); + + anjuta_launcher_reset (priv->launcher); +} + +static void launcher_child_exited_cb (AnjutaLauncher *launcher, gint child_pid, gint status, gulong time, gpointer userdata) { diff --git a/src/beaver-target.h b/src/beaver-target.h index 89ea4fe..a69d01b 100644 --- a/src/beaver-target.h +++ b/src/beaver-target.h @@ -54,6 +54,7 @@ typedef enum TARGET_STATE_STOPPED, TARGET_STATE_READY, TARGET_STATE_BUSY, + TARGET_STATE_REMOTE_RUNNING, TARGET_STATE_DEBUGGER_READY } BeaverTargetState; @@ -79,6 +80,7 @@ typedef struct { gboolean (* remote_debug) (BeaverTarget *target, gchar *cmd, gchar *args, GError **error); gboolean (* remote_debug_stop) (BeaverTarget *target, GError **error); + void (* remote_stop) (BeaverTarget *target); } BeaverTargetClass; GType beaver_target_get_type (void); @@ -92,6 +94,7 @@ gboolean beaver_target_run_remote_v (BeaverTarget *target, gchar **in_args, gboolean beaver_target_remote_debug (BeaverTarget *target, gchar *cmd, gchar *args, GError **error); gboolean beaver_target_remote_debug_stop (BeaverTarget *target, GError **error); +void beaver_target_remote_stop (BeaverTarget *target); G_END_DECLS #endif /* _BEAVER_TARGET */ diff --git a/src/plugin.c b/src/plugin.c index f428026..312d1ed 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -74,6 +74,8 @@ static void action_remote_debug_stop_activate_cb (GtkAction *action, gpointer userdata); static void action_remote_profile_activate_cb (GtkAction *action, gpointer userdata); +static void action_remote_stop_activate_cb (GtkAction *action, + gpointer userdata); /* actions */ static GtkActionEntry actions_sdk[] = { @@ -118,6 +120,14 @@ static GtkActionEntry actions_sdk[] = { G_CALLBACK (action_remote_run_activate_cb) }, { + "ActionStopRemote", + GTK_STOCK_CLOSE, + N_("Stop remote"), + NULL, + N_("Stop remote"), + G_CALLBACK (action_remote_stop_activate_cb) + }, + { "ActionDebugRemote", GTK_STOCK_EXECUTE, N_("Debug remote..."), @@ -807,6 +817,14 @@ action_remote_run_activate_cb (GtkAction *action, } static void +action_remote_stop_activate_cb (GtkAction *action, + gpointer userdata) +{ + AnjutaPluginSdk *sp = (AnjutaPluginSdk *)userdata; + beaver_target_remote_stop (sp->target); +} + +static void action_remote_profile_activate_cb (GtkAction *action, gpointer userdata) { AnjutaPluginSdk *sp = (AnjutaPluginSdk *)userdata; @@ -1121,6 +1139,15 @@ update_state (AnjutaPluginSdk *sp) switch (state) { + case TARGET_STATE_REMOTE_RUNNING: + gtk_action_set_sensitive (sp->deploy_action, FALSE); + gtk_action_set_sensitive (sp->remote_profile_action, FALSE); + gtk_action_set_sensitive (sp->qemu_shutdown_action, FALSE); + gtk_action_set_sensitive (sp->remote_run_action, FALSE); + gtk_action_set_sensitive (sp->remote_debug_action, FALSE); + gtk_action_set_sensitive (sp->remote_run_action, FALSE); + gtk_action_set_sensitive (sp->remote_stop_action, TRUE); + break; case TARGET_STATE_UNKNOWN: case TARGET_STATE_STOPPED: case TARGET_STATE_BUSY: @@ -1129,6 +1156,8 @@ update_state (AnjutaPluginSdk *sp) gtk_action_set_sensitive (sp->qemu_shutdown_action, FALSE); gtk_action_set_sensitive (sp->remote_run_action, FALSE); gtk_action_set_sensitive (sp->remote_debug_action, FALSE); + gtk_action_set_sensitive (sp->remote_run_action, FALSE); + gtk_action_set_sensitive (sp->remote_stop_action, FALSE); break; case TARGET_STATE_READY: /* Can only turn on if have a project */ @@ -1142,6 +1171,7 @@ update_state (AnjutaPluginSdk *sp) gtk_action_set_sensitive (sp->remote_debug_action, TRUE); gtk_action_set_sensitive (sp->remote_debug_stop_action, FALSE); + gtk_action_set_sensitive (sp->remote_stop_action, FALSE); break; case TARGET_STATE_DEBUGGER_READY: do_local_gdb (sp); @@ -1464,6 +1494,8 @@ anjuta_plugin_sdk_activate (AnjutaPlugin *plugin) "ActionStopRemoteDebugger"); sp->remote_profile_action = anjuta_ui_get_action (ui, "ActionGroupSdk", "ActionRemoteProfile"); + sp->remote_stop_action = anjuta_ui_get_action (ui, "ActionGroupSdk", + "ActionStopRemote"); gtk_action_set_sensitive (sp->qemu_start_action, FALSE); gtk_action_set_sensitive (sp->qemu_shutdown_action, FALSE); @@ -1472,6 +1504,7 @@ anjuta_plugin_sdk_activate (AnjutaPlugin *plugin) gtk_action_set_sensitive (sp->remote_debug_action, FALSE); gtk_action_set_sensitive (sp->remote_debug_stop_action, FALSE); gtk_action_set_sensitive (sp->remote_profile_action, FALSE); + gtk_action_set_sensitive (sp->remote_stop_action, FALSE); sp->sdk_root_notifyid = anjuta_preferences_notify_add (sp->prefs, PREFS_PROP_SDK_ROOT, sdk_root_preference_notify_cb, sp, NULL); diff --git a/src/plugin.h b/src/plugin.h index 11f79e2..1d1f348 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -109,6 +109,7 @@ struct _AnjutaPluginSdk GtkAction *remote_debug_action; GtkAction *remote_debug_stop_action; GtkAction *remote_profile_action; + GtkAction *remote_stop_action; AnjutaSession *session; AnjutaPluginManager *plugin_manager; |