Skip to content

Commit

Permalink
v18 release changes: Upgrade to CefSharp/Chrome v67. Added more web p…
Browse files Browse the repository at this point in the history
…age button links and improved the layout, so they are not as dense. Make the Tools and Bookmark panels symmetrical and not contending for the same screen space. Merging the Tools panel into the Web Link Buttons panel. Renamed icon images to be closer to the resource names they will get in the VB code (underscores instead of dashes). Kept the side-by-side homepage as an option, and made the top-and-bottom version the new default homepage. Fixing getting a Passkey at the newer URL. Fixing Discord login button.
  • Loading branch information
Hou5e committed Nov 12, 2018
1 parent 0c69f19 commit da58943
Show file tree
Hide file tree
Showing 14 changed files with 351 additions and 198 deletions.
17 changes: 16 additions & 1 deletion Browser/DisplayOptionsDialog.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 24 additions & 8 deletions Browser/DisplayOptionsDialog.vb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@

'Make sure the INI key/value exists
If INI.GetSection(INI_Settings).GetKey(INI_Homepage) IsNot Nothing Then
'Load Homepage option
'Load option
Me.cbxHomepage.Text = INI.GetSection(INI_Settings).GetKey(INI_Homepage).GetValue()
Else
'Add if it doesn't exist
'Add, if it doesn't exist
INI.AddSection(INI_Settings).AddKey(INI_Homepage).Value = HpgDefault
End If

If INI.GetSection(INI_Settings).GetKey(INI_ShowPanelOnMouseEnter) IsNot Nothing Then
'Load option
Me.chkShowPanelOnMouseEnterEvent.Checked = CBool(INI.GetSection(INI_Settings).GetKey(INI_ShowPanelOnMouseEnter).GetValue())
Else
'Add, if it doesn't exist
INI.AddSection(INI_Settings).AddKey(INI_ShowPanelOnMouseEnter).Value = g_bShowWebLinkPanelOnMouseEnterEvent.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)
Expand Down Expand Up @@ -61,10 +69,13 @@

Private Sub btnSaveChanges_Click(sender As Object, e As EventArgs) Handles btnSaveChanges.Click
If Me.chkShowRawData.Checked = False Then

'Save options
If Me.cbxHomepage.Text.Length > 0 Then
INI.AddSection(INI_Settings).AddKey(INI_Homepage).Value = Me.cbxHomepage.Text
End If

g_bShowWebLinkPanelOnMouseEnterEvent = Me.chkShowPanelOnMouseEnterEvent.Checked
INI.AddSection(INI_Settings).AddKey(INI_ShowPanelOnMouseEnter).Value = g_bShowWebLinkPanelOnMouseEnterEvent.ToString
INI.Save(IniFilePath)

'Display the INI data in the main raw data textbox
Expand All @@ -82,15 +93,20 @@
Me.Close()
End Sub

'If any of the options are changed, then enable the Save Changes button
Private Sub cbxHomepage_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxHomepage.SelectedIndexChanged
Me.btnSaveChanges.Enabled = True
End Sub

Private Sub DisplayOptionsDialog_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.Escape Then
'The Closing event clears out the displayed text
Me.Close()
End If
End Sub

'If any of the options are changed, then enable the Save Changes button
Private Sub cbxHomepage_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxHomepage.SelectedIndexChanged
Me.btnSaveChanges.Enabled = True
End Sub

'If any of the options are changed, then enable the Save Changes button
Private Sub chkShowPanelOnMouseEnterEvent_CheckedChanged(sender As Object, e As EventArgs) Handles chkShowPanelOnMouseEnterEvent.CheckedChanged
Me.btnSaveChanges.Enabled = True
End Sub
End Class
2 changes: 1 addition & 1 deletion Browser/DisplayTextDialog.vb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
Dim bFAH_Installed As Boolean = False
Dim strFAHConfigPath As String = ""
Const PATH_FAH_ALL_USER_CFG As String = "C:\ProgramData\FAHClient\config.xml"
Dim Path_FAH_CurrentUserCfg As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FAHClient", "config.xml")
Dim Path_FAH_CurrentUserCfg As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), FAH_Client, "config.xml")

If System.IO.Directory.Exists(strBackupPath) = False Then
My.Computer.FileSystem.CreateDirectory(strBackupPath)
Expand Down
2 changes: 1 addition & 1 deletion Browser/FAHSetupDialog.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions Browser/FAHSetupDialog.vb
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@
Me.txtEmail.BackColor = Color.FromKnownColor(KnownColor.Window)
End Sub

