Exemple #1
0
        private void ga_tracking_CheckedChanged(object sender, EventArgs e)
        {
            SETTINGS settings = set.open_settings();

            settings.Piwik.tracking_allowed = ga_tracking.Checked;
            set.save_settings(settings);
        }
Exemple #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            //Manually add installation
            manually_add_installation fm = new manually_add_installation(l10n_mai, RTL);

            fm.ShowDialog();
            if (fm.shared_string != null)
            {
                SETTINGS temp = set.open_settings();
                temp.manager_versions = set.update_manager_array(temp.manager_versions, fm.shared_string);
                set.save_settings(temp);
                update_selector();
            }
        }
Exemple #3
0
 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);
 }
Exemple #4
0
        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);
        }