private void update_selector() { SETTINGS temp = set.open_settings(); string[] list = temp.manager_versions; manager_list.Items.Clear(); if (list != null) { foreach (string s in list) { manager_list.Items.Add(s); } } }
public AboutUI(string[] l10n, bool rtl, string[] lang) { if (rtl) { RightToLeft = System.Windows.Forms.RightToLeft.Yes; } InitializeComponent(); bOk.DialogResult = System.Windows.Forms.DialogResult.OK; lang_chooser.Sorted = true; this.l10n = l10n; // Load default lang SETTINGS s = set.open_settings(); if (s.DL_saved_settings.download_path == "") { folder_save.Text = Path.GetTempPath(); } else { folder_save.Text = s.DL_saved_settings.download_path; } folder.RootFolder = Environment.SpecialFolder.MyComputer; lang_chooser.Items.AddRange(lang); try { lang_chooser.SelectedItem = s.l10n; ga_tracking.Checked = s.Piwik.tracking_allowed; ga_tracking.CheckedChanged += new EventHandler(ga_tracking_CheckedChanged); } catch (Exception e) { MessageBox.Show(e.Message); } lang_chooser.SelectedIndexChanged += new System.EventHandler(this.update_lang); cb_advancedFilenames.Checked = s.cb_advanced_filenames; if (s.DL_saved_settings.download_path != null) { folder_save.Text = s.DL_saved_settings.download_path; } else { folder_save.Text = Path.GetTempPath(); } TTadvanced_file_renaming = MainUI.get_ToolTip(cb_advancedFilenames, l10n[22]); cb_bs_autoedit.Checked = s.cb_autoedit_bs; }
public TDFPiwik(string allowed_title, string allowed_txt) { aSet = new access_settings(); Set = aSet.open_settings(); if (Set.Piwik.trackingID == null) { // Create new user ID string stemp = Environment.UserName + DateTime.Now.ToString(); MD5 algo = MD5.Create(); Set.Piwik.trackingID = BitConverter.ToString(algo.ComputeHash(Encoding.ASCII.GetBytes(stemp))).Replace("-", "").ToLower().Remove(16); } // Check whether GAnalytic tracking is allowed sallowed_title = allowed_title; sallowed_txt = allowed_txt.Replace("%trackingID", Set.Piwik.trackingID).Replace("nl", Environment.NewLine); if (!Set.Piwik.manually_set) { Set.Piwik.tracking_allowed = Tracking_allowed(); Set.Piwik.manually_set = true; } aSet.save_settings(Set); bw = new BackgroundWorker(); bw.DoWork += new DoWorkEventHandler(submit_piwik); bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(todo); }
public MainUI() { //l10n import string[] rtl = new string[] { "He" }; SETTINGS settings = new SETTINGS(); try { settings = set.open_settings(); string lang = settings.l10n; if (lang != null) { Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang, false); } else { int i = 0; try { while (true) { if (Thread.CurrentThread.CurrentUICulture.DisplayName.Contains(langAvailable[i])) { break; } i++; } } catch (Exception) { i = 0; } lang = langAvailable[i]; settings.l10n = lang; set.save_settings(settings); } piwik = new TDFPiwik(getstring("ga_allowed_title"), getstring("ga_allowed_text")); piwik.sendStartupStats(lang); if (rtl.Contains(lang)) { rtl_layout = true; } } catch (Exception ex) { MessageBox.Show(ex.Message); } if (rtl_layout) { RightToLeft = System.Windows.Forms.RightToLeft.Yes; } InitializeComponent(); initialDir = settings.FilesFolders.OpenFileStoredDir; if (initialDir == null) { initialDir = new string[3]; } for (int i = 0; i < initialDir.Length; i++) { if (initialDir[i] == null) { initialDir[i] = Path.GetTempPath(); } } downloader = new Downloader(settings, set.program_version(), progressBar, this, percent, start_dl, choose_lang); choose_lang.Items.AddRange(alllang); }