mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Selectively rebuild program list
This commit is contained in:
@@ -106,6 +106,7 @@
|
||||
- Add README files for two libraries
|
||||
- Simplify output name assembly logic
|
||||
- Fix output name null edge case
|
||||
- Selectively rebuild program list
|
||||
|
||||
### 3.2.4 (2024-11-24)
|
||||
|
||||
|
||||
@@ -574,7 +574,7 @@ namespace MPF.Frontend.ViewModels
|
||||
_processUserInfo = processUserInfo;
|
||||
|
||||
// Finish initializing the rest of the values
|
||||
InitializeUIValues(removeEventHandlers: false, rescanDrives: true);
|
||||
InitializeUIValues(removeEventHandlers: false, rebuildPrograms: true, rescanDrives: true);
|
||||
}
|
||||
|
||||
#region Property Updates
|
||||
@@ -977,7 +977,7 @@ namespace MPF.Frontend.ViewModels
|
||||
|
||||
// If settings were changed, reinitialize the UI
|
||||
if (savedSettings)
|
||||
InitializeUIValues(removeEventHandlers: true, rescanDrives: true);
|
||||
InitializeUIValues(removeEventHandlers: true, rebuildPrograms: true, rescanDrives: true);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -988,8 +988,9 @@ namespace MPF.Frontend.ViewModels
|
||||
/// Performs UI value setup end to end
|
||||
/// </summary>
|
||||
/// <param name="removeEventHandlers">Whether event handlers need to be removed first</param>
|
||||
/// <param name="rebuildPrograms">Whether the available program list should be rebuilt</param>
|
||||
/// <param name="rescanDrives">Whether drives should be rescanned or not</param>
|
||||
public void InitializeUIValues(bool removeEventHandlers, bool rescanDrives)
|
||||
public void InitializeUIValues(bool removeEventHandlers, bool rebuildPrograms, bool rescanDrives)
|
||||
{
|
||||
// Disable the dumping button
|
||||
StartStopButtonEnabled = false;
|
||||
@@ -1024,7 +1025,8 @@ namespace MPF.Frontend.ViewModels
|
||||
SetCurrentDiscType();
|
||||
|
||||
// Set the dumping program
|
||||
PopulateInternalPrograms();
|
||||
if (rebuildPrograms)
|
||||
PopulateInternalPrograms();
|
||||
|
||||
// Set the initial environment and UI values
|
||||
SetSupportedDriveSpeed();
|
||||
|
||||
@@ -518,7 +518,7 @@ namespace MPF.UI.Windows
|
||||
public void DriveLetterComboBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (MainViewModel.CanExecuteSelectionChanged)
|
||||
MainViewModel.InitializeUIValues(removeEventHandlers: true, rescanDrives: false);
|
||||
MainViewModel.InitializeUIValues(removeEventHandlers: true, rebuildPrograms: false, rescanDrives: false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -552,7 +552,7 @@ namespace MPF.UI.Windows
|
||||
/// Handler for MediaScanButton Click event
|
||||
/// </summary>
|
||||
public void MediaScanButtonClick(object sender, RoutedEventArgs e) =>
|
||||
MainViewModel.InitializeUIValues(removeEventHandlers: true, rescanDrives: true);
|
||||
MainViewModel.InitializeUIValues(removeEventHandlers: true, rebuildPrograms: false, rescanDrives: true);
|
||||
|
||||
/// <summary>
|
||||
/// Handler for MediaTypeComboBox SelectionChanged event
|
||||
@@ -606,7 +606,7 @@ namespace MPF.UI.Windows
|
||||
if (MainViewModel.Options.FastUpdateLabel)
|
||||
MainViewModel.FastUpdateLabel(removeEventHandlers: true);
|
||||
else
|
||||
MainViewModel.InitializeUIValues(removeEventHandlers: true, rescanDrives: false);
|
||||
MainViewModel.InitializeUIValues(removeEventHandlers: true, rebuildPrograms: false, rescanDrives: false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user