aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugin.c')
-rw-r--r--src/plugin.c33
1 files changed, 33 insertions, 0 deletions
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);