From 694497bc6fd3e22e9ea08f67fbb3c24705debd8e Mon Sep 17 00:00:00 2001 From: Zemrys Date: Sat, 28 Oct 2017 14:22:53 -0400 Subject: [PATCH] Added ability to view pool interface from pool list. --- Vertminer/Main.Designer.vb | 25 +++++----------- Vertminer/Main.vb | 44 ++++++++++++---------------- Vertminer/My Project/AssemblyInfo.vb | 4 +-- Vertminer/settings.Designer.vb | 10 +++++-- Vertminer/settings.resx | 6 ++++ 5 files changed, 43 insertions(+), 46 deletions(-) diff --git a/Vertminer/Main.Designer.vb b/Vertminer/Main.Designer.vb index 6714dc5..ee2f4e5 100644 --- a/Vertminer/Main.Designer.vb +++ b/Vertminer/Main.Designer.vb @@ -36,7 +36,6 @@ Partial Class Main Me.FileDirectoryToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.SystemLogToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.P2PoolConfigToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.P2PoolWebInterfaceToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.HelpToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.AboutToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ContactToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -143,14 +142,14 @@ Partial Class Main Me.UpdateToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control Me.UpdateToolStripMenuItem.ForeColor = System.Drawing.Color.DarkSlateGray Me.UpdateToolStripMenuItem.Name = "UpdateToolStripMenuItem" - Me.UpdateToolStripMenuItem.Size = New System.Drawing.Size(152, 28) + Me.UpdateToolStripMenuItem.Size = New System.Drawing.Size(140, 28) Me.UpdateToolStripMenuItem.Text = "Update" ' 'ExitToolStripMenuItem ' Me.ExitToolStripMenuItem.ForeColor = System.Drawing.Color.DarkSlateGray Me.ExitToolStripMenuItem.Name = "ExitToolStripMenuItem" - Me.ExitToolStripMenuItem.Size = New System.Drawing.Size(152, 28) + Me.ExitToolStripMenuItem.Size = New System.Drawing.Size(140, 28) Me.ExitToolStripMenuItem.Text = "Exit" ' 'EditToolStripMenuItem @@ -162,7 +161,7 @@ Partial Class Main ' 'ViewToolStripMenuItem ' - Me.ViewToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.FileDirectoryToolStripMenuItem, Me.SystemLogToolStripMenuItem, Me.P2PoolConfigToolStripMenuItem, Me.P2PoolWebInterfaceToolStripMenuItem}) + Me.ViewToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.FileDirectoryToolStripMenuItem, Me.SystemLogToolStripMenuItem, Me.P2PoolConfigToolStripMenuItem}) Me.ViewToolStripMenuItem.ForeColor = System.Drawing.SystemColors.Control Me.ViewToolStripMenuItem.Name = "ViewToolStripMenuItem" Me.ViewToolStripMenuItem.Size = New System.Drawing.Size(64, 46) @@ -172,30 +171,23 @@ Partial Class Main ' Me.FileDirectoryToolStripMenuItem.ForeColor = System.Drawing.Color.DarkSlateGray Me.FileDirectoryToolStripMenuItem.Name = "FileDirectoryToolStripMenuItem" - Me.FileDirectoryToolStripMenuItem.Size = New System.Drawing.Size(261, 28) + Me.FileDirectoryToolStripMenuItem.Size = New System.Drawing.Size(200, 28) Me.FileDirectoryToolStripMenuItem.Text = "Miner Config" ' 'SystemLogToolStripMenuItem ' Me.SystemLogToolStripMenuItem.ForeColor = System.Drawing.Color.DarkSlateGray Me.SystemLogToolStripMenuItem.Name = "SystemLogToolStripMenuItem" - Me.SystemLogToolStripMenuItem.Size = New System.Drawing.Size(261, 28) + Me.SystemLogToolStripMenuItem.Size = New System.Drawing.Size(200, 28) Me.SystemLogToolStripMenuItem.Text = "One-Click Log" ' 'P2PoolConfigToolStripMenuItem ' Me.P2PoolConfigToolStripMenuItem.ForeColor = System.Drawing.Color.DarkSlateGray Me.P2PoolConfigToolStripMenuItem.Name = "P2PoolConfigToolStripMenuItem" - Me.P2PoolConfigToolStripMenuItem.Size = New System.Drawing.Size(261, 28) + Me.P2PoolConfigToolStripMenuItem.Size = New System.Drawing.Size(200, 28) Me.P2PoolConfigToolStripMenuItem.Text = "P2Pool Config" ' - 'P2PoolWebInterfaceToolStripMenuItem - ' - Me.P2PoolWebInterfaceToolStripMenuItem.ForeColor = System.Drawing.Color.DarkSlateGray - Me.P2PoolWebInterfaceToolStripMenuItem.Name = "P2PoolWebInterfaceToolStripMenuItem" - Me.P2PoolWebInterfaceToolStripMenuItem.Size = New System.Drawing.Size(261, 28) - Me.P2PoolWebInterfaceToolStripMenuItem.Text = "P2Pool Web Interface" - ' 'HelpToolStripMenuItem ' Me.HelpToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.AboutToolStripMenuItem, Me.ContactToolStripMenuItem}) @@ -208,14 +200,14 @@ Partial Class Main ' Me.AboutToolStripMenuItem.ForeColor = System.Drawing.Color.DarkSlateGray Me.AboutToolStripMenuItem.Name = "AboutToolStripMenuItem" - Me.AboutToolStripMenuItem.Size = New System.Drawing.Size(152, 28) + Me.AboutToolStripMenuItem.Size = New System.Drawing.Size(143, 28) Me.AboutToolStripMenuItem.Text = "About" ' 'ContactToolStripMenuItem ' Me.ContactToolStripMenuItem.ForeColor = System.Drawing.Color.DarkSlateGray Me.ContactToolStripMenuItem.Name = "ContactToolStripMenuItem" - Me.ContactToolStripMenuItem.Size = New System.Drawing.Size(152, 28) + Me.ContactToolStripMenuItem.Size = New System.Drawing.Size(143, 28) Me.ContactToolStripMenuItem.Text = "Contact" ' 'UpdateStatsInterval @@ -585,7 +577,6 @@ Partial Class Main Friend WithEvents PictureBox9 As PictureBox Friend WithEvents Label4 As Label Friend WithEvents TextBox3 As TextBox - Friend WithEvents P2PoolWebInterfaceToolStripMenuItem As ToolStripMenuItem Friend WithEvents Panel1 As System.Windows.Forms.Panel Friend WithEvents PictureBox4 As System.Windows.Forms.PictureBox Friend WithEvents Panel3 As System.Windows.Forms.Panel diff --git a/Vertminer/Main.vb b/Vertminer/Main.vb index 0f4681e..53b0df7 100755 --- a/Vertminer/Main.vb +++ b/Vertminer/Main.vb @@ -14,6 +14,7 @@ Imports VertcoinOneClickMiner.Core Public Class Main + Dim Pool_Click As New DataGridViewCellEventHandler(AddressOf dataGridView1_CellContentClick) Dim JSONConverter As JavaScriptSerializer = New JavaScriptSerializer() Private _logger As ILogger @@ -170,6 +171,14 @@ Public Class Main End Sub + Private Sub dataGridView1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick + + If e.ColumnIndex = 1 Then + System.Diagnostics.Process.Start(DataGridView1(1, e.RowIndex).Value.ToString.Replace("stratum+tcp", "http")) + End If + + End Sub + Public Sub Process_Check() For Each p As Process In System.Diagnostics.Process.GetProcesses @@ -704,14 +713,18 @@ Public Class Main pools.Clear() pools = poolbuff Dim chk As New DataGridViewCheckBoxColumn() - DataGridView1.Columns.Add(chk) chk.HeaderText = "Select" chk.Name = "Select" + DataGridView1.Columns.Add(chk) + Dim link As New DataGridViewLinkColumn() + link.HeaderText = "Pool" + link.Name = "Pool" + DataGridView1.Columns.Add(link) DataGridView1.ColumnCount = 4 - With DataGridView1.Columns(1) - .Name = "Pool" - .AutoSizeMode = DataGridViewAutoSizeColumnsMode.AllCells - End With + 'With DataGridView1.Columns(1) + ' .Name = "Pool" + ' .AutoSizeMode = DataGridViewAutoSizeColumnsMode.AllCells + 'End With With DataGridView1.Columns(2) .Name = "Worker" End With @@ -1407,25 +1420,6 @@ Public Class Main End Sub - Private Sub P2PoolConfigToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles P2PoolConfigToolStripMenuItem.Click - - Try - p2pool_config_file = settingsfolder & "\p2pool\start_p2pool.bat" - If System.IO.File.Exists(p2pool_config_file) = True Then - Process.Start("notepad.exe", p2pool_config_file) - Else - MsgBox("No p2pool config file found.") - End If - Catch ex As Exception - MsgBox(ex.Message) - _logger.LogError(ex) - Invoke(New MethodInvoker(AddressOf SaveSettingsJSON)) - Finally - _logger.Trace("P2PoolConfigToolStripMenuItem(), Load P2Pool Config: OK") - End Try - - End Sub - Private Sub AboutToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AboutToolStripMenuItem.Click Dim dialog = New about(_logger) @@ -1908,7 +1902,7 @@ Public Class Main End Sub - Private Sub P2PoolWebInterfaceToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles P2PoolWebInterfaceToolStripMenuItem.Click + Private Sub P2PoolWebInterfaceToolStripMenuItem_Click(sender As Object, e As EventArgs) Try Dim url As String = pools(0).replace("stratum+tcp", "http") diff --git a/Vertminer/My Project/AssemblyInfo.vb b/Vertminer/My Project/AssemblyInfo.vb index 49a5201..69010d6 100644 --- a/Vertminer/My Project/AssemblyInfo.vb +++ b/Vertminer/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + diff --git a/Vertminer/settings.Designer.vb b/Vertminer/settings.Designer.vb index 5194c50..c962056 100644 --- a/Vertminer/settings.Designer.vb +++ b/Vertminer/settings.Designer.vb @@ -119,7 +119,7 @@ Partial Class settings Me.CheckBox4.TabIndex = 3 Me.CheckBox4.Text = "Use UPnP" Me.ToolTip.SetToolTip(Me.CheckBox4, "Toggle to enable UPnP. This will automatically set up port forwarding for P2Pool" & - " on compatible routers." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "***Still in development***") + " on compatible routers.") Me.CheckBox4.UseVisualStyleBackColor = True ' 'CheckBox6 @@ -199,7 +199,7 @@ Partial Class settings Me.PictureBox3.TabIndex = 8 Me.PictureBox3.TabStop = False Me.ToolTip.SetToolTip(Me.PictureBox3, "Toggle to enable UPnP. This will automatically set up port forwarding for P2Pool" & - " on compatible routers." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "***Still in development***" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10)) + " on compatible routers." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10)) ' 'PictureBox1 ' @@ -259,6 +259,7 @@ Partial Class settings Me.TextBox4.TabIndex = 0 Me.TextBox4.Text = "9346" Me.TextBox4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center + Me.ToolTip.SetToolTip(Me.TextBox4, "Port in which other P2Pool nodes and node scanners can connect to your node." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10)) ' 'TextBox5 ' @@ -269,6 +270,7 @@ Partial Class settings Me.TextBox5.TabIndex = 0 Me.TextBox5.Text = "9171" Me.TextBox5.TextAlign = System.Windows.Forms.HorizontalAlignment.Center + Me.ToolTip.SetToolTip(Me.TextBox5, "Port in which miners can connect to your node to mine.") ' 'Label15 ' @@ -299,6 +301,8 @@ Partial Class settings Me.Node_Fee.TabIndex = 2 Me.Node_Fee.Text = "%" Me.Node_Fee.TextAlign = System.Windows.Forms.HorizontalAlignment.Center + Me.ToolTip.SetToolTip(Me.Node_Fee, "This is the percentage of work done by miners on your node that is paid as a fee " & + "to you as the node operator." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10)) ' 'Node_Donation ' @@ -309,6 +313,8 @@ Partial Class settings Me.Node_Donation.TabIndex = 1 Me.Node_Donation.Text = "%" Me.Node_Donation.TextAlign = System.Windows.Forms.HorizontalAlignment.Center + Me.ToolTip.SetToolTip(Me.Node_Donation, "This is the percentage of work done by miners on your node that is donated to Ver" & + "tcoin Development.") ' 'Label3 ' diff --git a/Vertminer/settings.resx b/Vertminer/settings.resx index 280806d..ae7a3ee 100644 --- a/Vertminer/settings.resx +++ b/Vertminer/settings.resx @@ -120,6 +120,12 @@ 17, 17 + + 17, 17 + + + 17, 17 + Select the network in which p2pool will connect. Network 1 is recommended for larger (multi-card >100MH) miners.