Module: wine Branch: master Commit: cbf7a1e86eb7dceae3295ebe7b62f70eff4672e7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=cbf7a1e86eb7dceae3295ebe7b...
Author: Hans Leidekker hans@codeweavers.com Date: Fri Dec 24 15:31:02 2010 +0100
msi: Set the Preselected property if the default feature selection is modified in a dialog.
---
dlls/msi/events.c | 62 +++++++++++++++++++++++----------------------------- 1 files changed, 27 insertions(+), 35 deletions(-)
diff --git a/dlls/msi/events.c b/dlls/msi/events.c index 96fc677..b888c1c 100644 --- a/dlls/msi/events.c +++ b/dlls/msi/events.c @@ -163,58 +163,50 @@ static UINT ControlEvent_DoAction(MSIPACKAGE* package, LPCWSTR argument, return ERROR_SUCCESS; }
-static UINT ControlEvent_AddLocal(MSIPACKAGE* package, LPCWSTR argument, - msi_dialog* dialog) +static UINT ControlEvent_AddLocal( MSIPACKAGE *package, LPCWSTR argument, msi_dialog *dialog ) { - MSIFEATURE *feature = NULL; + MSIFEATURE *feature;
- if (strcmpW( szAll, argument )) + LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) { - MSI_SetFeatureStateW(package,argument,INSTALLSTATE_LOCAL); - } - else - { - LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) - msi_feature_set_state(package, feature, INSTALLSTATE_LOCAL); - - ACTION_UpdateComponentStates(package,argument); + if (!strcmpW( argument, feature->Feature ) || !strcmpW( argument, szAll )) + { + if (feature->ActionRequest != INSTALLSTATE_LOCAL) + msi_set_property( package->db, szPreselected, szOne ); + MSI_SetFeatureStateW( package, feature->Feature, INSTALLSTATE_LOCAL ); + } } return ERROR_SUCCESS; }
-static UINT ControlEvent_Remove(MSIPACKAGE* package, LPCWSTR argument, - msi_dialog* dialog) +static UINT ControlEvent_Remove( MSIPACKAGE *package, LPCWSTR argument, msi_dialog *dialog ) { - MSIFEATURE *feature = NULL; + MSIFEATURE *feature;
- if (strcmpW( szAll, argument )) - { - MSI_SetFeatureStateW(package,argument,INSTALLSTATE_ABSENT); - } - else + LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) { - LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) - msi_feature_set_state(package, feature, INSTALLSTATE_ABSENT); - - ACTION_UpdateComponentStates(package,argument); + if (!strcmpW( argument, feature->Feature ) || !strcmpW( argument, szAll )) + { + if (feature->ActionRequest != INSTALLSTATE_ABSENT) + msi_set_property( package->db, szPreselected, szOne ); + MSI_SetFeatureStateW( package, feature->Feature, INSTALLSTATE_ABSENT ); + } } return ERROR_SUCCESS; }
-static UINT ControlEvent_AddSource(MSIPACKAGE* package, LPCWSTR argument, - msi_dialog* dialog) +static UINT ControlEvent_AddSource( MSIPACKAGE *package, LPCWSTR argument, msi_dialog *dialog ) { - MSIFEATURE *feature = NULL; + MSIFEATURE *feature;
- if (strcmpW( szAll, argument )) + LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) { - MSI_SetFeatureStateW(package,argument,INSTALLSTATE_SOURCE); - } - else - { - LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) - msi_feature_set_state(package, feature, INSTALLSTATE_SOURCE); - ACTION_UpdateComponentStates(package,argument); + if (!strcmpW( argument, feature->Feature ) || !strcmpW( argument, szAll )) + { + if (feature->ActionRequest != INSTALLSTATE_SOURCE) + msi_set_property( package->db, szPreselected, szOne ); + MSI_SetFeatureStateW( package, feature->Feature, INSTALLSTATE_SOURCE ); + } } return ERROR_SUCCESS; }