'Run the script to send the Passkey. Web page: http://fah-web.stanford.edu/cgi-bin/getpasskey.py
'Run the web page to send the Passkey
Private Async Sub btnGetPasskey_Click(sender As Object, e As EventArgs) Handles btnGetPasskey.Click
'Check to see if email looks valid, and indicate if it isn't
If Me.txtEmail.Text.Length > 5 AndAlso Me.txtEmail.Text.Contains("@") AndAlso Me.txtEmail.Text.Contains(".") Then
Expand All @@ -477,8 +477,12 @@

'Remove any white space at the beginning or end of the email address
Me.txtEmail.Text = Me.txtEmail.Text.Trim
'Run the script to send the Passkey. Like: http://fah-web.stanford.edu/cgi-bin/getpasskey.py?name=[user]&email=[email]
If Await g_Main.GetFAHpasskey("http://fah-web.stanford.edu/cgi-bin/getpasskey.py?name=" & Me.lblUsernamePreview.Text & "&email=" & Me.txtEmail.Text) = True Then
'Run the web page to send the Passkey
If Await g_Main.GetFAHpasskey(URL_FAH_Passkey & Me.lblUsernamePreview.Text & "&email=" & Me.txtEmail.Text) = True Then
Await Wait(200)
'Click Get Passkey button (only button on the page)
Await g_Main.ClickByTag("button", 0, False)

'Good - Check your email
Dim OkMsg As New MsgBoxDialog
OkMsg.Text = "Check your email"
Expand Down Expand Up @@ -537,7 +541,7 @@
Try
Dim bRunning As Boolean = False
Dim p As Process
For Each p In Process.GetProcessesByName("FAHClient")
For Each p In Process.GetProcessesByName(FAH_Client)
g_Main.Msg("FAH is running at id: " & p.Id.ToString() & " - " & p.ProcessName)
bRunning = True
Exit For
Expand Down
1 change: 1 addition & 0 deletions Browser/FoldingBrowser.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
<ItemGroup>
<EmbeddedResource Include="DisplayOptionsDialog.resx">
<DependentUpon>DisplayOptionsDialog.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="FAHSetupDialog.resx">
<DependentUpon>FAHSetupDialog.vb</DependentUpon>
Expand Down
16 changes: 15 additions & 1 deletion Browser/GlobalRefs.vb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ Public Module GlobalRefs
Public Const URL_FAH_DL As String = "start-folding/"
Public Const URL_FAH_News As String = "news/"
Public Const URL_FAHTwitter As String = "https://twitter.com/foldingathome/"
Public Const URL_FAH_Client As String = "http://client.foldingathome.org/"
Public Const URL_FAH_Passkey As String = "https://apps.foldingathome.org/getpasskey?name="
Public Const URL_FAH_WebClient_URL As String = "http://client.foldingathome.org/"
Public Const URL_FAH_WebClient_IPAddr As String = "http://127.0.0.1:7396/?nocache="
Public Const URL_FAH_WebClient_ErrorAddr As String = "http://127.0.0.1:7396/js/main.js"
Public Const URL_NaCl_FAH As String = "http://nacl.foldingathome.org/"

'HTML from source code file: FoldingBrowser-SideBySide.html
Expand Down Expand Up @@ -104,6 +107,7 @@ Public Module GlobalRefs
Public Const INI_LastBrowserVersion As String = "LastBrowserVersion"
Public Const INI_HideSavedDataButton As String = "HideSavedDataButton"
Public Const INI_Homepage As String = "Homepage"
Public Const INI_ShowPanelOnMouseEnter As String = "ShowPanelOnMouseEnter"

'Wallet Id specific
Public Const INI_EOC_ID As String = "ExtremeOverclockingUserId"
Expand All @@ -126,6 +130,10 @@ Public Module GlobalRefs

'Website title to search for
Public Const NameCryptoBullions As String = "CryptoBullions"
'Search strings
Public Const FAH_Version As String = "Version"
Public Const FAH_Client As String = "FAHClient"
Public Const FAH_Core As String = "fahcore_"

Public UserProfileDir As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Prog_Name)
Public IniFilePath As String = System.IO.Path.Combine(UserProfileDir, Prog_Name & ".ini")
Expand All @@ -138,6 +146,12 @@ Public Module GlobalRefs
'Holds on to the last downloaded file path, when the download completes
Public g_strDownloadedFilePath As String = ""

'Option to Show the Web Link Panel On MouseEnter Event
Public g_bShowWebLinkPanelOnMouseEnterEvent As Boolean = True

'Event logging date-time stamp format string
Public Const LogDateTimeFormat As String = "yyyy-MM-dd HH:mm:ss.f"

Public Function SaveLogFile(ByRef strMsg As String) As Boolean
SaveLogFile = False
Dim twLog As System.IO.TextWriter = Nothing
Expand Down
Loading

0 comments on commit da58943

Please sign in to comment.