From cf4f1b9a724081ffde6c654979b512cda794238e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sun, 13 Jul 2014 19:04:51 +0000 Subject: [PATCH] [DEVELOPMENT ENVIRONMENT] * NEW: Help browser: Language support in the offline help. git-svn-id: svn://localhost/gambas/trunk@6375 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- app/src/gambas3/.src/Help/FHelpBrowser.class | 22 ++++++++++++-------- app/src/gambas3/.src/Help/FHelpBrowser.form | 9 +------- app/src/gambas3/.src/Help/MHelp.module | 8 ++----- app/src/gambas3/.src/Options/FOption.class | 3 ++- 4 files changed, 18 insertions(+), 24 deletions(-) diff --git a/app/src/gambas3/.src/Help/FHelpBrowser.class b/app/src/gambas3/.src/Help/FHelpBrowser.class index 7e4bd1878..a91255570 100644 --- a/app/src/gambas3/.src/Help/FHelpBrowser.class +++ b/app/src/gambas3/.src/Help/FHelpBrowser.class @@ -104,14 +104,20 @@ Public Sub GotoURL(sUrl As String) End - -Public Sub btnHome_Click() +Public Sub GotoHome() GotoURL(GetHomeURL()) webHelp.TextZoom = 0.8 End + +Public Sub btnHome_Click() + + GotoHome() + +End + Public Sub btnBack_Click() 'GotoURL($hHistory.Backward()) @@ -206,7 +212,6 @@ Public Sub webHelp_Error() Endif $bError = True - btnModify.Enabled = False End @@ -216,7 +221,6 @@ Public Sub webHelp_Load() ShowWaiting(False) $bError = False - btnModify.Enabled = webHelp.Url Begins Project.WIKI_URL ' If $bIgnoreNextHistory Then ' $bIgnoreNextHistory = False @@ -332,19 +336,19 @@ Public Sub Form_KeyPress() End -Private Sub SetLang(sLang As String) +Private Sub SetLang(Optional sLang As String) Dim sUrl As String - Dim sOldLang As String = MHelp.GetLanguage() MHelp.SetLanguage(sLang) sLang = MHelp.GetLanguage() sUrl = webHelp.Url If sUrl Begins Project.WIKI_URL Then - sUrl = Replace(sUrl, "&l=" & sOldLang, "") - 'Debug sUrl & "&" & sLang - GotoURL(sUrl & "&l=" & sLang) + sUrl = URL.SetQuery(sUrl, "l", sLang) + GotoURL(sUrl) + Else If sUrl Begins "file:///" &/ MHelp.GetOfflineDir() Then + GotoURL(Project.WIKI_ROOT &/ Wiki.Path & "?l=" & sLang) Endif End diff --git a/app/src/gambas3/.src/Help/FHelpBrowser.form b/app/src/gambas3/.src/Help/FHelpBrowser.form index c3d4da94b..7effaec02 100644 --- a/app/src/gambas3/.src/Help/FHelpBrowser.form +++ b/app/src/gambas3/.src/Help/FHelpBrowser.form @@ -1,7 +1,7 @@ # Gambas Form File 3.0 { Form Form - MoveScaled(0,0,59,20) + MoveScaled(0,0,55,20) Visible = False Action = "help" Text = ("Help browser") @@ -80,13 +80,6 @@ Text = ("Print") Picture = Picture["icon:/small/print"] } - { btnModify ToolButton - MoveScaled(81,0,25,4) - Visible = False - AutoResize = True - Text = ("Modify documentation") & "..." - Picture = Picture["icon:/small/edit"] - } } { Printer1 #Printer #MoveScaled(4,2) diff --git a/app/src/gambas3/.src/Help/MHelp.module b/app/src/gambas3/.src/Help/MHelp.module index 2285e8188..f695a1cec 100644 --- a/app/src/gambas3/.src/Help/MHelp.module +++ b/app/src/gambas3/.src/Help/MHelp.module @@ -56,7 +56,7 @@ Public Sub GetLanguage(Optional bReturnVoidIfDefault As Boolean) As String If Not IsLower(Mid$(sLang, iPos, 1)) Then Break Next - Return "l=" & Left$(sLang, iPos - 1) + Return Left$(sLang, iPos - 1) End @@ -808,10 +808,6 @@ Public Sub ReadConfig() End -Public Sub LoadOfflineHelpFile(sPath As String) As String - -End - Public Sub GetOfflineDir() As String Return Desktop.DataDir &/ "gambas3" &/ "wiki" @@ -885,7 +881,7 @@ Public Sub MakeOffline(hWebView As WebView, sUrl As String) sUrl = Left(sUrl, iPos - 1) Endif - Wiki.Lang = Wiki.DEFAULT_LANG + Wiki.Lang = GetLanguage() Wiki.Path = "/" &/ Mid$(sUrl, 8) Wiki.AnalyzePath() diff --git a/app/src/gambas3/.src/Options/FOption.class b/app/src/gambas3/.src/Options/FOption.class index be6029e08..e57319dfe 100644 --- a/app/src/gambas3/.src/Options/FOption.class +++ b/app/src/gambas3/.src/Options/FOption.class @@ -475,6 +475,7 @@ Public Sub btnOfflineHelp_Click() MHelp.ReadConfig panDownloadHelp.Visible = btnOfflineHelp.Value UpdateDocumentationState + FHelpBrowser.GotoHome End @@ -1291,4 +1292,4 @@ Private Sub UpdateDocumentationState() End Select -End \ No newline at end of file +End