Beispiel #1
0
        public void TestDisplayLanguage()
        {
            var languagesToTest = new[] { LocalizationHelper.CurrentUICulture }
            .Concat(CultureUtil.AvailableDisplayLanguages());

            foreach (var language in languagesToTest)
            {
                var oldLanguage = LocalizationHelper.CurrentUICulture;
                try
                {
                    LocalizationHelper.CurrentUICulture = language;
                    _language = language;
                    RunFunctionalTest();
                }
                finally
                {
                    LocalizationHelper.CurrentUICulture = oldLanguage;
                }
            }
        }
Beispiel #2
0
        public ToolOptionsUI()
        {
            InitializeComponent();
            checkBoxShowWizard.Checked = Settings.Default.ShowStartupForm;
            powerOfTenCheckBox.Checked = Settings.Default.UsePowerOfTen;
            Icon = Resources.Skyline;

            _driverServers = new SettingsListBoxDriver <Server>(listboxServers, Settings.Default.ServerList);
            _driverServers.LoadList();
            _driverChorusAccounts = new SettingsListBoxDriver <RemoteAccount>(listBoxRemoteAccounts, Settings.Default.RemoteAccountList);
            _driverChorusAccounts.LoadList();
            _driverColorSchemes = new SettingsListComboDriver <ColorScheme>(comboColorScheme, Settings.Default.ColorSchemes, true);
            _driverColorSchemes.LoadList(Settings.Default.CurrentColorScheme);

            // Hide ability to turn off live reports
            //tabControl.TabPages.Remove(tabMisc);

            // Populate the languages list with the languages that Skyline has been localized to
            string defaultDisplayName = string.Format(Resources.ToolOptionsUI_ToolOptionsUI_Default___0__,
                                                      CultureUtil.GetDisplayLanguage(CultureInfo.InstalledUICulture).DisplayName);

            listBoxLanguages.Items.Add(new DisplayLanguageItem(string.Empty, defaultDisplayName));
            foreach (var culture in CultureUtil.AvailableDisplayLanguages())
            {
                listBoxLanguages.Items.Add(new DisplayLanguageItem(culture.Name, culture.DisplayName));
            }
            for (int i = 0; i < listBoxLanguages.Items.Count; i++)
            {
                var displayLanguageItem = (DisplayLanguageItem)listBoxLanguages.Items[i];
                if (Equals(displayLanguageItem.Key, Settings.Default.DisplayLanguage))
                {
                    listBoxLanguages.SelectedIndex = i;
                }
            }
            comboCompactFormatOption.Items.AddRange(CompactFormatOption.ALL_VALUES.ToArray());
            comboCompactFormatOption.SelectedItem = CompactFormatOption.FromSettings();
        }
Beispiel #3
0
        public ToolOptionsUI(SrmSettings settings)
        {
            InitializeComponent();
            checkBoxShowWizard.Checked = Settings.Default.ShowStartupForm;
            powerOfTenCheckBox.Checked = Settings.Default.UsePowerOfTen;
            Icon = Resources.Skyline;

            _driverServers = new SettingsListBoxDriver <Server>(listboxServers, Settings.Default.ServerList);
            _driverServers.LoadList();
            _driverRemoteAccounts = new SettingsListBoxDriver <RemoteAccount>(listBoxRemoteAccounts, Settings.Default.RemoteAccountList);
            _driverRemoteAccounts.LoadList();
            _driverColorSchemes = new SettingsListComboDriver <ColorScheme>(comboColorScheme, Settings.Default.ColorSchemes, true);
            _driverColorSchemes.LoadList(Settings.Default.CurrentColorScheme);

            var pingPep   = new Peptide(@"PING");
            var peptide   = new PeptideDocNode(pingPep);
            var precursor = new TransitionGroupDocNode(new TransitionGroup(pingPep, Adduct.SINGLY_PROTONATED, IsotopeLabelType.light),
                                                       new TransitionDocNode[0]);

            _pingInput     = new PrositIntensityModel.PeptidePrecursorNCE(peptide, precursor, IsotopeLabelType.light, 32);
            _settingsNoMod = settings.ChangePeptideModifications(
                pm => new PeptideModifications(new StaticMod[0], new TypedModifications[0]));

            // Hide ability to turn off live reports
            //tabControl.TabPages.Remove(tabMisc);

            // Populate the languages list with the languages that Skyline has been localized to
            string defaultDisplayName = string.Format(Resources.ToolOptionsUI_ToolOptionsUI_Default___0__,
                                                      CultureUtil.GetDisplayLanguage(CultureInfo.InstalledUICulture).DisplayName);

            listBoxLanguages.Items.Add(new DisplayLanguageItem(string.Empty, defaultDisplayName));
            foreach (var culture in CultureUtil.AvailableDisplayLanguages())
            {
                listBoxLanguages.Items.Add(new DisplayLanguageItem(culture.Name, culture.DisplayName));
            }
            for (int i = 0; i < listBoxLanguages.Items.Count; i++)
            {
                var displayLanguageItem = (DisplayLanguageItem)listBoxLanguages.Items[i];
                if (Equals(displayLanguageItem.Key, Settings.Default.DisplayLanguage))
                {
                    listBoxLanguages.SelectedIndex = i;
                }
            }
            comboCompactFormatOption.Items.AddRange(CompactFormatOption.ALL_VALUES.ToArray());
            comboCompactFormatOption.SelectedItem = CompactFormatOption.FromSettings();

            var iModels = PrositIntensityModel.Models.ToList();

            iModels.Insert(0, string.Empty);
            var rtModels = PrositRetentionTimeModel.Models.ToList();

            rtModels.Insert(0, string.Empty);

            tbxPrositServer.Text = PrositConfig.GetPrositConfig().Server;
            intensityModelCombo.Items.AddRange(iModels.ToArray());
            iRTModelCombo.Items.AddRange(rtModels.ToArray());

            prositServerStatusLabel.Text = string.Empty;
            if (iModels.Contains(Settings.Default.PrositIntensityModel))
            {
                intensityModelCombo.SelectedItem = Settings.Default.PrositIntensityModel;
            }
            if (rtModels.Contains(Settings.Default.PrositRetentionTimeModel))
            {
                iRTModelCombo.SelectedItem = Settings.Default.PrositRetentionTimeModel;
            }

            ceCombo.Items.AddRange(
                Enumerable.Range(PrositConstants.MIN_NCE, PrositConstants.MAX_NCE - PrositConstants.MIN_NCE + 1).Select(c => (object)c)
                .ToArray());
            ceCombo.SelectedItem = Settings.Default.PrositNCE;
        }