16664 |
16662 |
16665 |trueForSave dialogTitle defaultBaseName defaultDirectory owningViewId windowGroup filterString filterArrayOrPairs |
16663 |trueForSave dialogTitle defaultBaseName defaultDirectory owningViewId windowGroup filterString filterArrayOrPairs |
16666 null filterStringParts |
16664 null filterStringParts |
16667 nativeFileDialogCreationData returnValue |
16665 nativeFileDialogCreationData returnValue |
16668 nativeFileDialogReturnData targetFileOrDirectory multiSelectBaseNames selectedSuffixInfo selectedSuffix |
16666 nativeFileDialogReturnData targetFileOrDirectory multiSelectBaseNames selectedSuffixInfo selectedSuffix |
16669 needsSlash checkForNativeFileDialogInitializeErrorBlock| |
16667 needsSlash dataAddress didPerformCroppedBaseNameHack delay| |
16670 |
16668 |
16671 trueForSave := trueForSaveArg ? false. |
16669 trueForSave := trueForSaveArg ? false. |
16672 |
16670 |
16673 dialogTitleArg notEmptyOrNil ifTrue:[ |
16671 dialogTitleArg notEmptyOrNil ifTrue:[ |
16674 dialogTitle := dialogTitleArg asUnicode16String. |
16672 dialogTitle := dialogTitleArg asUnicode16String. |
16736 filterIndex:filterIndexArg ? 1 |
16734 filterIndex:filterIndexArg ? 1 |
16737 trueForSave:trueForSave |
16735 trueForSave:trueForSave |
16738 trueForMultiSelect:trueForMultiSelect ? false |
16736 trueForMultiSelect:trueForMultiSelect ? false |
16739 trueForPromptOverwrite:trueForPromptOverwrite ? true. |
16737 trueForPromptOverwrite:trueForPromptOverwrite ? true. |
16740 |
16738 |
16741 checkForNativeFileDialogInitializeErrorBlock := |
16739 dataAddress := nativeFileDialogCreationData dataAddress. |
16742 [ |
16740 didPerformCroppedBaseNameHack := false. |
16743 NativeFileDialogInitializeError handle:[:ex | |
16741 |
16744 "set #returnValue to suppress the #ensure block, |
16742 [ |
16745 no need for close if this error occures, |
16743 delay := 100 milliseconds. |
16746 cleanups are done within #primCheckForErrorInFileDialogInitializeByCreationData" |
16744 |
16747 returnValue := ''. |
16745 (trueForSave not |
16748 ex reject. |
16746 and:[didPerformCroppedBaseNameHack not]) ifTrue:[ |
16749 ] do:[ |
16747 "hack for display bug (cropped default basename) |
16750 self primCheckForErrorInFileDialogInitializeByCreationData:nativeFileDialogCreationData. |
16748 https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/644328" |
|
16749 didPerformCroppedBaseNameHack := self primTryCroppedBaseNameHackByDataAddress:dataAddress. |
|
16750 didPerformCroppedBaseNameHack ifFalse:[ |
|
16751 delay := 10 milliseconds. |
16751 ]. |
16752 ]. |
16752 ]. |
16753 ]. |
16753 |
16754 |
16754 trueForSave ifFalse:[ |
|
16755 "hack for display bug (cropped default basename) |
|
16756 https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/644328" |
|
16757 [ |
|
16758 checkForNativeFileDialogInitializeErrorBlock value. "/ check to avoid freeze in this while loop |
|
16759 self primTryCroppedBaseNameHackByDataAddress:nativeFileDialogCreationData dataAddress |
|
16760 ] whileFalse:[ |
|
16761 "/ loop until the dialog has opened |
|
16762 Delay waitForMilliseconds:10. |
|
16763 ]. |
|
16764 ]. |
|
16765 |
|
16766 [ |
|
16767 windowGroup notNil ifTrue:[ |
16755 windowGroup notNil ifTrue:[ |
16768 windowGroup sensor eventSemaphore waitWithTimeout:100 milliseconds. |
16756 windowGroup sensor eventSemaphore waitWithTimeout:delay. |
16769 "sr: we can process all events (also redraws), |
16757 "sr: we can process all events (also redraws), |
16770 because the operating system handles the modal, |
16758 because the operating system handles the modal, |
16771 user events are blocked by operating system" |
16759 user events are blocked by operating system" |
16772 windowGroup processEvents. |
16760 windowGroup processEvents. |
16773 ] ifFalse:[ |
16761 ] ifFalse:[ |
16774 Delay waitForMilliseconds:100. |
16762 Delay waitFor:delay. |
16775 ]. |
16763 ]. |
16776 |
16764 |
16777 checkForNativeFileDialogInitializeErrorBlock value. "/ check to avoid freeze in this while loop |
16765 NativeFileDialogInitializeError handle:[:ex | |
|
16766 "set #returnValue to suppress the #ensure block, |
|
16767 no need for close if this error occures, |
|
16768 cleanups are done within #primCheckForErrorInFileDialogInitializeByCreationData" |
|
16769 returnValue := ''. |
|
16770 ex reject. |
|
16771 ] do:[ |
|
16772 self primCheckForErrorInFileDialogInitializeByCreationData:nativeFileDialogCreationData. |
|
16773 ]. |
|
16774 |
16778 returnValue := self primGetNativeFileDialogResultByCreationData:nativeFileDialogCreationData. |
16775 returnValue := self primGetNativeFileDialogResultByCreationData:nativeFileDialogCreationData. |
16779 ] doWhile:[ |
16776 ] doWhile:[ |
16780 returnValue isNil |
16777 returnValue isNil |
16781 ]. |
16778 ]. |
16782 ] ensure:[ |
16779 ] ensure:[ |