diff --git a/Browser/DisplayOptionsDialog.Designer.vb b/Browser/DisplayOptionsDialog.Designer.vb
index e134e70..3320269 100644
--- a/Browser/DisplayOptionsDialog.Designer.vb
+++ b/Browser/DisplayOptionsDialog.Designer.vb
@@ -30,10 +30,11 @@ Partial Class DisplayOptionsDialog
Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
Me.chkShowRawData = New System.Windows.Forms.CheckBox()
Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
+ Me.chkRevCWServers = New System.Windows.Forms.CheckBox()
+ Me.chkDarkTheme = New System.Windows.Forms.CheckBox()
Me.chkShowPanelOnMouseEnterEvent = New System.Windows.Forms.CheckBox()
Me.lblHomepage = New System.Windows.Forms.Label()
Me.cbxHomepage = New System.Windows.Forms.ComboBox()
- Me.chkDarkTheme = New System.Windows.Forms.CheckBox()
CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainer1.Panel1.SuspendLayout()
Me.SplitContainer1.Panel2.SuspendLayout()
@@ -122,6 +123,7 @@ Partial Class DisplayOptionsDialog
'
Me.SplitContainer1.Panel1.AutoScroll = True
Me.SplitContainer1.Panel1.BackColor = System.Drawing.SystemColors.Window
+ Me.SplitContainer1.Panel1.Controls.Add(Me.chkRevCWServers)
Me.SplitContainer1.Panel1.Controls.Add(Me.chkDarkTheme)
Me.SplitContainer1.Panel1.Controls.Add(Me.chkShowPanelOnMouseEnterEvent)
Me.SplitContainer1.Panel1.Controls.Add(Me.lblHomepage)
@@ -136,6 +138,30 @@ Partial Class DisplayOptionsDialog
Me.SplitContainer1.SplitterWidth = 3
Me.SplitContainer1.TabIndex = 3
'
+ 'chkRevCWServers
+ '
+ Me.chkRevCWServers.AutoSize = True
+ Me.chkRevCWServers.Checked = True
+ Me.chkRevCWServers.CheckState = System.Windows.Forms.CheckState.Checked
+ Me.chkRevCWServers.Location = New System.Drawing.Point(177, 141)
+ Me.chkRevCWServers.Name = "chkRevCWServers"
+ Me.chkRevCWServers.Size = New System.Drawing.Size(362, 20)
+ Me.chkRevCWServers.TabIndex = 4
+ Me.chkRevCWServers.Text = "Reverse CounterWallet Severs (Try using mirror site first)"
+ Me.chkRevCWServers.UseVisualStyleBackColor = True
+ '
+ 'chkDarkTheme
+ '
+ Me.chkDarkTheme.AutoSize = True
+ Me.chkDarkTheme.Checked = True
+ Me.chkDarkTheme.CheckState = System.Windows.Forms.CheckState.Checked
+ Me.chkDarkTheme.Location = New System.Drawing.Point(177, 106)
+ Me.chkDarkTheme.Name = "chkDarkTheme"
+ Me.chkDarkTheme.Size = New System.Drawing.Size(118, 20)
+ Me.chkDarkTheme.TabIndex = 3
+ Me.chkDarkTheme.Text = "Dark UI Theme"
+ Me.chkDarkTheme.UseVisualStyleBackColor = True
+ '
'chkShowPanelOnMouseEnterEvent
'
Me.chkShowPanelOnMouseEnterEvent.AutoSize = True
@@ -169,18 +195,6 @@ Partial Class DisplayOptionsDialog
Me.cbxHomepage.TabIndex = 1
Me.cbxHomepage.Text = "Default"
'
- 'chkDarkTheme
- '
- Me.chkDarkTheme.AutoSize = True
- Me.chkDarkTheme.Checked = True
- Me.chkDarkTheme.CheckState = System.Windows.Forms.CheckState.Checked
- Me.chkDarkTheme.Location = New System.Drawing.Point(177, 107)
- Me.chkDarkTheme.Name = "chkDarkTheme"
- Me.chkDarkTheme.Size = New System.Drawing.Size(118, 20)
- Me.chkDarkTheme.TabIndex = 3
- Me.chkDarkTheme.Text = "Dark UI Theme"
- Me.chkDarkTheme.UseVisualStyleBackColor = True
- '
'DisplayOptionsDialog
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
@@ -220,4 +234,5 @@ Partial Class DisplayOptionsDialog
Friend WithEvents lblHomepage As Label
Friend WithEvents chkShowPanelOnMouseEnterEvent As CheckBox
Friend WithEvents chkDarkTheme As CheckBox
+ Friend WithEvents chkRevCWServers As CheckBox
End Class
diff --git a/Browser/DisplayOptionsDialog.vb b/Browser/DisplayOptionsDialog.vb
index 8fe982c..ea3841f 100644
--- a/Browser/DisplayOptionsDialog.vb
+++ b/Browser/DisplayOptionsDialog.vb
@@ -16,7 +16,7 @@
'Load the pull-down menu from the constants
Me.cbxHomepage.Items.AddRange({HpgDefault, HpgTopBottom, HpgSideBySide, HpgFoldingCoin, HpgFoldingCoinTeamStats, HpgFoldingCoinMyStats, HpgCureCoin, HpgCureCoinTeamStatsEOC, HpgMyStatsEOC, HpgFAH, HpgBlank})
- 'Start with the textboxes instead of the raw data that is hard to look at
+ 'Start with the text boxes instead of the raw data that is hard to look at
chkShowRawData_CheckedChanged(Nothing, Nothing)
'Make sure the INI key/value exists
@@ -44,6 +44,14 @@
INI.AddSection(INI_Settings).AddKey(INI_DarkThemeUI).Value = Me.chkDarkTheme.Checked.ToString
End If
+ If INI.GetSection(INI_Settings).GetKey(INI_RevCWServers) IsNot Nothing Then
+ 'Load option
+ Me.chkRevCWServers.Checked = CBool(INI.GetSection(INI_Settings).GetKey(INI_RevCWServers).GetValue())
+ Else
+ 'Add, if it doesn't exist
+ INI.AddSection(INI_Settings).AddKey(INI_RevCWServers).Value = Me.chkRevCWServers.Checked.ToString
+ End If
+
'Display the INI data in the main raw data textbox
Me.txtDisplayText.Text = INI.SaveToString
Me.txtDisplayText.Select(Me.txtDisplayText.Text.Length, 0)
@@ -60,13 +68,18 @@
End Sub
Private Sub DisplayOptionsDialog_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing
+ If INI.GetSection(INI_Settings).GetKey(INI_DarkThemeUI) IsNot Nothing Then
+ 'Load option
+ Me.chkDarkTheme.Checked = CBool(INI.GetSection(INI_Settings).GetKey(INI_DarkThemeUI).GetValue())
+ End If
+
'Clear out the displayed text
Me.txtDisplayText.Text = String.Empty
End Sub
Private Sub chkShowRawData_CheckedChanged(sender As Object, e As EventArgs) Handles chkShowRawData.CheckedChanged
If Me.chkShowRawData.Checked = False Then
- 'Use the individual textboxes
+ 'Use the individual text boxes
Me.SplitContainer1.Panel1Collapsed = False
Me.SplitContainer1.Panel2Collapsed = True
Me.btnSaveChanges.Visible = True
@@ -92,6 +105,9 @@
INI.AddSection(INI_Settings).AddKey(INI_ShowPanelOnMouseEnter).Value = g_bShowWebLinkPanelOnMouseEnterEvent.ToString
INI.AddSection(INI_Settings).AddKey(INI_DarkThemeUI).Value = Me.chkDarkTheme.Checked.ToString
+
+ g_bRevCWServers = Me.chkRevCWServers.Checked
+ INI.AddSection(INI_Settings).AddKey(INI_RevCWServers).Value = Me.chkRevCWServers.Checked.ToString
INI.Save(IniFilePath)
'Display the INI data in the main raw data textbox
@@ -128,9 +144,14 @@
'If any of the options are changed, then enable the Save Changes button
Private Sub chkDarkTheme_CheckedChanged(sender As Object, e As EventArgs) Handles chkDarkTheme.CheckedChanged
- 'Update the UI
+ 'Update the UI immediately to preview the changes
g_Main.ThemeColorUI(Me.chkDarkTheme.Checked)
Me.btnSaveChanges.Enabled = True
End Sub
+
+ 'If any of the options are changed, then enable the Save Changes button
+ Private Sub chkRevCWServers_CheckedChanged(sender As Object, e As EventArgs) Handles chkRevCWServers.CheckedChanged
+ Me.btnSaveChanges.Enabled = True
+ End Sub
End Class
\ No newline at end of file
diff --git a/Browser/DisplayTextDialog.vb b/Browser/DisplayTextDialog.vb
index cbaf651..d9800f5 100644
--- a/Browser/DisplayTextDialog.vb
+++ b/Browser/DisplayTextDialog.vb
@@ -24,7 +24,7 @@
Me.cbxWalletId.Text = g_Main.cbxToolsWalletId.Text
End If
- 'Start with the textboxes instead of the raw data that is hard to look at
+ 'Start with the text boxes instead of the raw data that is hard to look at
chkShowRawData_CheckedChanged(Nothing, Nothing)
chkShowPW_CheckedChanged(Nothing, Nothing)
@@ -46,7 +46,7 @@
Private Sub chkShowRawData_CheckedChanged(sender As Object, e As EventArgs) Handles chkShowRawData.CheckedChanged
If Me.chkShowRawData.Checked = False Then
- 'Use the individual textboxes
+ 'Use the individual text boxes
Me.SplitContainer1.Panel1Collapsed = False
Me.SplitContainer1.Panel2Collapsed = True
Me.chkShowPW.Visible = True
@@ -85,7 +85,7 @@
Private Sub btnSaveChanges_Click(sender As Object, e As EventArgs) Handles btnSaveChanges.Click
If Me.chkShowRawData.Checked = False Then
- 'Use the individual textboxes
+ 'Use the individual text boxes
Dim DAT As New IniFile
'Build the new DAT file
If System.IO.File.Exists(DatFilePath) = True Then
@@ -116,7 +116,7 @@
Me.txtExtremeOverclockingId.Text = Me.txtExtremeOverclockingId.Text.Trim
- 'Save textboxes with DAT data for the Wallet Id...
+ 'Save text boxes with DAT data for the Wallet Id...
DAT.AddSection(Id & Me.cbxWalletId.Text)
If Me.txtFAHUsername.Text.Length <> 0 Then
DAT.AddSection(Id & Me.cbxWalletId.Text).AddKey(DAT_FAH_Username).Value = Me.txtFAHUsername.Text
@@ -177,7 +177,7 @@
DAT = Nothing
Else
- 'Large single textbox with the Raw INI data: Set a flag to reload the textboxes so they don't get out of sync
+ 'Large single textbox with the Raw INI data: Set a flag to reload the text boxes so they don't get out of sync
m_bRawDataSaved = True
End If
@@ -343,7 +343,7 @@
Me.txtDisplayText.Select(Me.txtDisplayText.Text.Length, 0)
- 'Load textboxes with DAT data for the Wallet Id...
+ 'Load text boxes with DAT data for the Wallet Id...
If DAT.GetSection(Id & Me.cbxWalletId.Text).GetKey(DAT_FAH_Username) IsNot Nothing Then
Me.txtFAHUsername.Text = DAT.GetSection(Id & Me.cbxWalletId.Text).GetKey(DAT_FAH_Username).GetValue()
End If
diff --git a/Browser/FAHSetupDialog.vb b/Browser/FAHSetupDialog.vb
index eb58668..982bea2 100644
--- a/Browser/FAHSetupDialog.vb
+++ b/Browser/FAHSetupDialog.vb
@@ -4,7 +4,7 @@
Public m_bInitialInstall As Boolean = False
Private Const PATH_FAH_ALL_USER_CFG As String = "C:\ProgramData\FAHClient\config.xml"
- Private Const PAUSE_FAH As String = "options idle=true open-web-control=false" 'Disabling the web control popup doesn't happen soon enough to stop it
+ Private Const PAUSE_FAH As String = "options idle=true open-web-control=false" 'Disabling the web control pop-up doesn't happen soon enough to stop it
Private Path_FAH_CurrentUserCfg As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FAHClient\config.xml")
Private m_strFAHCfgPath As String = ""
@@ -194,10 +194,10 @@
m_bSkipUpdating = False
CreateFAHUserName()
- 'Disable the OK button until settings are saved. NOTE: Pausing FAH with Telent is not Awaited above, and was undoing this on an initial install
+ 'Disable the OK button until settings are saved. NOTE: Pausing FAH with Telnet is not Awaited above, and was undoing this on an initial install
Me.btnOK.Enabled = False
- 'Set for inital state
+ 'Set for initial state
Me.SplitContainer2.SplitterWidth = 2
Me.SplitContainer1.SplitterWidth = 2
@@ -334,7 +334,7 @@
Me.lblErrorNote.Visible = True
Case m_regexFAH_Warning.IsMatch(Me.lblUsernamePreview.Text) = True
- 'This could be a warning, but it's safer to constrain the usernames to safe values, especially so the username might work in web link URLs, searches, databases, etc
+ 'This could be a warning, but it's safer to constrain the user names to safe values, especially so the username might work in web link URLs, searches, databases, etc
Me.txtUsername.BackColor = Color.Tomato
Me.lblErrorNote.Text = "Avoid special characters that may not work"
Me.lblErrorNote.Visible = True
diff --git a/Browser/GlobalRefs.vb b/Browser/GlobalRefs.vb
index b2cd24e..783730d 100644
--- a/Browser/GlobalRefs.vb
+++ b/Browser/GlobalRefs.vb
@@ -107,6 +107,7 @@ Public Module GlobalRefs
Public Const INI_Homepage As String = "Homepage"
Public Const INI_ShowPanelOnMouseEnter As String = "ShowPanelOnMouseEnter"
Public Const INI_DarkThemeUI As String = "DarkThemeUI"
+ Public Const INI_RevCWServers As String = "RevCWServers"
'Wallet Id specific
Public Const INI_EOC_ID As String = "ExtremeOverclockingUserId"
@@ -148,6 +149,8 @@ Public Module GlobalRefs
Public g_bAskDownloadLocation As Boolean = True
'Holds on to the last downloaded file path, when the download completes
Public g_strDownloadedFilePath As String = ""
+ 'CounterWallet
+ Public g_bRevCWServers As Boolean = True
'Option to Show the Web Link Panel On MouseEnter Event
Public g_bShowWebLinkPanelOnMouseEnterEvent As Boolean = True
diff --git a/Browser/Main.Designer.vb b/Browser/Main.Designer.vb
index 623617a..c19ebbe 100644
--- a/Browser/Main.Designer.vb
+++ b/Browser/Main.Designer.vb
@@ -28,6 +28,7 @@ Partial Class Main
Me.btnGo = New System.Windows.Forms.Button()
Me.lblURL = New System.Windows.Forms.Label()
Me.ToolStripContainer1 = New System.Windows.Forms.ToolStripContainer()
+ Me.lblHoverURL = New System.Windows.Forms.Label()
Me.btnToolsGetWallet = New System.Windows.Forms.Button()
Me.btnMyWallet = New System.Windows.Forms.Button()
Me.btnToolsGetFAH = New System.Windows.Forms.Button()
@@ -84,7 +85,6 @@ Partial Class Main
Me.pnlBtnLinksDividerTop = New System.Windows.Forms.Panel()
Me.pbMolecule = New System.Windows.Forms.PictureBox()
Me.pnlURL = New System.Windows.Forms.Panel()
- Me.lblHoverURL = New System.Windows.Forms.Label()
Me.ToolStripContainer1.ContentPanel.SuspendLayout()
Me.ToolStripContainer1.SuspendLayout()
Me.gbxTools.SuspendLayout()
@@ -178,6 +178,20 @@ Partial Class Main
Me.ToolStripContainer1.Text = "ToolStripContainer1"
Me.ToolStripContainer1.TopToolStripPanelVisible = False
'
+ 'lblHoverURL
+ '
+ Me.lblHoverURL.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
+ Me.lblHoverURL.AutoSize = True
+ Me.lblHoverURL.BackColor = System.Drawing.Color.White
+ Me.lblHoverURL.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
+ Me.lblHoverURL.ForeColor = System.Drawing.Color.DimGray
+ Me.lblHoverURL.Location = New System.Drawing.Point(-1, 676)
+ Me.lblHoverURL.Name = "lblHoverURL"
+ Me.lblHoverURL.Size = New System.Drawing.Size(37, 18)
+ Me.lblHoverURL.TabIndex = 0
+ Me.lblHoverURL.Text = "URL"
+ Me.lblHoverURL.Visible = False
+ '
'btnToolsGetWallet
'
Me.btnToolsGetWallet.BackColor = System.Drawing.SystemColors.Window
@@ -834,6 +848,7 @@ Partial Class Main
'
'gbxDownload
'
+ Me.gbxDownload.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.gbxDownload.BackColor = System.Drawing.Color.LemonChiffon
Me.gbxDownload.Controls.Add(Me.lblDownloadText)
Me.gbxDownload.Controls.Add(Me.lblPercent)
@@ -1035,9 +1050,9 @@ Partial Class Main
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.pnlURL.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
Me.pnlURL.BackColor = System.Drawing.Color.LightGray
+ Me.pnlURL.Controls.Add(Me.gbxDownload)
Me.pnlURL.Controls.Add(Me.btnGo)
Me.pnlURL.Controls.Add(Me.chkToolsShow)
- Me.pnlURL.Controls.Add(Me.gbxDownload)
Me.pnlURL.Controls.Add(Me.btnFwd)
Me.pnlURL.Controls.Add(Me.lblURL)
Me.pnlURL.Controls.Add(Me.txtURL)
@@ -1051,20 +1066,6 @@ Partial Class Main
Me.pnlURL.Size = New System.Drawing.Size(1269, 39)
Me.pnlURL.TabIndex = 0
'
- 'lblHoverURL
- '
- Me.lblHoverURL.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
- Me.lblHoverURL.AutoSize = True
- Me.lblHoverURL.BackColor = System.Drawing.Color.White
- Me.lblHoverURL.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.lblHoverURL.ForeColor = System.Drawing.Color.DimGray
- Me.lblHoverURL.Location = New System.Drawing.Point(-1, 676)
- Me.lblHoverURL.Name = "lblHoverURL"
- Me.lblHoverURL.Size = New System.Drawing.Size(37, 18)
- Me.lblHoverURL.TabIndex = 0
- Me.lblHoverURL.Text = "URL"
- Me.lblHoverURL.Visible = False
- '
'Main
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
diff --git a/Browser/Main.resx b/Browser/Main.resx
index 05830bb..77d822a 100644
--- a/Browser/Main.resx
+++ b/Browser/Main.resx
@@ -120,9 +120,6 @@
16, 6
-
- 16, 6
-
28
diff --git a/Browser/Main.vb b/Browser/Main.vb
index f068e93..2cdb1c8 100644
--- a/Browser/Main.vb
+++ b/Browser/Main.vb
@@ -23,12 +23,34 @@
Private Const i48 As Integer = 48
Private Const i96 As Integer = 96
Private Const i256 As Integer = 256
+ 'Ini settings
+ Private Const cTrue As String = "True"
+ Private Const cFalse As String = "False"
+ 'Initial install command line flags for with or without the CureCoin Wallet installer being run
+ Private Const cCmdLnInstl As String = "-Instl"
+ Private Const cCmdLnInstWithCure As String = "-InstWithCure"
+ Private m_aryCmdLnArgs As String()
+ Private m_bInitialInstall As Boolean = False
+ 'CounterWallet
+ Private m_iCounterWalletServerUp As Integer = 0
#Region "Form and Browser Events - Initialization, Exiting"
Public Sub New()
Try
InitializeComponent()
+ 'Process command line values (Only for initial installations)
+ If Environment.CommandLine.Length > 0 Then
+ 'MessageBox.Show(Environment.CommandLine.ToString)
+ m_aryCmdLnArgs = Environment.GetCommandLineArgs()
+ If m_aryCmdLnArgs.Length > 1 Then
+ Select Case m_aryCmdLnArgs(1)
+ Case cCmdLnInstl, cCmdLnInstWithCure
+ m_bInitialInstall = True
+ End Select
+ End If
+ End If
+
Using settings As New CefSharp.WinForms.CefSettings()
'Set the Cache path to the user's appdata roaming folder
settings.CachePath = System.IO.Path.Combine(UserProfileDir, "Cache")
@@ -38,7 +60,7 @@
settings.Locale = "en-US"
settings.AcceptLanguageList = settings.Locale & "," & settings.Locale.Substring(0, 2)
- 'For Debugging, to log everything, use: Verbose. Can cause Cef.Shutdown() to hang.
+ 'For Debugging, to log everything, use: Verbose. Can cause older versions of Cef.Shutdown() to hang
'settings.LogSeverity = CefSharp.LogSeverity.Verbose
settings.LogSeverity = CefSharp.LogSeverity.Info
@@ -72,11 +94,13 @@
'Add to a UI container
Me.ToolStripContainer1.ContentPanel.Controls.Add(browser)
- 'Default homepage / portal set to the FoldingCoin webpage
+ 'On initial install only, skip loading the homepage (skips message saying to load the FAH control because it's not installed yet)
+ If m_bInitialInstall = False Then
#Disable Warning BC42358 ' Because this call is not awaited, execution of the current method continues before the call is completed
- 'Load the Homepage based on the user's options in the INI file (call after loading the INI settings)
- LoadHomepage()
+ 'Load the Homepage based on the user's options in the INI file (call after loading the INI settings)
+ LoadHomepage()
#Enable Warning BC42358
+ End If
End If
End Using
@@ -97,11 +121,6 @@
End Try
ResizeControlsAndFormLayout()
- 'Hide the form while it's being adjusted
- Me.WindowState = FormWindowState.Minimized
- 'Create the main form (Needs to come before restoring the window size and window state)
- Me.Show()
-
'Restore window size
If INI.GetSection(INI_Settings).GetKey(INI_Size) IsNot Nothing Then
'Restore dimensions from string: {Left};{Top};{Width};{Height}
@@ -112,6 +131,16 @@
Me.Height = CInt(strDim(3))
End If
+ 'Create the main form (Needs to come before restoring the window size and window state)
+ Me.Show()
+
+ 'Window size not set yet, which is typical for initial installs
+ If INI.GetSection(INI_Settings).GetKey(INI_Size) Is Nothing Then
+ Me.CenterToScreen()
+ 'Store window size: {Left};{Top};{Width};{Height}. This will get updated when the program exits normally.
+ INI.AddSection(INI_Settings).AddKey(INI_Size).Value = If(Me.Left < 0, "0", Me.Left.ToString()) & ";" & If(Me.Top < 0, "0", Me.Top.ToString()) & ";" & Me.Width.ToString() & ";" & Me.Height.ToString()
+ End If
+
'Restore window state
If INI.GetSection(INI_Settings).GetKey(INI_WindowState) IsNot Nothing Then
'Restore last window state: Normal or Maximized
@@ -124,15 +153,6 @@
Me.WindowState = FormWindowState.Normal
End If
- 'Restore Option for the Panel MouseEnter event
- If INI.GetSection(INI_Settings).GetKey(INI_ShowPanelOnMouseEnter) IsNot Nothing Then
- g_bShowWebLinkPanelOnMouseEnterEvent = CBool(INI.GetSection(INI_Settings).GetKey(INI_ShowPanelOnMouseEnter).GetValue())
- End If
- 'Set UI Theme colors
- If INI.GetSection(INI_Settings).GetKey(INI_DarkThemeUI) IsNot Nothing Then
- ThemeColorUI(CBool(INI.GetSection(INI_Settings).GetKey(INI_DarkThemeUI).GetValue()))
- End If
-
'Force the URL text to scroll all the way to the left
Me.txtURL.Select(0, 0)
@@ -159,21 +179,45 @@
'Make sure the INI key/value exists
If INI.GetSection(INI_Settings).GetKey(INI_HideSavedDataButton) IsNot Nothing Then
'Show/hide the 'Show Dat' file button
- If INI.GetSection(INI_Settings).GetKey(INI_HideSavedDataButton).GetValue() = "False" Then
+ If INI.GetSection(INI_Settings).GetKey(INI_HideSavedDataButton).GetValue() = cFalse Then
Me.btnToolsSavedData.Visible = True
- ElseIf INI.GetSection(INI_Settings).GetKey(INI_HideSavedDataButton).GetValue() = "True" Then
+ ElseIf INI.GetSection(INI_Settings).GetKey(INI_HideSavedDataButton).GetValue() = cTrue Then
Me.btnToolsSavedData.Visible = False
Else
'Restore value, if missing
- INI.AddSection(INI_Settings).AddKey(INI_HideSavedDataButton).Value = "False"
+ INI.AddSection(INI_Settings).AddKey(INI_HideSavedDataButton).Value = cFalse
Me.btnToolsSavedData.Visible = True
End If
Else
'Restore value, if missing
- INI.AddSection(INI_Settings).AddKey(INI_HideSavedDataButton).Value = "False"
+ INI.AddSection(INI_Settings).AddKey(INI_HideSavedDataButton).Value = cFalse
Me.btnToolsSavedData.Visible = True
End If
+ 'Restore Option for the Panel MouseEnter event
+ If INI.GetSection(INI_Settings).GetKey(INI_ShowPanelOnMouseEnter) IsNot Nothing Then
+ g_bShowWebLinkPanelOnMouseEnterEvent = CBool(INI.GetSection(INI_Settings).GetKey(INI_ShowPanelOnMouseEnter).GetValue())
+ Else
+ 'Restore value, if missing
+ INI.AddSection(INI_Settings).AddKey(INI_ShowPanelOnMouseEnter).Value = cTrue
+ End If
+
+ 'Set UI Theme colors
+ If INI.GetSection(INI_Settings).GetKey(INI_DarkThemeUI) IsNot Nothing Then
+ ThemeColorUI(CBool(INI.GetSection(INI_Settings).GetKey(INI_DarkThemeUI).GetValue()))
+ Else
+ 'Restore value, if missing
+ INI.AddSection(INI_Settings).AddKey(INI_DarkThemeUI).Value = cTrue
+ End If
+
+ 'Reverse CounterWallet Server order (Try using the mirror server first, mostly for when the main site says it's OK, but it isn't)
+ If INI.GetSection(INI_Settings).GetKey(INI_RevCWServers) IsNot Nothing Then
+ g_bRevCWServers = CBool(INI.GetSection(INI_Settings).GetKey(INI_RevCWServers).GetValue())
+ Else
+ 'Restore value, if missing
+ INI.AddSection(INI_Settings).AddKey(INI_RevCWServers).Value = cTrue
+ End If
+
Else
'NOTE: closing the program will create most all of the other missing INI file settings
@@ -191,10 +235,8 @@
INI.AddSection(INI_Settings).AddKey(INI_LastBrowserVersion).Value = My.Application.Info.Version.Major.ToString
'Create a new INI for first time use. Set the default encryption PW
INI.AddSection(INI_Settings).AddKey(INI_PW).Value = Default_DAT_PW
- 'Store window size: {Left};{Top};{Width};{Height}. This will get updated when the program exits normally.
- INI.AddSection(INI_Settings).AddKey(INI_Size).Value = "5;5;955;805"
'Show/hide the 'Show Dat' file button
- INI.AddSection(INI_Settings).AddKey(INI_HideSavedDataButton).Value = "False"
+ INI.AddSection(INI_Settings).AddKey(INI_HideSavedDataButton).Value = cFalse
INI.Save(IniFilePath)
'Save and encrypt the 12 word Passphrase and the Bitcoin address
@@ -312,7 +354,7 @@
Const OldShowTheShowDatButton As String = "ShowTheShowDatButton"
'Renamed the 'Show Dat' file button to 'Saved Data'
- INI.AddSection(INI_Settings).AddKey(INI_HideSavedDataButton).Value = "False"
+ INI.AddSection(INI_Settings).AddKey(INI_HideSavedDataButton).Value = cFalse
INI.GetSection(INI_Settings).RemoveKey(OldShowTheShowDatButton)
'Last FoldingBrowser version, now upgraded to v6
INI.AddSection(INI_Settings).AddKey(INI_LastBrowserVersion).Value = "6"
@@ -398,125 +440,119 @@
'''''''''''''''''''''
'Process command line values (Only for initial installations).
- If Environment.CommandLine.Length > 0 Then
- 'MessageBox.Show(Environment.CommandLine.ToString)
- Dim args As String() = Environment.GetCommandLineArgs()
- If args.Length > 1 Then
- Select Case args(1)
- 'This command line option represents the FoldingBrowser was just installed
- Case "-Instl", "-InstWithCure"
- 'Create a dialog that sets the default checkbox selections based on stored wallet and F@H info.
- Dim Setup As New SetupDialog
+ If m_bInitialInstall = True Then
+ 'Create a dialog that sets the default checkbox selections based on stored wallet and F@H info.
+ Dim Setup As New SetupDialog
- Dim DAT As New IniFile
- 'Load DAT file, decrypt it
- DAT.LoadText(Decrypt(LoadDat))
- If DAT.ToString.Length = 0 Then
- 'Decryption failed
- Msg(DAT_ErrorMsg)
- MessageBox.Show(DAT_ErrorMsg)
- End If
+ Dim DAT As New IniFile
+ 'Load DAT file, decrypt it
+ DAT.LoadText(Decrypt(LoadDat))
+ If DAT.ToString.Length = 0 Then
+ 'Decryption failed
+ Msg(DAT_ErrorMsg)
+ MessageBox.Show(DAT_ErrorMsg)
+ End If
- 'Look for FAH username for FAH installation to un-check the dialog for existing users
- Try
- If DAT.GetSection(Id & Me.cbxToolsWalletId.Text) IsNot Nothing AndAlso DAT.GetSection(Id & Me.cbxToolsWalletId.Text).GetKey(DAT_FAH_Username) IsNot Nothing Then
- 'Has FAH setup already
- Setup.chkGetFAHSoftware.Checked = False
- Else
-
- 'Additionally look for FAH installation on PC
- If System.IO.File.Exists("C:\Program Files (x86)\FAHClient\FAHClient.exe") = True OrElse System.IO.File.Exists("C:\Program Files\FAHClient\FAHClient.exe") = True Then
- 'Has FAH setup already
- Setup.chkGetFAHSoftware.Checked = False
- Else
- 'Needs FAH
- Setup.chkGetFAHSoftware.Checked = True
- End If
- End If
- Catch
- Setup.chkGetFAHSoftware.Checked = True
- End Try
-
- 'Look for 12-word Passphrase (or BTC address?) to un-check the dialog for existing users
- Try
- If DAT.GetSection(Id & Me.cbxToolsWalletId.Text) IsNot Nothing AndAlso DAT.GetSection(Id & Me.cbxToolsWalletId.Text).GetKey(DAT_CP12Words) IsNot Nothing Then
- 'Wallet info exists
- Setup.chkGetWalletForFLDC.Checked = False
- Else
- 'No saved Wallet info
- Setup.chkGetWalletForFLDC.Checked = True
-
- 'TODO: Ask for existing 12-word PW CounterParty wallet info? (probably too confusing / too many options)
- End If
- Catch
- Setup.chkGetWalletForFLDC.Checked = True
- End Try
+ 'Look for FAH username for FAH installation to un-check the dialog for existing users
+ Try
+ If DAT.GetSection(Id & Me.cbxToolsWalletId.Text) IsNot Nothing AndAlso DAT.GetSection(Id & Me.cbxToolsWalletId.Text).GetKey(DAT_FAH_Username) IsNot Nothing Then
+ 'Has FAH setup already
+ Setup.chkGetFAHSoftware.Checked = False
+ Else
- 'Done with the DAT file
- DAT = Nothing
+ 'Additionally look for FAH installation on PC
+ If System.IO.File.Exists("C:\Program Files (x86)\FAHClient\FAHClient.exe") = True OrElse System.IO.File.Exists("C:\Program Files\FAHClient\FAHClient.exe") = True Then
+ 'Has FAH setup already
+ Setup.chkGetFAHSoftware.Checked = False
+ Else
+ 'Needs FAH
+ Setup.chkGetFAHSoftware.Checked = True
+ End If
+ End If
+ Catch
+ Setup.chkGetFAHSoftware.Checked = True
+ End Try
- 'If installing the CureCoin wallet, set this check box to setup the CureCoin pool info
- If args(1) = "-InstWithCure" Then
- Setup.chkSetupCURE.Checked = True
- Else
- Setup.chkSetupCURE.Checked = False
- End If
+ 'Look for 12-word Passphrase (or BTC address?) to un-check the dialog for existing users
+ Try
+ If DAT.GetSection(Id & Me.cbxToolsWalletId.Text) IsNot Nothing AndAlso DAT.GetSection(Id & Me.cbxToolsWalletId.Text).GetKey(DAT_CP12Words) IsNot Nothing Then
+ 'Wallet info exists
+ Setup.chkGetWalletForFLDC.Checked = False
+ Else
+ 'No saved Wallet info
+ Setup.chkGetWalletForFLDC.Checked = True
- 'Show modal dialog box
- If Setup.ShowDialog(Me) = DialogResult.OK Then
- 'Run the tasks the operator selected
-
- 'FAH adavanced client installation
- If Setup.chkGetFAHSoftware.Checked = True Then
- g_bAskDownloadLocation = False
- If Await GetFAH() = False Then
- MessageBox.Show("Task 'Get Folding@Home App' did not complete." & vbNewLine & "Please use the buttons in the 'Tools' checkbox")
- Exit Sub
- End If
- End If
+ 'TODO: Ask for existing 12-word PW CounterParty wallet info? (probably too confusing / too many options)
+ End If
+ Catch
+ Setup.chkGetWalletForFLDC.Checked = True
+ End Try
- 'Get Wallet
- If Setup.chkGetWalletForFLDC.Checked = True Then
- If Await GetWallet() = False Then
- MessageBox.Show("Task 'Get Wallet' did not complete." & vbNewLine & "Please use the buttons in the 'Tools' checkbox")
- Exit Sub
- End If
- End If
+ 'Done with the DAT file
+ DAT = Nothing
- 'FAH Username / Teamname settings setup
- If Setup.chkGetFAHSoftware.Checked = True OrElse Setup.chkGetWalletForFLDC.Checked = True Then
- Dim DialogFAH As New FAHSetupDialog
- Try
- 'Prompt for FAH info: Ask for: (existing) Username, Merged Folding Coin Selection, FAH Team #. Show Username as typing and check it for errors. (Optional) Get Passkey by email. Show before and after of the FAH Config file changes
- DialogFAH.m_bInitialInstall = True
- 'Show modal dialog box
- DialogFAH.ShowDialog(Me)
-
- Catch ex As Exception
- Msg("Setup FAH User, Team, and Config error:" & ex.ToString)
- End Try
- DialogFAH.Dispose()
- End If
+ 'If installing the CureCoin wallet, set this check box to setup the CureCoin pool info
+ If m_aryCmdLnArgs(1) = cCmdLnInstWithCure Then
+ Setup.chkSetupCURE.Checked = True
+ Else
+ Setup.chkSetupCURE.Checked = False
+ End If
- 'Only do this step if the CureCoin wallet.dat file wasn't found on the PC during the initial installation, or if the user chooses this option
- If Setup.chkSetupCURE.Checked = True Then
- Await SetupCureCoin()
- End If
+ 'Show modal dialog box
+ If Setup.ShowDialog(Me) = DialogResult.OK Then
+ 'Run the tasks the operator selected
+
+ 'FAH advanced client installation
+ If Setup.chkGetFAHSoftware.Checked = True Then
+ g_bAskDownloadLocation = False
+ If Await GetFAH() = False Then
+ MessageBox.Show("Task 'Get Folding@Home App' did not complete." & vbNewLine & "Please use the buttons in the 'Tools' checkbox")
+ Exit Sub
+ End If
+ End If
- 'Show DAT file saved info. Ask to make backups / store data in a safe place
- If Setup.chkGetFAHSoftware.Checked = True OrElse Setup.chkGetWalletForFLDC.Checked = True OrElse Setup.chkSetupCURE.Checked = True Then
- Dim DlgDisplaySavedData As New DisplayTextDialog
- DlgDisplaySavedData.StartPosition = FormStartPosition.CenterScreen
- 'Show the Saved Data dialog
- DlgDisplaySavedData.Show(Me)
- Delay(100)
- End If
- End If
+ 'Get Wallet
+ If Setup.chkGetWalletForFLDC.Checked = True Then
+ If Await GetWallet() = False Then
+ MessageBox.Show("Task 'Get Wallet' did not complete." & vbNewLine & "Please use the buttons in the 'Tools' checkbox")
+ Exit Sub
+ End If
+ End If
+
+ 'FAH Username / Team # settings setup
+ If Setup.chkGetFAHSoftware.Checked = True OrElse Setup.chkGetWalletForFLDC.Checked = True Then
+ Dim DialogFAH As New FAHSetupDialog
+ Try
+ 'Prompt for FAH info: Ask for: (existing) Username, Merged Folding Coin Selection, FAH Team #. Show Username as typing and check it for errors. (Optional) Get Passkey by email. Show before and after of the FAH Config file changes
+ DialogFAH.m_bInitialInstall = True
+ 'Show modal dialog box
+ DialogFAH.ShowDialog(Me)
- 'Automated process finished - Make a backup reminder, other informational messages
- Dim FinMsg As New MsgBoxDialog
- FinMsg.Text = "Setup Finished"
- FinMsg.MsgText.Text = "Setup Finished:" & vbNewLine &
+ Catch ex As Exception
+ Msg("Setup FAH User, Team, and Config error:" & ex.ToString)
+ End Try
+ DialogFAH.Dispose()
+ End If
+
+ 'Only do this step if the CureCoin wallet.dat file wasn't found on the PC during the initial installation, or if the user chooses this option
+ If Setup.chkSetupCURE.Checked = True Then
+ Await SetupCureCoin()
+ End If
+
+ 'Show DAT file saved info. Ask to make backups / store data in a safe place
+ If Setup.chkGetFAHSoftware.Checked = True OrElse Setup.chkGetWalletForFLDC.Checked = True OrElse Setup.chkSetupCURE.Checked = True Then
+ Dim DlgDisplaySavedData As New DisplayTextDialog
+ DlgDisplaySavedData.StartPosition = FormStartPosition.CenterScreen
+ 'Show the Saved Data dialog
+ DlgDisplaySavedData.Show(Me)
+ Delay(100)
+ End If
+ End If
+
+ 'Automated process finished - Make a backup reminder, other informational messages
+ Dim FinMsg As New MsgBoxDialog
+ FinMsg.Text = "Setup Finished"
+ FinMsg.MsgText.Text = "Setup Finished:" & vbNewLine &
DividerLine & vbNewLine & vbNewLine &
"-Please use: Tools | Saved Data | 'Make Backup' button to backup your settings" & vbNewLine & vbNewLine &
"-Note Distribution Intervals: " & vbNewLine &
@@ -524,16 +560,14 @@
" CureCoin: Daily. Also, Proof of Stake (POS) when coins are" & vbNewLine &
" over 4 days old, with wallet unlocked and left running." & vbNewLine & vbNewLine &
"-Please contact us on Discord for questions (Use FoldingBrowser Discord buttons)"
- FinMsg.Width = (FinMsg.MsgText.Left * 2) + FinMsg.MsgText.Width + 10
- FinMsg.Height = (FinMsg.MsgText.Top * 2) + FinMsg.MsgText.Height + FinMsg.btnOK.Height + System.Windows.Forms.SystemInformation.CaptionHeight + System.Windows.Forms.SystemInformation.BorderSize.Height + 30
- FinMsg.StartPosition = FormStartPosition.CenterScreen
- FinMsg.ShowDialog(Me)
- FinMsg.Dispose()
-
- 'Cleanup
- Setup.Dispose()
- End Select
- End If
+ FinMsg.Width = (FinMsg.MsgText.Left * 2) + FinMsg.MsgText.Width + 10
+ FinMsg.Height = (FinMsg.MsgText.Top * 2) + FinMsg.MsgText.Height + FinMsg.btnOK.Height + System.Windows.Forms.SystemInformation.CaptionHeight + System.Windows.Forms.SystemInformation.BorderSize.Height + 30
+ FinMsg.StartPosition = FormStartPosition.CenterScreen
+ FinMsg.ShowDialog(Me)
+ FinMsg.Dispose()
+
+ 'Cleanup
+ Setup.Dispose()
End If
End Sub
@@ -547,7 +581,7 @@
'Skip saving the window position, if closed while being minimized or full screen
If Me.WindowState = FormWindowState.Normal Then
'Store window size: {Left};{Top};{Width};{Height}
- INI.AddSection(INI_Settings).AddKey(INI_Size).Value = IIf(Me.Left < 0, "0", Me.Left).ToString() & ";" & IIf(Me.Top < 0, "0", Me.Top).ToString() & ";" & IIf(Me.Width < 700, "700", Me.Width).ToString() & ";" & IIf(Me.Height < 500, "500", Me.Height).ToString()
+ INI.AddSection(INI_Settings).AddKey(INI_Size).Value = If(Me.Left < 0, "0", Me.Left.ToString()) & ";" & If(Me.Top < 0, "0", Me.Top.ToString()) & ";" & If(Me.Width < 700, "700", Me.Width.ToString()) & ";" & If(Me.Height < 500, "500", Me.Height.ToString())
End If
'Last FoldingBrowser version. Used for updating old settings, if needed, for upgrading versions
INI.AddSection(INI_Settings).AddKey(INI_LastBrowserVersion).Value = My.Application.Info.Version.Major.ToString
@@ -616,7 +650,7 @@
Private Sub ResizeControlsAndFormLayout()
Try
If m_iCurrentDPI > 0 Then
- 'This scale factor is also ued for loading any child forms later
+ 'This scale factor is also used for loading any child forms later
g_sScaleFactor = CSng(m_iCurrentDPI / i96)
'Set the new font scalar to resize the form (Only after a DPI change)
@@ -692,7 +726,7 @@
'Button Link Panel: Initially show minimized
Me.pnlBtnLinks.Height = m_iMinPanelHeight
- 'Resize the toolbar and browser window. On Win10 at 175%, the right anchors weren't resizing to the window size
+ 'Resize the tool bar and browser window. On Win10 at 175%, the right anchors weren't resizing to the window size
Me.pnlURL.Width = Me.ClientSize.Width
Me.ToolStripContainer1.Width = Me.ClientSize.Width + (SystemInformation.BorderSize.Width * 2)
'Set other important positions that Windows might not adjust correctly
@@ -747,7 +781,7 @@
Select Case m.Msg
Case WM_DPICHANGED
Try
- 'Save the previous DPI value before updatating
+ 'Save the previous DPI value before updating
m_iOldDPI = m_iCurrentDPI
'Only use the low word of this integer
m_iCurrentDPI = CInt(m.WParam)
@@ -755,7 +789,7 @@
'Dim shtLowWord As Short = BitConverter.ToInt16(bytes, 0)
'Dim shtHighWord As Short = BitConverter.ToInt16(bytes, 2)
m_iCurrentDPI = BitConverter.ToInt16(bytes, 0)
- 'Only update if the DPI chages
+ 'Only update if the DPI changes
If m_iCurrentDPI <> m_iOldDPI Then
If m_bFormMoving = True Then
'Set the flag to update for DPI scaling change
@@ -849,7 +883,7 @@
End Try
Try
- 'Try up to 2 differnt URLs. This shouldn't be needed anymore
+ 'Try up to 2 different URLs. This shouldn't be needed anymore
Do Until bFAH_PageLoaded = True OrElse g_bCancelNav = True OrElse iPageReloads > 2
'WORKAROUND: The FAH Web Control doesn't always load during the 30 second count down. Bypass it, and load the unique URL directly with a Refresh 'ignoring browser cache' to avoid the CORS infinite loop web page error
iPageReloads += 1
@@ -907,7 +941,7 @@
End Try
Try
- 'No UserId, but if you have the FAH Username stored, then go look up the Id on EOC (the 3 attempts is for new users who's username won't be searchable for the first ~24 hours: Hopefully this will let them retry some other day)
+ 'No UserId, but if you have the FAH Username stored, then go look up the Id on EOC (the 3 attempts is for new users who's username won't be search-able for the first ~24 hours: Hopefully this will let them retry some other day)
If iUserId < 4 Then
'Just load the CureCoin stats for something to look at
Await OpenURL(URL_CureCoin_EOC, False)
@@ -1035,7 +1069,7 @@
'Normal: Load User's Stats
OpenURL(URL_FoldingCoinStats & URL_FoldingCoinStatsUser & strUsername, False)
Else
- 'Not a vailid FLDC username. Just go to the main FLDC Stats page
+ 'Not a valid FLDC username. Just go to the main FLDC Stats page
OpenURL(URL_FoldingCoinStats, False)
End If
#Enable Warning BC42358
@@ -1361,21 +1395,26 @@
DlgDisplaySavedData.StartPosition = FormStartPosition.CenterScreen
DlgDisplaySavedData.Show(Me)
End Sub
+
+ Private Sub lblHoverURL_Click(sender As Object, e As EventArgs) Handles lblHoverURL.Click
+ 'Hide the info text, if it got left shown (Like: sliding FAH web control power slider. Clicking on the web page would have also hidden this)
+ Me.lblHoverURL.Visible = False
+ Me.lblHoverURL.Text = ""
+ End Sub
#End Region
#Region "Auto-Wallet Login"
- 'Main CounterWallet server is up: m_iCounterWalletServerUp = 1. If set to 2, then use the secondary mirror server.
- Private m_iCounterWalletServerUp As Integer = 0
+ 'Get CounterWallet server status to make sure it is up. Sets return m_iCounterWalletServerUp: {main site = 1, or mirror site = 2} was up, otherwise = 0
Private Async Function IsCounterwalletUp() As Threading.Tasks.Task
Dim OkMsg As New MsgBoxDialog
+ Dim strResponse1 As String
+ Dim strResponse2 As String
+ m_iCounterWalletServerUp = 0
+
Try
- 'Get CounterWallet server status to make sure it is up. Use the main site as the default
- Dim strResponse1 As String = ""
- Dim strResponse2 As String = ""
- Msg("Getting CounterWallet server status from: " & URL_Counterwallet & CounterwalletAPI)
'Display status
OkMsg.Text = "Checking CounterWallet Server Status"
- OkMsg.MsgText.Text = OkMsg.Text & vbNewLine & vbNewLine & "1. " & URL_Counterwallet & CounterwalletAPI & vbNewLine & "(Can take 40 seconds)"
+ OkMsg.MsgText.Text = OkMsg.Text & vbNewLine & vbNewLine & If(g_bRevCWServers = True, 2, 1).ToString & ". " & If(g_bRevCWServers = True, URL_CoinDaddyCounterwallet, URL_Counterwallet) & CounterwalletAPI & vbNewLine & "(Can take 40 seconds)"
OkMsg.MsgText.Left = 70
OkMsg.MsgText.Top = 70
OkMsg.Width = (OkMsg.MsgText.Left * 2) + OkMsg.MsgText.Width + 20
@@ -1385,46 +1424,41 @@
OkMsg.BackColor = Color.Gold
OkMsg.Show(Me)
- 'Get CounterWallet status from server
- Await OpenURL(URL_Counterwallet & CounterwalletAPI, False)
- Await PageTitleWait(NameCounterwallet)
- Await Wait(50)
-
- 'Find status data in web page
- For i As Integer = 0 To 1
- 'Example text: ...3927775, "counterparty-server": "OK", "counterblock_last_message_index": 757169, "counterblock": "NOT OK", "cou...
- If FindTextInDoc("""counterparty-server"": ""*K""", """counterblock"": ""*K""", strResponse1, strResponse2, True, "") = True AndAlso strResponse1.Length > 0 AndAlso strResponse2.Length > 0 Then
- 'Search for: "O"K, or "NOT O"K. If OK, then set the flag for OK.
- If strResponse1 = "O" AndAlso strResponse2 = "O" Then m_iCounterWalletServerUp = 1
- Exit For
- End If
- Await Wait(700)
- Next
-
- 'Use the mirror CounterWallet site as the backup
- If m_iCounterWalletServerUp <> 1 Then
- Msg("Getting CounterWallet server status from: " & URL_CoinDaddyCounterwallet & CounterwalletAPI)
+ For j As Integer = 0 To 1
'Display status
- OkMsg.BackColor = Color.Orange
- OkMsg.MsgText.Text = OkMsg.Text & vbNewLine & vbNewLine & "2. " & URL_CoinDaddyCounterwallet & CounterwalletAPI & vbNewLine & "(Can take 40 seconds)"
+ Msg("Getting CounterWallet server status from: " & If(g_bRevCWServers = True, URL_CoinDaddyCounterwallet, URL_Counterwallet) & CounterwalletAPI)
+ If j > 0 Then
+ OkMsg.MsgText.Text = OkMsg.Text & vbNewLine & vbNewLine & If(g_bRevCWServers = True, 2, 1).ToString & ". " & If(g_bRevCWServers = True, URL_CoinDaddyCounterwallet, URL_Counterwallet) & CounterwalletAPI & vbNewLine & "(Can take 40 seconds)"
+ OkMsg.BackColor = Color.Orange
+ End If
'Get CounterWallet status from server
- Await OpenURL(URL_CoinDaddyCounterwallet & CounterwalletAPI, False)
+ Await OpenURL(If(g_bRevCWServers = True, URL_CoinDaddyCounterwallet, URL_Counterwallet) & CounterwalletAPI, False)
Await PageTitleWait(NameCounterwallet)
- Await Wait(50)
+ System.Windows.Forms.Application.DoEvents()
+ Await Wait(100)
'Find status data in web page
For i As Integer = 0 To 1
+ strResponse1 = ""
+ strResponse2 = ""
If FindTextInDoc("""counterparty-server"": ""*K""", """counterblock"": ""*K""", strResponse1, strResponse2, True, "") = True AndAlso strResponse1.Length > 0 AndAlso strResponse2.Length > 0 Then
'Search for: "O"K, or "NOT O"K. If OK, then set the flag for OK
- If strResponse1 = "O" AndAlso strResponse2 = "O" Then m_iCounterWalletServerUp = 2
- Exit For
+ If strResponse1 = "O" AndAlso strResponse2 = "O" Then
+ m_iCounterWalletServerUp = If(g_bRevCWServers = True, If(j = 0, 2, 1), If(j = 0, 1, 2))
+ Exit For
+ End If
End If
Await Wait(700)
Next
- End If
- Msg("Using CounterWallet server: #" & m_iCounterWalletServerUp)
+ 'If server was up, then exit server retry loop
+ If m_iCounterWalletServerUp > 0 Then
+ Exit For
+ End If
+ Next
+
+ Msg("CounterWallet server #" & m_iCounterWalletServerUp & " is up")
Catch ex As Exception
Msg("CounterWallet Status error:" & ex.ToString)
@@ -1503,7 +1537,7 @@
If bSaved12W = True Then
'Display status
OkMsg.Text = "Login to wallet"
- OkMsg.MsgText.Text = OkMsg.Text & vbNewLine & vbNewLine & "1. " & If(m_iCounterWalletServerUp = 2, URL_CoinDaddyCounterwallet, URL_Counterwallet) & vbNewLine & "(Can take 60 seconds)"
+ OkMsg.MsgText.Text = OkMsg.Text & vbNewLine & vbNewLine & "1. " & If(m_iCounterWalletServerUp = 2, URL_CoinDaddyCounterwallet, URL_Counterwallet) & vbNewLine & "Retry in 60s (Can take 60 seconds)"
OkMsg.MsgText.Left = 70
OkMsg.MsgText.Top = 70
OkMsg.Width = (OkMsg.MsgText.Left * 2) + OkMsg.MsgText.Width + 20
@@ -1518,25 +1552,28 @@
bFAH_PageLoaded = False
Do Until bFAH_PageLoaded = True OrElse g_bCancelNav = True OrElse i > 40
i += 1
+ If i < 20 Then
+ OkMsg.MsgText.Text = OkMsg.Text & vbNewLine & vbNewLine & "1. " & If(m_iCounterWalletServerUp = 2, URL_CoinDaddyCounterwallet, URL_Counterwallet) & vbNewLine & "Retry in " & (60 - (i * 3)).ToString & "s (Can take 60 seconds)"
+ ElseIf i >= 20 Then
+ OkMsg.MsgText.Text = OkMsg.Text & vbNewLine & vbNewLine & "2. " & If(m_iCounterWalletServerUp = 2, URL_Counterwallet, URL_CoinDaddyCounterwallet) & vbNewLine & "Waited " & (120 - (i * 3)).ToString & "s (Can take 60 seconds)"
+ End If
+
If i = 1 OrElse i = 20 Then
If i = 1 Then
'CounterWallet web page (Use the mirror site as the default)
Await OpenURL(If(m_iCounterWalletServerUp = 2, URL_CoinDaddyCounterwallet, URL_Counterwallet), False)
ElseIf i = 20 Then
- 'If still not loaded, try the other site
- OkMsg.BackColor = Color.LightSkyBlue
- OkMsg.MsgText.Text = OkMsg.Text & vbNewLine & vbNewLine & "2. " & If(m_iCounterWalletServerUp = 2, URL_Counterwallet, URL_CoinDaddyCounterwallet) & vbNewLine & "(Can take 60 seconds)"
-
'If still not loaded, try the other site
Await OpenURL(If(m_iCounterWalletServerUp = 2, URL_Counterwallet, URL_CoinDaddyCounterwallet), False)
+ OkMsg.BackColor = Color.LightSkyBlue
End If
Await PageTitleWait(NameCounterwallet)
+ System.Windows.Forms.Application.DoEvents()
Await Wait(700)
'Enter 12-word Passphrase to login
EnterTextById("password", DAT.GetSection(Id & Me.cbxToolsWalletId.Text).GetKey(DAT_CP12Words).GetValue())
Await Wait(50)
- DAT = Nothing
'Trigger event to enable the Login button, since there was no keystroke event to enable the button
Me.browser.GetBrowser.MainFrame.ExecuteJavaScriptAsync("ko.utils.triggerEvent(document.getElementById('password'), 'input');")
@@ -1561,9 +1598,9 @@
Catch ex As Exception
Msg("Auto-Wallet Login error:" & ex.ToString)
- If DAT IsNot Nothing Then DAT = Nothing
End Try
+ If DAT IsNot Nothing Then DAT = Nothing
'Close the informational message
OkMsg.Close()
OkMsg.Dispose()
@@ -1599,7 +1636,7 @@
'Determine if this is a first-time setup or not: Look for the Discord Login Email in the saved settings
If DAT.GetSection(Id & Me.cbxToolsWalletId.Text) Is Nothing OrElse DAT.GetSection(Id & Me.cbxToolsWalletId.Text).GetKey(DAT_DiscordEmail) Is Nothing Then
- 'Fix missing values. Ask for email and passowrd to sign in
+ 'Fix missing values. Ask for email and password to sign in
Dim DiscordDlg As New UserPwdDialog
'Suggest the Email from the saved settings, if available
If DAT.GetSection(Id & Me.cbxToolsWalletId.Text) IsNot Nothing AndAlso DAT.GetSection(Id & Me.cbxToolsWalletId.Text).GetKey(DAT_Email) IsNot Nothing Then
@@ -1719,7 +1756,7 @@
System.Windows.Forms.Application.DoEvents()
Await Wait(2000)
- 'Skip asking for this in the future, if originally cancelled - Don't store info
+ 'Skip asking for this in the future, if originally canceled - Don't store info
Dim strEmail As String = DAT.GetSection(Id & Me.cbxToolsWalletId.Text).GetKey(DAT_DiscordEmail).GetValue()
If strEmail <> SkipSavingDataFlag Then
'Don't try to login again if you're already logged in (pressing the button again or switching between FoldingCoin and CureCoin)
@@ -1848,7 +1885,7 @@
'Display status
OkMsg.Text = "Getting wallet address"
- OkMsg.MsgText.Text = OkMsg.Text & vbNewLine & vbNewLine & "1. " & If(m_iCounterWalletServerUp = 2, URL_CoinDaddyCounterwallet, URL_Counterwallet) & vbNewLine & "(Can take 60 seconds)"
+ OkMsg.MsgText.Text = OkMsg.Text & vbNewLine & vbNewLine & "1. " & If(m_iCounterWalletServerUp = 2, URL_CoinDaddyCounterwallet, URL_Counterwallet) & vbNewLine & "Retry in 60s (Can take 60 seconds)"
OkMsg.MsgText.Left = 70
OkMsg.MsgText.Top = 70
OkMsg.Width = (OkMsg.MsgText.Left * 2) + OkMsg.MsgText.Width + 20
@@ -1858,7 +1895,7 @@
OkMsg.BackColor = Color.PaleGreen
OkMsg.Show(Me)
- 'Try up to 2 differnt URLs
+ 'Try up to 2 different URLs
Do Until bFAH_PageLoaded = True OrElse g_bCancelNav = True OrElse iPageReloads > 2
iPageReloads += 1
If iPageReloads = 1 Then
@@ -1866,8 +1903,8 @@
Await OpenURL(If(m_iCounterWalletServerUp = 2, URL_CoinDaddyCounterwallet, URL_Counterwallet), False)
Else
'If still not loaded, try the other site
- OkMsg.BackColor = Color.LightSkyBlue
OkMsg.MsgText.Text = OkMsg.Text & vbNewLine & vbNewLine & "2. " & If(m_iCounterWalletServerUp = 2, URL_Counterwallet, URL_CoinDaddyCounterwallet) & vbNewLine & "(Can take 60 seconds)"
+ OkMsg.BackColor = Color.LightSkyBlue
Await OpenURL(If(m_iCounterWalletServerUp = 2, URL_Counterwallet, URL_CoinDaddyCounterwallet), False)
End If
@@ -1890,11 +1927,11 @@
Dim str12W As String = ""
Dim strBTCAddr As String = ""
- For i = 0 To 10
+ For i = 0 To 7
If FindTextInDoc("generatedPassphrase"">*", "", str12W, "", False, "") = True AndAlso str12W.Length > 24 Then
Exit For
End If
- Await Wait(400)
+ Await Wait(500)
Next
If str12W.Length > 24 Then
@@ -1924,8 +1961,14 @@
i = 0
bFAH_PageLoaded = False
Do Until bFAH_PageLoaded = True OrElse g_bCancelNav = True OrElse i > 20
- i += 1
+ 'Wait for login to complete (if server says it's OK, but it isn't, the login will hang. Try other server, if it does)
+ If iPageReloads = 1 Then
+ OkMsg.MsgText.Text = OkMsg.Text & vbNewLine & vbNewLine & "1. " & If(m_iCounterWalletServerUp = 2, URL_CoinDaddyCounterwallet, URL_Counterwallet) & vbNewLine & "Retry in " & (60 - (i * 3)).ToString & "s (Can take 60 seconds)"
+ Else
+ OkMsg.MsgText.Text = OkMsg.Text & vbNewLine & vbNewLine & "2. " & If(m_iCounterWalletServerUp = 2, URL_Counterwallet, URL_CoinDaddyCounterwallet) & vbNewLine & "Waited " & (i * 3).ToString & "s (Can take 60 seconds)"
+ End If
+ i += 1
'If 1.2 second wait wasn't long enough, retry at 12 seconds
If i = 1 OrElse i = 4 Then
'First login, accept terms. ('btn btn-success') 2nd instance for the Accept button:
@@ -2156,7 +2199,7 @@
Dim DAT As New IniFile
Try
- 'Try to make the window tall enough to see the captcha at the botttom of the screen
+ 'Try to make the window tall enough to see the captcha at the bottom of the screen
If Me.Height < 975 Then Me.Height = 975
'Go to the CureCoin folding pool (CryptoBullionPools) website
@@ -2197,7 +2240,7 @@
If bRunning = False Then
Msg("CureCoin Wallet not running")
- 'Make sure the config file ('curecoin.conf.example') is availible
+ 'Make sure the config file ('curecoin.conf.example') is available
Dim strCureCoinConfigPath As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "curecoin", "curecoin.conf.example")
Dim strCureCoinEXEPath As String = ""
If Environment.Is64BitOperatingSystem = True Then
@@ -2937,6 +2980,7 @@
If args.Value.Length = 0 Then
'Hide the info text
Me.lblHoverURL.Visible = False
+ Me.lblHoverURL.Text = ""
Else
'Display the info
Me.lblHoverURL.Text = args.Value
@@ -3306,7 +3350,7 @@
Return False
End Function
- Private Async Sub pnlBtnLinks_MouseEnter(sender As Object, e As EventArgs) Handles pnlBtnLinks.MouseEnter
+ Private Async Sub pnlBtnLinks_MouseEnter(sender As Object, e As EventArgs) Handles pnlBtnLinks.MouseEnter, pbMolecule.MouseEnter
'Skip, if already expanded
If Me.pnlBtnLinks.Height <= m_iMinPanelHeight Then
'Skip, if set in the options
diff --git a/FoldingBrowser - Status - ToDo List.txt b/FoldingBrowser - Status - ToDo List.txt
index 137d0e7..e61509f 100644
--- a/FoldingBrowser - Status - ToDo List.txt
+++ b/FoldingBrowser - Status - ToDo List.txt
@@ -8,7 +8,6 @@ Immediate Need / Short-Term Goals:
-Evaluate upgrading to CefSharp/Chrome v77 (VC++2015) when released here: https://github.com/cefsharp/CefSharp/releases
-CureCoin installer: Update blockchain files and 'peers.dat' file in the installer to be current.
-Support other wallets, for pressing the 'FLDC Wallet' button, with option for: https://freewallet.io/ Other alternatives (ignore for now): https://wallet.indiesquare.me/ also: rarepepewallet.com (Not updated enough? security risks?) (Not yet) https://tokenpockets.com/ (You cannot use tokenpockets currently. It is not compatible with existing passphrases from CounterWallet. If you want to use it, you will have to make a new address first)
--Option to select which CounterWallet site to use first by default. -(skipping for now) Reverse the CounterWallet website search order to use the mirror site first? Was using the main site first, which is down more often, but the mirror site is slower to load?
----------------------------------------------------
Other Ideas, Improvements, Tasks, Longer-Term Goals:
@@ -67,7 +66,10 @@ Other Ideas, Improvements, Tasks, Longer-Term Goals:
======================================================================================================
Change Log - Release Notes - Tasks completed:
======================================================================================================
-v21 Release (2019-10-07)
+v21 Release (2019-10-21)
+[DONE] -Changes for a better initial browser window location (center screen, on initial launch)
+[DONE] -Spell check source code
+[DONE] -Option to reverse the CounterWallet website search order (to use the mirror site first)? Was using the main site first, which is down more often, but the mirror site is slower to load?
[DONE] -Update the BTC blockchain explorer URL format to be: https://www.blockchain.com/btc/address/
[DONE] -Make it so when the main CounterWallet site is down, (1 minute timeout) it tries the other mirror site. The website status says it's up, but it's not working (logging-in to your wallet doesn't do anything), so the alternative site was not being used (because the site status said it wasn't down).
[DONE] -CureCoin installer: Update blockchain files in the installer to be current.
diff --git a/Install/CureCoin/curecoin.conf.example b/Install/CureCoin/curecoin.conf.example
index 3e96682..2c262b4 100644
--- a/Install/CureCoin/curecoin.conf.example
+++ b/Install/CureCoin/curecoin.conf.example
@@ -1,4 +1,5 @@
server=1
+port=9911
rpcuser=username
rpcpassword=password
rpcport=18512