Exemplo n.º 1
0
        public manually_add_installation(string[] l10n, bool rtl)
        {
            TDFPiwik ga = new TDFPiwik("", "");

            ga.sendFeatreUseageStats(TDFPiwik.Features.OpenDialogManuallyAddInstallation);
            if (rtl)
            {
                RightToLeft = System.Windows.Forms.RightToLeft.Yes;
            }
            InitializeComponent();
            this.l10n = l10n;
        }
Exemplo n.º 2
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);
        }