620 passedSignals add:confirmationQuerySignal. |
620 passedSignals add:confirmationQuerySignal. |
621 |
621 |
622 outerContext := thisContext. |
622 outerContext := thisContext. |
623 |
623 |
624 handledSignals handle:[:ex | |
624 handledSignals handle:[:ex | |
625 |sig action what sender msg param oldPackage newPackage proceedValue |
625 |sig action what sender msg param oldPackage newPackage proceedValue |
626 canContinueForAll| |
626 canContinueForAll| |
627 |
627 |
628 sig := ex signal. |
628 sig := ex signal. |
629 "/sig == packageQuerySignal ifTrue:[ |
629 "/sig == packageQuerySignal ifTrue:[ |
630 "/self halt. |
630 "/self halt. |
631 "/]. |
631 "/]. |
632 (passedSignals includes:sig) ifTrue:[ |
632 (passedSignals includes:sig) ifTrue:[ |
633 (sig isHandledIn:outerContext) ifTrue:[ |
633 (sig isHandledIn:outerContext) ifTrue:[ |
634 ex reject |
634 ex reject |
635 ] |
635 ] |
636 ]. |
636 ]. |
637 |
637 |
638 sig == changeDefaultApplicationNotificationSignal ifTrue:[ |
638 sig == changeDefaultApplicationNotificationSignal ifTrue:[ |
639 "/ invoked via #becomeDefault to set the defaultApp and the package. |
639 "/ invoked via #becomeDefault to set the defaultApp and the package. |
640 "/ (only when filing in V'Age code) |
640 "/ (only when filing in V'Age code) |
641 defaultApplication := ex parameter. |
641 defaultApplication := ex parameter. |
642 pkg := defaultApplication name asSymbol. |
642 pkg := defaultApplication name asSymbol. |
643 ex proceedWith:nil |
643 ex proceedWith:nil |
644 ]. |
644 ]. |
645 sig == defaultApplicationQuerySignal ifTrue:[ |
645 sig == defaultApplicationQuerySignal ifTrue:[ |
646 "/ query for the application to add classes & methods into |
646 "/ query for the application to add classes & methods into |
647 "/ (only when filing in V'Age code) |
647 "/ (only when filing in V'Age code) |
648 ex proceedWith:defaultApplication |
648 ex proceedWith:defaultApplication |
649 ]. |
649 ]. |
650 sig == packageQuerySignal ifTrue:[ |
650 sig == packageQuerySignal ifTrue:[ |
651 "/ query for the package to use for classes & methods |
651 "/ query for the package to use for classes & methods |
652 askSomeoneForPackage ifTrue:[ |
652 askSomeoneForPackage ifTrue:[ |
653 ex proceedWith:someone packageToInstall |
653 ex proceedWith:someone packageToInstall |
654 ] ifFalse:[ |
654 ] ifFalse:[ |
655 ex proceedWith:pkg |
655 ex proceedWith:pkg |
656 ] |
656 ] |
657 ]. |
657 ]. |
658 sig == usedNameSpaceQuerySignal ifTrue:[ |
658 sig == usedNameSpaceQuerySignal ifTrue:[ |
659 "/ query for the namespaces searched when encountering globals |
659 "/ query for the namespaces searched when encountering globals |
660 ex proceedWith:spaces |
660 ex proceedWith:spaces |
661 ]. |
661 ]. |
662 sig == nameSpaceQuerySignal ifTrue:[ |
662 sig == nameSpaceQuerySignal ifTrue:[ |
663 "/ query for the namespace to install new classes in |
663 "/ query for the namespace to install new classes in |
664 ex proceedWith:spc |
664 ex proceedWith:spc |
665 ]. |
665 ]. |
666 sig == confirmationQuerySignal ifTrue:[ |
666 sig == confirmationQuerySignal ifTrue:[ |
667 ex proceedWith:false "/ no dialogs popping up |
667 ex proceedWith:false "/ no dialogs popping up |
668 ]. |
668 ]. |
669 |
669 |
670 sig == Stream endOfStreamSignal ifTrue:[ |
670 sig == Stream endOfStreamSignal ifTrue:[ |
671 ex reject |
671 ex reject |
672 ]. |
672 ]. |
673 |
673 |
674 sig == Signal noHandlerSignal ifTrue:[ |
674 sig == Signal noHandlerSignal ifTrue:[ |
675 ex parameter rejected ifTrue:[ |
675 ex parameter rejected ifTrue:[ |
676 ex reject |
676 ex reject |
677 ]. |
677 ]. |
678 ]. |
678 ]. |
679 |
679 |
680 (dontAskSignals notNil and:[dontAskSignals includesKey:sig]) ifTrue:[ |
680 (dontAskSignals notNil and:[dontAskSignals includesKey:sig]) ifTrue:[ |
681 ex proceedWith:(dontAskSignals at:sig) |
681 ex proceedWith:(dontAskSignals at:sig) |
682 ]. |
682 ]. |
683 |
683 |
684 canContinueForAll := false. |
684 canContinueForAll := false. |
685 redef := false. |
685 redef := false. |
686 |
686 |
687 "/ for your convenience ... |
687 "/ for your convenience ... |
688 (sig == Class methodRedefinitionSignal) ifTrue:[ |
688 (sig == Class methodRedefinitionSignal) ifTrue:[ |
689 param := ex parameter. "/ an association: oldMethod -> newMethod |
689 param := ex parameter. "/ an association: oldMethod -> newMethod |
690 oldPackage := param key package. |
690 oldPackage := param key package. |
691 newPackage := param value package. |
691 newPackage := param value package. |
692 msg := 'trying to overwrite method:\\ ' , param key whoString , '\\in package ''' |
692 msg := 'trying to overwrite method:\\ ' , param key whoString , '\\in package ''' |
693 , oldPackage , ''' with method from package ''' , newPackage , ''''. |
693 , oldPackage , ''' with method from package ''' , newPackage , ''''. |
694 canContinueForAll := true. |
694 canContinueForAll := true. |
695 ] ifFalse:[ |
695 ] ifFalse:[ |
696 (sig == Class classRedefinitionSignal) ifTrue:[ |
696 (sig == Class classRedefinitionSignal) ifTrue:[ |
697 param := ex parameter. "/ an association: oldClass -> newClass |
697 param := ex parameter. "/ an association: oldClass -> newClass |
698 |
698 |
699 oldPackage := param key package. |
699 oldPackage := param key package. |
700 newPackage := param value package. |
700 newPackage := param value package. |
701 msg := 'trying to redefine class: ' , param key name allBold , '\\in package ''' |
701 msg := 'trying to redefine class: ' , param key name allBold , '\\in package ''' |
702 , oldPackage , ''' with new definition from package ''' , newPackage , ''''. |
702 , oldPackage , ''' with new definition from package ''' , newPackage , ''''. |
703 canContinueForAll := true. |
703 canContinueForAll := true. |
704 redef := true. |
704 redef := true. |
705 ] ifFalse:[ |
705 ] ifFalse:[ |
706 msg := 'error in fileIn: %1' |
706 msg := 'error in fileIn: %1' |
707 ] |
707 ] |
708 ]. |
708 ]. |
709 |
709 |
710 what := ex errorString. |
710 what := ex errorString. |
711 what isNil ifTrue:[ |
711 what isNil ifTrue:[ |
712 what := ex signal notifierString. |
712 what := ex signal notifierString. |
713 ]. |
713 ]. |
714 |
714 |
715 "/ handle the case where no GUI has been built in, |
715 "/ handle the case where no GUI has been built in, |
716 "/ just abort the fileIn with a notification |
716 "/ just abort the fileIn with a notification |
717 |
717 |
718 Display isNil ifTrue:[ |
718 Display isNil ifTrue:[ |
719 sender := ex suspendedContext sender. |
719 sender := ex suspendedContext sender. |
720 self notify:(what , |
720 self notify:(what , |
721 ' in ' , sender receiver class name , |
721 ' in ' , sender receiver class name , |
722 '>>>' , sender selector). |
722 '>>>' , sender selector). |
723 ex return |
723 ex return |
724 ]. |
724 ]. |
725 |
725 |
726 msg := msg bindWith:what. |
726 msg := msg bindWith:what. |
727 |
727 |
728 sig == HaltInterrupt ifTrue:[ |
728 sig == HaltInterrupt ifTrue:[ |
729 sender := ex suspendedContext. |
729 sender := ex suspendedContext. |
730 msg := msg , ('\\in ' , sender receiver class name , '>>>' , sender selector) withCRs |
730 msg := msg , ('\\in ' , sender receiver class name , '>>>' , sender selector) withCRs |
731 ]. |
731 ]. |
732 |
732 |
733 "/ otherwise ask what should be done now and either |
733 "/ otherwise ask what should be done now and either |
734 "/ continue or abort the fileIn |
734 "/ continue or abort the fileIn |
735 redef ifTrue:[ |
735 redef ifTrue:[ |
736 action := OptionBox |
736 action := OptionBox |
737 request:(msg withCRs) |
737 request:(msg withCRs) |
738 label:'Class redefinition in fileIn' |
738 label:'Class redefinition in fileIn' |
739 form:(WarningBox iconBitmap) |
739 form:(WarningBox iconBitmap) |
740 "/ cg: now always keep the old packageID |
740 "/ cg: now always keep the old packageID |
741 "/ buttonLabels:#('cancel' 'skip' 'debug' 'keep' 'keep all' 'continue' 'continue all') |
741 "/ buttonLabels:#('cancel' 'skip' 'debug' 'keep' 'keep all' 'continue' 'continue all') |
742 "/ values:#(#abort #skip #debug #keep #keepAll #continue #continueForAll) |
742 "/ values:#(#abort #skip #debug #keep #keepAll #continue #continueForAll) |
743 buttonLabels:#('Cancel' 'Skip' 'Debug' 'Continue' 'Continue All') |
743 buttonLabels:#('Cancel' 'Skip' 'Debug' 'Continue' 'Continue All') |
744 values:#(#abort #skip #debug #keep #keepAll) |
744 values:#(#abort #skip #debug #keep #keepAll) |
745 default:#continue |
745 default:#continue |
746 onCancel:#abort. |
746 onCancel:#abort. |
747 ] ifFalse:[ |
747 ] ifFalse:[ |
748 action := self askForDebug:msg withCRs canContinueForAll:canContinueForAll. |
748 action := self askForDebug:msg withCRs canContinueForAll:canContinueForAll. |
749 ]. |
749 ]. |
750 action == #continueForAll ifTrue:[ |
750 action == #continueForAll ifTrue:[ |
751 dontAskSignals isNil ifTrue:[ |
751 dontAskSignals isNil ifTrue:[ |
752 dontAskSignals := IdentityDictionary new. |
752 dontAskSignals := IdentityDictionary new. |
753 ]. |
753 ]. |
754 dontAskSignals at:sig put:#continue. |
754 dontAskSignals at:sig put:#continue. |
755 action := proceedValue := #continue. |
755 action := proceedValue := #continue. |
756 ] ifFalse:[ |
756 ] ifFalse:[ |
757 action == #keepForAll ifTrue:[ |
757 action == #keepForAll ifTrue:[ |
758 dontAskSignals isNil ifTrue:[ |
758 dontAskSignals isNil ifTrue:[ |
759 dontAskSignals := IdentityDictionary new. |
759 dontAskSignals := IdentityDictionary new. |
760 ]. |
760 ]. |
761 dontAskSignals at:sig put:#keep. |
761 dontAskSignals at:sig put:#keep. |
762 action := #continue. |
762 action := #continue. |
763 proceedValue := #keep. |
763 proceedValue := #keep. |
764 ] ifFalse:[ |
764 ] ifFalse:[ |
765 action == #keep ifTrue:[ |
765 action == #keep ifTrue:[ |
766 action := #continue. |
766 action := #continue. |
767 proceedValue := #keep. |
767 proceedValue := #keep. |
768 ]. |
768 ]. |
769 ]. |
769 ]. |
770 ]. |
770 ]. |
771 |
771 |
772 action == #continue ifTrue:[ |
772 action == #continue ifTrue:[ |
773 ex proceedWith:(proceedValue ? #continue) |
773 ex proceedWith:(proceedValue ? #continue) |
774 ]. |
774 ]. |
775 action == #abort ifTrue:[ |
775 action == #abort ifTrue:[ |
776 AbortSignal raise. |
776 AbortSignal raise. |
777 ex return |
777 ex return |
778 ]. |
778 ]. |
779 action == #cancelAll ifTrue:[ |
779 action == #cancelAll ifTrue:[ |
780 AbortAllSignal raise. |
780 AbortAllSignal raise. |
781 ex return |
781 ex return |
782 ]. |
782 ]. |
783 action == #skip ifTrue:[ |
783 action == #skip ifTrue:[ |
784 ex proceedWith:nil |
784 ex proceedWith:nil |
785 ]. |
785 ]. |
786 action == #debug ifTrue:[ |
786 action == #debug ifTrue:[ |
787 Debugger enter:ex suspendedContext |
787 Debugger enter:ex suspendedContext |
788 withMessage:ex errorString |
788 withMessage:ex errorString |
789 mayProceed:true. |
789 mayProceed:true. |
790 ex proceedWith:proceedValue |
790 ex proceedWith:proceedValue |
791 ]. |
791 ]. |
792 |
792 |
793 "/ (ex signal) enterDebuggerWith:ex message:what. |
793 "/ (ex signal) enterDebuggerWith:ex message:what. |
794 ex reject |
794 ex reject |
795 ] do:[ |
795 ] do:[ |
796 [self atEnd] whileFalse:[ |
796 [self atEnd] whileFalse:[ |
797 lastValue := self fileInNextChunkNotifying:someone passChunk:passChunk |
797 lastValue := self fileInNextChunkNotifying:someone passChunk:passChunk |
798 ] |
798 ] |
799 ]. |
799 ]. |
800 ^ lastValue |
800 ^ lastValue |
801 |
801 |
802 "Modified: / 10.9.1999 / 16:54:01 / stefan" |
802 "Modified: / 10.9.1999 / 16:54:01 / stefan" |
803 "Modified: / 16.11.2001 / 16:21:28 / cg" |
803 "Modified: / 16.11.2001 / 16:21:28 / cg" |