Esempio n. 1
0
        private void sts_IsOpenChanged(object sender, EventArgs e)
        {
            if (sts.IsOpen == false)
            {
                // Redraw?
                Boolean redraw = false;
                if (cqIDX == 1)
                {
                    if (sts.pg2.settings2_3_booknamefont.SelectedItem.ToString().CompareTo(stsObj.bookNameFont) != 0 || sts.pg2.settings2_3_authornamefont.SelectedItem.ToString().CompareTo(stsObj.authorNameFont) != 0 || sts.pg1.settings1_3_vertical.Value != stsObj.verticalText)
                    {
                        if (!isPicCover)
                        {
                            redraw = true;
                        }
                    }
                }

                // Save settigngs
                try
                {
                    stsObj.loadFromSettings(sts);
                    stsObj.writeToIni();
                }
                catch
                {
                    MessageBoxEx.Show(this, LANG.getString("event_setting_load_error"));
                    stsObj = null;
                    stsObj = new SettingsObject(settingsPath);
                    stsObj.writeToSettings(sts);
                    redraw = false;
                    reCovers = false;
                }

                // Redraw cover if necessary
                if (redraw)
                {
                    generateTempCovers();
                    pg2.cover_picturebox.Image = covers[0];
                    reCovers = false;
                }
            }
            else
            {
                stsObj.writeToSettings(sts);
                stsObj.writeToIni();
            }
        }
Esempio n. 2
0
 private void sts_pg4_settings4_3_reset_button_Click(object sender, EventArgs e)
 {
     DialogResult dialogResult = MessageBoxEx.Show(this,
         LANG.getString("event_setting_reset"),
         LANG.getString("event_setting_reset_title"),
         MessageBoxButtons.YesNo);
     if (dialogResult == DialogResult.Yes)
     {
         stsObj = null;
         stsObj = new SettingsObject(settingsPath);
         stsObj.writeToSettings(sts);
     }
 }
Esempio n. 3
0
            private void MainForm_Load(object sender, EventArgs e)
            {
            #region Set Subpages
            Extract(resourcesPath, "Resources", "About.png");
            setSubPages(true);
            #endregion

            #region Settings Preparation
            stsObj = new SettingsObject(settingsPath);

            // Create SettingsObject and load settings to form
            if (!File.Exists(stsObj.iniPath))
            {
                stsObj.writeToIni();
            }
            else
            {
                try
                {
                    stsObj.loadFromIni();
                }
                catch
                {
                    MessageBoxEx.Show(this, LANG.getString("event_setting_load_error"));
                    stsObj = null;
                    stsObj = new SettingsObject(settingsPath);
                    stsObj.writeToIni();
                }
            }
            stsObj.language = LANG.Lang;
            stsObj.writeToSettings(sts);

            if (sts.pg4.settings4_4_chkupd.Value)
                updater.DoUpdate(true);

            #endregion

            // Set UI Font according to language
            LANG.setFont(this.Controls);
            CaptionFont = new Font(LANG.getFont(), CaptionFont.Size, CaptionFont.Style);
            Font = new Font(LANG.getFont(), Font.Size, Font.Style);
            }