Changeset 570


Ignore:
Timestamp:
11/14/2008 2:31:30 PM (6 years ago)
Author:
lowjoel
Message:

Save the settings for those which don't fail first.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Eraser/SettingsPanel.cs

    r569 r570  
    320320        private void saveSettings_Click(object sender, EventArgs e) 
    321321        { 
    322             //Error checks first. 
     322            EraserSettings settings = new EraserSettings(); 
     323            ManagerSettings managerSettings = ManagerLibrary.Instance.Settings; 
     324 
     325            //Save the settings that don't fail first. 
     326            managerSettings.EraseLockedFilesOnRestart = lockedAllow.Checked; 
     327            managerSettings.ConfirmEraseOnRestart = lockedConfirm.Checked; 
     328            managerSettings.ExecuteMissedTasksImmediately = schedulerMissedImmediate.Checked; 
     329 
     330            List<Guid> approvedPlugins = managerSettings.ApprovedPlugins; 
     331            foreach (ListViewItem item in pluginsManager.Items) 
     332            { 
     333                PluginInstance plugin = (PluginInstance)item.Tag; 
     334                if (item.Checked) 
     335                { 
     336                    if (approvedPlugins.IndexOf(plugin.AssemblyInfo.GUID) == -1) 
     337                        approvedPlugins.Add(plugin.AssemblyInfo.GUID); 
     338                } 
     339                else 
     340                    approvedPlugins.Remove(plugin.AssemblyInfo.GUID); 
     341            } 
     342            managerSettings.ApprovedPlugins = approvedPlugins; 
     343 
     344            //Error checks for the rest that do. 
    323345            errorProvider.Clear(); 
    324346            if (uiLanguage.SelectedIndex == -1) 
     
    353375            } 
    354376 
    355             EraserSettings settings = new EraserSettings(); 
    356             ManagerSettings managerSettings = ManagerLibrary.Instance.Settings; 
    357377            if (((Language)uiLanguage.SelectedItem).Name != settings.Language) 
    358378            { 
     
    374394                managerSettings.ActivePRNG = newPRNG.GUID; 
    375395            } 
    376             managerSettings.EraseLockedFilesOnRestart = lockedAllow.Checked; 
    377             managerSettings.ConfirmEraseOnRestart = lockedConfirm.Checked; 
    378  
     396             
    379397            managerSettings.PlausibleDeniability = plausibleDeniability.Checked; 
    380398            List<string> plausibleDeniabilityFilesList = new List<string>(); 
     
    382400                plausibleDeniabilityFilesList.Add(str); 
    383401            managerSettings.PlausibleDeniabilityFiles = plausibleDeniabilityFilesList; 
    384  
    385             managerSettings.ExecuteMissedTasksImmediately = schedulerMissedImmediate.Checked; 
    386  
    387             foreach (ListViewItem item in pluginsManager.Items) 
    388             { 
    389                 PluginInstance plugin = (PluginInstance)item.Tag; 
    390                 if (item.Checked) 
    391                 { 
    392                     if (managerSettings.ApprovedPlugins.IndexOf(plugin.AssemblyInfo.GUID) == -1) 
    393                         managerSettings.ApprovedPlugins.Add(plugin.AssemblyInfo.GUID); 
    394                 } 
    395                 else 
    396                     managerSettings.ApprovedPlugins.Remove(plugin.AssemblyInfo.GUID); 
    397             } 
    398402        } 
    399403    } 
Note: See TracChangeset for help on using the changeset viewer.