Module: wine Branch: master Commit: a1b16d2d96c7d7e29bf9fd7dfccd45436242ea5e URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=a1b16d2d96c7d7e29bf9fd7d...
Author: James Hawkins truiken@gmail.com Date: Fri Aug 25 14:22:16 2006 -0700
msi: Add initial implementation of the DirectoryListUp event.
---
dlls/msi/dialog.c | 30 ++++++++++++++++++++++++++++++ dlls/msi/events.c | 7 +++++++ dlls/msi/msipriv.h | 1 + 3 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index 13c3a6b..96c8d07 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -1995,9 +1995,35 @@ static UINT msi_dialog_directory_combo(
/******************** Directory List ***************************************/
+UINT msi_dialog_directorylist_up( msi_dialog *dialog ) +{ + msi_control *control; + LPWSTR prop, path, ptr; + BOOL indirect; + + control = msi_dialog_find_control( dialog, szDirectoryList ); + indirect = control->attributes & msidbControlAttributesIndirect; + prop = msi_dialog_dup_property( dialog, control->property, indirect ); + + path = msi_dup_property( dialog->package, prop ); + + /* strip off the last directory */ + ptr = PathFindFileNameW( path ); + if (ptr != path) *(ptr - 1) = '\0'; + PathAddBackslashW( path ); + + MSI_SetPropertyW( dialog->package, prop, path ); + + msi_free( path ); + msi_free( prop ); + + return ERROR_SUCCESS; +} + static UINT msi_dialog_directory_list( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; + LPCWSTR prop; DWORD style;
style = LVS_LIST | LVS_EDITLABELS | WS_VSCROLL | LVS_SHAREIMAGELISTS | @@ -2007,6 +2033,10 @@ static UINT msi_dialog_directory_list( m if (!control) return ERROR_FUNCTION_FAILED;
+ control->attributes = MSI_RecordGetInteger( rec, 8 ); + prop = MSI_RecordGetString( rec, 9 ); + control->property = msi_dialog_dup_property( dialog, prop, FALSE ); + return ERROR_SUCCESS; }
diff --git a/dlls/msi/events.c b/dlls/msi/events.c index 4d1525a..72e5217 100644 --- a/dlls/msi/events.c +++ b/dlls/msi/events.c @@ -379,6 +379,12 @@ static UINT ControlEvent_SetInstallLevel return MSI_SetInstallLevel( package, iInstallLevel ); }
+static UINT ControlEvent_DirectoryListUp(MSIPACKAGE *package, LPCWSTR argument, + msi_dialog *dialog) +{ + return msi_dialog_directorylist_up( dialog ); +} + static const struct _events Events[] = { { "EndDialog",ControlEvent_EndDialog }, { "NewDialog",ControlEvent_NewDialog }, @@ -391,6 +397,7 @@ static const struct _events Events[] = { { "SetTargetPath",ControlEvent_SetTargetPath }, { "Reset",ControlEvent_Reset }, { "SetInstallLevel",ControlEvent_SetInstallLevel }, + { "DirectoryListUp",ControlEvent_DirectoryListUp }, { NULL,NULL }, };
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 7c85f1c..1c5a894 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -454,6 +454,7 @@ extern BOOL msi_dialog_register_class( v extern void msi_dialog_unregister_class( void ); extern void msi_dialog_handle_event( msi_dialog*, LPCWSTR, LPCWSTR, MSIRECORD * ); extern UINT msi_dialog_reset( msi_dialog *dialog ); +extern UINT msi_dialog_directorylist_up( msi_dialog *dialog );
/* preview */ extern MSIPREVIEW *MSI_EnableUIPreview( MSIDATABASE * );