Translation dialog: Do not use sorted ComboBoxes for choosing languages.

[DEVELOPMENT ENVIRONMENT]
* BUG: Translation dialog: Do not use sorted ComboBoxes for choosing languages, as Qt and GTK+ do not sort the same way, and it breaks the behaviour of the dialog when using GTK+3.
This commit is contained in:
gambas 2021-05-12 23:36:45 +02:00
parent 8ca02c7895
commit a22be6a4b4
3 changed files with 12 additions and 8 deletions

View file

@ -31,7 +31,7 @@ Component=gb.signal
Description="Integrated Development Environment for Gambas" Description="Integrated Development Environment for Gambas"
Authors="Benoît Minisini\nFabien Bodard\nCharlie Reinl\nJosé Luis Redrejo\nRobert Rowe\nTobias Boege" Authors="Benoît Minisini\nFabien Bodard\nCharlie Reinl\nJosé Luis Redrejo\nRobert Rowe\nTobias Boege"
Arguments=[["-L"],["-t","/home/benoit/gambas/git/master/app/src/gambas3"],["--help"]] Arguments=[["-L"],["-t","/home/benoit/gambas/git/master/app/src/gambas3"],["--help"]]
Environment="GB_GUI=gb.qt5\n GTK_DEBUG=interactive" Environment="GB_GUI=gb.gtk3\n GTK_DEBUG=interactive"
TabSize=2 TabSize=2
Translate=1 Translate=1
Language=en Language=en

View file

@ -134,6 +134,8 @@ Public Sub Form_Open()
Dim sLang As String Dim sLang As String
Dim sPath As String Dim sPath As String
Dim sName As String
Dim aName As String[]
Inc Application.Busy Inc Application.Busy
@ -149,14 +151,18 @@ Public Sub Form_Open()
cmbLangSource.Add(("(Default)")) cmbLangSource.Add(("(Default)"))
'For Each sLang In Language.GetAll() 'For Each sLang In Language.GetAll()
aName = New String[]
For Each sLang In Project.GetTranslations() For Each sLang In Project.GetTranslations()
'If Project.HasTranslation(sLang) Then sName = Language.ToName(sLang)
cvwLang.Add(sLang, Language.ToName(sLang)) aName.Add(sName)
cmbLang.Add(Language.ToName(sLang)) cvwLang.Add(sLang, sName)
cmbLangSource.Add(Language.ToName(sLang))
'Endif
Next Next
aName.Sort(gb.Natural)
cmbLang.List = aName
aName.Add(("(Default)"), 0)
cmbLangSource.List = aName
sPath = Settings["/FTranslate/ImportPath"] sPath = Settings["/FTranslate/ImportPath"]
If Not sPath Then sPath = System.User.Home If Not sPath Then sPath = System.User.Home
dchImport.SelectedPath = sPath dchImport.SelectedPath = sPath

View file

@ -82,7 +82,6 @@
MoveScaled(6,0,21,4) MoveScaled(6,0,21,4)
Expand = True Expand = True
ReadOnly = True ReadOnly = True
Sorted = True
} }
{ PictureBox2 PictureBox { PictureBox2 PictureBox
MoveScaled(28,0,4,4) MoveScaled(28,0,4,4)
@ -94,7 +93,6 @@
Font = Font["Bold"] Font = Font["Bold"]
Expand = True Expand = True
ReadOnly = True ReadOnly = True
Sorted = True
} }
{ btnNew ToolButton mnuNew { btnNew ToolButton mnuNew
Name = "btnNew" Name = "btnNew"