Exemplo n.º 1
0
        private void okButton_Click(object sender, EventArgs e)
        {
            s_lastPage = tabControl.SelectedIndex;

            foreach (var page in m_Pages)
            {
                page.OnConfirm();
            }

            if (otherDirButton.Checked)
            {
                if (String.IsNullOrEmpty(otherDirLabel.Text))
                {
                    MessageBox.Show(this, StringResources.NeedDirectory, "Ares", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    DialogResult = DialogResult.None;
                    return;
                }
                m_BasicSettings.UserSettingsLocation = BasicSettings.SettingsLocation.Custom;
            }
            else if (appDirButton.Checked && BasicSettings.IsAppDirAllowed())
            {
                m_BasicSettings.UserSettingsLocation = BasicSettings.SettingsLocation.AppDir;
            }
            else
            {
                m_BasicSettings.UserSettingsLocation = BasicSettings.SettingsLocation.AppDataDir;
            }
            m_Settings.MusicDirectory = musicDirLabel.Text;
            m_Settings.SoundDirectory = soundDirLabel.Text;
            m_Settings.CheckForUpdate = updateCheckBox.Checked;
            m_BasicSettings.CustomSettingsDirectory = otherDirLabel.Text;
            m_Settings.Commit();
        }
Exemplo n.º 2
0
 public SettingsDialog(Ares.Settings.Settings settings, BasicSettings basicSettings)
 {
     InitializeComponent();
     musicDirLabel.Text = settings.MusicDirectory;
     soundDirLabel.Text = settings.SoundDirectory;
     if (basicSettings.UserSettingsLocation == BasicSettings.SettingsLocation.Custom)
     {
         otherDirButton.Checked = true;
     }
     else if (basicSettings.UserSettingsLocation == BasicSettings.SettingsLocation.AppDir && BasicSettings.IsAppDirAllowed())
     {
         appDirButton.Checked = true;
     }
     else
     {
         userDirButton.Checked = true;
     }
     otherDirLabel.Text = basicSettings.CustomSettingsDirectory;
     userDirLabel.Text = basicSettings.GetSettingsDir(BasicSettings.SettingsLocation.AppDataDir);
     appDirLabel.Text = basicSettings.GetSettingsDir(BasicSettings.SettingsLocation.AppDir);
     appDirButton.Enabled = BasicSettings.IsAppDirAllowed();
     updateCheckBox.Checked = settings.CheckForUpdate;
     m_Settings = settings;
     m_BasicSettings = basicSettings;
 }