mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-03 23:15:52 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b2272a49c3
@ -12,6 +12,7 @@
|
||||
|| (__APPLE__ && __MACH__)
|
||||
#include <ev/ev_kqueue.hpp>
|
||||
#elif defined(_WIN32) || defined(_WIN64) || defined(__NT__)
|
||||
#define SHUT_RDWR SD_BOTH
|
||||
#include <ev/ev_win32.hpp>
|
||||
#else
|
||||
#error No async event loop for your platform, subclass llarp_ev_loop
|
||||
|
@ -97,7 +97,7 @@ namespace llarp
|
||||
Start();
|
||||
|
||||
virtual std::string
|
||||
Name() const;
|
||||
Name() const override;
|
||||
|
||||
bool
|
||||
ShouldPublishDescriptors(llarp_time_t now) const override;
|
||||
|
2
ui-win32/AboutBox.Designer.cs
generated
2
ui-win32/AboutBox.Designer.cs
generated
@ -163,7 +163,7 @@
|
||||
this.Padding = new System.Windows.Forms.Padding(9);
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "AboutBox1";
|
||||
this.tableLayoutPanel.ResumeLayout(false);
|
||||
this.tableLayoutPanel.PerformLayout();
|
||||
|
71
ui-win32/UIMain.Designer.cs
generated
71
ui-win32/UIMain.Designer.cs
generated
@ -39,6 +39,14 @@
|
||||
this.btnDrop = new System.Windows.Forms.Button();
|
||||
this.btnConfigProfile = new System.Windows.Forms.Button();
|
||||
this.btnAbout = new System.Windows.Forms.Button();
|
||||
this.TrayMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.TrayConnect = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.TrayDisconnect = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveLogToFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.showToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.TrayMenu.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// StatusLabel
|
||||
@ -72,6 +80,7 @@
|
||||
//
|
||||
// NotificationTrayIcon
|
||||
//
|
||||
this.NotificationTrayIcon.ContextMenuStrip = this.TrayMenu;
|
||||
this.NotificationTrayIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("NotificationTrayIcon.Icon")));
|
||||
this.NotificationTrayIcon.Text = "LokiNET - disconnected";
|
||||
this.NotificationTrayIcon.Visible = true;
|
||||
@ -143,6 +152,60 @@
|
||||
this.btnAbout.UseVisualStyleBackColor = true;
|
||||
this.btnAbout.Click += new System.EventHandler(this.btnAbout_Click);
|
||||
//
|
||||
// TrayMenu
|
||||
//
|
||||
this.TrayMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.showToolStripMenuItem,
|
||||
this.TrayConnect,
|
||||
this.TrayDisconnect,
|
||||
this.saveLogToFileToolStripMenuItem,
|
||||
this.aboutToolStripMenuItem,
|
||||
this.exitToolStripMenuItem});
|
||||
this.TrayMenu.Name = "TrayMenu";
|
||||
this.TrayMenu.Size = new System.Drawing.Size(181, 158);
|
||||
//
|
||||
// TrayConnect
|
||||
//
|
||||
this.TrayConnect.Name = "TrayConnect";
|
||||
this.TrayConnect.Size = new System.Drawing.Size(180, 22);
|
||||
this.TrayConnect.Text = "Connect";
|
||||
this.TrayConnect.Click += new System.EventHandler(this.TrayConnect_Click);
|
||||
//
|
||||
// TrayDisconnect
|
||||
//
|
||||
this.TrayDisconnect.Name = "TrayDisconnect";
|
||||
this.TrayDisconnect.Size = new System.Drawing.Size(180, 22);
|
||||
this.TrayDisconnect.Text = "Disconnect";
|
||||
this.TrayDisconnect.Click += new System.EventHandler(this.TrayDisconnect_Click);
|
||||
//
|
||||
// saveLogToFileToolStripMenuItem
|
||||
//
|
||||
this.saveLogToFileToolStripMenuItem.Name = "saveLogToFileToolStripMenuItem";
|
||||
this.saveLogToFileToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.saveLogToFileToolStripMenuItem.Text = "Save Log to File...";
|
||||
this.saveLogToFileToolStripMenuItem.Click += new System.EventHandler(this.saveLogToFileToolStripMenuItem_Click);
|
||||
//
|
||||
// aboutToolStripMenuItem
|
||||
//
|
||||
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
|
||||
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.aboutToolStripMenuItem.Text = "About...";
|
||||
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
|
||||
//
|
||||
// exitToolStripMenuItem
|
||||
//
|
||||
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||
this.exitToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.exitToolStripMenuItem.Text = "Exit";
|
||||
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
|
||||
//
|
||||
// showToolStripMenuItem
|
||||
//
|
||||
this.showToolStripMenuItem.Name = "showToolStripMenuItem";
|
||||
this.showToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.showToolStripMenuItem.Text = "Show";
|
||||
this.showToolStripMenuItem.Click += new System.EventHandler(this.showToolStripMenuItem_Click);
|
||||
//
|
||||
// main_frame
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@ -161,6 +224,7 @@
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "LokiNET Launcher";
|
||||
this.TrayMenu.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@ -177,6 +241,13 @@
|
||||
private System.Windows.Forms.Button btnConfigProfile;
|
||||
public System.Windows.Forms.TextBox lokinetd_fd1;
|
||||
private System.Windows.Forms.Button btnAbout;
|
||||
private System.Windows.Forms.ContextMenuStrip TrayMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem TrayConnect;
|
||||
private System.Windows.Forms.ToolStripMenuItem TrayDisconnect;
|
||||
private System.Windows.Forms.ToolStripMenuItem saveLogToFileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem showToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,8 @@ namespace network.loki.lokinet.win32.ui
|
||||
public static Process lokiNetDaemon = new Process();
|
||||
public static bool isConnected;
|
||||
public static string logText;
|
||||
private string config_path;
|
||||
private LogDumper ld;
|
||||
|
||||
void UpdateUI(string text)
|
||||
{
|
||||
@ -21,6 +23,10 @@ namespace network.loki.lokinet.win32.ui
|
||||
public main_frame()
|
||||
{
|
||||
InitializeComponent();
|
||||
if (Program.platform == PlatformID.Win32NT)
|
||||
config_path = Environment.ExpandEnvironmentVariables("%APPDATA%\\.lokinet");
|
||||
else
|
||||
config_path = Environment.ExpandEnvironmentVariables("%HOME%/.lokinet");
|
||||
StatusLabel.Text = "Disconnected";
|
||||
var build = ((AssemblyInformationalVersionAttribute)Assembly
|
||||
.GetAssembly(typeof(main_frame))
|
||||
@ -63,10 +69,13 @@ namespace network.loki.lokinet.win32.ui
|
||||
lokiNetDaemon.Start();
|
||||
lokiNetDaemon.BeginOutputReadLine();
|
||||
btnConnect.Enabled = false;
|
||||
TrayConnect.Enabled = false;
|
||||
StatusLabel.Text = "Connected";
|
||||
isConnected = true;
|
||||
NotificationTrayIcon.Text = "LokiNET - connected";
|
||||
btnDrop.Enabled = true;
|
||||
TrayDisconnect.Enabled = true;
|
||||
NotificationTrayIcon.ShowBalloonTip(5, "LokiNET", "Connected to network.", ToolTipIcon.Info);
|
||||
}
|
||||
|
||||
private void btnDrop_Click(object sender, EventArgs e)
|
||||
@ -74,12 +83,16 @@ namespace network.loki.lokinet.win32.ui
|
||||
lokiNetDaemon.CancelOutputRead();
|
||||
lokiNetDaemon.Kill();
|
||||
btnConnect.Enabled = true;
|
||||
TrayConnect.Enabled = true;
|
||||
btnDrop.Enabled = false;
|
||||
TrayDisconnect.Enabled = false;
|
||||
StatusLabel.Text = "Disconnected";
|
||||
NotificationTrayIcon.Text = "LokiNET - disconnected";
|
||||
isConnected = false;
|
||||
logText = lokinetd_fd1.Text;
|
||||
lokinetd_fd1.Text = string.Empty;
|
||||
NotificationTrayIcon.ShowBalloonTip(5, "LokiNET", "Disconnected from network.", ToolTipIcon.Info);
|
||||
|
||||
}
|
||||
|
||||
private void lokinetd_fd1_TextChanged(object sender, EventArgs e)
|
||||
@ -98,14 +111,66 @@ namespace network.loki.lokinet.win32.ui
|
||||
|
||||
private void NotificationTrayIcon_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
Show();
|
||||
if (!Visible)
|
||||
{
|
||||
Show();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAbout_Click(object sender, EventArgs e)
|
||||
{
|
||||
AboutBox a = new AboutBox();
|
||||
a.ShowDialog(this);
|
||||
a.Dispose();
|
||||
}
|
||||
|
||||
private void saveLogToFileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (isConnected)
|
||||
MessageBox.Show("Cannot dump log when client is running.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
else
|
||||
{
|
||||
if (logText == string.Empty)
|
||||
{
|
||||
MessageBox.Show("Log is empty", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
return;
|
||||
}
|
||||
if (ld == null)
|
||||
ld = new LogDumper(logText);
|
||||
else
|
||||
ld.setText(logText);
|
||||
|
||||
ld.CreateLog(config_path);
|
||||
MessageBox.Show(string.Format("Wrote log to {0}, previous log rotated", ld.getLogPath()), "LokiNET", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
logText = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
AboutBox a = new AboutBox();
|
||||
a.ShowDialog();
|
||||
a.Dispose();
|
||||
}
|
||||
|
||||
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
private void TrayDisconnect_Click(object sender, EventArgs e)
|
||||
{
|
||||
btnDrop_Click(sender, e);
|
||||
}
|
||||
|
||||
private void TrayConnect_Click(object sender, EventArgs e)
|
||||
{
|
||||
btnConnect_Click(sender, e);
|
||||
}
|
||||
|
||||
private void showToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -120,6 +120,9 @@
|
||||
<metadata name="NotificationTrayIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="TrayMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>179, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="NotificationTrayIcon.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
Loading…
Reference in New Issue
Block a user