Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nice integration #14

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added MenuIntegrated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Includes a full XTerm console, on the Linux version. Standard text window on Win

![alt tag](https://raw.githubusercontent.com/logicethos/SSHDebugger/master/SSHDebugger.png)


Easy to run the SSH Debugger from menu "Run" or with shortcut
![alt tag](https://raw.githubusercontent.com/Int32Overflow/SSHDebugger/NiceIntegration/MenuIntegrated.png)

Uses:

* Develop .NET apps for embedded devices and small computers such as the Raspberry Pi.
Expand Down
2 changes: 1 addition & 1 deletion SSHDebugger.sln
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ Global
GlobalSection(NestedProjects) = preSolution
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
version = 0.4
version = 0.5
EndGlobalSection
EndGlobal
132 changes: 68 additions & 64 deletions SSHDebugger/Debugger/clsDebuggerOptionsDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,68 +33,72 @@
namespace SSHDebugger
{

public class clsDebuggerOptionsDialog : Gtk.Dialog
{
public clsHost SelectedHost;
Gtk.Button newButton = new Gtk.Button ("New Host");
Gtk.Button connectButton = new Gtk.Button ("Run");
Gtk.ComboBox combo;

const Gtk.ResponseType connectResponse = Gtk.ResponseType.Ok;
const Gtk.ResponseType newResponse = Gtk.ResponseType.Accept;


Properties properties;

//TODO: dropdown menus for picking string substitutions. also substitutions for port, ip
public clsDebuggerOptionsDialog () : base (
"SSH Debug", MonoDevelop.Ide.MessageService.RootWindow,
Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal)
{
properties = PropertyService.Get ("MonoDevelop.Debugger.Soft.SSHDebug", new Properties());

AddActionWidget (connectButton, connectResponse);
AddActionWidget (newButton, newResponse);
AddActionWidget (new Gtk.Button (Gtk.Stock.Cancel), Gtk.ResponseType.Cancel);

var table = new Gtk.Table (1, 2, false);
table.BorderWidth = 6;
VBox.PackStart (table, true, true, 0);

table.Attach (new Gtk.Label ("Host") { Xalign = 0 }, 0, 1, 0, 1);

var values = clsSSHDebuggerEngine.HostsList.Select (x => String.Format ("{0} ({1})", x.Name, System.IO.Path.GetFileName (x.ScriptPath))).ToArray ();
combo = new Gtk.ComboBox (values);

int row=0;
if (clsSSHDebuggerEngine.HostsList.Count == 0) {
connectButton.Sensitive = false;
} else {

var lastSelected = clsSSHDebuggerEngine.HostsList.Find (x => x.ScriptPath == properties.Get<string> ("host", ""));
if (lastSelected != null)
{
row = clsSSHDebuggerEngine.HostsList.IndexOf (lastSelected);
if (row == -1)
row = 0;
}
Gtk.TreeIter iter;
combo.Model.IterNthChild (out iter, row);
combo.SetActiveIter (iter);
SelectedHost = clsSSHDebuggerEngine.HostsList [combo.Active];

combo.Changed += (object sender, EventArgs e) =>
{
SelectedHost = clsSSHDebuggerEngine.HostsList [combo.Active];
};

}

table.Attach (combo, 1, 2, 0, 1);


VBox.ShowAll ();

}
}
public class clsDebuggerOptionsDialog : Gtk.Dialog
{
public clsHost SelectedHost;
Gtk.Button newButton = new Gtk.Button("New Host");
Gtk.Button connectButton = new Gtk.Button("Run");
Gtk.ComboBox combo;

const Gtk.ResponseType connectResponse = Gtk.ResponseType.Ok;
const Gtk.ResponseType newResponse = Gtk.ResponseType.Accept;


Properties properties;

//TODO: dropdown menus for picking string substitutions. also substitutions for port, ip
public clsDebuggerOptionsDialog() : base(
"SSH Debug", MonoDevelop.Ide.MessageService.RootWindow,
Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal)
{
properties = PropertyService.Get("MonoDevelop.Debugger.Soft.SSHDebug", new Properties());

AddActionWidget(connectButton, connectResponse);
AddActionWidget(newButton, newResponse);
AddActionWidget(new Gtk.Button(Gtk.Stock.Cancel), Gtk.ResponseType.Cancel);

var table = new Gtk.Table(1, 2, false);
table.BorderWidth = 6;
VBox.PackStart(table, true, true, 0);

table.Attach(new Gtk.Label("Host") { Xalign = 0 }, 0, 1, 0, 1);

var values = clsSSHDebuggerEngine.HostsList.Select(x => String.Format("{0} ({1})", x.Name, System.IO.Path.GetFileName(x.ScriptPath))).ToArray();
combo = new Gtk.ComboBox(values);

int row = 0;
if (clsSSHDebuggerEngine.HostsList.Count == 0)
{
connectButton.Sensitive = false;
}
else
{

var lastSelected = clsSSHDebuggerEngine.HostsList.Find(x => x.ScriptPath == properties.Get<string>("host", ""));
if (lastSelected != null)
{
row = clsSSHDebuggerEngine.HostsList.IndexOf(lastSelected);
if (row == -1)
row = 0;
}
Gtk.TreeIter iter;
combo.Model.IterNthChild(out iter, row);
combo.SetActiveIter(iter);
SelectedHost = clsSSHDebuggerEngine.HostsList[combo.Active];

combo.Changed += (object sender, EventArgs e) =>
{
SelectedHost = clsSSHDebuggerEngine.HostsList[combo.Active];
};

}

table.Attach(combo, 1, 2, 0, 1);

connectButton.GrabFocus();

VBox.ShowAll();

}
}
}
Loading