Exemplo n.º 1
0
 public void SetLanguage(IEngine engine, OctarineLanguage language, int quality = 0)
 {
     if (engine.Languages == null)
     {
         return;
     }
     engine.SetLanguage(language, quality);
     engine.WriteConfig("Language", language.Code);
     if (quality > 0)
     {
         engine.WriteConfig("Quality", quality);
     }
     wnd.RefreshResult();
 }
Exemplo n.º 2
0
 private void ShowQualitiesForLanguage(IEngine engine, OctarineLanguage language)
 {
     if (language == null)
     {
         lst_quality.Items.Clear();
         lst_quality.Enabled = false;
         return;
     }
     lst_quality.Items.Clear();
     if (language.Qualities == 1)
     {
         lst_quality.Items.Add("Domyślna");
     }
     else if (language.Qualities == 2)
     {
         lst_quality.Items.Add("Niska");
         lst_quality.Items.Add("Wysoka");
         lst_quality.SelectedIndex = 1;
     }
     else if (language.Qualities == 3)
     {
         lst_quality.Items.Add("Szybka");
         lst_quality.Items.Add("Standardowa");
         lst_quality.Items.Add("Najlepsza");
         lst_quality.SelectedIndex = 1;
     }
     else
     {
         for (int i = 0; i < language.Qualities; ++i)
         {
             lst_quality.Items.Add((i + 1).ToString());
         }
         lst_quality.SelectedIndex = language.Qualities / 2;
     }
     lst_quality.Enabled = language.Qualities > 1;
     if (engine.CurrentQuality > 0 && engine.CurrentQuality <= lst_quality.Items.Count)
     {
         lst_quality.SelectedIndex = engine.CurrentQuality - 1;
     }
 }