Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            new SiteManager().ShowDialog();
            String selname = "";

            if (project_combo.SelectedIndex != -1)
            {
                if (!project_combo.Items[project_combo.SelectedIndex].Equals(""))
                {
                    selname = project_combo.Items[project_combo.SelectedIndex].ToString();
                }
            }

            SiteManagerClass.LoadFromSettings();
            project_combo.Items.Clear();
            foreach (DictionaryEntry dd in SiteManagerClass.table)
            {
                project_combo.Items.Add(dd.Key);
            }

            project_combo.Sorted = true;
            if (!selname.Equals(""))
            {
                int pos = 0;
                foreach (String s in project_combo.Items)
                {
                    if (s.Equals(selname))
                    {
                        project_combo.SelectedIndex = pos; break;
                    }
                    pos++;
                }
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            List <String> tmp = new List <String>();

            for (int row = 0; row < dataGridView1.Rows.Count; row++)
            {
                try
                {
                    tmp.Add(dataGridView1.Rows[row].Cells[1].Value.ToString());
                }
                catch { }
            }

            List <string> vals = new List <string>();

            foreach (string s in tmp)
            {
                if (vals.Contains(s))
                {
                    MessageBox.Show(T("There must be no duplicated names!"));     //Названия не должны повторяться!
                    return;
                }
                vals.Add(s);
            }



            SiteManagerClass.LoadFromGrid(dataGridView1);
            SiteManagerClass.SaveToSettings();
            this.Close();
        }
Exemplo n.º 3
0
        private void Auth_Load(object sender, EventArgs e)
        {
            version_label.Text = Version.GetName() + " " + Version.GetVersion();
            version_label.Left = this.Width / 2 - version_label.Width / 2 - 15;
            save_pass.Checked  = Options.GetOptionInt("save_pass") == 1 ? true : false;

            SetIfSaved();

            l_list = i18n.GetLanguages();
            langbox.Items.Clear();
            string qq = Options.GetOption("language"); int i = 0;

            foreach (Language l in l_list)
            {
                langbox.Items.Add(l.med_name);
                if (l.short_name == qq)
                {
                    i = langbox.Items.Count - 1;
                }
            }

            i18n.LoadLanguage(Options.GetOption("language"));
            UpdateLanguage();
            langbox.SelectedIndex = i;

            SiteManagerClass.LoadFromSettings();
            foreach (DictionaryEntry dd in SiteManagerClass.table)
            {
                project_combo.Items.Add(dd.Key);
            }

            project_combo.Sorted = true;

            int    pos  = 0;
            string last = Options.GetOption("wiki");

            foreach (String s in project_combo.Items)
            {
                if (s.Equals(last))
                {
                    project_combo.SelectedIndex = pos; break;
                }
                pos++;
            }
            langbox.SelectedItem = i;
        }
Exemplo n.º 4
0
        public void SaveSettings()
        {
            Options.SetOption("skip_null", skip_null.Checked ? 1 : 0);
            Options.SetOption("check_updates", check_updates.Checked ? 1 : 0);

            Options.SetOption("check_links", check_links.Checked ? 1 : 0);


            Options.SetOption("buff1", buff1.Text);
            Options.SetOption("buff2", buff2.Text);
            Options.SetOption("buff3", buff3.Text);

            Options.SetOption("recent_count", recent_count.Text);

            if (applyonlytotheproject1.Checked)
            {
                SiteManagerClass.review_summaries[SiteManagerClass.current] = rw_comm.Text;
            }
            else
            {
                Options.SetOption("rw_comm", rw_comm.Text);
                SiteManagerClass.review_summaries[SiteManagerClass.current] = "";
            }

            if (applyonlytotheproject2.Checked)
            {
                SiteManagerClass.rollback_summaries[SiteManagerClass.current] = rj_comm.Text;
            }
            else
            {
                Options.SetOption("rj_comm", rj_comm.Text);
                SiteManagerClass.rollback_summaries[SiteManagerClass.current] = "";
            }

            SiteManagerClass.SaveToSettings();

            Options.SetOption("pd_wait", pd_wait.Text);
            Options.SetOption("diff_style", diff_style.SelectedIndex == 0 ? "" : "_old");
            Options.SetOption("scroll_diff", auto_scroll.Checked ? 1 : 0);

            Options.SaveOptions();
        }
Exemplo n.º 5
0
 private void SiteManager_Load(object sender, EventArgs e)
 {
     SiteManagerClass.LoadFromSettings();
     SiteManagerClass.LoadToGrid(dataGridView1);
 }