Skip to content

Commit

Permalink
show actions in msgbox for mt params setting
Browse files Browse the repository at this point in the history
  • Loading branch information
xulihang committed Oct 11, 2020
1 parent 75b6a18 commit 5781222
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 28 deletions.
22 changes: 11 additions & 11 deletions BasicCAT/BasicCAT.b4j
Original file line number Diff line number Diff line change
Expand Up @@ -187,18 +187,18 @@ Library8=jrandomaccessfile
Library9=jb4xencryption
Module1=FileChooserUtils
Module10=RichTextArea
Module11=TMX
Module12=XmlNode
Module13=XMLUtils
Module14=xliffFilter
Module15=TMManager
Module16=confirmReviewDialog
Module17=Utils
Module18=editDistance
Module19=TM
Module11=MTParamsFiller
Module12=TMX
Module13=XmlNode
Module14=XMLUtils
Module15=xliffFilter
Module16=TMManager
Module17=confirmReviewDialog
Module18=Utils
Module19=editDistance
Module2=Project
Module20=Theme
Module21=MTParamsFiller
Module20=TM
Module21=Theme
Module22=LanguageTool
Module23=searchAndReplaceDialog
Module24=statistics
Expand Down
4 changes: 2 additions & 2 deletions BasicCAT/BasicCAT.b4j.meta
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,6 @@ ModuleClosedNodes74=
ModuleClosedNodes75=
ModuleClosedNodes8=
ModuleClosedNodes9=
NavigationStack=editDistance,getTextInParts,25,1,Visual Designer,pretranslate.bjl,-100,4,preTranslateDialog,Class_Globals,7,0,preTranslateDialog,Initialize,12,0,preTranslateDialog,applyTMButton_MouseClicked,31,0,preTranslateDialog,applyMTButton_MouseClicked,40,3,Project,preTranslate,1891,6,MTParamsFiller,Initialize,11,0,MTParamsFiller,init,58,6,MTParamsFiller,setTableView,76,5
NavigationStack=MTParamsFiller,Initialize,11,0,MTParamsFiller,setTableView,76,5,Preferences,lookupControlCheckBox_CheckedChange,265,0,MTParamsFiller,Class_Globals,0,0,MTParamsFiller,init,60,6,MTParamsFiller,paramsTableView_MouseClicked,106,6,Preferences,mtTableView_MouseClicked,202,1,Preferences,ShowMTParamsFiller,206,0,Preferences,loadMT,217,0,Preferences,chkbox_CheckedChange,259,6
SelectedBuild=0
VisibleModules=1,2,3,4,5,6,7,8,9,10,21
VisibleModules=1,2,3,4,5,6,7,8,9,10,11
7 changes: 6 additions & 1 deletion BasicCAT/MTParamsFiller.bas
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ Sub paramsTableView_MouseClicked (EventData As MouseEvent)
row(1)=inpBox.showAndWait("")
End If
paramsTableView.Items.Set(paramsTableView.SelectedRow,row)
params.Put(paramsTableView.SelectedRowValues(0),row(1))
If row(1)<>"" Then
params.Put(paramsTableView.SelectedRowValues(0),row(1))
Else
params.Remove(paramsTableView.SelectedRowValues(0))
End If

End If
End Sub
33 changes: 19 additions & 14 deletions BasicCAT/Preferences.bas
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,19 @@ Sub mtTableView_MouseClicked (EventData As MouseEvent)
Log(mtTableView.SelectedRowValues(0))
Dim engineName As String
engineName=mtTableView.SelectedRowValues(0)

Dim filler As MTParamsFiller
filler.Initialize(engineName,preferencesMap)
mtPreferences.Put(engineName,filler.showAndWait)
Log(mtPreferences)

unsavedPreferences.Put("mt",mtPreferences)
ShowMTParamsFiller(engineName)
End If

End Sub

Sub ShowMTParamsFiller(engineName As String)
Dim filler As MTParamsFiller
filler.Initialize(engineName,preferencesMap)
mtPreferences.Put(engineName,filler.showAndWait)
Log(mtPreferences)
unsavedPreferences.Put("mt",mtPreferences)
End Sub


Sub loadMT
For Each item As String In MT.getMTList
Dim chkbox As CheckBox
Expand Down Expand Up @@ -258,15 +260,18 @@ Sub chkbox_CheckedChange(Checked As Boolean)
isfilled=False
End If

If isfilled=True Then
mtPreferences.Put(engine&"_isEnabled",Checked)
Else
If isfilled=False Then
If Checked Then
fx.Msgbox(frm,"params are not filled completely","")
Dim response As Int=fx.Msgbox2(frm,"params for "&engine&" are not filled completely, the engine may not work.","","Continue","Abort","Fill params",fx.MSGBOX_CONFIRMATION)
If response=fx.DialogResponse.CANCEL Then
chkbox.Checked=False
Return
else if response=fx.DialogResponse.NEGATIVE Then
ShowMTParamsFiller(engine)
End If
End If
chkbox.Checked=False

End If
mtPreferences.Put(engine&"_isEnabled",Checked)
End Sub


Expand Down

0 comments on commit 5781222

Please sign in to comment.