1623 |
1623 |
1624 WindowTreeView openOnAll |
1624 WindowTreeView openOnAll |
1625 |
1625 |
1626 ! |
1626 ! |
1627 |
1627 |
1628 nOnAll |
1628 viewDestroy |
1629 |
1629 "let user pick a view and destroy it. |
1630 ! |
1630 Even allow destroying non-smalltalk views |
1631 |
1631 (also for views which I forgot due to some error)" |
1632 ]. |
1632 |
1633 |
1633 |device v id i c| |
1634 |
1634 |
1635 ! |
1635 (Delay forSeconds:1) wait. |
1636 |
1636 |
1637 alse:1) |
1637 device := Screen current. |
1638 ! |
1638 i := Image fromFile:'bitmaps/xpmBitmaps/cursors/cross2.xpm'. |
1639 |
1639 i isNil ifTrue:[ |
1640 ] |
1640 c := Cursor crossHair |
1641 |
1641 ] ifFalse:[ |
1642 ! ! |
1642 c := Cursor fromImage:i |
1643 |
1643 ]. |
1644 !AbstractLauncherApplication::KbdMappingSettingsAppl class methodsFor:'interface specs'! |
1644 id := device viewIdFromPoint:(device pointFromUserShowing:c). |
1645 |
1645 (v := device viewFromId:id) notNil ifTrue:[ |
1646 e specs' |
1646 v topView destroy. |
1647 ! ! |
1647 ^ self |
1648 |
1648 ]. |
1649 !AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'actions'! |
1649 id = device rootView id ifTrue:[ |
1650 |
1650 ^ self |
1651 actions' |
1651 ]. |
1652 ! |
1652 (Dialog confirm:'mhmh, this may not a be smalltalk view\(Or I somehow forgot about it).\Destroy anyway ?' withCRs) |
1653 |
1653 ifTrue:[ |
1654 equest. |
1654 device destroyView:nil withId:id |
1655 ! |
1655 ]. |
1656 |
1656 |
1657 anges). |
1657 |
1658 ! |
1658 ! |
1659 |
1659 |
1660 html']. |
1660 viewHardcopy |
1661 ! |
1661 "after a second (to allow redraw of views under menu ...), |
1662 |
1662 let user specify a view and save its contents." |
1663 :false. |
1663 |
1664 ! |
1664 Processor |
1665 |
1665 addTimedBlock:[ |
1666 ^ true |
1666 |v| |
1667 ! ! |
1667 (v := Screen current viewFromUser) notNil ifTrue:[ |
1668 |
1668 self saveScreenImage:(Image fromView:(v topView)) defaultName:'hardcopy' |
1669 !AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'aspects'! |
1669 ] |
1670 |
1670 ] |
1671 aspects' |
1671 afterSeconds:(self window sensor shiftDown ifTrue:5 ifFalse:1) |
1672 ! |
1672 ! |
1673 |
1673 |
1674 eyList. |
1674 viewInspect |
1675 ! |
1675 "let user pick a view and inspect it. Only smalltalk views are allowed" |
1676 |
1676 |
1677 Holder. |
1677 |v| |
1678 ! |
1678 |
1679 |
1679 (v := self pickAView) notNil ifTrue:[ |
1680 Holder. |
1680 v inspect |
1681 ! |
|
1682 |
|
1683 Channel |
|
1684 ! |
|
1685 |
|
1686 eyList. |
|
1687 ! |
|
1688 |
|
1689 ionKey. |
|
1690 ! ! |
|
1691 |
|
1692 !AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'change & update'! |
|
1693 |
|
1694 update' |
|
1695 ! |
|
1696 |
|
1697 String. |
|
1698 ! |
|
1699 |
|
1700 :macro. |
|
1701 ! |
|
1702 |
|
1703 ue:raw. |
|
1704 ! ! |
|
1705 |
|
1706 !AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'initialization & release'! |
|
1707 |
|
1708 release' |
|
1709 ! |
|
1710 |
|
1711 wnViews |
|
1712 ! |
|
1713 |
|
1714 equest. |
|
1715 ! ! |
|
1716 |
|
1717 !AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'queries'! |
|
1718 |
|
1719 queries' |
|
1720 ! ! |
|
1721 |
|
1722 !AbstractLauncherApplication::LanguageSettingsAppl class methodsFor:'interface specs'! |
|
1723 |
|
1724 e specs' |
|
1725 ! ! |
|
1726 |
|
1727 !AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'accessing'! |
|
1728 |
|
1729 cessing' |
|
1730 ! |
|
1731 |
|
1732 ageList |
|
1733 ! ! |
|
1734 |
|
1735 !AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'actions'! |
|
1736 |
|
1737 actions' |
|
1738 ! |
|
1739 |
|
1740 equest. |
|
1741 ! |
|
1742 |
|
1743 ttings. |
|
1744 ! |
|
1745 |
|
1746 anges). |
|
1747 ! |
|
1748 |
|
1749 html']. |
|
1750 ! |
|
1751 |
|
1752 :false. |
|
1753 ! |
|
1754 |
|
1755 ^ true |
|
1756 ! ! |
|
1757 |
|
1758 !AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'aspects'! |
|
1759 |
|
1760 aspects' |
|
1761 ! |
|
1762 |
|
1763 hannel. |
|
1764 ! |
|
1765 |
|
1766 eLabel. |
|
1767 ! |
|
1768 |
|
1769 Holder. |
|
1770 ! |
|
1771 |
|
1772 Channel |
|
1773 ! ! |
|
1774 |
|
1775 !AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'initialization & release'! |
|
1776 |
|
1777 release' |
|
1778 ! |
|
1779 |
|
1780 wnViews |
|
1781 ! |
|
1782 |
|
1783 equest. |
|
1784 ! ! |
|
1785 |
|
1786 !AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'queries'! |
|
1787 |
|
1788 queries' |
|
1789 ! |
|
1790 |
|
1791 f:lang) |
|
1792 ! ! |
|
1793 |
|
1794 !AbstractLauncherApplication::LauncherDialogs class methodsFor:'dialogs'! |
|
1795 |
|
1796 dialogs' |
|
1797 ! |
|
1798 |
|
1799 8 / cg" |
|
1800 ! |
|
1801 |
|
1802 9 / cg" |
|
1803 ! |
|
1804 |
|
1805 1 / cg" |
|
1806 ! |
|
1807 |
|
1808 1 / cg" |
|
1809 ! |
|
1810 |
|
1811 9 / cg" |
|
1812 ! |
|
1813 |
|
1814 3 / cg" |
|
1815 ! |
|
1816 |
|
1817 2 / cg" |
|
1818 ! |
|
1819 |
|
1820 For:nil |
|
1821 ! |
|
1822 |
|
1823 5 / cg" |
|
1824 ! |
|
1825 |
|
1826 2 / cg" |
|
1827 ! |
|
1828 |
|
1829 1 / cg" |
|
1830 ! |
|
1831 |
|
1832 8 / ps" |
|
1833 ! |
|
1834 |
|
1835 3 / cg" |
|
1836 ! |
|
1837 |
|
1838 4 / cg" |
|
1839 ! |
|
1840 |
|
1841 . |
|
1842 ] |
1681 ] |
1843 ! |
1682 |
1844 |
1683 ! |
1845 6 / cg" |
1684 |
1846 ! |
1685 viewMigrate |
1847 |
1686 "let user pick a view and migrate it to some other display" |
1848 1 / cg" |
1687 |
1849 ! |
1688 |v| |
1850 |
1689 |
1851 0 / cg" |
1690 (v := self pickAView) notNil ifTrue:[ |
1852 ! |
1691 self migrateWindow:v topView |
1853 |
|
1854 4 / cg" |
|
1855 ! |
|
1856 |
|
1857 For:nil |
|
1858 ! ! |
|
1859 |
|
1860 !AbstractLauncherApplication::LauncherDialogs class methodsFor:'dialogs - file'! |
|
1861 |
|
1862 - file' |
|
1863 ! |
|
1864 |
|
1865 2 / cg" |
|
1866 ! ! |
|
1867 |
|
1868 !AbstractLauncherApplication::LauncherDialogs class methodsFor:'dialogs - private'! |
|
1869 |
|
1870 private' |
|
1871 ! |
|
1872 |
|
1873 Module. |
|
1874 ! |
|
1875 |
|
1876 1 / cg" |
|
1877 ! |
|
1878 |
|
1879 ]. |
|
1880 ! ! |
|
1881 |
|
1882 !AbstractLauncherApplication::LauncherDialogs class methodsFor:'interface specs'! |
|
1883 |
|
1884 e specs' |
|
1885 ! |
|
1886 |
|
1887 ) |
|
1888 ! ! |
|
1889 |
|
1890 !AbstractLauncherApplication::SettingsDialog class methodsFor:'applications'! |
|
1891 |
|
1892 cations' |
|
1893 ! |
|
1894 |
|
1895 Symbol) |
|
1896 ! |
|
1897 |
|
1898 onList |
|
1899 ! |
|
1900 |
|
1901 ). |
|
1902 ! |
|
1903 |
|
1904 ]. |
|
1905 ! |
|
1906 |
|
1907 last]. |
|
1908 ! ! |
|
1909 |
|
1910 !AbstractLauncherApplication::SettingsDialog class methodsFor:'initialize'! |
|
1911 |
|
1912 tialize' |
|
1913 ! ! |
|
1914 |
|
1915 !AbstractLauncherApplication::SettingsDialog class methodsFor:'interface specs'! |
|
1916 |
|
1917 e specs' |
|
1918 ! ! |
|
1919 |
|
1920 !AbstractLauncherApplication::SettingsDialog class methodsFor:'menu specs'! |
|
1921 |
|
1922 u specs' |
|
1923 ! ! |
|
1924 |
|
1925 !AbstractLauncherApplication::SettingsDialog methodsFor:'accessing'! |
|
1926 |
|
1927 cessing' |
|
1928 ! |
|
1929 |
|
1930 questor |
|
1931 ! ! |
|
1932 |
|
1933 !AbstractLauncherApplication::SettingsDialog methodsFor:'actions'! |
|
1934 |
|
1935 actions' |
|
1936 ! |
|
1937 |
|
1938 ]. |
|
1939 ! ! |
|
1940 |
|
1941 !AbstractLauncherApplication::SettingsDialog methodsFor:'aspects'! |
|
1942 |
|
1943 aspects' |
|
1944 ! |
|
1945 |
|
1946 Holder. |
|
1947 ! |
|
1948 |
|
1949 lection |
|
1950 ! |
|
1951 |
|
1952 ]. |
|
1953 ! |
|
1954 |
|
1955 Holder. |
|
1956 ! ! |
|
1957 |
|
1958 !AbstractLauncherApplication::SettingsDialog methodsFor:'initialization & release'! |
|
1959 |
|
1960 release' |
|
1961 ! |
|
1962 |
|
1963 wnViews |
|
1964 ! |
|
1965 |
|
1966 Request |
|
1967 ! |
|
1968 |
|
1969 ialize. |
|
1970 ! |
|
1971 |
|
1972 Builder |
|
1973 ! ! |
|
1974 |
|
1975 !AbstractLauncherApplication::SettingsDialog methodsFor:'menu actions'! |
|
1976 |
|
1977 actions' |
|
1978 ! |
|
1979 |
|
1980 ]. |
|
1981 ! |
|
1982 |
|
1983 . |
|
1984 ] |
1692 ] |
1985 ! ! |
1693 ! ! |
1986 |
1694 |
|
1695 !AbstractLauncherApplication::KbdMappingSettingsAppl class methodsFor:'interface specs'! |
|
1696 |
|
1697 windowSpec |
|
1698 "This resource specification was automatically generated |
|
1699 by the UIPainter of ST/X." |
|
1700 |
|
1701 "Do not manually edit this!! If it is corrupted, |
|
1702 the UIPainter may not be able to read the specification." |
|
1703 |
|
1704 " |
|
1705 UIPainter new openOnClass:AbstractLauncherApplication::KbdMappingSettingsAppl andSelector:#windowSpec |
|
1706 AbstractLauncherApplication::KbdMappingSettingsAppl new openInterface:#windowSpec |
|
1707 AbstractLauncherApplication::KbdMappingSettingsAppl open |
|
1708 " |
|
1709 |
|
1710 <resource: #canvas> |
|
1711 |
|
1712 ^ |
|
1713 #(#FullSpec |
|
1714 #name: #windowSpec |
|
1715 #window: |
|
1716 #(#WindowSpec |
|
1717 #label: 'Keyboard Mappings' |
|
1718 #name: 'Keyboard Mappings' |
|
1719 #min: #(#Point 10 10) |
|
1720 #max: #(#Point 1024 768) |
|
1721 #bounds: #(#Rectangle 16 42 491 620) |
|
1722 ) |
|
1723 #component: |
|
1724 #(#SpecCollection |
|
1725 #collection: #( |
|
1726 #(#VariableVerticalPanelSpec |
|
1727 #name: 'VariableVerticalPanel1' |
|
1728 #layout: #(#LayoutFrame 0 0.0 60 0 0 1.0 -34 1) |
|
1729 #component: |
|
1730 #(#SpecCollection |
|
1731 #collection: #( |
|
1732 #(#VariableHorizontalPanelSpec |
|
1733 #name: 'VariableHorizontalPanel1' |
|
1734 #component: |
|
1735 #(#SpecCollection |
|
1736 #collection: #( |
|
1737 #(#SequenceViewSpec |
|
1738 #name: 'RawKeyList' |
|
1739 #model: #selectedRawKey |
|
1740 #hasHorizontalScrollBar: true |
|
1741 #hasVerticalScrollBar: true |
|
1742 #useIndex: false |
|
1743 #sequenceList: #rawKeyList |
|
1744 ) |
|
1745 #(#SequenceViewSpec |
|
1746 #name: 'FunctionKeyList' |
|
1747 #model: #selectedFunctionKey |
|
1748 #hasHorizontalScrollBar: true |
|
1749 #hasVerticalScrollBar: true |
|
1750 #useIndex: false |
|
1751 #sequenceList: #functionKeyList |
|
1752 ) |
|
1753 ) |
|
1754 |
|
1755 ) |
|
1756 #handles: #(#Any 0.5 1.0) |
|
1757 ) |
|
1758 #(#ViewSpec |
|
1759 #name: 'Box1' |
|
1760 #component: |
|
1761 #(#SpecCollection |
|
1762 #collection: #( |
|
1763 #(#TextEditorSpec |
|
1764 #name: 'MacroText' |
|
1765 #layout: #(#LayoutFrame 0 0.0 20 0 0 1.0 0 1.0) |
|
1766 #model: #macroTextHolder |
|
1767 #hasHorizontalScrollBar: true |
|
1768 #hasVerticalScrollBar: true |
|
1769 #isReadOnly: true |
|
1770 ) |
|
1771 #(#LabelSpec |
|
1772 #label: 'Macro text (if any):' |
|
1773 #name: 'MacroTextLabel' |
|
1774 #layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
1775 #translateLabel: true |
|
1776 #adjust: #left |
|
1777 ) |
|
1778 ) |
|
1779 |
|
1780 ) |
|
1781 ) |
|
1782 ) |
|
1783 |
|
1784 ) |
|
1785 #handles: #(#Any 0.5 1.0) |
|
1786 ) |
|
1787 #(#HorizontalPanelViewSpec |
|
1788 #name: 'HorizontalPanel1' |
|
1789 #layout: #(#LayoutFrame 0 0.0 -34 1 0 1.0 0 1) |
|
1790 #horizontalLayout: #center |
|
1791 #verticalLayout: #center |
|
1792 #horizontalSpace: 3 |
|
1793 #verticalSpace: 3 |
|
1794 #component: |
|
1795 #(#SpecCollection |
|
1796 #collection: #( |
|
1797 #(#ActionButtonSpec |
|
1798 #label: 'Close' |
|
1799 #name: 'Cancel' |
|
1800 #visibilityChannel: #isNotPartOfSettinsDialog |
|
1801 #translateLabel: true |
|
1802 #model: #doCancel |
|
1803 #extent: #(#Point 125 22) |
|
1804 ) |
|
1805 #(#ActionButtonSpec |
|
1806 #label: 'Help' |
|
1807 #name: 'Help' |
|
1808 #translateLabel: true |
|
1809 #model: #help |
|
1810 #extent: #(#Point 125 22) |
|
1811 ) |
|
1812 ) |
|
1813 |
|
1814 ) |
|
1815 ) |
|
1816 #(#LabelSpec |
|
1817 #label: 'NoticeText' |
|
1818 #name: 'Text' |
|
1819 #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 60 0) |
|
1820 #translateLabel: true |
|
1821 #labelChannel: #labelTextHolder |
|
1822 #resizeForLabel: true |
|
1823 #adjust: #left |
|
1824 ) |
|
1825 ) |
|
1826 |
|
1827 ) |
|
1828 ) |
|
1829 ! ! |
|
1830 |
|
1831 !AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'actions'! |
|
1832 |
|
1833 doCancel |
|
1834 |
|
1835 self isPartOfSettinsDialog ifTrue:[ |
|
1836 self loadRequest. |
|
1837 ]. |
|
1838 self closeRequest. |
|
1839 ! |
|
1840 |
|
1841 evaluateModified |
|
1842 |
|
1843 self modifiedChannel value:(self hasUnsavedChanges). |
|
1844 ! |
|
1845 |
|
1846 help |
|
1847 |
|
1848 self withWaitCursorDo:[HTMLDocumentView openFullOnHelpFile:'Launcher/keyboardSetting.html']. |
|
1849 ! |
|
1850 |
|
1851 loadRequest |
|
1852 |
|
1853 self modifiedChannel value:false. |
|
1854 ! |
|
1855 |
|
1856 saveRequest |
|
1857 | result | |
|
1858 |
|
1859 (self hasUnsavedChanges) ifTrue:[ |
|
1860 result := self confirmWithCancel:(resources string:'Save changed Tool Settings ?'). |
|
1861 result isNil ifTrue:[ ^ false]. |
|
1862 result ifTrue:[ |
|
1863 self saveSettings. |
|
1864 ] |
|
1865 ]. |
|
1866 ^ true |
|
1867 ! |
|
1868 |
|
1869 saveSettings |
|
1870 ! ! |
|
1871 |
|
1872 !AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'aspects'! |
|
1873 |
|
1874 functionKeyList |
|
1875 "automatically generated by UIPainter ..." |
|
1876 |
|
1877 "*** the code below creates a default model when invoked." |
|
1878 "*** (which may not be the one you wanted)" |
|
1879 "*** Please change as required and accept it in the browser." |
|
1880 "*** (and replace this comment by something more useful ;-)" |
|
1881 |
|
1882 functionKeyList isNil ifTrue:[ |
|
1883 functionKeyList := ValueHolder new. |
|
1884 "/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
1885 "/ functionKeyList addDependent:self. |
|
1886 "/ functionKeyList onChangeSend:#functionKeyListChanged to:self. |
|
1887 ]. |
|
1888 ^ functionKeyList. |
|
1889 ! |
|
1890 |
|
1891 labelTextHolder |
|
1892 "automatically generated by UIPainter ..." |
|
1893 |
|
1894 "*** the code below creates a default model when invoked." |
|
1895 "*** (which may not be the one you wanted)" |
|
1896 "*** Please change as required and accept it in the browser." |
|
1897 "*** (and replace this comment by something more useful ;-)" |
|
1898 |
|
1899 labelTextHolder isNil ifTrue:[ |
|
1900 labelTextHolder := ValueHolder new. |
|
1901 "/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
1902 "/ labelTextHolder addDependent:self. |
|
1903 "/ labelTextHolder onChangeSend:#labelTextHolderChanged to:self. |
|
1904 ]. |
|
1905 ^ labelTextHolder. |
|
1906 ! |
|
1907 |
|
1908 macroTextHolder |
|
1909 "automatically generated by UIPainter ..." |
|
1910 |
|
1911 "*** the code below creates a default model when invoked." |
|
1912 "*** (which may not be the one you wanted)" |
|
1913 "*** Please change as required and accept it in the browser." |
|
1914 "*** (and replace this comment by something more useful ;-)" |
|
1915 |
|
1916 macroTextHolder isNil ifTrue:[ |
|
1917 macroTextHolder := ValueHolder new. |
|
1918 "/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
1919 "/ macroTextHolder addDependent:self. |
|
1920 "/ macroTextHolder onChangeSend:#macroTextHolderChanged to:self. |
|
1921 ]. |
|
1922 ^ macroTextHolder. |
|
1923 ! |
|
1924 |
|
1925 modifiedChannel |
|
1926 |
|
1927 modifiedChannel isNil ifTrue:[ |
|
1928 modifiedChannel := false asValue. |
|
1929 ]. |
|
1930 ^ modifiedChannel |
|
1931 ! |
|
1932 |
|
1933 rawKeyList |
|
1934 "automatically generated by UIPainter ..." |
|
1935 |
|
1936 "*** the code below creates a default model when invoked." |
|
1937 "*** (which may not be the one you wanted)" |
|
1938 "*** Please change as required and accept it in the browser." |
|
1939 "*** (and replace this comment by something more useful ;-)" |
|
1940 |
|
1941 rawKeyList isNil ifTrue:[ |
|
1942 rawKeyList := List new. |
|
1943 ]. |
|
1944 ^ rawKeyList. |
|
1945 ! |
|
1946 |
|
1947 selectedFunctionKey |
|
1948 |
|
1949 selectedFunctionKey isNil ifTrue:[ |
|
1950 selectedFunctionKey := ValueHolder new. |
|
1951 selectedFunctionKey addDependent:self. |
|
1952 ]. |
|
1953 ^ selectedFunctionKey. |
|
1954 ! |
|
1955 |
|
1956 selectedRawKey |
|
1957 |
|
1958 selectedRawKey isNil ifTrue:[ |
|
1959 selectedRawKey := ValueHolder new. |
|
1960 selectedRawKey addDependent:self. |
|
1961 ]. |
|
1962 ^ selectedRawKey. |
|
1963 ! ! |
|
1964 |
|
1965 !AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'change & update'! |
|
1966 |
|
1967 changeFunctionKeySelection |
|
1968 |
|
1969 |raw| |
|
1970 raw := self selectedRawKey value. |
|
1971 self selectedFunctionKey value:(mappings at:raw asSymbol) asString. |
|
1972 ! |
|
1973 |
|
1974 changeMacroText |
|
1975 |
|
1976 |f macro indent| |
|
1977 |
|
1978 f := self selectedFunctionKey value. |
|
1979 (f startsWith:'Cmd') ifTrue:[ |
|
1980 f := f copyFrom:4 |
|
1981 ]. |
|
1982 macro := UserPreferences current functionKeySequences |
|
1983 at:(f asSymbol) ifAbsent:nil. |
|
1984 macro notNil ifTrue:[ |
|
1985 macro := macro asStringCollection. |
|
1986 indent := macro |
|
1987 inject:99999 into:[:min :element | |
|
1988 |stripped| |
|
1989 |
|
1990 stripped := element withoutLeadingSeparators. |
|
1991 stripped size == 0 ifTrue:[ |
|
1992 min |
|
1993 ] ifFalse:[ |
|
1994 min min:(element size - stripped size) |
|
1995 ] |
|
1996 ]. |
|
1997 indent ~~ 0 ifTrue:[ |
|
1998 macro := macro collect:[:line | |
|
1999 line size > indent ifTrue:[ |
|
2000 line copyFrom:indent+1 |
|
2001 ] ifFalse:[ |
|
2002 line |
|
2003 ]. |
|
2004 ] |
|
2005 ]. |
|
2006 ]. |
|
2007 macroTextHolder value:macro. |
|
2008 ! |
|
2009 |
|
2010 changeRawKeySelection |
|
2011 |f raw| |
|
2012 |
|
2013 f := self selectedFunctionKey value. |
|
2014 raw := mappings keyAtValue:f asString. |
|
2015 raw isNil ifTrue:[ |
|
2016 raw := mappings keyAtValue:f first. |
|
2017 raw isNil ifTrue:[ |
|
2018 raw := mappings keyAtValue:f asSymbol. |
|
2019 ] |
|
2020 ]. |
|
2021 self selectedRawKey value:raw. |
|
2022 ! |
|
2023 |
|
2024 update:something with:aParameter from:changedObject |
|
2025 "Invoked when an object that I depend upon sends a change notification." |
|
2026 |
|
2027 "stub code automatically generated - please change as required" |
|
2028 |
|
2029 changedObject == self selectedFunctionKey ifTrue:[ |
|
2030 self changeRawKeySelection. |
|
2031 self changeMacroText. |
|
2032 ^ self |
|
2033 ]. |
|
2034 changedObject == self selectedRawKey ifTrue:[ |
|
2035 self changeFunctionKeySelection. |
|
2036 ^ self |
|
2037 ]. |
|
2038 super update:something with:aParameter from:changedObject |
|
2039 ! ! |
|
2040 |
|
2041 !AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'initialization & release'! |
|
2042 |
|
2043 closeDownViews |
|
2044 "This is a hook method generated by the Browser. |
|
2045 It will be invoked when your app/dialog-window is really closed. |
|
2046 See also #closeDownViews, which is invoked before and may suppress the close |
|
2047 or ask the user for confirmation." |
|
2048 |
|
2049 "/ change the code below as required ... |
|
2050 "/ This should cleanup any leftover resources |
|
2051 "/ (for example, temporary files) |
|
2052 "/ super closeRequest will initiate the closeDown |
|
2053 |
|
2054 "/ add your code here |
|
2055 |
|
2056 "/ do not remove the one below ... |
|
2057 ^ super closeDownViews |
|
2058 ! |
|
2059 |
|
2060 closeRequest |
|
2061 |
|
2062 self saveRequest ifFalse:[ |
|
2063 ^ self |
|
2064 ]. |
|
2065 |
|
2066 ^ super closeRequest. |
|
2067 ! |
|
2068 |
|
2069 initialize |
|
2070 |
|
2071 resources := self class owningClass classResources. |
|
2072 |
|
2073 mappings := Screen current keyboardMap. |
|
2074 |
|
2075 rawKeyList := (mappings keys asArray collect:[:key | key asString]) sort. |
|
2076 functionKeyList := (mappings values asSet asArray collect:[:key | key asString]) sort. |
|
2077 |
|
2078 self labelTextHolder value:(resources at:'KEY_MSG2' default:'keyboard mapping:') withCRs. |
|
2079 super initialize |
|
2080 ! ! |
|
2081 |
|
2082 !AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'queries'! |
|
2083 |
|
2084 hasUnsavedChanges |
|
2085 |
|
2086 ^ false |
|
2087 ! ! |
|
2088 |
|
2089 !AbstractLauncherApplication::LanguageSettingsAppl class methodsFor:'interface specs'! |
|
2090 |
|
2091 windowSpec |
|
2092 "This resource specification was automatically generated |
|
2093 by the UIPainter of ST/X." |
|
2094 |
|
2095 "Do not manually edit this!! If it is corrupted, |
|
2096 the UIPainter may not be able to read the specification." |
|
2097 |
|
2098 " |
|
2099 UIPainter new openOnClass:AbstractLauncherApplication::LanguageSettingsAppl andSelector:#windowSpec |
|
2100 AbstractLauncherApplication::LanguageSettingsAppl new openInterface:#windowSpec |
|
2101 AbstractLauncherApplication::LanguageSettingsAppl open |
|
2102 " |
|
2103 |
|
2104 <resource: #canvas> |
|
2105 |
|
2106 ^ |
|
2107 #(#FullSpec |
|
2108 #name: #windowSpec |
|
2109 #window: |
|
2110 #(#WindowSpec |
|
2111 #label: 'Language Settings' |
|
2112 #name: 'Language Settings' |
|
2113 #min: #(#Point 10 10) |
|
2114 #max: #(#Point 1024 768) |
|
2115 #bounds: #(#Rectangle 16 42 491 713) |
|
2116 ) |
|
2117 #component: |
|
2118 #(#SpecCollection |
|
2119 #collection: #( |
|
2120 #(#InputFieldSpec |
|
2121 #name: 'EntryField1' |
|
2122 #layout: #(#LayoutFrame 0 0.0 105 0 0 1.0 125 0) |
|
2123 #model: #languageHolder |
|
2124 #acceptOnReturn: true |
|
2125 #acceptOnTab: true |
|
2126 #acceptOnLostFocus: true |
|
2127 #acceptOnPointerLeave: false |
|
2128 ) |
|
2129 #(#SequenceViewSpec |
|
2130 #name: 'List1' |
|
2131 #layout: #(#LayoutFrame 0 0.0 125 0 0 1.0 -34 1) |
|
2132 #model: #languageHolder |
|
2133 #hasHorizontalScrollBar: true |
|
2134 #hasVerticalScrollBar: true |
|
2135 #doubleClickSelector: #doubleClick: |
|
2136 #useIndex: false |
|
2137 #sequenceList: #languageList |
|
2138 ) |
|
2139 #(#HorizontalPanelViewSpec |
|
2140 #name: 'HorizontalPanel1' |
|
2141 #layout: #(#LayoutFrame 0 0.0 -34 1 0 1.0 0 1.0) |
|
2142 #horizontalLayout: #center |
|
2143 #verticalLayout: #center |
|
2144 #horizontalSpace: 3 |
|
2145 #verticalSpace: 3 |
|
2146 #component: |
|
2147 #(#SpecCollection |
|
2148 #collection: #( |
|
2149 #(#ActionButtonSpec |
|
2150 #label: 'OK' |
|
2151 #name: 'OK' |
|
2152 #translateLabel: true |
|
2153 #model: #saveSettings |
|
2154 #enableChannel: #modifiedChannel |
|
2155 #extent: #(#Point 125 22) |
|
2156 ) |
|
2157 #(#ActionButtonSpec |
|
2158 #label: 'Cancel' |
|
2159 #name: 'Cancel' |
|
2160 #translateLabel: true |
|
2161 #model: #doCancel |
|
2162 #extent: #(#Point 125 22) |
|
2163 ) |
|
2164 #(#ActionButtonSpec |
|
2165 #label: 'Help' |
|
2166 #name: 'Help' |
|
2167 #translateLabel: true |
|
2168 #model: #help |
|
2169 #extent: #(#Point 125 22) |
|
2170 ) |
|
2171 ) |
|
2172 |
|
2173 ) |
|
2174 ) |
|
2175 #(#LabelSpec |
|
2176 #label: 'Notice:' |
|
2177 #name: 'Notice' |
|
2178 #layout: #(#LayoutFrame 0 0 0 0 0 1.0 105 0) |
|
2179 #translateLabel: true |
|
2180 #labelChannel: #noticeLabelHolder |
|
2181 #adjust: #left |
|
2182 ) |
|
2183 #(#LabelSpec |
|
2184 #label: 'Label' |
|
2185 #name: 'CurrentLang' |
|
2186 #layout: #(#LayoutFrame -150 1 0 0 0 1 20 0) |
|
2187 #style: #(#FontDescription #helvetica #bold #roman 12) |
|
2188 #translateLabel: true |
|
2189 #labelChannel: #currentLanguageChannel |
|
2190 #adjust: #left |
|
2191 ) |
|
2192 #(#LabelSpec |
|
2193 #label: 'Current Language:' |
|
2194 #name: 'Label1' |
|
2195 #layout: #(#LayoutFrame 190 0 0 0 -150 1 20 0) |
|
2196 #translateLabel: true |
|
2197 #labelChannel: #currentLanguageLabel |
|
2198 #adjust: #right |
|
2199 ) |
|
2200 ) |
|
2201 |
|
2202 ) |
|
2203 ) |
|
2204 ! ! |
|
2205 |
|
2206 !AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'accessing'! |
|
2207 |
|
2208 languageList |
|
2209 "return the value of the instance variable 'languageList' (automatically generated)" |
|
2210 |
|
2211 ^ languageList |
|
2212 ! |
|
2213 |
|
2214 requestor |
|
2215 "return the value of the instance variable 'requestor' (automatically generated)" |
|
2216 |
|
2217 | masterApplication | |
|
2218 masterApplication := self masterApplication. |
|
2219 masterApplication notNil ifTrue:[ |
|
2220 ^ masterApplication requestor. |
|
2221 ]. |
|
2222 ^ nil |
|
2223 ! ! |
|
2224 |
|
2225 !AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'actions'! |
|
2226 |
|
2227 doCancel |
|
2228 |
|
2229 self isPartOfSettinsDialog ifTrue:[ |
|
2230 self loadRequest. |
|
2231 ]. |
|
2232 self closeRequest. |
|
2233 ! |
|
2234 |
|
2235 doubleClick:aEntry |
|
2236 |
|
2237 self saveSettings. |
|
2238 ! |
|
2239 |
|
2240 evaluateModified |
|
2241 |
|
2242 self modifiedChannel value:(self hasUnsavedChanges). |
|
2243 ! |
|
2244 |
|
2245 help |
|
2246 |
|
2247 self withWaitCursorDo:[HTMLDocumentView openFullOnHelpFile:'Launcher/languageSetting.html']. |
|
2248 ! |
|
2249 |
|
2250 loadRequest |
|
2251 |
|
2252 self languageHolder value:self currentLanguage. |
|
2253 self currentLanguageChannel value:self currentLanguage. |
|
2254 self modifiedChannel value:false. |
|
2255 ! |
|
2256 |
|
2257 saveRequest |
|
2258 | result | |
|
2259 |
|
2260 (self hasUnsavedChanges) ifTrue:[ |
|
2261 result := self confirmWithCancel:(resources string:'Save changed Language Settings ?'). |
|
2262 result isNil ifTrue:[ ^ false]. |
|
2263 result ifTrue:[ |
|
2264 self saveSettings. |
|
2265 ] |
|
2266 ]. |
|
2267 ^ true |
|
2268 ! |
|
2269 |
|
2270 saveSettings |
|
2271 |
|
2272 |fontPref idx language oldLanguage territory enc |
|
2273 answer matchingFonts l screen newLanguage switch| |
|
2274 |
|
2275 newLanguage := self languageHolder value. |
|
2276 self withWaitCursorDo:[ |
|
2277 idx := translatedLanguages indexOf:newLanguage. |
|
2278 idx ~~ 0 ifTrue:[ |
|
2279 language := listOfLanguages at:idx |
|
2280 ] ifFalse:[ |
|
2281 language := newLanguage |
|
2282 ]. |
|
2283 (language includes:$-) ifTrue:[ |
|
2284 l := language asCollectionOfSubstringsSeparatedBy:$-. |
|
2285 language := l at:1. |
|
2286 territory := l at:2. |
|
2287 ]. |
|
2288 territory isNil ifTrue:[ |
|
2289 territory := language copyTo:2 |
|
2290 ]. |
|
2291 |
|
2292 "/ check if the new language needs a differently encoded font; |
|
2293 "/ ask user to switch font and allow cancellation. |
|
2294 "/ Otherwise, you are left with unreadable menu & button items ... |
|
2295 |
|
2296 oldLanguage := Smalltalk language. |
|
2297 Smalltalk language:language asSymbol. |
|
2298 ResourcePack flushCachedResourcePacks. |
|
2299 "/ refetch resources ... |
|
2300 resources := AbstractLauncherApplication classResources. |
|
2301 fontPref := resources at:'PREFERRED_FONT_ENCODING' default:'iso8859*'. |
|
2302 fontPref := fontPref asLowercase. |
|
2303 Smalltalk language:oldLanguage. |
|
2304 |
|
2305 switch := true. |
|
2306 enc := MenuView defaultFont encoding. |
|
2307 (fontPref match:enc asLowercase) ifFalse:[ |
|
2308 "/ look if there is one at all. |
|
2309 screen := Screen current. |
|
2310 matchingFonts := screen listOfAvailableFonts select:[:f | fontPref match:f encoding asLowercase]. |
|
2311 matchingFonts size == 0 ifTrue:[ |
|
2312 "/ flush and try again - just in case, the font path has changed. |
|
2313 screen flushListOfAvailableFonts. |
|
2314 matchingFonts := screen listOfAvailableFonts select:[:f | fontPref match:f encoding asLowercase]. |
|
2315 ]. |
|
2316 matchingFonts size == 0 ifTrue:[ |
|
2317 (Dialog |
|
2318 confirm:(resources |
|
2319 string:'Your display does not offer any %1-encoded font.\\Change the language anyway ?\ (texts will probably be unreadable then)' |
|
2320 with:fontPref) withCRs) |
|
2321 ifFalse:[ |
|
2322 switch := false |
|
2323 ] |
|
2324 ] ifFalse:[ |
|
2325 answer := Dialog |
|
2326 confirmWithCancel:(resources |
|
2327 string:'menu font is not %1-encoded.\\Change it ?' |
|
2328 with:fontPref) withCRs |
|
2329 labels:(resources |
|
2330 array:#('cancel' 'no' 'yes')) |
|
2331 default:3. |
|
2332 answer isNil ifTrue:[ |
|
2333 switch := false |
|
2334 ] ifFalse:[ |
|
2335 answer ifTrue:[ |
|
2336 switch := ( self requestor fontBoxForEncoding:fontPref) |
|
2337 ] |
|
2338 ]. |
|
2339 ]. |
|
2340 ]. |
|
2341 |
|
2342 switch ifTrue:[ |
|
2343 Transcript showCR:'change language to ' , newLanguage , ' ...'. |
|
2344 Smalltalk language:language asSymbol. |
|
2345 Smalltalk languageTerritory:territory asSymbol. |
|
2346 "/ ResourcePack flushCachedResourcePacks - already done by language-change |
|
2347 ]. |
|
2348 ]. |
|
2349 switch ifTrue:[ |
|
2350 self requestor notNil ifTrue:[ |
|
2351 self requestor reopenLauncher. |
|
2352 ]. |
|
2353 DebugView newDebugger. |
|
2354 ]. |
|
2355 self currentLanguageChannel value:self currentLanguage. |
|
2356 self modifiedChannel value:false. |
|
2357 ! ! |
|
2358 |
|
2359 !AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'aspects'! |
|
2360 |
|
2361 currentLanguageChannel |
|
2362 |
|
2363 currentLanguageChannel isNil ifTrue:[ |
|
2364 currentLanguageChannel := self currentLanguage asValue. |
|
2365 ]. |
|
2366 ^ currentLanguageChannel. |
|
2367 ! |
|
2368 |
|
2369 currentLanguageLabel |
|
2370 |
|
2371 currentLanguageLabel isNil ifTrue:[ |
|
2372 currentLanguageLabel := (resources string:'Current Language:') asValue. |
|
2373 ]. |
|
2374 ^ currentLanguageLabel. |
|
2375 ! |
|
2376 |
|
2377 languageHolder |
|
2378 |
|
2379 languageHolder isNil ifTrue:[ |
|
2380 languageHolder := self currentLanguage asValue. |
|
2381 languageHolder onChangeSend:#evaluateModified to:self. |
|
2382 ]. |
|
2383 ^ languageHolder. |
|
2384 ! |
|
2385 |
|
2386 modifiedChannel |
|
2387 |
|
2388 modifiedChannel isNil ifTrue:[ |
|
2389 modifiedChannel := false asValue. |
|
2390 ]. |
|
2391 ^ modifiedChannel |
|
2392 ! |
|
2393 |
|
2394 noticeLabelHolder |
|
2395 |
|
2396 noticeLabelHolder isNil ifTrue:[ |
|
2397 noticeLabelHolder := ((resources at:'LANG_MSG' default:'Select a Language') withCRs) asValue. |
|
2398 ]. |
|
2399 ^ noticeLabelHolder. |
|
2400 ! ! |
|
2401 |
|
2402 !AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'initialization & release'! |
|
2403 |
|
2404 closeDownViews |
|
2405 "This is a hook method generated by the Browser. |
|
2406 It will be invoked when your app/dialog-window is really closed. |
|
2407 See also #closeDownViews, which is invoked before and may suppress the close |
|
2408 or ask the user for confirmation." |
|
2409 |
|
2410 "/ change the code below as required ... |
|
2411 "/ This should cleanup any leftover resources |
|
2412 "/ (for example, temporary files) |
|
2413 "/ super closeRequest will initiate the closeDown |
|
2414 |
|
2415 "/ add your code here |
|
2416 |
|
2417 "/ do not remove the one below ... |
|
2418 ^ super closeDownViews |
|
2419 ! |
|
2420 |
|
2421 closeRequest |
|
2422 |
|
2423 self saveRequest ifFalse:[ |
|
2424 ^ self |
|
2425 ]. |
|
2426 |
|
2427 ^ super closeRequest. |
|
2428 ! |
|
2429 |
|
2430 initialize |
|
2431 |
|
2432 |flags| |
|
2433 |
|
2434 resources := self class owningClass classResources. |
|
2435 listOfLanguages := resources at:'LIST_OF_OFFERED_LANGUAGES' default:#('default'). |
|
2436 listOfLanguages := listOfLanguages asOrderedCollection. |
|
2437 translatedLanguages := listOfLanguages collect:[:lang | |item| |
|
2438 item := resources at:lang. |
|
2439 item isString ifTrue:[ |
|
2440 item |
|
2441 ] ifFalse:[ |
|
2442 item at:1 |
|
2443 ] |
|
2444 ]. |
|
2445 flags := listOfLanguages collect:[:lang | |item| |
|
2446 item := resources at:lang. |
|
2447 item isArray ifTrue:[ |
|
2448 item at:2 |
|
2449 ] ifFalse:[ |
|
2450 nil |
|
2451 ] |
|
2452 ]. |
|
2453 flags := flags collect:[:nm | |img d| nm notNil ifTrue:[ |
|
2454 img := Image fromFile:nm. |
|
2455 img isNil ifTrue:[ |
|
2456 d := Smalltalk getPackageDirectoryForPackage:'stx:goodies'. |
|
2457 img := Image fromFile:(d construct:nm). |
|
2458 ]. |
|
2459 ] ifFalse:[ |
|
2460 nil |
|
2461 ] |
|
2462 ]. |
|
2463 listOfLanguages := listOfLanguages collect:[:nm | nm copyFrom:'LANG_' size + 1]. |
|
2464 languageList := translatedLanguages with:flags collect:[:lang :flag | LabelAndIcon icon:flag string:lang.]. |
|
2465 super initialize |
|
2466 ! ! |
|
2467 |
|
2468 !AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'queries'! |
|
2469 |
|
2470 currentLanguage |
|
2471 |
|
2472 | lang | |
|
2473 |
|
2474 lang := Language ~= LanguageTerritory ifTrue:[ |
|
2475 Language , '-' , LanguageTerritory |
|
2476 ] ifFalse:[ |
|
2477 Language |
|
2478 ]. |
|
2479 ^ languageList at:(listOfLanguages indexOf:lang) |
|
2480 ! |
|
2481 |
|
2482 hasUnsavedChanges |
|
2483 |
|
2484 ^ (self languageHolder value) ~= (self currentLanguage) |
|
2485 ! ! |
|
2486 |
|
2487 !AbstractLauncherApplication::LauncherDialogs class methodsFor:'dialogs'! |
|
2488 |
|
2489 communicationsSettings |
|
2490 "open a dialog on communications settings" |
|
2491 |
|
2492 |box check in resources y acceptChannel |
|
2493 hasRDoitServer rDoitServerPort |
|
2494 rDoitsEnabled rDoitLogging rDoitErrorLogging rDoitErrorDebugging |
|
2495 org_rDoitsEnabled org_rDoitLogging org_rDoitErrorLogging org_rDoitErrorDebugging org_rDoitServerPort |
|
2496 |
|
2497 hasRemoteBrowsingSupport remoteBrowsingEnabled org_remoteBrowsingEnabled |
|
2498 |
|
2499 hasWindowMigrationServer windowMigrationAuthenticate windowMigrationPassword |
|
2500 windowMigrationEnabled |
|
2501 org_windowMigrationEnabled org_windowMigrationAuthenticate org_windowMigrationPassword |
|
2502 |
|
2503 hasHTTPServer httpServerRunning httpServerFileRoot httpServerHomeURL |
|
2504 httpServerPort httpServerLogFile hasSwiki swikiEnabled swikiRoot |
|
2505 allowEmbedded hasSoap soapEnabled |
|
2506 org_httpServerRunning org_httpServerFileRoot org_httpServerHomeURL |
|
2507 org_httpServerPort org_swikiRoot org_swikiEnabled org_httpServerLogFile |
|
2508 org_allowEmbedded org_soapEnabled |
|
2509 |
|
2510 osiACSEPresent osiROSEPresent osiCMISEPresent |
|
2511 osiACSEErrorLogging osiACSEConnectionLogging osiACSEDataLogging |
|
2512 osiROSEErrorLogging osiROSEResponseLogging osiROSEInvokationLogging |
|
2513 osiCMISEErrorLogging osiCMISEMessageLogging |
|
2514 | |
|
2515 |
|
2516 acceptChannel := false asValue. |
|
2517 |
|
2518 resources := self owningClass classResources. |
|
2519 |
|
2520 "/ |
|
2521 "/ extract relevant remoteBrowsing settings ... |
|
2522 "/ |
|
2523 remoteBrowsingEnabled := false. |
|
2524 (hasRemoteBrowsingSupport := SmalltalkShareServer notNil) ifTrue:[ |
|
2525 SmalltalkShareServer isLoaded ifTrue:[ |
|
2526 remoteBrowsingEnabled := SmalltalkShareServer serverRunning. |
|
2527 ]. |
|
2528 ]. |
|
2529 org_remoteBrowsingEnabled := remoteBrowsingEnabled. |
|
2530 remoteBrowsingEnabled := remoteBrowsingEnabled asValue. |
|
2531 |
|
2532 "/ |
|
2533 "/ extract relevant windowMigration settings ... |
|
2534 "/ |
|
2535 windowMigrationEnabled := windowMigrationAuthenticate := false. |
|
2536 (hasWindowMigrationServer := WindowMigrationServer notNil) ifTrue:[ |
|
2537 WindowMigrationServer isLoaded ifTrue:[ |
|
2538 windowMigrationEnabled := WindowMigrationServer serverRunning. |
|
2539 ]. |
|
2540 windowMigrationPassword := WindowMigrationServer password. |
|
2541 windowMigrationAuthenticate := windowMigrationPassword notNil. |
|
2542 ]. |
|
2543 org_windowMigrationEnabled := windowMigrationEnabled. |
|
2544 windowMigrationEnabled := windowMigrationEnabled asValue. |
|
2545 org_windowMigrationAuthenticate := windowMigrationAuthenticate. |
|
2546 windowMigrationAuthenticate := windowMigrationAuthenticate asValue. |
|
2547 org_windowMigrationPassword := windowMigrationPassword. |
|
2548 windowMigrationPassword := windowMigrationPassword asValue. |
|
2549 |
|
2550 "/ |
|
2551 "/ extract relevant rdoit settings ... |
|
2552 "/ |
|
2553 rDoitsEnabled := rDoitLogging := rDoitErrorLogging := false. |
|
2554 (hasRDoitServer := RDoItServer notNil) ifTrue:[ |
|
2555 RDoItServer isLoaded ifTrue:[ |
|
2556 rDoitsEnabled := RDoItServer serverRunning. |
|
2557 rDoitLogging := RDoItServer isLogging. |
|
2558 rDoitErrorLogging := RDoItServer isErrorLogging. |
|
2559 rDoitErrorDebugging := RDoItServer isErrorCatching not. |
|
2560 rDoitServerPort := RDoItServer defaultPortNumber. |
|
2561 ] |
|
2562 ]. |
|
2563 org_rDoitsEnabled := rDoitsEnabled. |
|
2564 org_rDoitLogging := rDoitLogging. |
|
2565 org_rDoitErrorLogging := rDoitErrorLogging. |
|
2566 org_rDoitErrorDebugging := rDoitErrorDebugging. |
|
2567 org_rDoitServerPort := rDoitServerPort. |
|
2568 |
|
2569 rDoitServerPort := rDoitServerPort asValue. |
|
2570 rDoitsEnabled := rDoitsEnabled asValue. |
|
2571 rDoitLogging := rDoitLogging asValue. |
|
2572 rDoitErrorLogging := rDoitErrorLogging asValue. |
|
2573 rDoitErrorDebugging := rDoitErrorDebugging asValue. |
|
2574 |
|
2575 "/ |
|
2576 "/ extract http-server settings |
|
2577 "/ |
|
2578 hasHTTPServer := httpServerRunning := false. |
|
2579 (hasHTTPServer := HTTPServer notNil) ifTrue:[ |
|
2580 HTTPServer isLoaded ifTrue:[ |
|
2581 httpServerRunning := HTTPServer isRunning. |
|
2582 httpServerFileRoot := HTTPServer fileRoot. |
|
2583 httpServerHomeURL := HTTPServer homeURL. |
|
2584 httpServerPort := HTTPServer defaultPort. |
|
2585 httpServerLogFile := HTTPServer defaultLogFile. |
|
2586 ]. |
|
2587 ]. |
|
2588 org_httpServerRunning := httpServerRunning. |
|
2589 httpServerRunning := httpServerRunning asValue. |
|
2590 org_httpServerFileRoot := httpServerFileRoot. |
|
2591 httpServerFileRoot := httpServerFileRoot asValue. |
|
2592 org_httpServerHomeURL := httpServerHomeURL. |
|
2593 httpServerHomeURL := httpServerHomeURL asValue. |
|
2594 org_httpServerPort := httpServerPort. |
|
2595 httpServerPort := httpServerPort asValue. |
|
2596 org_httpServerLogFile := httpServerLogFile. |
|
2597 httpServerLogFile := httpServerLogFile asValue. |
|
2598 |
|
2599 httpServerRunning |
|
2600 onChangeEvaluate:[ |
|
2601 httpServerFileRoot value:(HTTPServer fileRoot). |
|
2602 httpServerHomeURL value:(HTTPServer homeURL). |
|
2603 httpServerPort value:(HTTPServer defaultPort). |
|
2604 httpServerLogFile value:(HTTPServer defaultLogFile) |
|
2605 ]. |
|
2606 |
|
2607 hasSwiki := false. |
|
2608 swikiEnabled := false. |
|
2609 soapEnabled := false. |
|
2610 |
|
2611 (hasSwiki := PWS::SwikiAction notNil) ifTrue:[ |
|
2612 PWS::SwikiAction isLoaded ifTrue:[ |
|
2613 (HTTPServer notNil and:[HTTPServer isLoaded]) ifTrue:[ |
|
2614 swikiEnabled := HTTPServer hasMySwikiConfigured. |
|
2615 swikiRoot := PWS::SwikiAction serverDirectory. |
|
2616 ] |
|
2617 ]. |
|
2618 ]. |
|
2619 (hasSoap := SOAP::SoapHttpModule notNil) ifTrue:[ |
|
2620 SOAP::SoapHttpModule isLoaded ifTrue:[ |
|
2621 (HTTPServer notNil and:[HTTPServer isLoaded]) ifTrue:[ |
|
2622 soapEnabled := HTTPServer hasSoapEnabled. |
|
2623 ] |
|
2624 ]. |
|
2625 ]. |
|
2626 |
|
2627 org_swikiRoot := swikiRoot. |
|
2628 org_swikiEnabled := swikiEnabled. |
|
2629 org_soapEnabled := soapEnabled. |
|
2630 swikiRoot := swikiRoot asValue. |
|
2631 swikiEnabled := swikiEnabled asValue. |
|
2632 soapEnabled := soapEnabled asValue. |
|
2633 |
|
2634 swikiEnabled |
|
2635 onChangeEvaluate:[ |
|
2636 swikiRoot value:(PWS::SwikiAction serverDirectory). |
|
2637 ]. |
|
2638 |
|
2639 allowEmbedded := HTTPServer isLoaded and:[HTTPServer enableEmbeddedSmalltalk]. |
|
2640 org_allowEmbedded := allowEmbedded. |
|
2641 allowEmbedded := allowEmbedded asValue. |
|
2642 |
|
2643 "/ |
|
2644 "/ osi settings ... |
|
2645 "/ |
|
2646 osiACSEPresent := OSI::ACSE notNil and:[OSI::ACSE isLoaded]. |
|
2647 osiROSEPresent := OSI::ROSE notNil and:[OSI::ROSE isLoaded]. |
|
2648 osiCMISEPresent := OSI::CMISE notNil and:[OSI::CMISE isLoaded]. |
|
2649 |
|
2650 osiACSEPresent ifTrue:[ |
|
2651 osiACSEErrorLogging := OSI::ACSE errorLogging asValue. |
|
2652 osiACSEConnectionLogging := OSI::ACSE connectionLogging asValue. |
|
2653 osiACSEDataLogging := OSI::ACSE dataLogging asValue. |
|
2654 ]. |
|
2655 osiROSEPresent ifTrue:[ |
|
2656 osiROSEErrorLogging := OSI::ROSE errorLogging asValue. |
|
2657 osiROSEInvokationLogging := OSI::ROSE invocationLogging asValue. |
|
2658 osiROSEResponseLogging := OSI::ROSE responseLogging asValue. |
|
2659 ]. |
|
2660 osiCMISEPresent ifTrue:[ |
|
2661 osiCMISEErrorLogging := OSI::CMISE errorLogging asValue. |
|
2662 osiCMISEMessageLogging := OSI::CMISE messageLogging asValue. |
|
2663 ]. |
|
2664 |
|
2665 "/ |
|
2666 "/ create a box on those values ... |
|
2667 "/ |
|
2668 box := DialogBox new. |
|
2669 box label:(resources string:'Communication settings'). |
|
2670 |
|
2671 box addTextLabel:(resources string:'Remote browsing'). |
|
2672 |
|
2673 check := box addCheckBox:(resources string:'Remote browsing enabled') on:remoteBrowsingEnabled. |
|
2674 hasRemoteBrowsingSupport ifFalse:[ |
|
2675 check disable |
|
2676 ]. |
|
2677 box addHorizontalLine. |
|
2678 |
|
2679 box addTextLabel:(resources string:'Window migration'). |
|
2680 |
|
2681 check := box addCheckBox:(resources string:'Window migration enabled') on:windowMigrationEnabled. |
|
2682 hasWindowMigrationServer ifFalse:[ |
|
2683 check disable |
|
2684 ]. |
|
2685 check := box addCheckBox:(resources string:'Password check') on:windowMigrationAuthenticate. |
|
2686 check enableChannel:windowMigrationEnabled. |
|
2687 hasWindowMigrationServer ifFalse:[ |
|
2688 check disable |
|
2689 ]. |
|
2690 box leftIndent:20. |
|
2691 in := box |
|
2692 addLabelledInputField:(resources string:'Password:') |
|
2693 adjust:#right |
|
2694 on:nil |
|
2695 tabable:true |
|
2696 separateAtX:0.3. |
|
2697 in passwordCharacter:$*. |
|
2698 in model:windowMigrationPassword. |
|
2699 in acceptChannel:acceptChannel. |
|
2700 in enableChannel:windowMigrationAuthenticate. |
|
2701 box leftIndent:0. |
|
2702 |
|
2703 box addHorizontalLine. |
|
2704 |
|
2705 box addTextLabel:'RDoIt Server'. |
|
2706 |
|
2707 check := box addCheckBox:(resources string:'Remote doits enabled') on:rDoitsEnabled. |
|
2708 hasRDoitServer ifFalse:[ |
|
2709 check disable |
|
2710 ]. |
|
2711 box leftIndent:20. |
|
2712 rDoitsEnabled onChangeEvaluate:[ rDoitsEnabled value ifTrue:[ |
|
2713 rDoitServerPort value isNil ifTrue:[ |
|
2714 rDoitServerPort value:(RDoItServer defaultPortNumber). |
|
2715 ] |
|
2716 ] |
|
2717 ]. |
|
2718 |
|
2719 in := box |
|
2720 addLabelledInputField:(resources string:'Port:') |
|
2721 adjust:#right |
|
2722 on:nil |
|
2723 tabable:true |
|
2724 separateAtX:0.3. |
|
2725 in converter:(PrintConverter new initForNumber). |
|
2726 in model:rDoitServerPort. |
|
2727 in acceptChannel:acceptChannel. |
|
2728 in enableChannel:rDoitsEnabled. |
|
2729 |
|
2730 y := box yPosition. |
|
2731 check := box addCheckBox:(resources string:'Log errors') on:rDoitErrorLogging. |
|
2732 check width:0.4. |
|
2733 check enableChannel:rDoitsEnabled. |
|
2734 hasRDoitServer ifFalse:[ |
|
2735 check disable |
|
2736 ]. |
|
2737 box yPosition:y. |
|
2738 check := box addCheckBox:(resources string:'Log requests') on:rDoitLogging. |
|
2739 check left:0.4; width:0.4. |
|
2740 check enableChannel:rDoitsEnabled. |
|
2741 hasRDoitServer ifFalse:[ |
|
2742 check disable |
|
2743 ]. |
|
2744 check := box addCheckBox:(resources string:'Debug errors') on:rDoitErrorDebugging. |
|
2745 check width:0.4. |
|
2746 check enableChannel:rDoitsEnabled. |
|
2747 hasRDoitServer ifFalse:[ |
|
2748 check disable |
|
2749 ]. |
|
2750 box leftIndent:0. |
|
2751 |
|
2752 box addHorizontalLine. |
|
2753 |
|
2754 box addTextLabel:'HTTP Server'. |
|
2755 |
|
2756 check := box addCheckBox:(resources string:'Serving HTTP Requests') on:httpServerRunning. |
|
2757 hasHTTPServer ifFalse:[ |
|
2758 check disable |
|
2759 ]. |
|
2760 box leftIndent:20. |
|
2761 in := box |
|
2762 addLabelledInputField:(resources string:'Port:') |
|
2763 adjust:#right |
|
2764 on:nil |
|
2765 tabable:true |
|
2766 separateAtX:0.3. |
|
2767 in converter:(PrintConverter new initForNumber). |
|
2768 in model:httpServerPort. |
|
2769 in acceptChannel:acceptChannel. |
|
2770 in enableChannel:httpServerRunning. |
|
2771 |
|
2772 in := box |
|
2773 addLabelledInputField:(resources string:'Log File:') |
|
2774 adjust:#right |
|
2775 on:httpServerLogFile |
|
2776 tabable:true |
|
2777 separateAtX:0.3. |
|
2778 in acceptChannel:acceptChannel. |
|
2779 in enableChannel:httpServerRunning. |
|
2780 |
|
2781 in := box |
|
2782 addLabelledInputField:(resources string:'File Root:') |
|
2783 adjust:#right |
|
2784 on:httpServerFileRoot |
|
2785 tabable:true |
|
2786 separateAtX:0.3. |
|
2787 in acceptChannel:acceptChannel. |
|
2788 in enableChannel:httpServerRunning. |
|
2789 |
|
2790 in := box |
|
2791 addLabelledInputField:(resources string:'Home URL:') |
|
2792 adjust:#right |
|
2793 on:httpServerHomeURL |
|
2794 tabable:true |
|
2795 separateAtX:0.3. |
|
2796 in acceptChannel:acceptChannel. |
|
2797 in enableChannel:httpServerRunning. |
|
2798 |
|
2799 check := box addCheckBox:(resources string:'Swiki enabled') on:swikiEnabled. |
|
2800 hasHTTPServer ifFalse:[ |
|
2801 check disable |
|
2802 ]. |
|
2803 check enableChannel:httpServerRunning. |
|
2804 |
|
2805 "/ box leftIndent:40. |
|
2806 |
|
2807 in := box |
|
2808 addLabelledInputField:(resources string:'SwikiRoot:') |
|
2809 adjust:#right |
|
2810 on:swikiRoot |
|
2811 tabable:true |
|
2812 separateAtX:0.3. |
|
2813 in acceptChannel:acceptChannel. |
|
2814 in enableChannel:(BlockValue forLogical:httpServerRunning and:swikiEnabled). |
|
2815 |
|
2816 check := box addCheckBox:(resources string:'Allow embedded ST applications') on:allowEmbedded. |
|
2817 hasHTTPServer ifFalse:[ |
|
2818 check disable |
|
2819 ]. |
|
2820 check enableChannel:httpServerRunning. |
|
2821 |
|
2822 check := box addCheckBox:(resources string:'Soap enabled') on:soapEnabled. |
|
2823 hasHTTPServer ifFalse:[ |
|
2824 check disable |
|
2825 ]. |
|
2826 check enableChannel:httpServerRunning. |
|
2827 |
|
2828 box leftIndent:0. |
|
2829 box addHorizontalLine. |
|
2830 |
|
2831 box addTextLabel:(resources string:'OSI Protocols (addOn package)'). |
|
2832 |
|
2833 y := box yPosition. |
|
2834 check := box addCheckBox:(resources string:'Log %1 Errors' with:'ACSE') on:osiACSEErrorLogging. |
|
2835 check width:0.33. |
|
2836 osiACSEPresent ifFalse:[ |
|
2837 check disable |
|
2838 ]. |
|
2839 |
|
2840 box yPosition:y. |
|
2841 check := box addCheckBox:(resources string:'Connections') on:osiACSEConnectionLogging. |
|
2842 osiACSEPresent ifFalse:[ |
|
2843 check disable |
|
2844 ]. |
|
2845 check left:0.33; width:0.33. |
|
2846 |
|
2847 box yPosition:y. |
|
2848 check := box addCheckBox:(resources string:'Data Xfer') on:osiACSEDataLogging. |
|
2849 osiACSEPresent ifFalse:[ |
|
2850 check disable |
|
2851 ]. |
|
2852 check left:0.66; width:0.34. |
|
2853 |
|
2854 |
|
2855 box addVerticalSpace. |
|
2856 |
|
2857 y := box yPosition. |
|
2858 check := box addCheckBox:(resources string:'Log %1 Errors' with:'ROSE') on:osiROSEErrorLogging. |
|
2859 osiROSEPresent ifFalse:[ |
|
2860 check disable |
|
2861 ]. |
|
2862 check width:0.33. |
|
2863 |
|
2864 box yPosition:y. |
|
2865 check := box addCheckBox:(resources string:'Invoactions') on:osiROSEInvokationLogging. |
|
2866 osiROSEPresent ifFalse:[ |
|
2867 check disable |
|
2868 ]. |
|
2869 check left:0.33; width:0.33. |
|
2870 |
|
2871 box yPosition:y. |
|
2872 check := box addCheckBox:(resources string:'Responses') on:osiROSEResponseLogging. |
|
2873 osiROSEPresent ifFalse:[ |
|
2874 check disable |
|
2875 ]. |
|
2876 check left:0.66; width:0.34. |
|
2877 |
|
2878 box addVerticalSpace. |
|
2879 |
|
2880 y := box yPosition. |
|
2881 check := box addCheckBox:(resources string:'Log %1 Errors' with:'CMISE') on:osiCMISEErrorLogging. |
|
2882 osiCMISEPresent ifFalse:[ |
|
2883 check disable |
|
2884 ]. |
|
2885 check width:0.33. |
|
2886 |
|
2887 box yPosition:y. |
|
2888 check := box addCheckBox:(resources string:'Messages') on:osiCMISEMessageLogging. |
|
2889 osiCMISEPresent ifFalse:[ |
|
2890 check disable |
|
2891 ]. |
|
2892 check left:0.33; width:0.33. |
|
2893 |
|
2894 |
|
2895 box addHorizontalLine. |
|
2896 box |
|
2897 addHelpButtonFor:'Launcher/communicationsSettings.html'; |
|
2898 addAbortAndOkButtons. |
|
2899 |
|
2900 "/ |
|
2901 "/ show the box ... |
|
2902 "/ |
|
2903 box open. |
|
2904 |
|
2905 "/ |
|
2906 "/ update system settings |
|
2907 "/ |
|
2908 box accepted ifTrue:[ |
|
2909 acceptChannel value:false; value:true. |
|
2910 |
|
2911 hasRemoteBrowsingSupport ifTrue:[ |
|
2912 remoteBrowsingEnabled := remoteBrowsingEnabled value. |
|
2913 (remoteBrowsingEnabled ~~ org_remoteBrowsingEnabled) ifTrue:[ |
|
2914 remoteBrowsingEnabled ~~ SmalltalkShareServer serverRunning ifTrue:[ |
|
2915 remoteBrowsingEnabled ifFalse:[ |
|
2916 SmalltalkShareServer killAll |
|
2917 ] ifTrue:[ |
|
2918 SmalltalkShareServer start. |
|
2919 "/ must wait a bit; give it a chance to |
|
2920 "/ really start (before checking) |
|
2921 Delay waitForSeconds:0.5. |
|
2922 SmalltalkShareServer serverRunning ifFalse:[ |
|
2923 self warn:'SmalltalkShareServer startup failed (see stderr).' |
|
2924 ] |
|
2925 ] |
|
2926 ]. |
|
2927 ] |
|
2928 ]. |
|
2929 |
|
2930 hasWindowMigrationServer ifTrue:[ |
|
2931 windowMigrationEnabled := windowMigrationEnabled value. |
|
2932 windowMigrationAuthenticate := windowMigrationAuthenticate value. |
|
2933 windowMigrationPassword := windowMigrationPassword value. |
|
2934 (windowMigrationEnabled ~~ org_windowMigrationEnabled |
|
2935 or:[windowMigrationAuthenticate ~~ org_windowMigrationAuthenticate |
|
2936 or:[windowMigrationPassword ~~ org_windowMigrationPassword]]) ifTrue:[ |
|
2937 windowMigrationAuthenticate ~~ org_windowMigrationAuthenticate ifTrue:[ |
|
2938 windowMigrationAuthenticate ifFalse:[ |
|
2939 WindowMigrationServer password:nil |
|
2940 ] ifTrue:[ |
|
2941 WindowMigrationServer password:windowMigrationPassword |
|
2942 ]. |
|
2943 ]. |
|
2944 windowMigrationEnabled ~~ WindowMigrationServer serverRunning ifTrue:[ |
|
2945 windowMigrationEnabled ifFalse:[ |
|
2946 WindowMigrationServer stop |
|
2947 ] ifTrue:[ |
|
2948 WindowMigrationServer start. |
|
2949 "/ must wait a bit; give it a chance to |
|
2950 "/ really start (before checking) |
|
2951 Delay waitForSeconds:0.5. |
|
2952 WindowMigrationServer serverRunning ifFalse:[ |
|
2953 self warn:'WindowMigrationServer startup failed (see stderr).' |
|
2954 ] |
|
2955 ] |
|
2956 ]. |
|
2957 ] |
|
2958 ]. |
|
2959 |
|
2960 hasRDoitServer ifTrue:[ |
|
2961 (rDoitLogging value ~~ org_rDoitLogging |
|
2962 or:[rDoitErrorDebugging value ~~ org_rDoitErrorDebugging |
|
2963 or:[rDoitErrorLogging value ~~ org_rDoitErrorLogging |
|
2964 or:[rDoitsEnabled value ~~ org_rDoitsEnabled |
|
2965 or:[rDoitServerPort value ~~ org_rDoitServerPort]]]]) ifTrue:[ |
|
2966 RDoItServer autoload. |
|
2967 RDoItServer defaultPortNumber:rDoitServerPort value. |
|
2968 RDoItServer logging:(rDoitLogging value). |
|
2969 RDoItServer errorLogging:(rDoitErrorLogging value). |
|
2970 RDoItServer errorCatching:(rDoitErrorDebugging value not). |
|
2971 rDoitsEnabled := rDoitsEnabled value. |
|
2972 rDoitsEnabled ~~ RDoItServer serverRunning ifTrue:[ |
|
2973 rDoitsEnabled ifFalse:[ |
|
2974 RDoItServer stop |
|
2975 ] ifTrue:[ |
|
2976 RDoItServer start. |
|
2977 "/ must wait a bit; give it a chance to |
|
2978 "/ really start (before checking) |
|
2979 Delay waitForSeconds:0.5. |
|
2980 RDoItServer serverRunning ifFalse:[ |
|
2981 self warn:'RDoit startup failed (see stderr).' |
|
2982 ] |
|
2983 ] |
|
2984 ]. |
|
2985 ]. |
|
2986 ]. |
|
2987 |
|
2988 (hasHTTPServer and:[HTTPServer isLoaded]) ifTrue:[ |
|
2989 httpServerPort := httpServerPort value. |
|
2990 org_httpServerPort ~= httpServerPort ifTrue:[ |
|
2991 HTTPServer defaultPort:httpServerPort. |
|
2992 ]. |
|
2993 |
|
2994 httpServerFileRoot := httpServerFileRoot value. |
|
2995 httpServerFileRoot size == 0 ifTrue:[ |
|
2996 httpServerFileRoot := nil |
|
2997 ]. |
|
2998 org_httpServerFileRoot ~= httpServerFileRoot ifTrue:[ |
|
2999 HTTPServer fileRoot:httpServerFileRoot. |
|
3000 ]. |
|
3001 |
|
3002 httpServerLogFile := httpServerLogFile value. |
|
3003 httpServerLogFile size == 0 ifTrue:[ |
|
3004 httpServerLogFile := nil |
|
3005 ]. |
|
3006 org_httpServerLogFile ~= httpServerLogFile ifTrue:[ |
|
3007 HTTPServer defaultLogFile:httpServerLogFile. |
|
3008 ]. |
|
3009 |
|
3010 httpServerHomeURL := httpServerHomeURL value. |
|
3011 httpServerHomeURL size == 0 ifTrue:[ |
|
3012 httpServerHomeURL := nil |
|
3013 ]. |
|
3014 org_httpServerHomeURL ~= httpServerHomeURL ifTrue:[ |
|
3015 HTTPServer homeURL:httpServerHomeURL. |
|
3016 ]. |
|
3017 |
|
3018 httpServerRunning value ~~ org_httpServerRunning ifTrue:[ |
|
3019 httpServerRunning value ifTrue:[ |
|
3020 HTTPServer startServer |
|
3021 ] ifFalse:[ |
|
3022 HTTPServer stopServer |
|
3023 ] |
|
3024 ]. |
|
3025 ]. |
|
3026 |
|
3027 hasSwiki ifTrue:[ |
|
3028 swikiRoot := swikiRoot value. |
|
3029 swikiRoot size == 0 ifTrue:[ |
|
3030 swikiRoot := nil |
|
3031 ]. |
|
3032 org_swikiRoot ~= swikiRoot ifTrue:[ |
|
3033 PWS::ServerAction serverDirectory:swikiRoot. |
|
3034 ]. |
|
3035 |
|
3036 swikiEnabled value ~~ org_swikiEnabled ifTrue:[ |
|
3037 swikiEnabled value ifTrue:[ |
|
3038 HTTPServer setupMySwiki |
|
3039 ] ifFalse:[ |
|
3040 HTTPServer disableMySwiki |
|
3041 ] |
|
3042 ]. |
|
3043 allowEmbedded value ~~ org_allowEmbedded ifTrue:[ |
|
3044 HTTPServer enableEmbeddedSmalltalk:allowEmbedded value |
|
3045 ]. |
|
3046 ]. |
|
3047 hasSoap ifTrue:[ |
|
3048 soapEnabled value ~~ org_soapEnabled ifTrue:[ |
|
3049 soapEnabled value ifTrue:[ |
|
3050 HTTPServer setupSoap |
|
3051 ] ifFalse:[ |
|
3052 HTTPServer disableSoap |
|
3053 ] |
|
3054 ]. |
|
3055 ]. |
|
3056 |
|
3057 osiACSEPresent ifTrue:[ |
|
3058 OSI::ACSE errorLogging:osiACSEErrorLogging value. |
|
3059 OSI::ACSE connectionLogging:osiACSEConnectionLogging value. |
|
3060 OSI::ACSE dataLogging:osiACSEDataLogging value. |
|
3061 ]. |
|
3062 osiROSEPresent ifTrue:[ |
|
3063 OSI::ROSE errorLogging:osiROSEErrorLogging value. |
|
3064 OSI::ROSE invocationLogging:osiROSEInvokationLogging value. |
|
3065 OSI::ROSE responseLogging:osiROSEResponseLogging value. |
|
3066 ]. |
|
3067 osiCMISEPresent ifTrue:[ |
|
3068 OSI::CMISE errorLogging:osiCMISEErrorLogging value. |
|
3069 OSI::CMISE messageLogging:osiCMISEMessageLogging value. |
|
3070 ]. |
|
3071 ]. |
|
3072 box destroy |
|
3073 |
|
3074 "Modified: / 28.6.1999 / 15:44:35 / stefan" |
|
3075 "Modified: / 20.1.2000 / 19:14:18 / cg" |
|
3076 ! |
|
3077 |
|
3078 compilerSettings |
|
3079 "open a dialog on compiler related settings" |
|
3080 |
|
3081 |box warnings warnSTX warnUnderscore warnDollar warnOldStyle warnUnusedVars |
|
3082 allowDollar allowUnderscore allowSqueakExtensions allowQualifiedNames |
|
3083 allowDolphinExtensions allowOldStyleAssignment allowReservedWordsAsSelectors |
|
3084 immutableArrays |
|
3085 warnSTXBox warnUnderscoreBox warnOldStyleBox warnCommonMistakes warnCommonMistakesBox |
|
3086 warnCompatibility warnCompatibilityBox warnDollarBox warnUnusedVarsBox |
|
3087 stcCompilation compilationList stcCompilationOptions |
|
3088 historyLines fullHistoryUpdate |
|
3089 catchMethodRedefs catchClassRedefs keepSourceOptions keepSource |
|
3090 constantFoldingOptions constantFolding justInTimeCompilation |
|
3091 warnEnabler check component oldIndent supportsJustInTimeCompilation y |
|
3092 y2 fullDebugSupport yMax |
|
3093 compileLazy loadBinaries canLoadBinaries strings idx thisIsADemoVersion |
|
3094 resources stcSetupButt| |
|
3095 |
|
3096 resources := self owningClass classResources. |
|
3097 |
|
3098 canLoadBinaries := ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]. |
|
3099 loadBinaries := Smalltalk loadBinaries asValue. |
|
3100 compileLazy := Autoload compileLazy asValue. |
|
3101 |
|
3102 warnings := Compiler warnings asValue. |
|
3103 |
|
3104 warnSTX := Compiler warnSTXSpecials asValue. |
|
3105 warnUnderscore := Compiler warnUnderscoreInIdentifier asValue. |
|
3106 warnDollar := Compiler warnDollarInIdentifier asValue. |
|
3107 warnOldStyle := Compiler warnOldStyleAssignment asValue. |
|
3108 warnCommonMistakes := Compiler warnCommonMistakes asValue. |
|
3109 warnCompatibility := Compiler warnPossibleIncompatibilities asValue. |
|
3110 warnUnusedVars := Compiler warnUnusedVars asValue. |
|
3111 allowUnderscore := Compiler allowUnderscoreInIdentifier asValue. |
|
3112 allowDollar := Compiler allowDollarInIdentifier asValue. |
|
3113 allowSqueakExtensions := Compiler allowSqueakExtensions asValue. |
|
3114 allowDolphinExtensions := Compiler allowDolphinExtensions asValue. |
|
3115 allowQualifiedNames := Compiler allowQualifiedNames asValue. |
|
3116 allowOldStyleAssignment := Compiler allowOldStyleAssignment asValue. |
|
3117 allowReservedWordsAsSelectors := Compiler allowReservedWordsAsSelectors asValue. |
|
3118 immutableArrays := Compiler arraysAreImmutable asValue. |
|
3119 |
|
3120 constantFoldingOptions := #( nil #level1 #level2 #full ). |
|
3121 constantFolding := SelectionInList new list:(resources array:#('disabled' 'level1 (always safe)' 'level2 (usually safe)' 'full')). |
|
3122 constantFolding selectionIndex:3. |
|
3123 |
|
3124 thisIsADemoVersion := (Smalltalk releaseIdentification = 'ST/X_free_demo_vsn'). |
|
3125 thisIsADemoVersion ifTrue:[ |
|
3126 stcCompilationOptions := #( never). |
|
3127 strings := #('never'). |
|
3128 idx := 1. |
|
3129 ] ifFalse:[ |
|
3130 stcCompilationOptions := #( always default never). |
|
3131 strings := #('always' 'primitive code only' 'never'). |
|
3132 idx := 2. |
|
3133 ]. |
|
3134 |
|
3135 stcCompilation := SelectionInList new list:(resources array:strings). |
|
3136 stcCompilation selectionIndex:idx. |
|
3137 |
|
3138 (supportsJustInTimeCompilation := ObjectMemory supportsJustInTimeCompilation) |
|
3139 ifTrue:[ |
|
3140 justInTimeCompilation := ObjectMemory justInTimeCompilation. |
|
3141 fullDebugSupport := ObjectMemory fullSingleStepSupport. |
|
3142 ] ifFalse:[ |
|
3143 justInTimeCompilation := false. |
|
3144 fullDebugSupport := (Compiler lineNumberInfo == #full) asValue. |
|
3145 ]. |
|
3146 justInTimeCompilation := justInTimeCompilation asValue. |
|
3147 fullDebugSupport := fullDebugSupport asValue. |
|
3148 |
|
3149 catchMethodRedefs := Class catchMethodRedefinitions asValue. |
|
3150 catchClassRedefs := Class catchClassRedefinitions asValue. |
|
3151 historyLines := HistoryManager notNil and:[HistoryManager isLoaded and:[HistoryManager isActive]]. |
|
3152 historyLines ifFalse:[ |
|
3153 fullHistoryUpdate := false asValue |
|
3154 ] ifTrue:[ |
|
3155 fullHistoryUpdate := HistoryManager fullHistoryUpdate asValue. |
|
3156 ]. |
|
3157 historyLines := historyLines asValue. |
|
3158 |
|
3159 keepSourceOptions := #( keep reference absReference sourceReference discard ). |
|
3160 keepSource := SelectionInList new |
|
3161 list:(resources array:#('Keep as String' 'Reference to Filename' 'Reference to Full Path' 'Append and Ref in `st.src''' 'Discard' )). |
|
3162 keepSource selectionIndex:1. |
|
3163 |
|
3164 warnEnabler := [ |
|
3165 warnings value ifTrue:[ |
|
3166 warnSTXBox enable. |
|
3167 warnOldStyleBox enable. |
|
3168 warnCommonMistakesBox enable. |
|
3169 warnCompatibilityBox enable. |
|
3170 warnUnusedVarsBox enable. |
|
3171 allowUnderscore value ifTrue:[ |
|
3172 warnUnderscoreBox enable. |
|
3173 ] ifFalse:[ |
|
3174 warnUnderscoreBox disable. |
|
3175 ]. |
|
3176 allowDollar value ifTrue:[ |
|
3177 warnDollarBox enable. |
|
3178 ] ifFalse:[ |
|
3179 warnDollarBox disable. |
|
3180 ]. |
|
3181 ] ifFalse:[ |
|
3182 warnSTXBox disable. |
|
3183 warnUnderscoreBox disable. |
|
3184 warnDollarBox disable. |
|
3185 warnOldStyleBox disable. |
|
3186 warnCommonMistakesBox disable. |
|
3187 warnCompatibilityBox disable. |
|
3188 warnUnusedVarsBox disable. |
|
3189 ]]. |
|
3190 |
|
3191 warnings onChangeEvaluate:warnEnabler. |
|
3192 allowUnderscore onChangeEvaluate:warnEnabler. |
|
3193 allowDollar onChangeEvaluate:warnEnabler. |
|
3194 "/ allowSqueakExtensions onChangeEvaluate:warnEnabler. |
|
3195 "/ allowQualifiedNames onChangeEvaluate:warnEnabler. |
|
3196 |
|
3197 box := DialogBox new. |
|
3198 box label:(resources string:'Compiler Settings'). |
|
3199 |
|
3200 y := box yPosition. |
|
3201 check := box addCheckBox:(resources string:'Catch Method Redefinitions') on:catchMethodRedefs. |
|
3202 check width:0.5. |
|
3203 |
|
3204 box yPosition:y. |
|
3205 check := box addCheckBox:(resources string:'Catch Class Redefinitions') on:catchClassRedefs. |
|
3206 check left:0.5; width:0.5. |
|
3207 |
|
3208 y := box yPosition. |
|
3209 check := box addCheckBox:(resources string:'Keep History Line in Methods') on:historyLines. |
|
3210 check width:0.5. |
|
3211 HistoryManager isNil ifTrue:[check disable]. |
|
3212 box yPosition:y. |
|
3213 check := box addCheckBox:(resources string:'Keep Full Class History') on:fullHistoryUpdate. |
|
3214 check left:0.5; width:0.5. |
|
3215 HistoryManager isNil ifTrue:[check disable] ifFalse:[check enableChannel:historyLines]. |
|
3216 |
|
3217 box addPopUpList:(resources string:'FileIn Source Mode:') on:keepSource. |
|
3218 keepSource selectionIndex:( keepSourceOptions indexOf:(ClassCategoryReader sourceMode) ifAbsent:1). |
|
3219 |
|
3220 box addHorizontalLine. |
|
3221 |
|
3222 box addCheckBox:(resources string:'Lazy Compilation when Autoloading') on:compileLazy. |
|
3223 check := box addCheckBox:(resources string:'If Present, Load Binary Objects when Autoloading') on:loadBinaries. |
|
3224 canLoadBinaries ifFalse:[ |
|
3225 loadBinaries value:false. |
|
3226 check disable |
|
3227 ]. |
|
3228 supportsJustInTimeCompilation ifTrue:[ |
|
3229 component := box |
|
3230 addCheckBox:(resources string:'Just in Time Compilation to Machine Code') |
|
3231 on:justInTimeCompilation. |
|
3232 ]. |
|
3233 |
|
3234 box addHorizontalLine. |
|
3235 |
|
3236 ObjectFileLoader notNil ifTrue:[ |
|
3237 compilationList := box addPopUpList:(resources string:'Stc Compilation to Machine Code') on:stcCompilation. |
|
3238 |
|
3239 thisIsADemoVersion ifFalse:[ |
|
3240 stcCompilation selectionIndex:( stcCompilationOptions indexOf:(Compiler stcCompilation) ifAbsent:2). |
|
3241 |
|
3242 stcSetupButt := box addComponent:(Button label:(resources string:'Stc Compilation Parameters...') |
|
3243 action:[|manager| |
|
3244 |
|
3245 self stcCompilerSettings. |
|
3246 ]). |
|
3247 ]. |
|
3248 |
|
3249 box addHorizontalLine. |
|
3250 |
|
3251 "/ if there is no compiler around, |
|
3252 "/ change to compile nothing, and disable the checkBoxes |
|
3253 Compiler canCreateMachineCode ifFalse:[ |
|
3254 stcCompilation selectionIndex:(3 min:stcCompilationOptions size). |
|
3255 compilationList disable. |
|
3256 ]. |
|
3257 ]. |
|
3258 |
|
3259 y := box yPosition. |
|
3260 |
|
3261 component := box addCheckBox:(resources string:'Allow Underscore in Identifiers') on:allowUnderscore. |
|
3262 component width:0.4. |
|
3263 |
|
3264 component := box addCheckBox:(resources string:'Allow Dollar in Identifiers') on:allowDollar. |
|
3265 component width:0.4. |
|
3266 |
|
3267 component := box addCheckBox:(resources string:'Allow VW3 QualifiedNames') on:allowQualifiedNames. |
|
3268 component width:0.4. |
|
3269 |
|
3270 component := box addCheckBox:(resources string:'Allow Squeak Extensions') on:allowSqueakExtensions. |
|
3271 component width:0.4. |
|
3272 |
|
3273 component := box addCheckBox:(resources string:'Allow Dolphin Extensions') on:allowDolphinExtensions. |
|
3274 component width:0.4. |
|
3275 |
|
3276 y2 := box yPosition. |
|
3277 |
|
3278 box yPosition:y. |
|
3279 box leftIndent:0. |
|
3280 |
|
3281 component :=box addPopUpList:(resources string:'Constant Folding:') on:constantFolding. |
|
3282 component superView left:0.5; width:0.5. |
|
3283 constantFolding selectionIndex:( constantFoldingOptions indexOf:(Compiler foldConstants) ifAbsent:1). |
|
3284 |
|
3285 component := box addCheckBox:(resources string:'Allow OldStyle Assignment (_)') on:allowOldStyleAssignment. |
|
3286 component left:0.5; width:0.4. |
|
3287 |
|
3288 component := box addCheckBox:(resources string:'Allow Reserved Words as Selector (self)') on:allowReservedWordsAsSelectors. |
|
3289 component left:0.5; width:0.4. |
|
3290 |
|
3291 component := box addCheckBox:(resources string:'Full Debug Info') on:fullDebugSupport. |
|
3292 component left:0.5; width:0.4. |
|
3293 |
|
3294 component := box addCheckBox:(resources string:'Literal Arrays are Immutable') on:immutableArrays. |
|
3295 component left:0.5; width:0.4. |
|
3296 |
|
3297 box yPosition:(box yPosition max:y2). |
|
3298 |
|
3299 |
|
3300 box addHorizontalLine. |
|
3301 |
|
3302 box addCheckBox:(resources string:'Warnings') on:warnings. |
|
3303 "/ box addVerticalSpace. |
|
3304 oldIndent := box leftIndent. |
|
3305 box leftIndent:30. |
|
3306 |
|
3307 y := box yPosition. |
|
3308 |
|
3309 warnSTXBox := box addCheckBox:(resources string:'ST/X Extensions') on:warnSTX. |
|
3310 warnSTXBox width:0.4. |
|
3311 |
|
3312 warnUnderscoreBox := box addCheckBox:(resources string:'Underscores in Identifiers') on:warnUnderscore. |
|
3313 warnUnderscoreBox width:0.4. |
|
3314 |
|
3315 warnDollarBox := box addCheckBox:(resources string:'Dollars in Identifiers') on:warnDollar. |
|
3316 warnDollarBox width:0.4. |
|
3317 |
|
3318 warnUnusedVarsBox := box addCheckBox:(resources string:'Unused Method Variables') on:warnUnusedVars. |
|
3319 warnUnusedVarsBox width:0.4. |
|
3320 |
|
3321 yMax := box yPosition. |
|
3322 |
|
3323 box yPosition:y. |
|
3324 box leftIndent:0. |
|
3325 warnOldStyleBox := box addCheckBox:(resources string:'OldStyle Assignment') on:warnOldStyle. |
|
3326 warnOldStyleBox left:0.5; width:0.4. |
|
3327 |
|
3328 warnCommonMistakesBox := box addCheckBox:(resources string:'Common Mistakes') on:warnCommonMistakes. |
|
3329 warnCommonMistakesBox left:0.5; width:0.4. |
|
3330 |
|
3331 warnCompatibilityBox := box addCheckBox:(resources string:'Possible Incompatibilities') on:warnCompatibility. |
|
3332 warnCompatibilityBox left:0.5; width:0.4. |
|
3333 |
|
3334 box leftIndent:oldIndent. |
|
3335 box yPosition:(yMax max: box yPosition). |
|
3336 |
|
3337 box addHorizontalLine. |
|
3338 box |
|
3339 addHelpButtonFor:'Launcher/compilerSettings.html'; |
|
3340 addAbortAndOkButtons. |
|
3341 |
|
3342 warnEnabler value. |
|
3343 box open. |
|
3344 |
|
3345 box accepted ifTrue:[ |
|
3346 HistoryManager notNil ifTrue:[ |
|
3347 HistoryManager fullHistoryUpdate:fullHistoryUpdate value. |
|
3348 historyLines value ifTrue:[ |
|
3349 HistoryManager activate |
|
3350 ] ifFalse:[ |
|
3351 HistoryManager deactivate |
|
3352 ]. |
|
3353 ]. |
|
3354 Class catchMethodRedefinitions:catchMethodRedefs value. |
|
3355 Class catchClassRedefinitions:catchClassRedefs value. |
|
3356 ClassCategoryReader sourceMode:(keepSourceOptions at:keepSource selectionIndex). |
|
3357 Compiler warnings:warnings value. |
|
3358 Compiler warnSTXSpecials:warnSTX value. |
|
3359 Compiler warnOldStyleAssignment:warnOldStyle value. |
|
3360 Compiler warnUnderscoreInIdentifier:warnUnderscore value. |
|
3361 Compiler warnDollarInIdentifier:warnDollar value. |
|
3362 Compiler warnCommonMistakes:warnCommonMistakes value. |
|
3363 Compiler warnPossibleIncompatibilities:warnCompatibility value. |
|
3364 Compiler warnUnusedVars:warnUnusedVars value. |
|
3365 Compiler allowUnderscoreInIdentifier:allowUnderscore value. |
|
3366 Compiler allowDollarInIdentifier:allowDollar value. |
|
3367 Compiler allowSqueakExtensions:allowSqueakExtensions value. |
|
3368 Compiler allowDolphinExtensions:allowDolphinExtensions value. |
|
3369 Compiler allowQualifiedNames:allowQualifiedNames value. |
|
3370 Compiler allowOldStyleAssignment:allowOldStyleAssignment value. |
|
3371 Compiler allowReservedWordsAsSelectors:allowReservedWordsAsSelectors value. |
|
3372 |
|
3373 Compiler arraysAreImmutable:immutableArrays value. |
|
3374 fullDebugSupport value ifTrue:[ |
|
3375 Compiler lineNumberInfo:#full. |
|
3376 ] ifFalse:[ |
|
3377 Compiler lineNumberInfo:true |
|
3378 ]. |
|
3379 |
|
3380 Compiler stcCompilation:(stcCompilationOptions at:stcCompilation selectionIndex). |
|
3381 Compiler foldConstants:(constantFoldingOptions at:constantFolding selectionIndex). |
|
3382 |
|
3383 supportsJustInTimeCompilation ifTrue:[ |
|
3384 justInTimeCompilation := justInTimeCompilation value. |
|
3385 justInTimeCompilation ifTrue:[ |
|
3386 Method allInstancesDo:[:m | m checked:false]. |
|
3387 ]. |
|
3388 ObjectMemory justInTimeCompilation:justInTimeCompilation. |
|
3389 ObjectMemory fullSingleStepSupport:fullDebugSupport value. |
|
3390 ]. |
|
3391 Autoload compileLazy:compileLazy value. |
|
3392 Smalltalk loadBinaries:loadBinaries value. |
|
3393 ]. |
|
3394 box destroy |
|
3395 |
|
3396 "Modified: / 10.9.1995 / 19:19:18 / claus" |
|
3397 "Modified: / 9.9.1996 / 22:42:47 / stefan" |
|
3398 "Modified: / 5.11.1998 / 14:25:59 / cg" |
|
3399 ! |
|
3400 |
|
3401 displaySettings |
|
3402 "open a dialog on display related settings" |
|
3403 |
|
3404 |box listOfSizes sizeInfos |
|
3405 sizes sizeNames sizeList sizeX sizeY deepIcons |
|
3406 isColorMonitor useFixPalette useFixGrayPalette idx ditherStyles ditherSyms ditherList |
|
3407 y component screen visual clipEncodings clipEncodingSyms clipEncodingList resources |
|
3408 | |
|
3409 |
|
3410 resources := self owningClass classResources. |
|
3411 |
|
3412 listOfSizes := resources at:'LIST_OF_OFFERED_SCREEN_SIZES' default:#default. |
|
3413 listOfSizes == #default ifTrue:[ |
|
3414 "/ nothing in resource file; offer at least some. |
|
3415 sizeInfos := #( |
|
3416 ( '11.3'' (235mm x 175mm) LCD' (235 175) ) |
|
3417 ( '17'' (325mm x 245mm)' (325 245) ) |
|
3418 ( '19'' (340mm x 270mm)' (340 270) ) |
|
3419 ( '20'' (350mm x 280mm)' (350 280) ) |
|
3420 ( '21'' (365mm x 285mm)' (365 285) ) |
|
3421 ). |
|
3422 ] ifFalse:[ |
|
3423 sizeInfos := resources array:listOfSizes. |
|
3424 ]. |
|
3425 sizeNames := sizeInfos collect:[:entry | entry at:1]. |
|
3426 sizes := sizeInfos collect:[:entry | entry at:2]. |
|
3427 |
|
3428 screen := Screen current. |
|
3429 visual := screen visualType. |
|
3430 |
|
3431 isColorMonitor := screen hasColors asValue. |
|
3432 deepIcons := screen supportsDeepIcons asValue. |
|
3433 useFixPalette := screen fixColors notNil asValue. |
|
3434 useFixGrayPalette := screen fixGrayColors notNil asValue. |
|
3435 |
|
3436 sizeList := SelectionInList with:sizeNames. |
|
3437 sizeX := screen widthInMillimeter asValue. |
|
3438 sizeY := screen heightInMillimeter asValue. |
|
3439 |
|
3440 clipEncodingSyms := #(nil #iso8859 #jis #jis7 #sjis #euc #big5). |
|
3441 clipEncodings := resources array:#('untranslated' 'iso8859' 'jis' 'jis7' 'shift-JIS' 'EUC' 'big5'). |
|
3442 clipEncodingList := SelectionInList new. |
|
3443 clipEncodingList list:clipEncodings. |
|
3444 clipEncodingList selectionIndex:(clipEncodingSyms indexOf:screen clipBoardEncoding ifAbsent:1). |
|
3445 |
|
3446 ditherList := SelectionInList new. |
|
3447 |
|
3448 (visual == #StaticGray or:[visual == #GrayScale]) ifTrue:[ |
|
3449 ditherStyles := #('threshold' 'ordered dither' 'error diffusion'). |
|
3450 ditherSyms := #(threshold ordered floydSteinberg). |
|
3451 ] ifFalse:[ |
|
3452 visual ~~ #TrueColor ifTrue:[ |
|
3453 ditherStyles := #('nearest color' 'error diffusion'). |
|
3454 ditherSyms := #(ordered floydSteinberg). |
|
3455 ] |
|
3456 ]. |
|
3457 ditherSyms notNil ifTrue:[ |
|
3458 ditherList list:ditherStyles. |
|
3459 ditherList selectionIndex:(ditherSyms indexOf:(Image ditherAlgorithm) ifAbsent:#threshold). |
|
3460 ]. |
|
3461 |
|
3462 box := DialogBox new. |
|
3463 box label:(resources string:'Display Screen Settings'). |
|
3464 |
|
3465 (box addTextLabel:(resources string:'Actual Visible Screen Area:')) |
|
3466 adjust:#left. |
|
3467 |
|
3468 (box addPopUpList:(resources string:'Common Sizes:') on:sizeList) |
|
3469 label:'monitor size'. |
|
3470 |
|
3471 idx := sizes findFirst:[:entry | |
|
3472 ((entry at:1) = sizeX value) |
|
3473 and:[((entry at:2) = sizeY value)] |
|
3474 ]. |
|
3475 idx ~~ 0 ifTrue:[ |
|
3476 sizeList selectionIndex:idx |
|
3477 ]. |
|
3478 |
|
3479 sizeList onChangeEvaluate:[ |
|
3480 |idx| |
|
3481 |
|
3482 idx := sizeList selectionIndex. |
|
3483 sizeX value:((sizes at:idx) at:1). |
|
3484 sizeY value:((sizes at:idx) at:2). |
|
3485 ]. |
|
3486 |
|
3487 y := box yPosition. |
|
3488 component := box addTextLabel:(resources string:'Screen Size:'). |
|
3489 component width:0.3; adjust:#right; borderWidth:0. |
|
3490 |
|
3491 box yPosition:y. |
|
3492 component := box addInputFieldOn:nil tabable:true. |
|
3493 component width:0.25; left:0.3; |
|
3494 immediateAccept:false; acceptOnLeave:false; |
|
3495 cursorMovementWhenUpdating:#beginOfLine; |
|
3496 converter:(PrintConverter new initForInteger); |
|
3497 model:sizeX. |
|
3498 |
|
3499 box yPosition:y. |
|
3500 component := box addTextLabel:(' x '). |
|
3501 component width:0.1; left:0.55; adjust:#center; borderWidth:0. |
|
3502 |
|
3503 box yPosition:y. |
|
3504 component := box addInputFieldOn:nil tabable:true. |
|
3505 component width:0.25; left:0.65; |
|
3506 immediateAccept:false; acceptOnLeave:false; |
|
3507 cursorMovementWhenUpdating:#beginOfLine; |
|
3508 converter:(PrintConverter new initForInteger); |
|
3509 model:sizeY. |
|
3510 |
|
3511 box yPosition:y. |
|
3512 component := box addTextLabel:('(mm)'). |
|
3513 component width:0.1; left:0.9; adjust:#center; borderWidth:0. |
|
3514 |
|
3515 box addVerticalSpace; addHorizontalLine; addVerticalSpace. |
|
3516 |
|
3517 (box addTextLabel:(resources string:'Screen: Depth: %1 Visual: %2 (%3)' |
|
3518 with:screen depth printString |
|
3519 with:screen visualType |
|
3520 with:screen serverVendor)) |
|
3521 adjust:#left. |
|
3522 |
|
3523 box addVerticalSpace; addHorizontalLine; addVerticalSpace. |
|
3524 |
|
3525 box addCheckBox:(resources string:'Color Monitor') on:isColorMonitor. |
|
3526 |
|
3527 visual == #PseudoColor ifTrue:[ |
|
3528 box addVerticalSpace. |
|
3529 component := box addCheckBox:(resources string:'Use Fix Color Palette %1' with:'(4x8x4)') on:useFixPalette. |
|
3530 |
|
3531 box addVerticalSpace. |
|
3532 component := box addCheckBox:(resources string:'Use Fix Gray Color Palette %1' with:'(32)') on:useFixGrayPalette. |
|
3533 ]. |
|
3534 |
|
3535 ditherSyms notNil ifTrue:[ |
|
3536 box addVerticalSpace. |
|
3537 component := box addPopUpList:(resources string:'Image Display:') on:ditherList. |
|
3538 component defaultLabel:'image display'. |
|
3539 component superView horizontalLayout:#leftSpace. |
|
3540 ]. |
|
3541 |
|
3542 box addVerticalSpace. |
|
3543 box addCheckBox:(resources string:'Allow Colored/Grayscale Icons') on:deepIcons. |
|
3544 |
|
3545 box addVerticalSpace; addHorizontalLine; addVerticalSpace. |
|
3546 |
|
3547 component := box addPopUpList:(resources string:'ClipBoard Encoding:') on:clipEncodingList. |
|
3548 component superView horizontalLayout:#leftSpace. |
|
3549 |
|
3550 box addHorizontalLine. |
|
3551 box |
|
3552 addHelpButtonFor:'Launcher/screenSettings.html'; |
|
3553 addAbortAndOkButtons. |
|
3554 box open. |
|
3555 |
|
3556 box accepted ifTrue:[ |
|
3557 Image flushDeviceImages. |
|
3558 |
|
3559 screen visualType == #PseudoColor ifTrue:[ |
|
3560 useFixPalette value ifTrue:[ |
|
3561 Color colorAllocationFailSignal handle:[:ex | |
|
3562 self warn:'Could not allocate colors.'. |
|
3563 ] do:[ |
|
3564 Color getColorsRed:4 green:8 blue:4 on:screen |
|
3565 ] |
|
3566 ] ifFalse:[ |
|
3567 screen releaseFixColors |
|
3568 ]. |
|
3569 |
|
3570 useFixGrayPalette value ifTrue:[ |
|
3571 Color colorAllocationFailSignal handle:[:ex | |
|
3572 self warn:'Could not allocate colors.'. |
|
3573 ] do:[ |
|
3574 Color getGrayColors:32 on:screen |
|
3575 ] |
|
3576 ] ifFalse:[ |
|
3577 screen releaseFixGrayColors |
|
3578 ] |
|
3579 ]. |
|
3580 screen hasColors:isColorMonitor value. |
|
3581 screen widthInMillimeter:sizeX value. |
|
3582 screen heightInMillimeter:sizeY value. |
|
3583 |
|
3584 screen supportsDeepIcons:deepIcons value. |
|
3585 ditherSyms notNil ifTrue:[ |
|
3586 Image ditherAlgorithm:(ditherSyms at:ditherList selectionIndex). |
|
3587 ]. |
|
3588 |
|
3589 WindowGroup activeGroup withWaitCursorDo:[ |
|
3590 View defaultStyle:(View defaultStyle). |
|
3591 ]. |
|
3592 |
|
3593 screen clipBoardEncoding:(clipEncodingSyms at:clipEncodingList selectionIndex). |
|
3594 ]. |
|
3595 box destroy |
|
3596 |
|
3597 "Modified: / 9.9.1996 / 22:43:04 / stefan" |
|
3598 "Modified: / 20.5.1999 / 18:35:21 / cg" |
|
3599 ! |
|
3600 |
|
3601 editSettings |
|
3602 "open a dialog on edit settings" |
|
3603 |
|
3604 |box st80EditingMode st80DoubleClickSelectMode resources |
|
3605 tabsIs4 prevTabsIs4 searchDialogIsModal startTextDragWithControl| |
|
3606 |
|
3607 resources := self owningClass classResources. |
|
3608 |
|
3609 "/ |
|
3610 "/ extract relevant system settings ... |
|
3611 "/ |
|
3612 st80EditingMode := UserPreferences current st80EditMode asValue. |
|
3613 st80DoubleClickSelectMode := TextView st80SelectMode asValue. |
|
3614 prevTabsIs4 := (ListView userDefaultTabPositions = ListView tab4Positions). |
|
3615 tabsIs4 := prevTabsIs4 asValue. |
|
3616 searchDialogIsModal := UserPreferences current searchDialogIsModal asValue. |
|
3617 startTextDragWithControl := UserPreferences current startTextDragWithControl asValue. |
|
3618 |
|
3619 "/ |
|
3620 "/ create a box on those values ... |
|
3621 "/ |
|
3622 box := DialogBox new. |
|
3623 box label:(resources string:'Edit settings'). |
|
3624 |
|
3625 box addCheckBox:(resources string:'Cursor has ST80 Line-end Behavior') on:st80EditingMode. |
|
3626 box addCheckBox:(resources string:'Double Click Select Behavior as in ST80') on:st80DoubleClickSelectMode. |
|
3627 box addCheckBox:(resources string:'Tab Stops in Multiples of 4') on:tabsIs4. |
|
3628 box addCheckBox:(resources string:'SearchBox is Modal') on:searchDialogIsModal. |
|
3629 box addCheckBox:(resources string:'CTRL-Key to Start TextDrag') on:startTextDragWithControl. |
|
3630 |
|
3631 box addHorizontalLine. |
|
3632 |
|
3633 box |
|
3634 addHelpButtonFor:'Launcher/editSettings.html'; |
|
3635 addAbortAndOkButtons. |
|
3636 |
|
3637 "/ |
|
3638 "/ show the box ... |
|
3639 "/ |
|
3640 box open. |
|
3641 |
|
3642 "/ |
|
3643 "/ update system settings |
|
3644 "/ |
|
3645 box accepted ifTrue:[ |
|
3646 UserPreferences current st80EditMode:(st80EditingMode value). |
|
3647 TextView st80SelectMode:(st80DoubleClickSelectMode value). |
|
3648 tabsIs4 value ~~ prevTabsIs4 ifTrue:[ |
|
3649 ListView userDefaultTabPositions:(tabsIs4 value ifTrue:[ListView tab4Positions] ifFalse:[ListView tab8Positions]). |
|
3650 ListView allSubInstancesDo:[:eachKindOfListView | |
|
3651 tabsIs4 value ifTrue:[eachKindOfListView setTab4] ifFalse:[eachKindOfListView setTab8] |
|
3652 ]. |
|
3653 ]. |
|
3654 UserPreferences current searchDialogIsModal:searchDialogIsModal value. |
|
3655 UserPreferences current startTextDragWithControl:startTextDragWithControl value. |
|
3656 ]. |
|
3657 box destroy |
|
3658 |
|
3659 "Created: / 6.1.1999 / 14:12:09 / cg" |
|
3660 "Modified: / 6.1.1999 / 14:17:51 / cg" |
|
3661 ! |
|
3662 |
|
3663 fontSettingsFor:requestor |
|
3664 "open a dialog on font related settings" |
|
3665 |
|
3666 (self fontBoxForEncoding:nil) ifTrue:[ |
|
3667 requestor reopenLauncher. |
|
3668 ] |
|
3669 |
|
3670 "Created: 26.2.1996 / 22:52:51 / cg" |
|
3671 "Modified: 8.1.1997 / 14:52:49 / cg" |
|
3672 ! |
|
3673 |
|
3674 javaSettings |
|
3675 "open a dialog on settings related to the java subsystem" |
|
3676 |
|
3677 |box audio javaHome classPath oldJavaHome oldClassPath resources component |
|
3678 extraFileSecurityChecks extraSocketSecurityChecks |
|
3679 supportsJustInTimeCompilation |
|
3680 javaJustInTimeCompilation javaNativeCodeOptimization |
|
3681 showJavaByteCode exceptionDebug nullPointerExceptionDebug pathSep| |
|
3682 |
|
3683 resources := self owningClass classResources. |
|
3684 |
|
3685 audio := JavaVM audioEnabled asValue. |
|
3686 extraFileSecurityChecks := JavaVM fileOpenConfirmation asValue. |
|
3687 extraSocketSecurityChecks := JavaVM socketConnectConfirmation asValue. |
|
3688 (supportsJustInTimeCompilation := ObjectMemory supportsJustInTimeCompilation) ifTrue:[ |
|
3689 javaJustInTimeCompilation := ObjectMemory javaJustInTimeCompilation asValue. |
|
3690 javaNativeCodeOptimization := ObjectMemory javaNativeCodeOptimization asValue. |
|
3691 ] ifFalse:[ |
|
3692 javaJustInTimeCompilation := javaNativeCodeOptimization := false |
|
3693 ]. |
|
3694 showJavaByteCode := JavaMethod forceByteCodeDisplay asValue. |
|
3695 exceptionDebug := JavaVM exceptionDebug asValue. |
|
3696 nullPointerExceptionDebug := JavaVM nullPointerExceptionDebug asValue. |
|
3697 |
|
3698 classPath := (Java classPath ? ''). |
|
3699 OperatingSystem isUNIXlike ifTrue:[ |
|
3700 pathSep := $;. |
|
3701 ] ifFalse:[ |
|
3702 pathSep := $:. |
|
3703 ]. |
|
3704 classPath := (classPath asStringWith:pathSep) asValue. |
|
3705 oldClassPath := classPath copy. |
|
3706 classPath := classPath asValue. |
|
3707 |
|
3708 javaHome := (Java javaHome ? ''). |
|
3709 oldJavaHome := javaHome copy. |
|
3710 javaHome := javaHome asValue. |
|
3711 |
|
3712 box := DialogBox new. |
|
3713 box label:(resources string:'Java'). |
|
3714 |
|
3715 box addCheckBox:(resources string:'Audio Enabled') on:audio. |
|
3716 box addCheckBox:(resources string:'Confirm file open for write') on:extraFileSecurityChecks. |
|
3717 box addCheckBox:(resources string:'Confirm socket connect') on:extraSocketSecurityChecks. |
|
3718 box addCheckBox:(resources string:'Debug Exceptions') on:exceptionDebug. |
|
3719 box addCheckBox:(resources string:'Debug Null Pointer Exceptions') on:nullPointerExceptionDebug. |
|
3720 box addHorizontalLine. |
|
3721 supportsJustInTimeCompilation ifTrue:[ |
|
3722 box |
|
3723 addCheckBox:(resources string:'java just in time compilation to machine code') |
|
3724 on:javaJustInTimeCompilation. |
|
3725 box |
|
3726 addCheckBox:(resources string:'optimize native code') |
|
3727 on:javaNativeCodeOptimization. |
|
3728 ]. |
|
3729 box addHorizontalLine. |
|
3730 box addCheckBox:(resources string:'Display java byteCode (i.e. not source)') on:showJavaByteCode. |
|
3731 box addHorizontalLine. |
|
3732 component := box |
|
3733 addLabelledInputField:(resources string:'classPath:') |
|
3734 adjust:#right |
|
3735 on:classPath |
|
3736 tabable:true |
|
3737 separateAtX:0.3. |
|
3738 component acceptOnLeave:false. |
|
3739 component := box |
|
3740 addLabelledInputField:(resources string:'java home:') |
|
3741 adjust:#right |
|
3742 on:javaHome |
|
3743 tabable:true |
|
3744 separateAtX:0.3. |
|
3745 component acceptOnLeave:false. |
|
3746 |
|
3747 box addVerticalSpace. |
|
3748 box addComponent:(Button |
|
3749 label:(resources string:'Reinit VM now') |
|
3750 action:[ |
|
3751 box windowGroup withWaitCursorDo:[ |
|
3752 "/ Java classPath size == 0 ifTrue:[ |
|
3753 "/ Java initialize. |
|
3754 "/ ]. |
|
3755 "/ Java classPath size == 0 ifTrue:[ |
|
3756 "/ self warn:'No JDK found'. |
|
3757 "/ ] ifFalse:[ |
|
3758 JavaVM initializeVM |
|
3759 "/ ] |
|
3760 ] |
|
3761 ]). |
|
3762 |
|
3763 box addComponent:(Button |
|
3764 label:(resources string:'Remove all Java classes now') |
|
3765 action:[ |
|
3766 box windowGroup withWaitCursorDo:[ |
|
3767 Java flushAllJavaResources |
|
3768 ] |
|
3769 ]). |
|
3770 |
|
3771 "/ box addHorizontalLine. |
|
3772 |
|
3773 "/ box addHelpButtonFor:'Launcher/javaSettings.html'. |
|
3774 box addAbortAndOkButtons. |
|
3775 box open. |
|
3776 |
|
3777 box accepted ifTrue:[ |
|
3778 classPath value ~= oldClassPath ifTrue:[ |
|
3779 OperatingSystem isUNIXlike ifTrue:[ |
|
3780 classPath := (classPath value asCollectionOfSubstringsSeparatedBy:$:) |
|
3781 ] ifFalse:[ |
|
3782 classPath := (classPath value asCollectionOfSubstringsSeparatedBy:$;) |
|
3783 ]. |
|
3784 Java classPath:classPath |
|
3785 ]. |
|
3786 Java javaHome:javaHome value. |
|
3787 |
|
3788 JavaMethod forceByteCodeDisplay:showJavaByteCode value. |
|
3789 JavaVM audioEnabled:audio value. |
|
3790 JavaVM exceptionDebug:exceptionDebug value. |
|
3791 JavaVM nullPointerExceptionDebug:nullPointerExceptionDebug value. |
|
3792 JavaVM fileOpenConfirmation: extraFileSecurityChecks value. |
|
3793 JavaVM socketConnectConfirmation: extraSocketSecurityChecks value. |
|
3794 |
|
3795 javaJustInTimeCompilation value ~~ ObjectMemory javaJustInTimeCompilation ifTrue:[ |
|
3796 ObjectMemory javaJustInTimeCompilation:javaJustInTimeCompilation value. |
|
3797 javaJustInTimeCompilation value ifTrue:[ |
|
3798 JavaMethod allSubInstancesDo:[:m | m checked:false]. |
|
3799 ]. |
|
3800 ]. |
|
3801 javaNativeCodeOptimization value ~~ ObjectMemory javaNativeCodeOptimization ifTrue:[ |
|
3802 ObjectMemory javaNativeCodeOptimization:javaNativeCodeOptimization value. |
|
3803 ]. |
|
3804 ]. |
|
3805 box destroy |
|
3806 |
|
3807 "Created: / 18.7.1998 / 22:32:58 / cg" |
|
3808 "Modified: / 27.1.1999 / 20:16:03 / cg" |
|
3809 ! |
|
3810 |
|
3811 keyboardSettings |
|
3812 "open a dialog on keyboard related settings" |
|
3813 |
|
3814 |mappings listOfRawKeys listOfFunctions |
|
3815 box l |
|
3816 list1 list2 listView1 listView2 |
|
3817 frame selectionForwarder macroForwarder macroTextView y resources| |
|
3818 |
|
3819 resources := self owningClass classResources. |
|
3820 |
|
3821 mappings := Screen current keyboardMap. |
|
3822 |
|
3823 listOfRawKeys := (mappings keys asArray collect:[:key | key asString]) sort. |
|
3824 listOfFunctions := (mappings values asSet asArray collect:[:key | key asString]) sort. |
|
3825 |
|
3826 selectionForwarder := Plug new. |
|
3827 selectionForwarder respondTo:#showFunction |
|
3828 with:[ |
|
3829 |raw| |
|
3830 raw := list1 selection. |
|
3831 list2 retractInterestsFor:selectionForwarder. |
|
3832 list2 selection:(mappings at:raw asSymbol) asString. |
|
3833 list2 onChangeSend:#showRawKey to:selectionForwarder. |
|
3834 ]. |
|
3835 selectionForwarder respondTo:#showRawKey |
|
3836 with:[ |
|
3837 |f raw| |
|
3838 |
|
3839 f := list2 selection. |
|
3840 list1 retractInterestsFor:selectionForwarder. |
|
3841 raw := mappings keyAtValue:f asString. |
|
3842 raw isNil ifTrue:[ |
|
3843 raw := mappings keyAtValue:f first. |
|
3844 raw isNil ifTrue:[ |
|
3845 raw := mappings keyAtValue:f asSymbol. |
|
3846 ] |
|
3847 ]. |
|
3848 list1 selection:raw. |
|
3849 list1 onChangeSend:#showFunction to:selectionForwarder. |
|
3850 ]. |
|
3851 |
|
3852 macroForwarder := [ |
|
3853 |f macro indent| |
|
3854 f := list2 selection. |
|
3855 (f startsWith:'Cmd') ifTrue:[ |
|
3856 f := f copyFrom:4 |
|
3857 ]. |
|
3858 macro := UserPreferences current functionKeySequences |
|
3859 at:(f asSymbol) ifAbsent:nil. |
|
3860 macro notNil ifTrue:[ |
|
3861 macro := macro asStringCollection. |
|
3862 indent := macro |
|
3863 inject:99999 into:[:min :element | |
|
3864 |stripped| |
|
3865 |
|
3866 stripped := element withoutLeadingSeparators. |
|
3867 stripped size == 0 ifTrue:[ |
|
3868 min |
|
3869 ] ifFalse:[ |
|
3870 min min:(element size - stripped size) |
|
3871 ] |
|
3872 ]. |
|
3873 indent ~~ 0 ifTrue:[ |
|
3874 macro := macro collect:[:line | |
|
3875 line size > indent ifTrue:[ |
|
3876 line copyFrom:indent+1 |
|
3877 ] ifFalse:[ |
|
3878 line |
|
3879 ]. |
|
3880 ] |
|
3881 ]. |
|
3882 ]. |
|
3883 macroTextView contents:macro. |
|
3884 ]. |
|
3885 |
|
3886 list1 := SelectionInList with:listOfRawKeys. |
|
3887 list1 onChangeSend:#showFunction to:selectionForwarder. |
|
3888 |
|
3889 list2 := SelectionInList with:listOfFunctions. |
|
3890 list2 onChangeSend:#showRawKey to:selectionForwarder. |
|
3891 list2 onChangeEvaluate:macroForwarder. |
|
3892 |
|
3893 box := Dialog new. |
|
3894 box label:(resources string:'Keyboard Mappings'). |
|
3895 |
|
3896 l := box addTextLabel:(resources at:'KEY_MSG' default:'keyboard mapping:') withCRs. |
|
3897 l adjust:#left; borderWidth:0. |
|
3898 |
|
3899 frame := View new. |
|
3900 frame extent:300 @ 300. |
|
3901 frame borderWidth:0. |
|
3902 |
|
3903 listView1 := ScrollableView for:SelectionInListView in:frame. |
|
3904 listView1 model:list1. |
|
3905 listView1 origin:0.0@0.0 corner:0.5@1.0; inset:2. |
|
3906 |
|
3907 listView2 := ScrollableView for:SelectionInListView in:frame. |
|
3908 listView2 model:list2. |
|
3909 listView2 origin:0.5@0.0 corner:1.0@1.0; inset:2. |
|
3910 |
|
3911 frame topInset:box yPosition. |
|
3912 box addComponent:frame withExtent:350@200. |
|
3913 box makeTabable:listView1. |
|
3914 box makeTabable:listView2. |
|
3915 frame origin:0.0@0.0 corner:1.0@0.6. |
|
3916 |
|
3917 box addVerticalSpace. |
|
3918 |
|
3919 l := box addTextLabel:(resources string:'Macro text (if any):') withCRs. |
|
3920 l adjust:#left; borderWidth:0. |
|
3921 l origin:0.0@0.6 corner:1.0@0.6. |
|
3922 l topInset:(View viewSpacing). |
|
3923 l bottomInset:(l preferredExtent y negated - View viewSpacing). |
|
3924 |
|
3925 macroTextView := HVScrollableView for:TextView miniScroller:true. |
|
3926 box addComponent:macroTextView tabable:true. |
|
3927 macroTextView origin:0.0@0.6 corner:1.0@1.0. |
|
3928 y := box yPosition. |
|
3929 |
|
3930 box |
|
3931 addHelpButtonFor:'Launcher/keyboardSetting.html'; |
|
3932 "addAbortButton;" |
|
3933 addOkButtonLabelled:(resources string:'Close' "'Dismiss'"). |
|
3934 |
|
3935 macroTextView topInset:(l preferredExtent y + 5). |
|
3936 macroTextView bottomInset:(box preferredExtent y - y). |
|
3937 |
|
3938 box open. |
|
3939 |
|
3940 box accepted ifTrue:[ |
|
3941 "no action yet ..." |
|
3942 ]. |
|
3943 box destroy |
|
3944 |
|
3945 "Modified: / 9.9.1996 / 22:43:17 / stefan" |
|
3946 "Modified: / 4.5.1998 / 12:40:02 / cg" |
|
3947 ! |
|
3948 |
|
3949 languageSettings |
|
3950 self languageSettingsFor:nil |
|
3951 ! |
|
3952 |
|
3953 languageSettingsFor:requestor |
|
3954 "open a dialog on language related settings" |
|
3955 |
|
3956 |listOfLanguages translatedLanguages switch box languageList flags resources| |
|
3957 |
|
3958 resources := self owningClass classResources. |
|
3959 |
|
3960 " |
|
3961 get list of supported languages from the launchers resources ... |
|
3962 " |
|
3963 |
|
3964 listOfLanguages := resources at:'LIST_OF_OFFERED_LANGUAGES' default:#('default'). |
|
3965 listOfLanguages := listOfLanguages asOrderedCollection. |
|
3966 |
|
3967 translatedLanguages := listOfLanguages collect:[:lang | |item| |
|
3968 item := resources at:lang. |
|
3969 item isString ifTrue:[ |
|
3970 item |
|
3971 ] ifFalse:[ |
|
3972 item at:1 |
|
3973 ] |
|
3974 ]. |
|
3975 flags := listOfLanguages collect:[:lang | |item| |
|
3976 item := resources at:lang. |
|
3977 item isArray ifTrue:[ |
|
3978 item at:2 |
|
3979 ] ifFalse:[ |
|
3980 nil |
|
3981 ] |
|
3982 ]. |
|
3983 flags := flags collect:[:nm | |img d| nm notNil ifTrue:[ |
|
3984 img := Image fromFile:nm. |
|
3985 img isNil ifTrue:[ |
|
3986 d := Smalltalk getPackageDirectoryForPackage:'stx:goodies'. |
|
3987 img := Image fromFile:(d construct:nm). |
|
3988 ]. |
|
3989 ] ifFalse:[ |
|
3990 nil |
|
3991 ] |
|
3992 ]. |
|
3993 listOfLanguages := listOfLanguages collect:[:nm | nm copyFrom:'LANG_' size + 1]. |
|
3994 languageList := translatedLanguages with:flags collect:[:lang :flag | LabelAndIcon icon:flag string:lang.]. |
|
3995 |
|
3996 box := ListSelectionBox title:(resources at:'LANG_MSG' default:'Select a Language') withCRs. |
|
3997 box label:(resources string:'Language Selection'). |
|
3998 box list:languageList. |
|
3999 box initialText:(Language , '-' , LanguageTerritory). |
|
4000 box action:[:newLanguage | |
|
4001 WindowGroup activeGroup withWaitCursorDo:[ |
|
4002 |fontPref idx language oldLanguage territory enc |
|
4003 answer matchingFonts l screen| |
|
4004 |
|
4005 idx := translatedLanguages indexOf:newLanguage withoutSeparators. |
|
4006 idx ~~ 0 ifTrue:[ |
|
4007 language := listOfLanguages at:idx |
|
4008 ] ifFalse:[ |
|
4009 language := newLanguage |
|
4010 ]. |
|
4011 (language includes:$-) ifTrue:[ |
|
4012 l := language asCollectionOfSubstringsSeparatedBy:$-. |
|
4013 language := l at:1. |
|
4014 territory := l at:2. |
|
4015 ]. |
|
4016 territory isNil ifTrue:[ |
|
4017 territory := language copyTo:2 |
|
4018 ]. |
|
4019 |
|
4020 "/ check if the new language needs a differently encoded font; |
|
4021 "/ ask user to switch font and allow cancellation. |
|
4022 "/ Otherwise, you are left with unreadable menu & button items ... |
|
4023 |
|
4024 oldLanguage := Smalltalk language. |
|
4025 Smalltalk language:language asSymbol. |
|
4026 ResourcePack flushCachedResourcePacks. |
|
4027 "/ refetch resources ... |
|
4028 resources := self owningClass classResources. |
|
4029 fontPref := resources at:'PREFERRED_FONT_ENCODING' default:'iso8859*'. |
|
4030 fontPref := fontPref asLowercase. |
|
4031 Smalltalk language:oldLanguage. |
|
4032 |
|
4033 switch := true. |
|
4034 enc := MenuView defaultFont encoding. |
|
4035 (fontPref match:enc asLowercase) ifFalse:[ |
|
4036 "/ look if there is one at all. |
|
4037 screen := Screen current. |
|
4038 matchingFonts := screen listOfAvailableFonts select:[:f | fontPref match:f encoding asLowercase]. |
|
4039 matchingFonts size == 0 ifTrue:[ |
|
4040 "/ flush and try again - just in case, the font path has changed. |
|
4041 screen flushListOfAvailableFonts. |
|
4042 matchingFonts := screen listOfAvailableFonts select:[:f | fontPref match:f encoding asLowercase]. |
|
4043 ]. |
|
4044 matchingFonts size == 0 ifTrue:[ |
|
4045 (Dialog |
|
4046 confirm:(resources |
|
4047 string:'Your display does not offer any %1-encoded font.\\Change the language anyway ?\ (texts will probably be unreadable then)' |
|
4048 with:fontPref) withCRs) |
|
4049 ifFalse:[ |
|
4050 switch := false |
|
4051 ] |
|
4052 ] ifFalse:[ |
|
4053 answer := Dialog |
|
4054 confirmWithCancel:(resources |
|
4055 string:'menu font is not %1-encoded.\\Change it ?' |
|
4056 with:fontPref) withCRs |
|
4057 labels:(resources |
|
4058 array:#('cancel' 'no' 'yes')) |
|
4059 default:3. |
|
4060 answer isNil ifTrue:[ |
|
4061 switch := false |
|
4062 ] ifFalse:[ |
|
4063 answer ifTrue:[ |
|
4064 switch := (requestor fontBoxForEncoding:fontPref) |
|
4065 ] |
|
4066 ]. |
|
4067 ]. |
|
4068 ]. |
|
4069 |
|
4070 switch ifTrue:[ |
|
4071 Transcript showCR:'change language to ' , newLanguage , ' ...'. |
|
4072 Smalltalk language:language asSymbol. |
|
4073 Smalltalk languageTerritory:territory asSymbol. |
|
4074 "/ ResourcePack flushCachedResourcePacks - already done by language-change |
|
4075 ]. |
|
4076 ]. |
|
4077 switch ifTrue:[ |
|
4078 requestor reopenLauncher. |
|
4079 DebugView newDebugger. |
|
4080 ] |
|
4081 ]. |
|
4082 box |
|
4083 addHelpButtonFor:'Launcher/languageSetting.html'. |
|
4084 box open. |
|
4085 box destroy |
|
4086 |
|
4087 "Modified: / 9.9.1996 / 22:43:27 / stefan" |
|
4088 "Modified: / 16.11.2001 / 11:51:35 / cg" |
|
4089 ! |
|
4090 |
|
4091 memorySettings |
|
4092 "open a dialog on objectMemory related settings" |
|
4093 |
|
4094 |box igcLimit igcFreeLimit igcFreeAmount newSpaceSize |
|
4095 compressLimit |
|
4096 oldIncr component fields codeLimit codeTrigger stackLimit resources |
|
4097 fastMoreLimit maxOldSpace models info acceptChannel| |
|
4098 |
|
4099 acceptChannel := false asValue. |
|
4100 |
|
4101 resources := self owningClass classResources. |
|
4102 |
|
4103 "/ |
|
4104 "/ extract relevant system settings ... |
|
4105 "/ |
|
4106 igcLimit := ObjectMemory incrementalGCLimit asValue. |
|
4107 igcFreeLimit := ObjectMemory freeSpaceGCLimit asValue. |
|
4108 igcFreeAmount := ObjectMemory freeSpaceGCAmount asValue. |
|
4109 newSpaceSize := ObjectMemory newSpaceSize asValue. |
|
4110 oldIncr := ObjectMemory oldSpaceIncrement asValue. |
|
4111 compressLimit := ObjectMemory oldSpaceCompressLimit asValue. |
|
4112 codeLimit := ObjectMemory dynamicCodeLimit asValue. |
|
4113 codeTrigger := ObjectMemory dynamicCodeGCTrigger asValue. |
|
4114 stackLimit := Process defaultMaximumStackSize asValue. |
|
4115 fastMoreLimit := (ObjectMemory fastMoreOldSpaceLimit:-1) asValue. |
|
4116 maxOldSpace := ObjectMemory maxOldSpace asValue. |
|
4117 |
|
4118 models := OrderedCollection new. |
|
4119 info := OrderedCollection new. |
|
4120 models add:newSpaceSize. info add:#(number 'Size of newSpace where objects are created' 'Size of NewSpace:' ). |
|
4121 models add:fastMoreLimit. info add:#(number 'Quickly allocate more memory (suppress GC) up to this limit' 'Quick Allocation Limit:'). |
|
4122 models add:maxOldSpace. info add:#(number 'Never allocate more than this amount of memory' 'Maximum Memory Limit:'). |
|
4123 models add:igcLimit. info add:#(number 'Start IGC whenever this amount has been allocated' 'Incremental GC Allocation Trigger:'). |
|
4124 models add:igcFreeLimit. info add:#(number 'Start IGC whenever freespace drops below this' 'Incremental GC Freespace Trigger:'). |
|
4125 models add:igcFreeAmount. info add:#(number 'Try to keep this amount for peak requests' 'Incremental GC Amount:'). |
|
4126 models add:oldIncr. info add:#(number 'Increase oldSpace in chunks of this size' 'Oldspace Increment:'). |
|
4127 models add:compressLimit. info add:#(number 'Use 2-pass compressing GC if > 0 and more memory is in use' 'Oldspace Compress Limit:'). |
|
4128 models add:stackLimit. info add:#(number 'Trigger recursionInterrupt if more stack is used by a process' 'Stack Limit:'). |
|
4129 models add:codeLimit. info add:#(numberOrNil 'Flush dynamic compiled code to stay within this limit' 'Dynamic code Limit:'). |
|
4130 models add:codeTrigger. info add:#(numberOrNil 'Start incremental GC whenever this amount of code has been allocated' 'Dynamic Code GC Trigger:'). |
|
4131 |
|
4132 "/ |
|
4133 "/ create a box on those values ... |
|
4134 "/ |
|
4135 fields := OrderedCollection new. |
|
4136 |
|
4137 box := DialogBox new. |
|
4138 box label:(resources string:'Memory Manager Settings'). |
|
4139 |
|
4140 (box addTextLabel:'Warning - invalid settings may result in failures or poor performance |
|
4141 ' , 'You have been warned' allBold , '.') adjust:#left. |
|
4142 box addHorizontalLine. |
|
4143 |
|
4144 models with:info do:[:m :i | |
|
4145 |lbl descr conv| |
|
4146 |
|
4147 conv := i at:1. |
|
4148 lbl := i at:3. |
|
4149 descr := i at:2. |
|
4150 |
|
4151 component := box |
|
4152 addLabelledInputField:(resources string:lbl) |
|
4153 adjust:#right |
|
4154 on:nil "/ newSpaceSize |
|
4155 tabable:true |
|
4156 separateAtX:0.7. |
|
4157 component acceptOnLeave:false. |
|
4158 "/ component converter:(PrintConverter new perform:conv). |
|
4159 component model:((TypeConverter on:m) perform:conv). |
|
4160 component acceptChannel:acceptChannel. |
|
4161 fields add:component. |
|
4162 |
|
4163 (box addTextLabel:descr) adjust:#left. |
|
4164 box addHorizontalLine. |
|
4165 ]. |
|
4166 |
|
4167 ObjectMemory supportsJustInTimeCompilation ifFalse:[ |
|
4168 (fields at:9) disable. |
|
4169 (fields at:10) disable. |
|
4170 ]. |
|
4171 |
|
4172 box addAbortAndOkButtons. |
|
4173 box |
|
4174 addHelpButtonFor:'Launcher/memorySettings.html'. |
|
4175 |
|
4176 "/ |
|
4177 "/ show the box ... |
|
4178 "/ |
|
4179 box open. |
|
4180 |
|
4181 "/ |
|
4182 "/ update system settings |
|
4183 "/ |
|
4184 box accepted ifTrue:[ |
|
4185 acceptChannel value:true. |
|
4186 |
|
4187 igcFreeAmount value ~~ ObjectMemory freeSpaceGCAmount ifTrue:[ |
|
4188 ObjectMemory freeSpaceGCAmount:igcFreeAmount value. |
|
4189 ]. |
|
4190 igcFreeLimit value ~~ ObjectMemory freeSpaceGCLimit ifTrue:[ |
|
4191 ObjectMemory freeSpaceGCLimit:igcFreeLimit value. |
|
4192 ]. |
|
4193 igcLimit value ~~ ObjectMemory incrementalGCLimit ifTrue:[ |
|
4194 ObjectMemory incrementalGCLimit:igcLimit value. |
|
4195 ]. |
|
4196 newSpaceSize value ~~ ObjectMemory newSpaceSize ifTrue:[ |
|
4197 ObjectMemory newSpaceSize:newSpaceSize value. |
|
4198 ]. |
|
4199 oldIncr value ~~ ObjectMemory oldSpaceIncrement ifTrue:[ |
|
4200 ObjectMemory oldSpaceIncrement:oldIncr value. |
|
4201 ]. |
|
4202 stackLimit value ~~ Process defaultMaximumStackSize ifTrue:[ |
|
4203 Process defaultMaximumStackSize:stackLimit value. |
|
4204 ]. |
|
4205 fastMoreLimit value ~~ (ObjectMemory fastMoreOldSpaceLimit:-1) ifTrue:[ |
|
4206 ObjectMemory fastMoreOldSpaceLimit:fastMoreLimit value. |
|
4207 ]. |
|
4208 maxOldSpace value ~~ ObjectMemory maxOldSpace ifTrue:[ |
|
4209 ObjectMemory maxOldSpace:maxOldSpace value. |
|
4210 ]. |
|
4211 ObjectMemory oldSpaceCompressLimit:compressLimit value. |
|
4212 ObjectMemory dynamicCodeLimit:codeLimit value. |
|
4213 ObjectMemory dynamicCodeGCTrigger:codeTrigger value. |
|
4214 ]. |
|
4215 box destroy |
|
4216 |
|
4217 "Modified: 27.2.1997 / 16:50:12 / cg" |
|
4218 ! |
|
4219 |
|
4220 messageSettings |
|
4221 "open a dialog on infoMessage related settings" |
|
4222 |
|
4223 |box vmInfo vmErrors displayErrors classInfos resources| |
|
4224 |
|
4225 resources := self owningClass classResources. |
|
4226 |
|
4227 vmInfo := ObjectMemory infoPrinting asValue. |
|
4228 vmErrors := ObjectMemory debugPrinting asValue. |
|
4229 classInfos := Object infoPrinting asValue. |
|
4230 displayErrors := DeviceWorkstation errorPrinting asValue. |
|
4231 |
|
4232 box := DialogBox new. |
|
4233 box label:(resources string:'Messages'). |
|
4234 |
|
4235 box addCheckBox:(resources string:'VM Info Messages') on:vmInfo. |
|
4236 box addCheckBox:(resources string:'VM Error Messages') on:vmErrors. |
|
4237 box addHorizontalLine. |
|
4238 |
|
4239 box addCheckBox:(resources string:'Display Error Messages (Xlib, Xtlib, WinAPI ...)') on:displayErrors. |
|
4240 box addCheckBox:(resources string:'Other Info Messages') on:classInfos. |
|
4241 box addHorizontalLine. |
|
4242 |
|
4243 box addHelpButtonFor:'Launcher/messageSettings.html'. |
|
4244 box addAbortAndOkButtons. |
|
4245 box open. |
|
4246 |
|
4247 box accepted ifTrue:[ |
|
4248 ObjectMemory infoPrinting:vmInfo value. |
|
4249 ObjectMemory debugPrinting:vmErrors value. |
|
4250 Object infoPrinting:classInfos value. |
|
4251 DeviceWorkstation errorPrinting:displayErrors value. |
|
4252 ]. |
|
4253 box destroy |
|
4254 |
|
4255 "Modified: 27.1.1997 / 17:46:01 / cg" |
|
4256 ! |
|
4257 |
|
4258 miscSettings |
|
4259 "open a dialog on misc other settings" |
|
4260 |
|
4261 |box pos pos2 check butt shadows takeFocus focusFollowsMouse returnFocus |
|
4262 hostNameInLabel showAccelerators |
|
4263 preemptive dynamicPrios hostNameInLabelHolder resources |
|
4264 activateOnClick opaqueVariablePanelResize opaqueTableColumnResize currentUserPrefs |
|
4265 beepEnabled newWindowLabelFormat| |
|
4266 |
|
4267 resources := self owningClass classResources. |
|
4268 currentUserPrefs := UserPreferences current. |
|
4269 |
|
4270 "/ |
|
4271 "/ extract relevant system settings ... |
|
4272 "/ |
|
4273 shadows := PopUpView shadows asValue. |
|
4274 beepEnabled := currentUserPrefs beepEnabled asValue. |
|
4275 |
|
4276 hostNameInLabel := StandardSystemView includeHostNameInLabel. |
|
4277 hostNameInLabelHolder := hostNameInLabel asValue. |
|
4278 returnFocus := StandardSystemView returnFocusWhenClosingModalBoxes asValue. |
|
4279 takeFocus := StandardSystemView takeFocusWhenMapped asValue. |
|
4280 focusFollowsMouse := (currentUserPrefs focusFollowsMouse ? true) asValue. |
|
4281 activateOnClick := (Display activateOnClick:nil) asValue. |
|
4282 opaqueVariablePanelResize := currentUserPrefs opaqueVariablePanelResizing asValue. |
|
4283 opaqueTableColumnResize := currentUserPrefs opaqueTableColumnResizing asValue. |
|
4284 |
|
4285 showAccelerators := MenuView showAcceleratorKeys asValue. |
|
4286 preemptive := Processor isTimeSlicing asValue. |
|
4287 dynamicPrios := Processor supportDynamicPriorities asValue. |
|
4288 |
|
4289 "/ |
|
4290 "/ create a box on those values ... |
|
4291 "/ |
|
4292 box := DialogBox new. |
|
4293 box label:(resources string:'Other settings'). |
|
4294 |
|
4295 box addCheckBox:(resources string:'Shadows under PopUp Views') on:shadows. |
|
4296 box addCheckBox:(resources string:'Beeper enabled') on:beepEnabled. |
|
4297 box addCheckBox:(resources string:'Boxes Return Focus to Previously Active View') on:returnFocus. |
|
4298 box addCheckBox:(resources string:'Views Catch Focus when Mapped') on:takeFocus. |
|
4299 pos := box yPosition. |
|
4300 check := box addCheckBox:(resources string:'Hostname in Window Labels') on:hostNameInLabelHolder. |
|
4301 check width:0.6. |
|
4302 pos2 := box yPosition. |
|
4303 box yPosition:pos. |
|
4304 butt := box addComponent:(Button label:(resources string:'Format...') |
|
4305 action:[ |
|
4306 |newFormat| |
|
4307 |
|
4308 newFormat := Dialog request: |
|
4309 'Define the Format of Window Labels:\\ %1 - Label\ %2 - Hostname\ %3 - Username\ %4 - ProcessId\' |
|
4310 withCRs initialAnswer:StandardSystemView windowLabelFormat. |
|
4311 |
|
4312 newFormat size > 0 ifTrue:[ |
|
4313 newWindowLabelFormat := newFormat |
|
4314 ]. |
|
4315 ]). |
|
4316 box makeTabable:butt. |
|
4317 butt left:0.6; width:0.4. |
|
4318 box yPosition:(box yPosition max:pos2). |
|
4319 |
|
4320 box addCheckBox:(resources string:'Show Accelerator Keys in Menus') on:showAccelerators. |
|
4321 box addCheckBox:(resources string:'Raise & Activate Windows on Click') on:activateOnClick. |
|
4322 box addCheckBox:(resources string:'Focus Follows Mouse') on:focusFollowsMouse. |
|
4323 box addCheckBox:(resources string:'Opaque Variable Panel Resizing') on:opaqueVariablePanelResize. |
|
4324 box addCheckBox:(resources string:'Opaque Table Column Resizing') on:opaqueTableColumnResize. |
|
4325 |
|
4326 box addHorizontalLine. |
|
4327 |
|
4328 box addCheckBox:(resources string:'Preemptive Scheduling') on:preemptive. |
|
4329 box leftIndent:20. |
|
4330 check := box addCheckBox:(resources string:'Dynamic Priorities') on:dynamicPrios. |
|
4331 check enableChannel:preemptive. |
|
4332 box leftIndent:0. |
|
4333 |
|
4334 box addHorizontalLine. |
|
4335 box |
|
4336 addHelpButtonFor:'Launcher/miscSettings.html'; |
|
4337 addAbortAndOkButtons. |
|
4338 |
|
4339 "/ |
|
4340 "/ show the box ... |
|
4341 "/ |
|
4342 box open. |
|
4343 |
|
4344 "/ |
|
4345 "/ update system settings |
|
4346 "/ |
|
4347 box accepted ifTrue:[ |
|
4348 PopUpView shadows:shadows value. |
|
4349 (hostNameInLabelHolder value ~= hostNameInLabel |
|
4350 or:[newWindowLabelFormat ~= StandardSystemView windowLabelFormat]) ifTrue:[ |
|
4351 StandardSystemView includeHostNameInLabel:hostNameInLabelHolder value. |
|
4352 newWindowLabelFormat notNil ifTrue:[ |
|
4353 StandardSystemView windowLabelFormat:newWindowLabelFormat |
|
4354 ]. |
|
4355 |
|
4356 Screen allScreens do:[:aDisplay | |
|
4357 aDisplay allViewsDo:[:aView | |
|
4358 |l| |
|
4359 |
|
4360 aView isTopView ifTrue:[ |
|
4361 l := aView label. |
|
4362 l notNil ifTrue:[ |
|
4363 aView label:(l , ' '); label:l. "/ force a change |
|
4364 ] |
|
4365 ] |
|
4366 ] |
|
4367 ] |
|
4368 ]. |
|
4369 |
|
4370 currentUserPrefs opaqueVariablePanelResizing:opaqueVariablePanelResize value. |
|
4371 currentUserPrefs opaqueTableColumnResizing:opaqueTableColumnResize value. |
|
4372 |
|
4373 currentUserPrefs beepEnabled:beepEnabled value. |
|
4374 |
|
4375 StandardSystemView returnFocusWhenClosingModalBoxes:returnFocus value. |
|
4376 StandardSystemView takeFocusWhenMapped:takeFocus value. |
|
4377 currentUserPrefs focusFollowsMouse:focusFollowsMouse value. |
|
4378 Screen current activateOnClick:(activateOnClick value). |
|
4379 |
|
4380 MenuView showAcceleratorKeys:showAccelerators value. |
|
4381 Processor isTimeSlicing ~~ preemptive value ifTrue:[ |
|
4382 preemptive value ifTrue:[ |
|
4383 Processor startTimeSlicing |
|
4384 ] ifFalse:[ |
|
4385 Processor stopTimeSlicing |
|
4386 ] |
|
4387 ]. |
|
4388 Processor supportDynamicPriorities ~~ dynamicPrios value ifTrue:[ |
|
4389 Processor supportDynamicPriorities:dynamicPrios value |
|
4390 ]. |
|
4391 ]. |
|
4392 box destroy |
|
4393 |
|
4394 "Modified: / 9.9.1996 / 22:43:36 / stefan" |
|
4395 "Modified: / 20.5.1999 / 18:33:55 / cg" |
|
4396 "Modified: / 3.12.1999 / 17:11:38 / ps" |
|
4397 ! |
|
4398 |
|
4399 printerSettings |
|
4400 "open a dialog on printer related settings; returns true if accepted" |
|
4401 |
|
4402 |box accepted |
|
4403 possiblePrinters possibleTypes printerType printCommand |
|
4404 pageFormat landscape updater |
|
4405 formatLabel formatComponent landscapeLabel landscapeComponent |
|
4406 topMargin leftMargin rightMargin bottomMargin unitList unit |
|
4407 topMarginComponent leftMarginComponent |
|
4408 rightMarginComponent |
|
4409 bottomMarginComponent supportsColor supportsColorComponent |
|
4410 y y1 commandListPop component commandList row resources| |
|
4411 |
|
4412 resources := self owningClass classResources. |
|
4413 |
|
4414 possiblePrinters := PrinterStream withAllSubclasses asArray. |
|
4415 possibleTypes := possiblePrinters collect:[:cls | cls printerTypeName]. |
|
4416 |
|
4417 printerType := SelectionInList new list:(resources array:possibleTypes). |
|
4418 printerType selectionIndex:(possiblePrinters identityIndexOf:Printer). |
|
4419 printCommand := Printer printCommand asValue. |
|
4420 |
|
4421 pageFormat := SelectionInList new list:(Printer defaultPageFormats). |
|
4422 pageFormat selection:(Printer pageFormat). |
|
4423 landscape := Printer landscape asValue. |
|
4424 |
|
4425 topMargin := Printer topMargin asValue. |
|
4426 leftMargin := Printer leftMargin asValue. |
|
4427 rightMargin := Printer rightMargin asValue. |
|
4428 bottomMargin := Printer bottomMargin asValue. |
|
4429 supportsColor := Printer supportsColor asValue. |
|
4430 |
|
4431 box := DialogBox new. |
|
4432 box label:(resources string:'Printer Settings'). |
|
4433 |
|
4434 "/ either use a popUpList ... |
|
4435 "/ box addPopUpList:(resources string:'printer type:') on:printerType. |
|
4436 |
|
4437 "/ or a comboList; |
|
4438 "/ which one looks better ? |
|
4439 y := box yPosition. |
|
4440 component := box addTextLabel:(resources string:'Printer Type:'). |
|
4441 component width:0.25; adjust:#right; borderWidth:0. |
|
4442 box yPosition:y. |
|
4443 component := box addComboListOn:printerType tabable:true. |
|
4444 component aspect:#selectionIndex; changeMessage:#selectionIndex:; useIndex:true. |
|
4445 component width:0.75; left:0.25. |
|
4446 "/ end of question |
|
4447 |
|
4448 y := box yPosition. |
|
4449 component := box addTextLabel:(resources string:'Print Command:'). |
|
4450 component width:0.25; adjust:#right; borderWidth:0. |
|
4451 box yPosition:y. |
|
4452 commandListPop := box addComboBoxOn:printCommand tabable:true. |
|
4453 "/ commandListPop := box addInputFieldOn:printCommand tabable:true. |
|
4454 commandListPop width:0.75; left:0.25; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
4455 "/ some common print commands ... |
|
4456 |
|
4457 commandList := resources at:'PRINT_COMMANDS' ifAbsent:nil. |
|
4458 commandList isNil ifTrue:[ |
|
4459 commandList := PrinterStream defaultCommands. |
|
4460 commandList isNil ifTrue:[ |
|
4461 commandList := #('lpr' |
|
4462 'lp' |
|
4463 ). |
|
4464 ] |
|
4465 ]. |
|
4466 |
|
4467 commandListPop list:commandList. |
|
4468 |
|
4469 box addVerticalSpace; addHorizontalLine; addVerticalSpace. |
|
4470 |
|
4471 row := OrderedCollection new. |
|
4472 row add:(formatLabel := Label label:(resources string:'Page Format:')). |
|
4473 formatLabel borderWidth:0. |
|
4474 row add:(formatComponent := PopUpList on:pageFormat). |
|
4475 formatComponent label:'unknown'. |
|
4476 |
|
4477 row add:(landscapeLabel := Label label:(resources string:'Landscape:')). |
|
4478 landscapeLabel borderWidth:0. |
|
4479 row add:(landscapeComponent := CheckToggle on:landscape). |
|
4480 |
|
4481 y := box yPosition. |
|
4482 box |
|
4483 addRow:(1 to:2) |
|
4484 fromX:0 |
|
4485 toX:0.5 |
|
4486 collect:[:idx | row at:idx] |
|
4487 tabable:false |
|
4488 horizontalLayout:#leftSpace |
|
4489 verticalLayout:#center. |
|
4490 y1 := box yPosition. |
|
4491 box yPosition:y. |
|
4492 |
|
4493 box |
|
4494 addRow:(3 to:4) |
|
4495 fromX:0.5 |
|
4496 toX:1.0 |
|
4497 collect:[:idx | row at:idx] |
|
4498 tabable:false |
|
4499 horizontalLayout:#leftSpace |
|
4500 verticalLayout:#center. |
|
4501 |
|
4502 box yPosition:(box yPosition max:y1). |
|
4503 |
|
4504 box makeTabable:(formatComponent). |
|
4505 box makeTabable:(landscapeComponent). |
|
4506 |
|
4507 box addVerticalSpace; addHorizontalLine; addVerticalSpace. |
|
4508 |
|
4509 y := box yPosition. |
|
4510 |
|
4511 topMarginComponent := box |
|
4512 addLabelledInputField:(resources string:'Top Margin:') |
|
4513 adjust:#right |
|
4514 on:nil "/ topMargin |
|
4515 tabable:true |
|
4516 from:0.0 to:0.5 |
|
4517 separateAtX:0.6. |
|
4518 topMarginComponent converter:(PrintConverter new initForNumber). |
|
4519 topMarginComponent model:topMargin. |
|
4520 y1 := box yPosition. |
|
4521 |
|
4522 box yPosition:y. |
|
4523 unitList := SelectionInList with:#('inch' 'mm'). |
|
4524 unitList selectionIndex:1. |
|
4525 |
|
4526 component := box addComponent:(PopUpList on:unitList). |
|
4527 component |
|
4528 left:0.6; |
|
4529 width:0.3. |
|
4530 |
|
4531 box yPosition:y1. |
|
4532 |
|
4533 leftMarginComponent := box |
|
4534 addLabelledInputField:(resources string:'Left Margin:') |
|
4535 adjust:#right |
|
4536 on:nil "/ leftMargin |
|
4537 tabable:true |
|
4538 from:0.0 to:0.5 |
|
4539 separateAtX:0.6. |
|
4540 leftMarginComponent converter:(PrintConverter new initForNumber). |
|
4541 leftMarginComponent model:leftMargin. |
|
4542 |
|
4543 rightMarginComponent := box |
|
4544 addLabelledInputField:(resources string:'Right Margin:') |
|
4545 adjust:#right |
|
4546 on:nil "/ rightMargin |
|
4547 tabable:true |
|
4548 from:0.0 to:0.5 |
|
4549 separateAtX:0.6. |
|
4550 rightMarginComponent converter:(PrintConverter new initForNumber). |
|
4551 rightMarginComponent model:rightMargin. |
|
4552 |
|
4553 bottomMarginComponent := box |
|
4554 addLabelledInputField:(resources string:'Bottom Margin:') |
|
4555 adjust:#right |
|
4556 on:nil "/ bottomMargin |
|
4557 tabable:true |
|
4558 from:0.0 to:0.5 |
|
4559 separateAtX:0.6. |
|
4560 bottomMarginComponent converter:(PrintConverter new initForNumber). |
|
4561 bottomMarginComponent model:bottomMargin. |
|
4562 |
|
4563 box addHorizontalLine. |
|
4564 supportsColorComponent := box addCheckBox:(resources string:'Color Printer') on:supportsColor. |
|
4565 box addVerticalSpace. |
|
4566 |
|
4567 updater := [ |p fg hasPageSize hasMargins| |
|
4568 |
|
4569 printerType selectionIndex ~~ 0 ifTrue:[ |
|
4570 p := possiblePrinters at:(printerType selectionIndex). |
|
4571 hasPageSize := p supportsPageSizes. |
|
4572 hasMargins := p supportsMargins. |
|
4573 ] ifFalse:[ |
|
4574 hasPageSize := false. |
|
4575 hasMargins := false. |
|
4576 ]. |
|
4577 hasPageSize ifTrue:[ |
|
4578 fg := Button new foregroundColor. |
|
4579 formatComponent enable. |
|
4580 landscapeComponent enable. |
|
4581 |
|
4582 formatComponent label:p pageFormat. |
|
4583 pageFormat value:(p pageFormat). |
|
4584 landscape value:(p landscape). |
|
4585 ] ifFalse:[ |
|
4586 fg := Button new disabledForegroundColor. |
|
4587 formatComponent disable. |
|
4588 landscapeComponent disable. |
|
4589 |
|
4590 formatComponent label:'unknown'. |
|
4591 landscape value:nil. |
|
4592 ]. |
|
4593 hasMargins ifTrue:[ |
|
4594 unitList selectionIndex == 2 ifTrue:[ |
|
4595 unit := #mm |
|
4596 ] ifFalse:[ |
|
4597 unit := #inch |
|
4598 ]. |
|
4599 |
|
4600 topMargin value:(UnitConverter convert:p topMargin from:#inch to:unit). |
|
4601 leftMargin value:(UnitConverter convert:p leftMargin from:#inch to:unit). |
|
4602 rightMargin value:(UnitConverter convert:p rightMargin from:#inch to:unit). |
|
4603 bottomMargin value:(UnitConverter convert:p bottomMargin from:#inch to:unit). |
|
4604 |
|
4605 topMarginComponent enable. |
|
4606 leftMarginComponent enable. |
|
4607 rightMarginComponent enable. |
|
4608 bottomMarginComponent enable. |
|
4609 ] ifFalse:[ |
|
4610 topMarginComponent disable. |
|
4611 leftMarginComponent disable. |
|
4612 rightMarginComponent disable. |
|
4613 bottomMarginComponent disable. |
|
4614 ]. |
|
4615 formatLabel foregroundColor:fg. |
|
4616 landscapeLabel foregroundColor:fg. |
|
4617 |
|
4618 p notNil ifTrue:[ |
|
4619 commandList := p defaultCommands. |
|
4620 commandList notNil ifTrue:[ |
|
4621 commandListPop list:commandList |
|
4622 ]. |
|
4623 |
|
4624 printCommand value:(p printCommand). |
|
4625 ]. |
|
4626 p supportsPostscript ifFalse:[ |
|
4627 supportsColorComponent disable. |
|
4628 supportsColor value:false |
|
4629 ] ifTrue:[ |
|
4630 supportsColorComponent enable. |
|
4631 supportsColor value:(Printer supportsColor). |
|
4632 ] |
|
4633 ]. |
|
4634 unitList onChangeEvaluate:updater. |
|
4635 printerType onChangeEvaluate:updater. |
|
4636 updater value. |
|
4637 |
|
4638 box addHorizontalLine. |
|
4639 box addVerticalSpace; |
|
4640 addHelpButtonFor:'Launcher/printerSettings.html'; |
|
4641 addAbortAndOkButtons. |
|
4642 box open. |
|
4643 |
|
4644 (accepted := box accepted) ifTrue:[ |
|
4645 Printer := possiblePrinters at:(printerType selectionIndex). |
|
4646 Printer printCommand:printCommand value. |
|
4647 |
|
4648 Printer supportsPageSizes ifTrue:[ |
|
4649 Printer pageFormat:(pageFormat selection). |
|
4650 Printer landscape:(landscape value). |
|
4651 ]. |
|
4652 Printer supportsMargins ifTrue:[ |
|
4653 unitList selectionIndex == 2 ifTrue:[ |
|
4654 unit := #mm |
|
4655 ] ifFalse:[ |
|
4656 unit := #inch |
|
4657 ]. |
|
4658 Printer topMargin:(UnitConverter convert:topMargin value from:unit to:#inch). |
|
4659 Printer leftMargin:(UnitConverter convert:leftMargin value from:unit to:#inch). |
|
4660 Printer rightMargin:(UnitConverter convert:rightMargin value from:unit to:#inch). |
|
4661 Printer bottomMargin:(UnitConverter convert:bottomMargin value from:unit to:#inch). |
|
4662 ]. |
|
4663 Printer supportsPostscript ifTrue:[ |
|
4664 Printer supportsColor:supportsColor value. |
|
4665 ]. |
|
4666 ]. |
|
4667 box destroy. |
|
4668 ^ accepted |
|
4669 |
|
4670 "Modified: 9.9.1996 / 22:43:51 / stefan" |
|
4671 "Modified: 28.2.1997 / 14:00:13 / cg" |
|
4672 ! |
|
4673 |
|
4674 restoreSettings |
|
4675 "restore settings from a settings-file." |
|
4676 |
|
4677 "a temporary kludge - we need a central systemSettings object for this, |
|
4678 which can be saved/restored with a single store/read. |
|
4679 Will move entries over to UserPreferences over time; |
|
4680 new items should always go there." |
|
4681 |
|
4682 |fileName resources| |
|
4683 |
|
4684 resources := self owningClass classResources. |
|
4685 |
|
4686 fileName := Dialog |
|
4687 requestFileName:(resources string:'restore settings from:') |
|
4688 default:'settings.stx' |
|
4689 ok:(resources string:'restore') |
|
4690 abort:(resources string:'cancel') |
|
4691 pattern:'*.stx' |
|
4692 fromDirectory:nil. |
|
4693 |
|
4694 (fileName size == 0) ifTrue:[ |
|
4695 "/ canceled |
|
4696 ^ self |
|
4697 ]. |
|
4698 |
|
4699 self withWaitCursorDo:[ |
|
4700 Smalltalk fileIn:fileName. |
|
4701 |
|
4702 self reopenLauncher. |
|
4703 ]. |
|
4704 |
|
4705 "Modified: / 21.7.1998 / 11:37:54 / cg" |
|
4706 ! |
|
4707 |
|
4708 saveSettings |
|
4709 "save settings to a settings-file." |
|
4710 |
|
4711 "a temporary kludge - we need a central systemSettings object for this, |
|
4712 which can be saved/restored with a single store/read. |
|
4713 Will move entries over to UserPreferences over time; |
|
4714 new items should always go there." |
|
4715 |
|
4716 |fileName resources| |
|
4717 |
|
4718 resources := self owningClass classResources. |
|
4719 |
|
4720 fileName := Dialog |
|
4721 requestFileName:(resources string:'Save settings in:') |
|
4722 default:'settings.stx' |
|
4723 ok:(resources string:'Save') |
|
4724 abort:(resources string:'Cancel') |
|
4725 pattern:'*.stx' |
|
4726 fromDirectory:'.'. |
|
4727 |
|
4728 fileName size ~~ 0 ifTrue:[ |
|
4729 "not canceled" |
|
4730 self saveSettingsIn:fileName. |
|
4731 ] |
|
4732 ! |
|
4733 |
|
4734 saveSettingsIn:fileName |
|
4735 "save settings to a settings-file." |
|
4736 |
|
4737 "a temporary kludge - we need a central systemSettings object for this, |
|
4738 which can be saved/restored with a single store/read. |
|
4739 Will move entries over to UserPreferences over time; |
|
4740 new items should always go there." |
|
4741 |
|
4742 |resources s screen currentUserPrefs| |
|
4743 |
|
4744 resources := self owningClass classResources. |
|
4745 |
|
4746 s := fileName asFilename writeStream. |
|
4747 s isNil ifTrue:[ |
|
4748 self warn:(resources string:'Cannot write the %1 file !!' with:fileName). |
|
4749 ^ self |
|
4750 ]. |
|
4751 |
|
4752 currentUserPrefs := UserPreferences current. |
|
4753 screen := Screen current. |
|
4754 |
|
4755 s nextPutLine:'"/ ST/X saved settings'; |
|
4756 nextPutLine:'"/ DO NOT MODIFY MANUALLY'; |
|
4757 nextPutLine:'"/ (modifications would be lost with next save-settings)'; |
|
4758 nextPutLine:'"/'; |
|
4759 nextPutLine:'"/ this file was automatically generated by the'; |
|
4760 nextPutLine:'"/ ''save settings'' function of the Launcher'; |
|
4761 nextPutLine:'"/'. |
|
4762 s cr. |
|
4763 |
|
4764 s nextPutLine:'"/'. |
|
4765 s nextPutLine:'"/ saved by ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName , ' at ' , AbsoluteTime now printString. |
|
4766 s nextPutLine:'"/'. |
|
4767 s cr. |
|
4768 |
|
4769 s nextPutLine:'"/'. |
|
4770 s nextPutLine:'"/ Display settings:'. |
|
4771 s nextPutLine:'"/'. |
|
4772 s nextPutLine:'"/ only restore the display settings, if on the same Display ...'. |
|
4773 s nextPutLine:'Display notNil ifTrue:['. |
|
4774 s nextPutLine:' Display displayName = ' , (screen displayName storeString) , ' ifTrue:['. |
|
4775 screen fixColors notNil ifTrue:[ |
|
4776 s nextPutLine:' Image flushDeviceImages.'. |
|
4777 s nextPutLine:' Color colorAllocationFailSignal catch:['. |
|
4778 s nextPutLine:' Color getColorsRed:6 green:6 blue:4 on:Display'. |
|
4779 s nextPutLine:' ].'. |
|
4780 ] ifFalse:[ |
|
4781 s nextPutLine:' Display releaseFixColors.'. |
|
4782 ]. |
|
4783 s nextPutLine:' Display hasColors: ' , (screen hasColors storeString) , '.'. |
|
4784 s nextPutLine:' Display widthInMillimeter: ' , (screen widthInMillimeter storeString) , '.'. |
|
4785 s nextPutLine:' Display heightInMillimeter: ' , (screen heightInMillimeter storeString) , '.'. |
|
4786 s nextPutLine:' Display supportsDeepIcons: ' , (screen supportsDeepIcons storeString) , '.'. |
|
4787 s nextPutLine:' Image ditherAlgorithm: ' , (Image ditherAlgorithm storeString) , '.'. |
|
4788 s nextPutLine:' View defaultStyle:' , View defaultStyle storeString , '.'. |
|
4789 s nextPutLine:' ].'. |
|
4790 s nextPutLine:'].'. |
|
4791 s cr. |
|
4792 |
|
4793 s nextPutLine:'"/'. |
|
4794 s nextPutLine:'"/ Compiler settings:'. |
|
4795 s nextPutLine:'"/'. |
|
4796 s nextPutLine:'Compiler warnSTXSpecials: ' , (Compiler warnSTXSpecials storeString) , '.'; |
|
4797 nextPutLine:'Compiler warnUnderscoreInIdentifier: ' , (Compiler warnUnderscoreInIdentifier storeString) , '.'; |
|
4798 nextPutLine:'Compiler warnOldStyleAssignment: ' , (Compiler warnOldStyleAssignment storeString) , '.'; |
|
4799 nextPutLine:'Compiler warnCommonMistakes: ' , (Compiler warnCommonMistakes storeString) , '.'; |
|
4800 nextPutLine:'Compiler warnPossibleIncompatibilities: ' , (Compiler warnPossibleIncompatibilities storeString) , '.'; |
|
4801 nextPutLine:'Compiler allowUnderscoreInIdentifier: ' , (Compiler allowUnderscoreInIdentifier storeString) , '.'; |
|
4802 nextPutLine:'Compiler allowSqueakExtensions: ' , (Compiler allowSqueakExtensions storeString) , '.'; |
|
4803 nextPutLine:'Compiler allowDolphinExtensions: ' , (Compiler allowDolphinExtensions storeString) , '.'; |
|
4804 nextPutLine:'Compiler arraysAreImmutable: ' , (Compiler arraysAreImmutable storeString) , '.'; |
|
4805 nextPutLine:'Compiler lineNumberInfo: ' , (Compiler lineNumberInfo storeString) , '.'; |
|
4806 |
|
4807 nextPutLine:'Compiler foldConstants: ' , (Compiler foldConstants storeString) , '.'; |
|
4808 nextPutLine:'Compiler stcCompilation: ' , (Compiler stcCompilation storeString) , '.'; |
|
4809 nextPutLine:'OperatingSystem getOSType = ' , (OperatingSystem getOSType storeString) , ' ifTrue:['; |
|
4810 nextPutLine:' Compiler stcCompilationIncludes: ' , (Compiler stcCompilationIncludes storeString) , '.'; |
|
4811 nextPutLine:' Compiler stcCompilationDefines: ' , (Compiler stcCompilationDefines storeString) , '.'; |
|
4812 nextPutLine:' Compiler stcCompilationOptions: ' , (Compiler stcCompilationOptions storeString) , '.'; |
|
4813 nextPutLine:' ' , (Compiler stcModulePath storeString) , ' asFilename exists ifTrue:['; |
|
4814 nextPutLine:' Compiler stcModulePath: ' , (Compiler stcModulePath storeString) , '.'; |
|
4815 nextPutLine:' ].'; |
|
4816 nextPutLine:' Compiler stcPath: ' , (Compiler stcPath storeString) , '.'; |
|
4817 nextPutLine:' Compiler ccCompilationOptions: ' , (Compiler ccCompilationOptions storeString) , '.'; |
|
4818 nextPutLine:' Compiler ccPath: ' , (Compiler ccPath storeString) , '.'; |
|
4819 nextPutLine:' ObjectFileLoader linkArgs: ' , (ObjectFileLoader linkArgs storeString) , '.'; |
|
4820 nextPutLine:' ObjectFileLoader linkCommand: ' , (ObjectFileLoader linkCommand storeString) , '.'; |
|
4821 nextPutLine:' ObjectFileLoader libPath: ' , (ObjectFileLoader libPath storeString) , '.'; |
|
4822 nextPutLine:' ObjectFileLoader searchedLibraries: ' , (ObjectFileLoader searchedLibraries storeString) , '.'; |
|
4823 nextPutLine:'].'; |
|
4824 |
|
4825 nextPutLine:'ObjectMemory justInTimeCompilation: ' , (ObjectMemory justInTimeCompilation storeString) , '.'; |
|
4826 nextPutLine:'ObjectMemory fullSingleStepSupport: ' , (ObjectMemory fullSingleStepSupport storeString) , '.'. |
|
4827 |
|
4828 HistoryManager notNil ifTrue:[ |
|
4829 HistoryManager isActive ifTrue:[ |
|
4830 s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager activate].'. |
|
4831 s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager fullHistoryUpdate:' , HistoryManager fullHistoryUpdate storeString , '].'. |
|
4832 ] ifFalse:[ |
|
4833 s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager deactivate].'. |
|
4834 ]. |
|
4835 ]. |
|
4836 |
|
4837 ObjectFileLoader notNil ifTrue:[ |
|
4838 s nextPutLine:'ObjectFileLoader searchedLibraries: ' , (ObjectFileLoader searchedLibraries storeString) , '.'. |
|
4839 s nextPutLine:'ObjectFileLoader libPath: ' , (ObjectFileLoader libPath storeString) , '.'. |
|
4840 ]. |
|
4841 |
|
4842 s nextPutLine:'Class catchMethodRedefinitions: ' , (Class catchMethodRedefinitions storeString) , '.'. |
|
4843 s nextPutLine:'ClassCategoryReader sourceMode: ' , (ClassCategoryReader sourceMode storeString) , '.'. |
|
4844 |
|
4845 s cr. |
|
4846 s nextPutLine:'"/'. |
|
4847 s nextPutLine:'"/ Info & Debug Messages:'. |
|
4848 s nextPutLine:'"/'. |
|
4849 s nextPutLine:'ObjectMemory infoPrinting: ' , (ObjectMemory infoPrinting storeString) , '.'; |
|
4850 nextPutLine:'ObjectMemory debugPrinting: ' , (ObjectMemory debugPrinting storeString) , '.'; |
|
4851 nextPutLine:'Object infoPrinting: ' , (Object infoPrinting storeString) , '.'; |
|
4852 nextPutLine:'DeviceWorkstation errorPrinting: ' , (DeviceWorkstation errorPrinting storeString) , '.'. |
|
4853 |
|
4854 FlyByHelp isActive ifTrue:[ |
|
4855 s nextPutLine:'FlyByHelp start.' |
|
4856 ]. |
|
4857 |
|
4858 s cr. |
|
4859 s nextPutLine:'"/'. |
|
4860 s nextPutLine:'"/ Edit settings:'. |
|
4861 s nextPutLine:'"/'. |
|
4862 "/ s nextPutLine:'EditTextView st80Mode: ' , (EditTextView st80Mode storeString) , '.'. |
|
4863 s nextPutLine:'TextView st80SelectMode: ' , (TextView st80SelectMode storeString) , '.'. |
|
4864 s nextPutLine:'UserPreferences current syntaxColoring: ' , (currentUserPrefs syntaxColoring storeString) , '.'. |
|
4865 (ListView userDefaultTabPositions = ListView tab4Positions) ifTrue:[ |
|
4866 s nextPutLine:'ListView userDefaultTabPositions:(ListView tab4Positions).'. |
|
4867 ] ifFalse:[ |
|
4868 s nextPutLine:'ListView userDefaultTabPositions:(ListView tab8Positions).'. |
|
4869 ]. |
|
4870 |
|
4871 s nextPutLine:'"/'. |
|
4872 s nextPutLine:'"/ User preference values:'. |
|
4873 s nextPutLine:'"/'. |
|
4874 currentUserPrefs keysAndValuesDo:[:k :v | |
|
4875 (UserPreferences includesSelector:(k , ':') asSymbol) ifTrue:[ |
|
4876 s nextPutLine:'UserPreferences current ' , k , ':' , v storeString , '.'. |
|
4877 ] ifFalse:[ |
|
4878 s nextPutLine:'UserPreferences current at:' , k storeString , ' put:' , v storeString , '.'. |
|
4879 ] |
|
4880 ]. |
|
4881 |
|
4882 s cr. |
|
4883 s nextPutLine:'"/'. |
|
4884 s nextPutLine:'"/ Misc settings:'. |
|
4885 s nextPutLine:'"/'. |
|
4886 s nextPutLine:'Class keepMethodHistory: ' , (Class methodHistory notNil storeString) , '.'; |
|
4887 nextPutLine:'Smalltalk logDoits: ' , (Smalltalk logDoits storeString) , '.'; |
|
4888 nextPutLine:'Autoload compileLazy: ' , (Autoload compileLazy storeString) , '.'; |
|
4889 nextPutLine:'Smalltalk loadBinaries: ' , (Smalltalk loadBinaries storeString) , '.'; |
|
4890 nextPutLine:'StandardSystemView includeHostNameInLabel: ' , (StandardSystemView includeHostNameInLabel storeString) , '.'; |
|
4891 |
|
4892 "/ claus - I dont think its a good idea to save those ... |
|
4893 nextPutLine:'"/ Class updateChanges: ' , (Class updatingChanges storeString) , '.'; |
|
4894 nextPutLine:'"/ ObjectMemory nameForChanges: ' , (ObjectMemory nameForChanges storeString) , '.'; |
|
4895 |
|
4896 nextPutLine:'StandardSystemView returnFocusWhenClosingModalBoxes: ' , (StandardSystemView returnFocusWhenClosingModalBoxes storeString) , '.'; |
|
4897 nextPutLine:'StandardSystemView takeFocusWhenMapped: ' , (StandardSystemView takeFocusWhenMapped storeString) , '.'; |
|
4898 nextPutLine:'Display notNil ifTrue:['; |
|
4899 nextPutLine:' Display activateOnClick: ' , ((screen activateOnClick:nil) storeString) , '.'; |
|
4900 nextPutLine:'].'; |
|
4901 nextPutLine:'MenuView showAcceleratorKeys: ' , (MenuView showAcceleratorKeys storeString) , '.'; |
|
4902 nextPutLine:'Class tryLocalSourceFirst: ' , (Class tryLocalSourceFirst storeString) , '.'. |
|
4903 (Exception emergencyHandler == AbstractLauncherApplication notifyingEmergencyHandler) ifTrue:[ |
|
4904 s nextPutLine:'Exception emergencyHandler:(AbstractLauncherApplication notifyingEmergencyHandler).'. |
|
4905 ]. |
|
4906 Processor isTimeSlicing ifTrue:[ |
|
4907 s nextPutLine:'Processor startTimeSlicing.'. |
|
4908 s nextPutLine:('Processor supportDynamicPriorities:' , (Processor supportDynamicPriorities ? false) storeString , '.'). |
|
4909 ] ifFalse:[ |
|
4910 s nextPutLine:'Processor stopTimeSlicing.'. |
|
4911 ]. |
|
4912 |
|
4913 s cr. |
|
4914 s nextPutLine:'"/'. |
|
4915 s nextPutLine:'"/ Printer settings:'. |
|
4916 s nextPutLine:'"/'. |
|
4917 s nextPutLine:'Printer := ' , (Printer name) , '.'; |
|
4918 nextPutLine:'Printer printCommand: ' , (Printer printCommand storeString) , '.'. |
|
4919 |
|
4920 Printer supportsPageSizes ifTrue:[ |
|
4921 s nextPutLine:'Printer pageFormat: ' , (Printer pageFormat storeString) , '.'. |
|
4922 s nextPutLine:'Printer landscape: ' , (Printer landscape storeString) , '.'. |
|
4923 ]. |
|
4924 Printer supportsMargins ifTrue:[ |
|
4925 s nextPutLine:'Printer topMargin: ' , (Printer topMargin storeString) , '.'. |
|
4926 s nextPutLine:'Printer leftMargin: ' , (Printer leftMargin storeString) , '.'. |
|
4927 s nextPutLine:'Printer rightMargin: ' , (Printer rightMargin storeString) , '.'. |
|
4928 s nextPutLine:'Printer bottomMargin: ' , (Printer bottomMargin storeString) , '.'. |
|
4929 ]. |
|
4930 Printer supportsPostscript ifTrue:[ |
|
4931 s nextPutLine:'Printer supportsColor: ' , (Printer supportsColor storeString) , '.'. |
|
4932 ]. |
|
4933 |
|
4934 s cr. |
|
4935 s nextPutLine:'"/'. |
|
4936 s nextPutLine:'"/ Font settings:'. |
|
4937 s nextPutLine:'"/ (only restored, if image is restarted on the same display)'. |
|
4938 s nextPutLine:'"/'. |
|
4939 s nextPutLine:'Display notNil ifTrue:['. |
|
4940 s nextPutLine:' Display displayName = ' , (screen displayName storeString) , ' ifTrue:['. |
|
4941 s nextPutLine:' View defaultFont: ' , (View defaultFont storeString) , '.'. |
|
4942 s nextPutLine:' Label defaultFont: ' , (Label defaultFont storeString) , '.'. |
|
4943 s nextPutLine:' Button defaultFont: ' , (Button defaultFont storeString) , '.'. |
|
4944 s nextPutLine:' Toggle defaultFont: ' , (Toggle defaultFont storeString) , '.'. |
|
4945 s nextPutLine:' SelectionInListView defaultFont: ' , (SelectionInListView defaultFont storeString) , '.'. |
|
4946 s nextPutLine:' MenuView defaultFont: ' , (MenuView defaultFont storeString) , '.'. |
|
4947 s nextPutLine:' PullDownMenu defaultFont: ' , (PullDownMenu defaultFont storeString) , '.'. |
|
4948 s nextPutLine:' TextView defaultFont: ' , (TextView defaultFont storeString) , '.'. |
|
4949 s nextPutLine:' EditTextView defaultFont: ' , (EditTextView defaultFont storeString) , '.'. |
|
4950 s nextPutLine:' CodeView defaultFont: ' , (CodeView defaultFont storeString) , '.'. |
|
4951 s nextPutLine:' ].'. |
|
4952 s nextPutLine:'].'. |
|
4953 |
|
4954 s cr. |
|
4955 s nextPutLine:'"/'. |
|
4956 s nextPutLine:'"/ Language setting:'. |
|
4957 s nextPutLine:'"/'. |
|
4958 s nextPutLine:'Smalltalk language: ' , (Smalltalk language storeString) , '.'. |
|
4959 s nextPutLine:'Smalltalk languageTerritory: ' , (Smalltalk languageTerritory storeString) , '.'. |
|
4960 |
|
4961 s cr. |
|
4962 s nextPutLine:'"/'. |
|
4963 s nextPutLine:'"/ SourceCodeManager settings:'. |
|
4964 s nextPutLine:'"/ (only restored, if image is restarted on the same host)'. |
|
4965 s nextPutLine:'"/'. |
|
4966 s nextPutLine:'OperatingSystem getHostName = ' , (OperatingSystem getHostName storeString) , ' ifTrue:['. |
|
4967 s nextPutLine:' Class tryLocalSourceFirst:' , Class tryLocalSourceFirst storeString , '.'. |
|
4968 (Smalltalk at:#SourceCodeManager) == CVSSourceCodeManager ifTrue:[ |
|
4969 s nextPutLine:' Smalltalk at:#SourceCodeManager put: CVSSourceCodeManager.'. |
|
4970 s nextPutLine:' AbstractSourceCodeManager cacheDirectoryName:' , AbstractSourceCodeManager cacheDirectoryName storeString , '.'. |
|
4971 s nextPutLine:' CVSSourceCodeManager cvsBinDirectory:' , CVSSourceCodeManager cvsBinDirectory storeString , '.'. |
|
4972 s nextPutLine:' CVSSourceCodeManager repositoryNamesPerModule:' , CVSSourceCodeManager repositoryNamesPerModule storeString , '.'. |
|
4973 s nextPutLine:' CVSSourceCodeManager initializeForRepository:' , CVSSourceCodeManager repositoryName storeString , '.'. |
|
4974 ]. |
|
4975 s nextPutLine:'].'. |
|
4976 |
|
4977 s close. |
|
4978 |
|
4979 " |
|
4980 Transcript topView application saveSettings |
|
4981 " |
|
4982 |
|
4983 "Modified: / 6.1.1999 / 14:24:16 / cg" |
|
4984 ! |
|
4985 |
|
4986 sourceAndDebuggerSettings |
|
4987 "open a dialog on source&debugger other settings" |
|
4988 |
|
4989 |box check butt setupButt logDoits updChanges changeFileName |
|
4990 useManager hasManager cvsIsSetup |
|
4991 repository repositoryHolder localSourceFirst |
|
4992 sourceCacheDir cacheEntry |
|
4993 component localCheck oldIndent nm fn manager |
|
4994 showErrorNotifier showVerboseStack |
|
4995 syntaxColoring fullSelectorCheck autoFormat |
|
4996 resources pos currentUserPrefs checkClassesWhenCheckingIn checkClassesBox| |
|
4997 |
|
4998 currentUserPrefs := UserPreferences current. |
|
4999 |
|
5000 resources := self owningClass classResources. |
|
5001 |
|
5002 "/ |
|
5003 "/ extract relevant system settings ... |
|
5004 "/ |
|
5005 logDoits := Smalltalk logDoits asValue. |
|
5006 updChanges := Class updatingChanges asValue. |
|
5007 changeFileName := ObjectMemory nameForChanges asValue. |
|
5008 |
|
5009 (AbstractSourceCodeManager notNil |
|
5010 and:[AbstractSourceCodeManager isLoaded not]) ifTrue:[ |
|
5011 AbstractSourceCodeManager autoload. |
|
5012 ]. |
|
5013 |
|
5014 hasManager := AbstractSourceCodeManager notNil |
|
5015 and:[AbstractSourceCodeManager isLoaded]. |
|
5016 |
|
5017 repositoryHolder := '' asValue. |
|
5018 hasManager ifTrue:[ |
|
5019 useManager := (manager := Smalltalk at:#SourceCodeManager) notNil asValue. |
|
5020 localSourceFirst := Class tryLocalSourceFirst asValue. |
|
5021 manager notNil ifTrue:[ |
|
5022 manager forgetDisabledModules. |
|
5023 repository := manager repositoryName. |
|
5024 repository notNil ifTrue:[ |
|
5025 repositoryHolder := repository asValue. |
|
5026 ] ifFalse:[ |
|
5027 repositoryHolder := '' asValue. |
|
5028 ]. |
|
5029 ]. |
|
5030 cvsIsSetup := true. |
|
5031 ] ifFalse:[ |
|
5032 useManager := false. |
|
5033 localSourceFirst := false. |
|
5034 cvsIsSetup := false. |
|
5035 ]. |
|
5036 cvsIsSetup := cvsIsSetup asValue. |
|
5037 showErrorNotifier := (Exception emergencyHandler == AbstractLauncherApplication notifyingEmergencyHandler) asValue. |
|
5038 showVerboseStack := (DebugView defaultVerboseBacktrace ? false) asValue. |
|
5039 syntaxColoring := currentUserPrefs syntaxColoring asValue. |
|
5040 fullSelectorCheck := currentUserPrefs fullSelectorCheck asValue. |
|
5041 autoFormat := currentUserPrefs autoFormatting asValue. |
|
5042 |
|
5043 sourceCacheDir := nil asValue. |
|
5044 checkClassesWhenCheckingIn := (currentUserPrefs at:#checkClassesWhenCheckingIn ifAbsent:true) asValue. |
|
5045 |
|
5046 "/ |
|
5047 "/ create a box on those values ... |
|
5048 "/ |
|
5049 box := DialogBox new. |
|
5050 box label:(resources string:'Source & Debugger Settings'). |
|
5051 |
|
5052 box addCheckBox:(resources string:'Log compiles in Changefile') on:updChanges. |
|
5053 box addCheckBox:(resources string:'Log doIts in Changefile') on:logDoits. |
|
5054 |
|
5055 component := box |
|
5056 addLabelledInputField:(resources string:'Changefile Name:') |
|
5057 adjust:#right |
|
5058 on:changeFileName |
|
5059 tabable:true |
|
5060 separateAtX:0.4. |
|
5061 component immediateAccept:true; acceptOnLeave:false. |
|
5062 |
|
5063 "/ y := box yPosition. |
|
5064 "/ component := box addTextLabel:(resources string:'change file name:'). |
|
5065 "/ component width:0.5; adjust:#right; borderWidth:0. |
|
5066 "/ box yPosition:y. |
|
5067 "/ component := box addInputFieldOn:changeFileName tabable:true. |
|
5068 "/ component width:0.5; left:0.5; immediateAccept:true; acceptOnLeave:false. |
|
5069 |
|
5070 box addHorizontalLine. |
|
5071 |
|
5072 hasManager ifTrue:[ |
|
5073 pos := box yPosition. |
|
5074 check := box addCheckBox:(resources string:'Sourcecode Management') on:useManager. |
|
5075 check enableChannel:cvsIsSetup. |
|
5076 box makeTabable:check. |
|
5077 |
|
5078 CVSSourceCodeManager notNil ifTrue:[ |
|
5079 check width:0.6. |
|
5080 box yPosition:pos. |
|
5081 setupButt := box addComponent:(Button label:(resources string:'Setup...') |
|
5082 action:[|manager| |
|
5083 |
|
5084 self cvsConfigurationDialog. |
|
5085 manager := (Smalltalk at:#SourceCodeManager). |
|
5086 cvsIsSetup value:manager notNil. |
|
5087 manager notNil ifTrue:[ |
|
5088 repositoryHolder value: manager repositoryName. |
|
5089 sourceCacheDir value:(AbstractSourceCodeManager cacheDirectoryName). |
|
5090 ]. |
|
5091 ]). |
|
5092 setupButt enableChannel:useManager. |
|
5093 box makeTabable:setupButt. |
|
5094 setupButt left:0.6; width:0.4. |
|
5095 ]. |
|
5096 oldIndent := box leftIndent. |
|
5097 box leftIndent:30. |
|
5098 |
|
5099 box addVerticalSpace:10. |
|
5100 "/ component := box |
|
5101 "/ addLabelledInputField:(resources string:'CVS repository:') |
|
5102 "/ adjust:#right |
|
5103 "/ on:repositoryHolder |
|
5104 "/ tabable:true |
|
5105 "/ separateAtX:0.5. |
|
5106 "/ component immediateAccept:true; acceptOnLeave:false. |
|
5107 "/ component enableChannel:useManager. |
|
5108 "/ component readOnly:true. |
|
5109 "/ |
|
5110 cacheEntry := box |
|
5111 addLabelledInputField:(resources string:'Source Cache Dir:') |
|
5112 adjust:#right |
|
5113 on:sourceCacheDir |
|
5114 tabable:true |
|
5115 separateAtX:0.5. |
|
5116 cacheEntry immediateAccept:true; acceptOnLeave:false. |
|
5117 cacheEntry enableChannel:useManager. |
|
5118 |
|
5119 pos := box yPosition. |
|
5120 butt := Button label:(resources string:'Flush Cache now'). |
|
5121 butt action:[ box withWaitCursorDo:[ AbstractSourceCodeManager flushSourceCache ] ]. |
|
5122 box addComponent:butt tabable:true. |
|
5123 butt left:0.6; width:0.4; leftInset:0. |
|
5124 butt enableChannel:useManager. |
|
5125 |
|
5126 butt := Button label:(resources string:'Condense Cache now'). |
|
5127 butt action:[ box withWaitCursorDo:[ AbstractSourceCodeManager condenseSourceCache ] ]. |
|
5128 box addComponent:butt tabable:true. |
|
5129 butt left:0.6; width:0.4; leftInset:0. |
|
5130 butt enableChannel:useManager. |
|
5131 |
|
5132 localCheck := box addCheckBox:(resources string:'If Present, Use Local Source (Suppress Checkout)') on:localSourceFirst. |
|
5133 localCheck enableChannel:useManager. |
|
5134 |
|
5135 checkClassesBox := box addCheckBox:(resources string:'Check for halt/error-Sends when Checking in') on:checkClassesWhenCheckingIn. |
|
5136 checkClassesBox enableChannel:useManager. |
|
5137 |
|
5138 box leftIndent:oldIndent. |
|
5139 |
|
5140 (AbstractSourceCodeManager isNil |
|
5141 or:[AbstractSourceCodeManager defaultManager isNil]) ifTrue:[ |
|
5142 useManager value:false. |
|
5143 "/ cacheEntry disable. |
|
5144 "/ localCheck enable. |
|
5145 ] ifFalse:[ |
|
5146 sourceCacheDir value:(AbstractSourceCodeManager cacheDirectoryName). |
|
5147 ]. |
|
5148 box addHorizontalLine. |
|
5149 ]. |
|
5150 |
|
5151 pos := box yPosition. |
|
5152 check := box addCheckBox:(resources string:'Syntax Coloring') on:syntaxColoring. |
|
5153 check width:0.6. |
|
5154 box yPosition:pos. |
|
5155 butt := box addComponent:(Button label:(resources string:'Configure...') action:[self syntaxColorConfigurationDialog]). |
|
5156 box makeTabable:butt. |
|
5157 butt enableChannel:syntaxColoring. |
|
5158 butt left:0.6; width:0.4. |
|
5159 |
|
5160 check := box addCheckBox:(resources string:'Immediate Selector Check') on:fullSelectorCheck. |
|
5161 check enableChannel:syntaxColoring. |
|
5162 |
|
5163 pos := box yPosition. |
|
5164 check := box addCheckBox:(resources string:'Auto Format') on:autoFormat. |
|
5165 check width:0.6. |
|
5166 box yPosition:pos. |
|
5167 butt := box addComponent:(Button label:(resources string:'Configure...') action:[self formattingConfigurationDialog]). |
|
5168 box makeTabable:butt. |
|
5169 butt left:0.6; width:0.4. |
|
5170 |
|
5171 box addHorizontalLine. |
|
5172 |
|
5173 |
|
5174 box addCheckBox:(resources string:'Show Error Notifier before Opening Debugger') on:showErrorNotifier. |
|
5175 box addCheckBox:(resources string:'Verbose Backtrace by Default in Debugger') on:showVerboseStack. |
|
5176 |
|
5177 box addHorizontalLine. |
|
5178 box |
|
5179 addHelpButtonFor:'Launcher/sourceSettings.html'; |
|
5180 addAbortAndOkButtons. |
|
5181 |
|
5182 box maxExtent:1000@600. |
|
5183 |
|
5184 "/ |
|
5185 "/ show the box ... |
|
5186 "/ |
|
5187 box open. |
|
5188 |
|
5189 "/ |
|
5190 "/ update system settings |
|
5191 "/ |
|
5192 box accepted ifTrue:[ |
|
5193 Smalltalk logDoits:logDoits value. |
|
5194 Class updateChanges:updChanges value. |
|
5195 ObjectMemory nameForChanges:changeFileName value. |
|
5196 |
|
5197 (hasManager and:[useManager value]) ifTrue:[ |
|
5198 manager isNil ifTrue:[ |
|
5199 Smalltalk at:#SourceCodeManager put:(AbstractSourceCodeManager defaultManager). |
|
5200 manager := Smalltalk at:#SourceCodeManager. |
|
5201 ]. |
|
5202 Class tryLocalSourceFirst:(localSourceFirst value). |
|
5203 |
|
5204 manager notNil ifTrue:[ |
|
5205 "/ localSourceFirst value ifFalse:[ |
|
5206 |
|
5207 nm := sourceCacheDir value. |
|
5208 nm size > 0 ifTrue:[ |
|
5209 (fn := nm asFilename) exists ifFalse:[ |
|
5210 (self confirm:('CVS cache directory ''' , nm , ''' does not exists\create ?' withCRs)) ifTrue:[ |
|
5211 fn makeDirectory; |
|
5212 makeReadableForAll; |
|
5213 makeWritableForAll; |
|
5214 makeExecutableForAll. |
|
5215 ] |
|
5216 ]. |
|
5217 (fn exists |
|
5218 and:[fn isDirectory |
|
5219 and:[fn isReadable |
|
5220 and:[fn isWritable]]]) ifTrue:[ |
|
5221 AbstractSourceCodeManager cacheDirectoryName:(sourceCacheDir value). |
|
5222 ] ifFalse:[ |
|
5223 self warn:'Invalid sourceCache directory.' |
|
5224 ] |
|
5225 ] |
|
5226 "/ ] |
|
5227 ]. |
|
5228 |
|
5229 repositoryHolder notNil ifTrue:[ |
|
5230 repositoryHolder value size > 0 ifTrue:[ |
|
5231 manager notNil ifTrue:[ |
|
5232 manager initializeForRepository:repositoryHolder value. |
|
5233 ] |
|
5234 ]. |
|
5235 ]. |
|
5236 ] ifFalse:[ |
|
5237 Smalltalk at:#SourceCodeManager put:nil |
|
5238 ]. |
|
5239 |
|
5240 showErrorNotifier value ifFalse:[ |
|
5241 Exception emergencyHandler:nil |
|
5242 ] ifTrue:[ |
|
5243 Exception emergencyHandler:(AbstractLauncherApplication notifyingEmergencyHandler) |
|
5244 ]. |
|
5245 DebugView defaultVerboseBacktrace:(showVerboseStack value). |
|
5246 currentUserPrefs syntaxColoring:syntaxColoring value. |
|
5247 currentUserPrefs at:#fullSelectorCheck put:fullSelectorCheck value. |
|
5248 currentUserPrefs autoFormatting:autoFormat value. |
|
5249 |
|
5250 UserPreferences current at:#checkClassesWhenCheckingIn put:checkClassesWhenCheckingIn value. |
|
5251 ]. |
|
5252 box destroy |
|
5253 |
|
5254 "Modified: / 9.9.1996 / 22:43:36 / stefan" |
|
5255 "Created: / 17.1.1997 / 17:39:33 / cg" |
|
5256 "Modified: / 16.4.1998 / 17:18:47 / ca" |
|
5257 "Modified: / 13.10.1998 / 15:47:31 / cg" |
|
5258 ! |
|
5259 |
|
5260 stcCompilerSettings |
|
5261 "open an extra dialog on stc-compiler related settings" |
|
5262 |
|
5263 |box |
|
5264 stcIncludes stcDefines stcOptions |
|
5265 stcLibraries stcLibraryPath cc stc ccOptions |
|
5266 linkCommand linkArgs |
|
5267 component t |
|
5268 canLoadBinaries thisIsADemoVersion |
|
5269 resources| |
|
5270 |
|
5271 resources := self owningClass classResources. |
|
5272 |
|
5273 canLoadBinaries := ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]. |
|
5274 |
|
5275 stcIncludes := Compiler stcCompilationIncludes asValue. |
|
5276 stcDefines := Compiler stcCompilationDefines asValue. |
|
5277 stcOptions := Compiler stcCompilationOptions asValue. |
|
5278 ccOptions := Compiler ccCompilationOptions asValue. |
|
5279 |
|
5280 cc := Compiler ccPath asValue. |
|
5281 stc := Compiler stcPath asValue. |
|
5282 linkCommand := ObjectFileLoader linkCommand asValue. |
|
5283 linkArgs := ObjectFileLoader linkArgs asValue. |
|
5284 |
|
5285 ObjectFileLoader notNil ifTrue:[ |
|
5286 (t := ObjectFileLoader searchedLibraries) notNil ifTrue:[ |
|
5287 stcLibraries := (String fromStringCollection:t separatedBy:' ') asValue. |
|
5288 ]. |
|
5289 (t := ObjectFileLoader libPath) notNil ifTrue:[ |
|
5290 stcLibraryPath := t asValue. |
|
5291 ] |
|
5292 ]. |
|
5293 |
|
5294 box := DialogBox new. |
|
5295 box label:(resources string:'STC Compilation Settings'). |
|
5296 |
|
5297 thisIsADemoVersion := (Smalltalk releaseIdentification = 'ST/X_free_demo_vsn'). |
|
5298 ObjectFileLoader notNil ifTrue:[ |
|
5299 thisIsADemoVersion ifFalse:[ |
|
5300 |
|
5301 component := box |
|
5302 addLabelledInputField:(resources string:'stc Command:') |
|
5303 adjust:#right |
|
5304 on:stc |
|
5305 tabable:true |
|
5306 separateAtX:0.3. |
|
5307 component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5308 component preferredExtent:(100 @ component preferredExtent y). |
|
5309 canLoadBinaries ifFalse:[component disable]. |
|
5310 |
|
5311 component := box |
|
5312 addLabelledInputField:(resources string:'stc Options:') |
|
5313 adjust:#right |
|
5314 on:stcOptions |
|
5315 tabable:true |
|
5316 separateAtX:0.3. |
|
5317 component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5318 component preferredExtent:(250 @ component preferredExtent y). |
|
5319 canLoadBinaries ifFalse:[component disable]. |
|
5320 |
|
5321 component := box |
|
5322 addLabelledInputField:(resources string:'cc Command:') |
|
5323 adjust:#right |
|
5324 on:cc |
|
5325 tabable:true |
|
5326 separateAtX:0.3. |
|
5327 component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5328 component preferredExtent:(150 @ component preferredExtent y). |
|
5329 canLoadBinaries ifFalse:[component disable]. |
|
5330 |
|
5331 component := box |
|
5332 addLabelledInputField:(resources string:'cc Options:') |
|
5333 adjust:#right |
|
5334 on:ccOptions |
|
5335 tabable:true |
|
5336 separateAtX:0.3. |
|
5337 component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5338 component preferredExtent:(250 @ component preferredExtent y). |
|
5339 canLoadBinaries ifFalse:[component disable]. |
|
5340 |
|
5341 component := box |
|
5342 addLabelledInputField:(resources string:'Include Directories:') |
|
5343 adjust:#right |
|
5344 on:stcIncludes |
|
5345 tabable:true |
|
5346 separateAtX:0.3. |
|
5347 component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5348 component preferredExtent:(250 @ component preferredExtent y). |
|
5349 canLoadBinaries ifFalse:[component disable]. |
|
5350 |
|
5351 "/ box addVerticalSpace. |
|
5352 |
|
5353 component := box |
|
5354 addLabelledInputField:(resources string:'Defines:') |
|
5355 adjust:#right |
|
5356 on:stcDefines |
|
5357 tabable:true |
|
5358 separateAtX:0.3. |
|
5359 component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5360 component preferredExtent:(250 @ component preferredExtent y). |
|
5361 canLoadBinaries ifFalse:[component disable]. |
|
5362 |
|
5363 "/ box addVerticalSpace. |
|
5364 |
|
5365 "/ box addVerticalSpace. |
|
5366 |
|
5367 component := box |
|
5368 addLabelledInputField:(resources string:'Link Command:') |
|
5369 adjust:#right |
|
5370 on:linkCommand |
|
5371 tabable:true |
|
5372 separateAtX:0.3. |
|
5373 component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5374 component preferredExtent:(250 @ component preferredExtent y). |
|
5375 canLoadBinaries ifFalse:[component disable]. |
|
5376 |
|
5377 component := box |
|
5378 addLabelledInputField:(resources string:'Link Args:') |
|
5379 adjust:#right |
|
5380 on:linkArgs |
|
5381 tabable:true |
|
5382 separateAtX:0.3. |
|
5383 component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5384 component preferredExtent:(250 @ component preferredExtent y). |
|
5385 canLoadBinaries ifFalse:[component disable]. |
|
5386 |
|
5387 stcLibraries notNil ifTrue:[ |
|
5388 "/ box addVerticalSpace. |
|
5389 |
|
5390 component := box |
|
5391 addLabelledInputField:(resources string:'C-libraries:') |
|
5392 adjust:#right |
|
5393 on:stcLibraries |
|
5394 tabable:true |
|
5395 separateAtX:0.3. |
|
5396 component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5397 component preferredExtent:(250 @ component preferredExtent y). |
|
5398 canLoadBinaries ifFalse:[component disable]. |
|
5399 ]. |
|
5400 |
|
5401 stcLibraryPath notNil ifTrue:[ |
|
5402 "/ box addVerticalSpace. |
|
5403 |
|
5404 component := box |
|
5405 addLabelledInputField:(resources string:'stc LibPath:') |
|
5406 adjust:#right |
|
5407 on:stcLibraryPath |
|
5408 tabable:true |
|
5409 separateAtX:0.3. |
|
5410 component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5411 component preferredExtent:(250 @ component preferredExtent y). |
|
5412 canLoadBinaries ifFalse:[component disable]. |
|
5413 ]. |
|
5414 ]. |
|
5415 ]. |
|
5416 |
|
5417 box |
|
5418 addHelpButtonFor:'Launcher/compilerSettings.html'; |
|
5419 addAbortAndOkButtons. |
|
5420 |
|
5421 box open. |
|
5422 |
|
5423 box accepted ifTrue:[ |
|
5424 thisIsADemoVersion ifFalse:[ |
|
5425 Compiler stcCompilationIncludes:stcIncludes value. |
|
5426 Compiler stcCompilationDefines:stcDefines value. |
|
5427 Compiler stcCompilationOptions:stcOptions value. |
|
5428 Compiler ccCompilationOptions:ccOptions value. |
|
5429 Compiler ccPath:cc value. |
|
5430 stc value ~= Compiler stcPath ifTrue:[ |
|
5431 Compiler stcPath:stc value |
|
5432 ]. |
|
5433 ObjectFileLoader linkCommand:linkCommand value. |
|
5434 ObjectFileLoader linkArgs:linkArgs value. |
|
5435 ]. |
|
5436 |
|
5437 ObjectFileLoader notNil ifTrue:[ |
|
5438 stcLibraries notNil ifTrue:[ |
|
5439 ObjectFileLoader searchedLibraries:(stcLibraries value asCollectionOfWords). |
|
5440 ]. |
|
5441 stcLibraryPath notNil ifTrue:[ |
|
5442 ObjectFileLoader libPath:(stcLibraryPath value). |
|
5443 ] |
|
5444 ]. |
|
5445 ]. |
|
5446 box destroy |
|
5447 |
|
5448 "Modified: / 10.9.1995 / 19:19:18 / claus" |
|
5449 "Modified: / 9.9.1996 / 22:42:47 / stefan" |
|
5450 "Created: / 2.10.1998 / 16:27:49 / cg" |
|
5451 "Modified: / 21.10.1998 / 19:15:10 / cg" |
|
5452 ! |
|
5453 |
|
5454 toolSettings |
|
5455 "open a dialog on tool settings" |
|
5456 |
|
5457 |box resources currentUserPrefs in acceptChannel |
|
5458 useNewInspector useNewChangesBrowser useNewSystemBrowser useNewVersionDiffBrowser |
|
5459 useNewFileBrowser showClockInLauncher showClock launcher transcriptBufferSize | |
|
5460 |
|
5461 currentUserPrefs := UserPreferences current. |
|
5462 |
|
5463 resources := self owningClass classResources. |
|
5464 |
|
5465 "/ |
|
5466 "/ extract relevant system settings ... |
|
5467 "/ |
|
5468 useNewInspector := currentUserPrefs useNewInspector asValue. |
|
5469 useNewChangesBrowser := currentUserPrefs useNewChangesBrowser asValue. |
|
5470 useNewSystemBrowser := currentUserPrefs useNewSystemBrowser asValue. |
|
5471 showClockInLauncher := currentUserPrefs showClockInLauncher asValue. |
|
5472 useNewVersionDiffBrowser := currentUserPrefs useNewVersionDiffBrowser asValue. |
|
5473 useNewFileBrowser := currentUserPrefs useNewFileBrowser asValue. |
|
5474 transcriptBufferSize := Transcript current lineLimit printString asValue. |
|
5475 |
|
5476 acceptChannel := false asValue. |
|
5477 |
|
5478 "/ |
|
5479 "/ create a box on those values ... |
|
5480 "/ |
|
5481 box := DialogBox new. |
|
5482 box label:(resources string:'Tool Settings'). |
|
5483 |
|
5484 |
|
5485 box addCheckBox:(resources string:'Use the New Changes Browser') on:useNewChangesBrowser. |
|
5486 box addHorizontalLine. |
|
5487 box addCheckBox:(resources string:'Use the New System Browser') on:useNewSystemBrowser. |
|
5488 box addHorizontalLine. |
|
5489 box addCheckBox:(resources string:'Use the New VersionDiff Browser') on:useNewVersionDiffBrowser. |
|
5490 box addHorizontalLine. |
|
5491 (Smalltalk at:#FileBrowserV2) isBehavior ifTrue:[ |
|
5492 box addCheckBox:(resources string:'Use the New File Browser') on:useNewFileBrowser. |
|
5493 box addHorizontalLine. |
|
5494 ]. |
|
5495 box addCheckBox:(resources string:'Use Hierarchical Inspector') on:useNewInspector. |
|
5496 box addHorizontalLine. |
|
5497 box addCheckBox:(resources string:'Show Clock in Launcher') on:showClockInLauncher. |
|
5498 box addHorizontalLine. |
|
5499 in := box |
|
5500 addLabelledInputField:(resources string:'Transcripts Buffer Size:') |
|
5501 adjust:#right |
|
5502 on:transcriptBufferSize |
|
5503 tabable:true |
|
5504 separateAtX:0.6. |
|
5505 in acceptChannel:acceptChannel. |
|
5506 box addHorizontalLine. |
|
5507 |
|
5508 box |
|
5509 addHelpButtonFor:'Launcher/toolSettings.html'; |
|
5510 addAbortAndOkButtons. |
|
5511 |
|
5512 "/ |
|
5513 "/ show the box ... |
|
5514 "/ |
|
5515 box open. |
|
5516 |
|
5517 "/ |
|
5518 "/ update system settings |
|
5519 "/ |
|
5520 box accepted ifTrue:[ |
|
5521 acceptChannel value:false; value:true. |
|
5522 |
|
5523 currentUserPrefs useNewInspector:useNewInspector value. |
|
5524 currentUserPrefs useNewChangesBrowser:useNewChangesBrowser value. |
|
5525 currentUserPrefs useNewSystemBrowser:useNewSystemBrowser value. |
|
5526 currentUserPrefs useNewVersionDiffBrowser:useNewVersionDiffBrowser value. |
|
5527 currentUserPrefs useNewFileBrowser:useNewFileBrowser value. |
|
5528 (Smalltalk at:#FileBrowserV2) isBehavior ifTrue:[ |
|
5529 useNewFileBrowser value ifTrue:[ |
|
5530 FileBrowserV2 installInLauncher. |
|
5531 ] ifFalse:[ |
|
5532 FileBrowserV2 isLoaded ifTrue:[ |
|
5533 FileBrowserV2 removeFromLauncher. |
|
5534 ] |
|
5535 ]. |
|
5536 ]. |
|
5537 showClock := showClockInLauncher value. |
|
5538 currentUserPrefs showClockInLauncher ~= showClock ifTrue:[ |
|
5539 currentUserPrefs showClockInLauncher:showClock. |
|
5540 launcher := Transcript application. |
|
5541 (launcher isKindOf:ToolApplicationModel) ifTrue:[ |
|
5542 showClock ifTrue:[ |
|
5543 launcher startClock |
|
5544 ] ifFalse:[ |
|
5545 launcher stopClock |
|
5546 ] |
|
5547 ] |
|
5548 ]. |
|
5549 |
|
5550 Inspector := currentUserPrefs inspectorClassSetting. |
|
5551 |
|
5552 transcriptBufferSize := Integer readFrom:transcriptBufferSize value onError:Transcript current lineLimit. |
|
5553 Transcript current lineLimit:transcriptBufferSize. |
|
5554 |
|
5555 ]. |
|
5556 box destroy |
|
5557 |
|
5558 "Modified: / 9.9.1996 / 22:43:36 / stefan" |
|
5559 "Modified: / 16.4.1998 / 17:18:47 / ca" |
|
5560 "Created: / 13.10.1998 / 15:44:36 / cg" |
|
5561 "Modified: / 12.11.2001 / 15:48:54 / cg" |
|
5562 ! |
|
5563 |
|
5564 viewStyleSettings |
|
5565 self viewStyleSettingsFor:nil |
|
5566 ! |
|
5567 |
|
5568 viewStyleSettingsFor:requestor |
|
5569 "open a dialog on viewStyle related settings" |
|
5570 |
|
5571 |resourceDir dir box |
|
5572 list listView scrView infoLabel infoForwarder newStyle |
|
5573 someRsrcFile didApply resources listUpdater showStandardStylesOnly standardStyles| |
|
5574 |
|
5575 showStandardStylesOnly := true asValue. |
|
5576 standardStyles := #( |
|
5577 'decWindows' |
|
5578 'iris' |
|
5579 'motif' |
|
5580 'mswindows95' |
|
5581 'next' |
|
5582 'normal' |
|
5583 'os2' |
|
5584 'st80' |
|
5585 ). |
|
5586 |
|
5587 resources := self owningClass classResources. |
|
5588 |
|
5589 " |
|
5590 search resources directory for a list of .style files ... |
|
5591 " |
|
5592 someRsrcFile := Smalltalk getSystemFileName:('resources' asFilename constructString:'normal.style'). |
|
5593 someRsrcFile isNil ifTrue:[ |
|
5594 someRsrcFile := Smalltalk getResourceFileName:'normal.style' forPackage:'stx:libview'. |
|
5595 someRsrcFile isNil ifTrue:[ |
|
5596 someRsrcFile := Smalltalk getResourceFileName:'styles/normal.style' forPackage:'stx:libview'. |
|
5597 ]. |
|
5598 ]. |
|
5599 someRsrcFile notNil ifTrue:[ |
|
5600 resourceDir := someRsrcFile asFilename directoryName |
|
5601 ] ifFalse:[ |
|
5602 resourceDir := Smalltalk getSystemFileName:'resources'. |
|
5603 ]. |
|
5604 |
|
5605 resourceDir isNil ifTrue:[ |
|
5606 self warn:'no styles found (missing ''resources'' directory)'. |
|
5607 ^ self |
|
5608 ]. |
|
5609 dir := resourceDir asFilename directoryContents. |
|
5610 |
|
5611 list := SelectionInList new. |
|
5612 |
|
5613 listUpdater := [ |
|
5614 |listOfStyles lastSelection| |
|
5615 |
|
5616 lastSelection := list selection. |
|
5617 listOfStyles := dir select:[:aFileName | aFileName asFilename hasSuffix:'style']. |
|
5618 listOfStyles := listOfStyles collect:[:aFileName | aFileName asFilename withoutSuffix name]. |
|
5619 Filename isCaseSensitive ifFalse:[ |
|
5620 listOfStyles := listOfStyles collect:[:aStyleName | aStyleName asLowercase]. |
|
5621 ]. |
|
5622 listOfStyles remove:'generic' ifAbsent:nil; remove:'mswindows3' ifAbsent:nil. |
|
5623 showStandardStylesOnly value ifTrue:[ |
|
5624 listOfStyles := listOfStyles select:[:aStyleName | standardStyles includes:aStyleName]. |
|
5625 ]. |
|
5626 |
|
5627 listOfStyles sort. |
|
5628 list list:listOfStyles. |
|
5629 list selection:lastSelection. |
|
5630 ]. |
|
5631 listUpdater value. |
|
5632 |
|
5633 showStandardStylesOnly onChangeEvaluate:listUpdater. |
|
5634 |
|
5635 infoForwarder := [ |
|
5636 |nm sheet comment| |
|
5637 |
|
5638 comment := ''. |
|
5639 nm := list selection. |
|
5640 nm notNil ifTrue:[ |
|
5641 sheet := ViewStyle fromFile:(nm , '.style'). |
|
5642 comment := (sheet at:#comment ifAbsent:'') withoutSeparators. |
|
5643 ]. |
|
5644 comment := comment withCRs asStringCollection. |
|
5645 comment size == 1 ifTrue:[ |
|
5646 comment := comment first |
|
5647 ]. |
|
5648 infoLabel label:comment |
|
5649 ]. |
|
5650 |
|
5651 list onChangeEvaluate:infoForwarder. |
|
5652 |
|
5653 box := Dialog new. |
|
5654 box label:(resources string:'Style Selection'). |
|
5655 |
|
5656 (box addTextLabel:(resources at:'STYLE_MSG' default:'Select a Style') withCRs) adjust:#left. |
|
5657 listView := SelectionInListView on:list. |
|
5658 listView doubleClickAction:[:sel | box acceptChannel value:true. box hide]. |
|
5659 box addCheckBox:(resources string:'standard styles only') on:showStandardStylesOnly. |
|
5660 scrView := box addComponent:(ScrollableView forView:listView) tabable:true. |
|
5661 |
|
5662 box addVerticalSpace. |
|
5663 |
|
5664 (infoLabel := box addTextLabel:'\\' withCRs) adjust:#centerLeft. |
|
5665 |
|
5666 box addAbortAndOkButtons. |
|
5667 "/ mhmh - the newLauncher does not yet handle apply (without close) correctly |
|
5668 "/ b := box addButton:(Button label:(resources string:'apply')). |
|
5669 "/ b action:[didApply := true. requestor changeViewStyleTo:(list selection)]. |
|
5670 |
|
5671 (standardStyles includes:View defaultStyle) ifFalse:[ |
|
5672 showStandardStylesOnly value:false |
|
5673 ]. |
|
5674 list selection:(View defaultStyle). |
|
5675 |
|
5676 box stickAtBottomWithVariableHeight:scrView. |
|
5677 box stickAtBottomWithFixHeight:infoLabel. |
|
5678 didApply := false. |
|
5679 box open. |
|
5680 |
|
5681 box destroy. |
|
5682 box accepted ifTrue:[ |
|
5683 ((newStyle := list selection) ~= View defaultStyle |
|
5684 or:[didApply ~~ true]) ifTrue:[ |
|
5685 requestor notNil ifTrue:[requestor changeViewStyleTo:newStyle]. |
|
5686 ]. |
|
5687 ]. |
|
5688 |
|
5689 " |
|
5690 self viewStyleSettingsFor:nil |
|
5691 " |
|
5692 |
|
5693 "Modified: / 14.9.1998 / 20:33:59 / cg" |
|
5694 ! ! |
|
5695 |
|
5696 !AbstractLauncherApplication::LauncherDialogs class methodsFor:'dialogs - file'! |
|
5697 |
|
5698 objectModuleDialog |
|
5699 "opens a moduleInfo dialog" |
|
5700 |
|
5701 <resource: #programMenu > |
|
5702 |
|
5703 |allModules moduleNames |
|
5704 allObjects methodObjects methodNames |
|
5705 cObjects cObjectNames |
|
5706 otherObjects otherObjectNames |
|
5707 box l handles unloadButton unloadAndRemoveButton |
|
5708 list1 list2 listView1 listView2 |
|
5709 y panel |
|
5710 showBuiltIn showModules showMethods showCObjects showOthers |
|
5711 moduleListUpdater check canDoIt menu |
|
5712 resources middleLabel| |
|
5713 |
|
5714 resources := self owningClass classResources. |
|
5715 |
|
5716 showBuiltIn := true asValue. |
|
5717 canDoIt := ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]. |
|
5718 |
|
5719 showModules := canDoIt asValue. |
|
5720 showMethods := canDoIt asValue. |
|
5721 showCObjects := canDoIt asValue. |
|
5722 showOthers := canDoIt asValue. |
|
5723 |
|
5724 list1 := SelectionInList new. |
|
5725 list2 := SelectionInList new. |
|
5726 |
|
5727 moduleListUpdater := [ |
|
5728 |l| |
|
5729 |
|
5730 list2 list:nil. |
|
5731 |
|
5732 l := Array new. |
|
5733 handles := Array new. |
|
5734 |
|
5735 (showModules value or:[showBuiltIn value]) ifTrue:[ |
|
5736 allModules := ObjectMemory binaryModuleInfo asOrderedCollection. |
|
5737 (showBuiltIn value and:[showModules value]) ifFalse:[ |
|
5738 allModules := allModules select:[:i | |
|
5739 |wantToSee| |
|
5740 |
|
5741 wantToSee := i dynamic. |
|
5742 showBuiltIn value ifTrue:[ |
|
5743 wantToSee := wantToSee not |
|
5744 ]. |
|
5745 wantToSee |
|
5746 ] |
|
5747 ]. |
|
5748 |
|
5749 "/ sorting by reverse id brings newest ones to the top (a side effect) |
|
5750 allModules sort:[:a :b | (a id) > (b id)]. |
|
5751 moduleNames := allModules collect:[:entry | entry name]. |
|
5752 l := l , moduleNames. |
|
5753 handles := handles , allModules. |
|
5754 ]. |
|
5755 |
|
5756 showMethods value ifTrue:[ |
|
5757 allObjects := ObjectFileLoader loadedObjectHandles. |
|
5758 methodObjects := (allObjects select:[:h | h isMethodHandle]) asArray. |
|
5759 methodNames := methodObjects collect:[:mH | mH method isNil ifTrue:[ |
|
5760 'compiled method - removed' " , ' (in ' , mH pathName , ')' " |
|
5761 ] ifFalse:[ |
|
5762 'compiled method ' , mH method whoString " , ' (in ' , mH pathName , ')' " |
|
5763 ]. |
|
5764 ]. |
|
5765 l := l , methodNames. |
|
5766 handles := handles , methodObjects. |
|
5767 ]. |
|
5768 |
|
5769 showCObjects value ifTrue:[ |
|
5770 allObjects := ObjectFileLoader loadedObjectHandles. |
|
5771 cObjects := (allObjects select:[:h | h isFunctionObjectHandle]) asArray. |
|
5772 cObjectNames := cObjects collect:[:entry | entry pathName]. |
|
5773 l := l , cObjectNames. |
|
5774 handles := handles , cObjects. |
|
5775 ]. |
|
5776 |
|
5777 showOthers value ifTrue:[ |
|
5778 allObjects := ObjectFileLoader loadedObjectHandles. |
|
5779 otherObjects := (allObjects select:[:h | (h isFunctionObjectHandle |
|
5780 or:[h isMethodHandle |
|
5781 or:[h isClassLibHandle]]) not]) asArray. |
|
5782 otherObjectNames := otherObjects collect:[:entry | entry pathName]. |
|
5783 l := l , otherObjectNames. |
|
5784 handles := handles , otherObjects. |
|
5785 ]. |
|
5786 |
|
5787 showBuiltIn value ifTrue:[ |
|
5788 l := #('VM') , l. |
|
5789 handles := #(VM) , handles. |
|
5790 allModules := #(VM) , allModules. |
|
5791 ]. |
|
5792 |
|
5793 list1 list:l. |
|
5794 unloadButton disable. |
|
5795 unloadAndRemoveButton disable. |
|
5796 ]. |
|
5797 |
|
5798 showBuiltIn onChangeEvaluate:moduleListUpdater. |
|
5799 showModules onChangeEvaluate:moduleListUpdater. |
|
5800 showMethods onChangeEvaluate:moduleListUpdater. |
|
5801 showCObjects onChangeEvaluate:moduleListUpdater. |
|
5802 showOthers onChangeEvaluate:moduleListUpdater. |
|
5803 |
|
5804 box := Dialog new. |
|
5805 box label:(resources string:'ST/X & Module Version information'). |
|
5806 |
|
5807 listView1 := HVScrollableView for:SelectionInListView miniScrollerH:true. |
|
5808 listView1 model:list1. |
|
5809 listView1 origin:0.0@0.0 corner:1.0@0.4. "/ ; inset:2. |
|
5810 listView1 action:[:sel | |
|
5811 |info classNames tabs module| |
|
5812 |
|
5813 listView1 middleButtonMenu:nil. |
|
5814 |
|
5815 box withWaitCursorDo:[ |
|
5816 |nm fileName addr entry1 entry2 entry3 method l| |
|
5817 |
|
5818 tabs := TabulatorSpecification unit:#inch positions:#(0 2.6 3.5). |
|
5819 |
|
5820 (showModules value or:[showBuiltIn value]) ifTrue:[ |
|
5821 info := allModules at:sel ifAbsent:nil. |
|
5822 ]. |
|
5823 info isNil ifTrue:[ |
|
5824 "/ selected a method, cObject or unknown |
|
5825 |
|
5826 module := handles at:sel. |
|
5827 fileName := module pathName. |
|
5828 |
|
5829 module isMethodHandle ifTrue:[ |
|
5830 middleLabel label:'contains method:'. |
|
5831 |
|
5832 (method := module method) isNil ifTrue:[ |
|
5833 nm := '** removed **'. |
|
5834 ] ifFalse:[ |
|
5835 menu := PopUpMenu |
|
5836 labels:#('inspect' 'browse') |
|
5837 selectors:#(inspect browse). |
|
5838 menu actionAt:#inspect put:[ method inspect ]. |
|
5839 menu actionAt:#browse put:[ |who| |
|
5840 who := method who. |
|
5841 UserPreferences systemBrowserClass |
|
5842 openInClass:(who methodClass) |
|
5843 selector:(who methodSelector) |
|
5844 ]. |
|
5845 listView1 middleButtonMenu:menu. |
|
5846 |
|
5847 nm := (method whoString) asText emphasizeAllWith:(#color->Color blue). |
|
5848 ]. |
|
5849 entry1 := MultiColListEntry new:2 tabulatorSpecification:tabs. |
|
5850 entry1 colAt:1 put:'compiled method'; colAt:2 put:nm. |
|
5851 |
|
5852 entry2 := MultiColListEntry new:2 tabulatorSpecification:tabs. |
|
5853 entry2 colAt:1 put:'path'; colAt:2 put:fileName. |
|
5854 |
|
5855 entry3 := MultiColListEntry new:2 tabulatorSpecification:tabs. |
|
5856 entry3 colAt:1 put:'address'; colAt:2 put:('(16r) ' , (method code address hexPrintString leftPaddedTo:8 with:$0)). |
|
5857 |
|
5858 list2 list:(Array with:entry1 with:entry2 with:entry3). |
|
5859 ] ifFalse:[ |
|
5860 (module isFunctionObjectHandle |
|
5861 and:[module functions notEmpty]) ifTrue:[ |
|
5862 middleLabel label:'contains function:'. |
|
5863 |
|
5864 menu := PopUpMenu |
|
5865 labels:#('inspect') |
|
5866 selectors:#(inspect). |
|
5867 menu actionAt:#inspect put:[ module functions inspect ]. |
|
5868 listView1 middleButtonMenu:menu. |
|
5869 |
|
5870 list2 list:((module functions select:[:f | f notNil]) |
|
5871 collect:[:f | |entry| |
|
5872 entry := MultiColListEntry new:2 tabulatorSpecification:tabs. |
|
5873 entry colAt:1 put:(f name asText emphasizeAllWith:(#color->Color blue)). |
|
5874 entry colAt:2 put:('address: (16r) ' , (f code address hexPrintString leftPaddedTo:8 with:$0)). |
|
5875 entry |
|
5876 ]). |
|
5877 ] ifFalse:[ |
|
5878 list2 list:#('nothing known about contents (no functions have been extracted)'). |
|
5879 ] |
|
5880 ]. |
|
5881 |
|
5882 unloadButton enable. |
|
5883 unloadAndRemoveButton disable. |
|
5884 ] ifFalse:[ |
|
5885 info == #VM ifTrue:[ |
|
5886 "/ dummy entry for VM; |
|
5887 "/ show file versions in lower view. |
|
5888 |
|
5889 middleLabel label:'contains modules:'. |
|
5890 l := (ObjectMemory getVMIdentificationStrings). |
|
5891 l := l select:[:entry | entry includesString:'$Header']. |
|
5892 l := l select:[:entry | entry includesString:',v']. |
|
5893 l := l collect:[:entry | |
|
5894 |i1 i2 file revision date listEntry| |
|
5895 |
|
5896 listEntry := MultiColListEntry new:3 tabulatorSpecification:tabs. |
|
5897 |
|
5898 i1 := entry indexOfSubCollection:'librun'. |
|
5899 i1 ~~ 0 ifTrue:[ |
|
5900 i2 := entry indexOfSubCollection:',v' startingAt:i1. |
|
5901 i2 ~~ 0 ifTrue:[ |
|
5902 file := entry copyFrom:i1+7 to:(i2-1). |
|
5903 listEntry colAt:1 put:file. |
|
5904 |
|
5905 i1 := i2+3. |
|
5906 i2 := entry indexOfSeparatorStartingAt:i1. |
|
5907 revision := entry copyFrom:i1 to:(i2-1). |
|
5908 listEntry colAt:2 put:revision. |
|
5909 |
|
5910 i1 := i2+1. |
|
5911 i2 := entry indexOfSeparatorStartingAt:i1. |
|
5912 date := entry copyFrom:i1 to:(i2-1). |
|
5913 listEntry colAt:3 put:date. |
|
5914 ]. |
|
5915 ]. |
|
5916 listEntry. |
|
5917 "/ entry |
|
5918 ]. |
|
5919 list2 list:l. |
|
5920 |
|
5921 unloadButton disable. |
|
5922 unloadAndRemoveButton disable. |
|
5923 ] ifFalse:[ |
|
5924 "/ selected a package |
|
5925 |
|
5926 "/ fill bottom list with class-info |
|
5927 |
|
5928 middleLabel label:'contains classes:'. |
|
5929 classNames := info classNames asSortedCollection. |
|
5930 classNames := classNames select:[:cName | |
|
5931 |cls| |
|
5932 |
|
5933 cls := Smalltalk classNamed:cName. |
|
5934 cls isNil ifTrue:[ |
|
5935 true "a removed class" |
|
5936 ] ifFalse:[ |
|
5937 cls isPrivate not |
|
5938 ]. |
|
5939 ]. |
|
5940 |
|
5941 classNames := classNames collect:[:cName | |
|
5942 |cls entry rev listEntry| |
|
5943 |
|
5944 listEntry := MultiColListEntry new:2 tabulatorSpecification:tabs. |
|
5945 listEntry colAt:1 put:cName. |
|
5946 |
|
5947 cls := Smalltalk classNamed:cName. |
|
5948 cls isNil ifTrue:[ |
|
5949 listEntry colAt:2 put:'(class removed)'. |
|
5950 ] ifFalse:[ |
|
5951 rev := cls binaryRevision. |
|
5952 rev notNil ifTrue:[ |
|
5953 cls isLoaded ifFalse:[ |
|
5954 entry := '(stub for: ' , rev. |
|
5955 ] ifTrue:[ |
|
5956 entry :='(bin: ' , rev. |
|
5957 ]. |
|
5958 cls revision ~= rev ifTrue:[ |
|
5959 entry := entry , ' / src: ' , (cls revision printString) |
|
5960 ]. |
|
5961 listEntry colAt:2 put:entry , ')' |
|
5962 ] ifFalse:[ |
|
5963 cls revision notNil ifTrue:[ |
|
5964 listEntry colAt:2 put:'(overloaded by: ' , cls revision , ')' |
|
5965 ] |
|
5966 ] |
|
5967 ]. |
|
5968 listEntry |
|
5969 ]. |
|
5970 list2 list:classNames. |
|
5971 info dynamic ifTrue:[ |
|
5972 unloadButton enable. |
|
5973 unloadAndRemoveButton enable. |
|
5974 ] ifFalse:[ |
|
5975 unloadButton disable. |
|
5976 unloadAndRemoveButton disable. |
|
5977 ]. |
|
5978 ]. |
|
5979 ] |
|
5980 ] |
|
5981 ]. |
|
5982 |
|
5983 |
|
5984 panel := HorizontalPanelView new. |
|
5985 |
|
5986 panel add:(l := Label label:'show:'). |
|
5987 l adjust:#left; borderWidth:0. |
|
5988 panel add:(check := CheckBox label:'builtin' model:showBuiltIn). |
|
5989 box makeTabable:check. |
|
5990 panel add:(check := CheckBox label:'classLibs' model:showModules). |
|
5991 canDoIt ifFalse:[ |
|
5992 check disable |
|
5993 ] ifTrue:[ |
|
5994 box makeTabable:check. |
|
5995 ]. |
|
5996 panel add:(check := CheckBox label:'methods' model:showMethods). |
|
5997 canDoIt ifFalse:[ |
|
5998 check disable |
|
5999 ] ifTrue:[ |
|
6000 box makeTabable:check. |
|
6001 ]. |
|
6002 panel add:(check := CheckBox label:'c-objects' model:showCObjects). |
|
6003 canDoIt ifFalse:[ |
|
6004 check disable |
|
6005 ] ifTrue:[ |
|
6006 box makeTabable:check. |
|
6007 ]. |
|
6008 panel add:(check := CheckBox label:'others' model:showOthers). |
|
6009 canDoIt ifFalse:[ |
|
6010 check disable |
|
6011 ] ifTrue:[ |
|
6012 box makeTabable:check. |
|
6013 ]. |
|
6014 |
|
6015 panel horizontalLayout:#fitSpace. |
|
6016 "/ panel horizontalLayout:#leftSpace. |
|
6017 |
|
6018 box addComponent:panel tabable:false. |
|
6019 |
|
6020 box addVerticalSpace. |
|
6021 box addComponent:listView1 tabable:true. |
|
6022 listView1 topInset:(View viewSpacing + panel preferredExtent y). |
|
6023 listView1 origin:0.0@0.0 corner:1.0@0.4. "/ ; inset:2. |
|
6024 |
|
6025 l := box addTextLabel:(resources string:'contains:'). |
|
6026 l adjust:#left; borderWidth:0. |
|
6027 l origin:0.0@0.4 corner:1.0@0.4. |
|
6028 l topInset:(View viewSpacing). |
|
6029 l bottomInset:((l preferredExtent y) negated - View viewSpacing). |
|
6030 middleLabel := l. |
|
6031 |
|
6032 listView2 := HVScrollableView for:SelectionInListView miniScrollerH:true. |
|
6033 listView2 model:list2; printItems:false. |
|
6034 box addComponent:listView2 tabable:true. |
|
6035 listView2 origin:0.0@0.4 corner:1.0@1.0. "/ ; inset:2. |
|
6036 listView2 disable. |
|
6037 |
|
6038 unloadButton := Button label:(resources string:'unload'). |
|
6039 unloadButton action:[ |
|
6040 box withWaitCursorDo:[ |
|
6041 |info idx pathName| |
|
6042 |
|
6043 idx := list1 selectionIndex. |
|
6044 info := allModules at:idx ifAbsent:nil. |
|
6045 |
|
6046 list1 selectionIndex:nil. |
|
6047 |
|
6048 info isNil ifTrue:[ |
|
6049 "/ selected a method |
|
6050 "/ idx := idx - allModules size. |
|
6051 pathName := (handles at:idx) pathName. |
|
6052 |
|
6053 ] ifFalse:[ |
|
6054 "/ selected a package |
|
6055 pathName := info pathName. |
|
6056 ]. |
|
6057 ObjectFileLoader unloadObjectFile:pathName. |
|
6058 moduleListUpdater value. |
|
6059 unloadButton disable. |
|
6060 ] |
|
6061 ]. |
|
6062 |
|
6063 unloadAndRemoveButton := Button label:(resources string:'remove classes & unload'). |
|
6064 unloadAndRemoveButton action:[ |
|
6065 box withWaitCursorDo:[ |
|
6066 |info idx pathName| |
|
6067 |
|
6068 idx := list1 selectionIndex. |
|
6069 info := allModules at:idx ifAbsent:nil. |
|
6070 |
|
6071 list1 selectionIndex:nil. |
|
6072 |
|
6073 info isNil ifTrue:[ |
|
6074 "/ selected a method |
|
6075 "/ idx := idx - allModules size. |
|
6076 pathName := (handles at:idx) pathName. |
|
6077 |
|
6078 ] ifFalse:[ |
|
6079 "/ selected a package |
|
6080 pathName := info pathName. |
|
6081 ]. |
|
6082 ObjectFileLoader unloadObjectFileAndRemoveClasses:pathName. |
|
6083 moduleListUpdater value. |
|
6084 unloadAndRemoveButton disable. |
|
6085 ] |
|
6086 ]. |
|
6087 |
|
6088 moduleListUpdater value. |
|
6089 |
|
6090 box addButton:unloadButton. |
|
6091 box addButton:unloadAndRemoveButton. |
|
6092 box addAbortButtonLabelled:(resources string:'dismiss'). |
|
6093 |
|
6094 y := box yPosition. |
|
6095 listView2 topInset:(l preferredExtent y + 5). |
|
6096 listView2 bottomInset:(box preferredExtent y - y). |
|
6097 |
|
6098 box width:(400 min:(box device width * 2 // 3)); |
|
6099 height:(450 min:(box device height - 50)). |
|
6100 |
|
6101 "/ box sizeFixed:true. |
|
6102 box openWithExtent:(600 min:(box device width * 2 // 3)) |
|
6103 @ |
|
6104 (500 min:(box device height - 50)) . |
|
6105 |
|
6106 box destroy. |
|
6107 |
|
6108 "Modified: / 17.9.1995 / 16:47:50 / claus" |
|
6109 "Created: / 31.7.1998 / 15:49:45 / cg" |
|
6110 "Modified: / 10.8.1998 / 11:33:22 / cg" |
|
6111 ! |
|
6112 |
|
6113 packageDialog |
|
6114 "opens a package dialog" |
|
6115 |
|
6116 |allPackages packageList packageUpdater |
|
6117 box listView tabs |
|
6118 menu resources selectedPackage| |
|
6119 |
|
6120 resources := self owningClass classResources. |
|
6121 |
|
6122 box := Dialog new. |
|
6123 box label:(resources string:'Packages'). |
|
6124 |
|
6125 allPackages := Set new. |
|
6126 allPackages addAll:(Smalltalk knownPackages). |
|
6127 |
|
6128 Project knownProjects do:[:package | |
|
6129 allPackages add:(package name) |
|
6130 ]. |
|
6131 Project loadedProjects do:[:package | |
|
6132 allPackages add:(package name) |
|
6133 ]. |
|
6134 allPackages := allPackages asOrderedCollection sort. |
|
6135 |
|
6136 packageUpdater := [ |
|
6137 tabs := TabulatorSpecification unit:#inch positions:#(0 4). |
|
6138 packageList := allPackages collect:[:pName | |pkg entry| |
|
6139 entry := MultiColListEntry new:2 tabulatorSpecification:tabs. |
|
6140 pkg := Project projectWithId:pName asSymbol. |
|
6141 (pkg notNil and:[pkg isLoaded]) ifTrue:[ |
|
6142 entry colAt:1 put:pName allBold. |
|
6143 entry colAt:2 put:'loaded'. |
|
6144 ] ifFalse:[ |
|
6145 entry colAt:1 put:pName. |
|
6146 |
|
6147 (Smalltalk allClasses |
|
6148 contains:[:cls | cls package = pName and:[cls isLoaded not]]) |
|
6149 ifTrue:[ |
|
6150 (Smalltalk allClasses |
|
6151 contains:[:cls | cls package = pName and:[cls isLoaded]]) |
|
6152 ifTrue:[ |
|
6153 entry colAt:2 put:'loaded/autoloaded'. |
|
6154 ] ifFalse:[ |
|
6155 entry colAt:2 put:'autoloaded'. |
|
6156 ] |
|
6157 ] |
|
6158 ]. |
|
6159 entry |
|
6160 ]. |
|
6161 ]. |
|
6162 packageUpdater value. |
|
6163 |
|
6164 listView := HVScrollableView for:SelectionInListView miniScrollerH:true. |
|
6165 listView list:packageList. |
|
6166 |
|
6167 box addComponent:listView tabable:true. |
|
6168 listView origin:0.0@0.0 corner:1.0@1.0. |
|
6169 listView bottomInset:40. |
|
6170 listView action:[:selIndex | |pkg| |
|
6171 selectedPackage := (allPackages at:selIndex) asSymbol. |
|
6172 |
|
6173 pkg := Project projectWithId:selectedPackage. |
|
6174 (pkg notNil and:[pkg isLoaded]) ifTrue:[ |
|
6175 menu disable:#load. |
|
6176 "/ menu enable:#unload. |
|
6177 ] ifFalse:[ |
|
6178 "/ menu disable:#unload. |
|
6179 menu enable:#load. |
|
6180 ] |
|
6181 ]. |
|
6182 |
|
6183 menu := PopUpMenu |
|
6184 itemList:#( |
|
6185 ('load...' load ) |
|
6186 "/ ('-' nil ) |
|
6187 "/ ('unload...' unload) |
|
6188 ) |
|
6189 resources:resources. |
|
6190 listView middleButtonMenu:menu. |
|
6191 menu actionAt:#load put:[ |
|
6192 box withWaitCursorDo:[ |
|
6193 Smalltalk loadPackage:selectedPackage. |
|
6194 packageUpdater value. |
|
6195 ] |
|
6196 ]. |
|
6197 "/ menu actionAt:#unload put:[ |
|
6198 "/ box withWaitCursorDo:[ |
|
6199 "/ Smalltalk unloadPackage:selectedPackage. |
|
6200 "/ packageUpdater value. |
|
6201 "/ ]. |
|
6202 "/ ]. |
|
6203 menu disable:#load. |
|
6204 "/ menu disable:#unload. |
|
6205 |
|
6206 box addAbortButtonLabelled:(resources string:'dismiss'). |
|
6207 |
|
6208 box width:(400 min:(box device width * 2 // 3)); |
|
6209 height:(450 min:(box device height - 50)). |
|
6210 |
|
6211 box openWithExtent:(600 min:(box device width * 2 // 3)) |
|
6212 @ |
|
6213 (500 min:(box device height - 50)) . |
|
6214 |
|
6215 box destroy. |
|
6216 ! ! |
|
6217 |
|
6218 !AbstractLauncherApplication::LauncherDialogs class methodsFor:'dialogs - private'! |
|
6219 |
|
6220 cvsConfigurationDialog |
|
6221 |cvsRootHolder resources defaultsList bindings dialog |
|
6222 listOfModules selectedPerModuleRoot rootsPerModule acceptChannel |
|
6223 removeEnabled cvsBinDirectoryHolder| |
|
6224 |
|
6225 resources := self owningClass classResources. |
|
6226 |
|
6227 OperatingSystem isUNIXlike ifTrue:[ |
|
6228 defaultsList := #( |
|
6229 '/files/CVS' |
|
6230 '/CVS' |
|
6231 'host:/files/CVS' |
|
6232 'host:/CVS' |
|
6233 ':pserver:user@host:/files/CVS' |
|
6234 ). |
|
6235 ] ifFalse:[ |
|
6236 OperatingSystem isMSDOSlike ifTrue:[ |
|
6237 defaultsList := #( |
|
6238 ':local:c:\files\CVS' |
|
6239 ':local:c:\CVS' |
|
6240 'host:/files/CVS' |
|
6241 'host:/CVS' |
|
6242 ':pserver:user@host:/files/CVS' |
|
6243 ). |
|
6244 ] ifFalse:[ |
|
6245 defaultsList := #('host:/files/CVS' 'host:/CVS' ':pserver:user@host:/files/CVS'). |
|
6246 ] |
|
6247 ]. |
|
6248 |
|
6249 cvsRootHolder := CVSSourceCodeManager repositoryName ? '/files/CVS'. |
|
6250 cvsRootHolder := cvsRootHolder asValue. |
|
6251 rootsPerModule := Dictionary new declareAllFrom:(CVSSourceCodeManager repositoryNamesPerModule). |
|
6252 cvsBinDirectoryHolder := CVSSourceCodeManager cvsBinDirectory asValue. |
|
6253 |
|
6254 bindings := IdentityDictionary new. |
|
6255 bindings at:#acceptChannel put:(acceptChannel := TriggerValue new). |
|
6256 |
|
6257 bindings at:#cvsRootPrototypeList put:defaultsList. |
|
6258 bindings at:#cvsRootHolder put:cvsRootHolder. |
|
6259 bindings at:#perModuleRootModule put:nil asValue. |
|
6260 bindings at:#perModuleRoot put:nil asValue. |
|
6261 bindings at:#removeEnabled put:(removeEnabled := false asValue). |
|
6262 bindings at:#listOfModules put:(listOfModules := rootsPerModule keys asList). |
|
6263 bindings at:#cvsBinDirectoryHolder put:cvsBinDirectoryHolder. |
|
6264 listOfModules sort. |
|
6265 |
|
6266 bindings at:#selectedPerModuleRoot put:(selectedPerModuleRoot := nil asValue). |
|
6267 selectedPerModuleRoot |
|
6268 onChangeEvaluate:[ |
|
6269 |module cvsRoot| |
|
6270 |
|
6271 acceptChannel value:true. |
|
6272 module := selectedPerModuleRoot value. |
|
6273 removeEnabled value:true. |
|
6274 cvsRoot := rootsPerModule at:module ifAbsent:''. |
|
6275 (bindings at:#perModuleRootModule) value:module. |
|
6276 (bindings at:#perModuleRoot) value:cvsRoot. |
|
6277 ]. |
|
6278 |
|
6279 bindings at:#help put:[ |
|
6280 WindowGroup activeGroup withWaitCursorDo:[ |
|
6281 HTMLDocumentView openFullOnHelpFile:'Launcher/cvsSetup.html' |
|
6282 ] |
|
6283 ]. |
|
6284 |
|
6285 bindings at:#addPerModuleRoot put:[ |
|
6286 |module cvsRoot| |
|
6287 |
|
6288 acceptChannel value:true. |
|
6289 module := (bindings at:#perModuleRootModule) value. |
|
6290 cvsRoot := (bindings at:#perModuleRoot) value. |
|
6291 (listOfModules includes:module) ifFalse:[ |
|
6292 listOfModules add:module. |
|
6293 listOfModules sort. |
|
6294 ]. |
|
6295 cvsRoot size > 0 ifTrue:[ |
|
6296 rootsPerModule at:module put:cvsRoot. |
|
6297 ]. |
|
6298 ]. |
|
6299 bindings at:#removePerModuleRoot put:[ |
|
6300 |module| |
|
6301 |
|
6302 acceptChannel value:true. |
|
6303 module := (bindings at:#perModuleRootModule) value. |
|
6304 listOfModules remove:module ifAbsent:nil. |
|
6305 rootsPerModule removeKey:module ifAbsent:nil. |
|
6306 (bindings at:#perModuleRootModule) value:nil. |
|
6307 (bindings at:#perModuleRoot) value:nil. |
|
6308 ]. |
|
6309 |
|
6310 dialog := SimpleDialog new. |
|
6311 dialog resources:resources. |
|
6312 (dialog openSpec:(self cvsSetupSpec) withBindings:bindings) ifFalse:[ |
|
6313 ^ self |
|
6314 ]. |
|
6315 |
|
6316 acceptChannel value. |
|
6317 |
|
6318 "/ |
|
6319 "/ update system settings |
|
6320 "/ |
|
6321 CVSSourceCodeManager cvsBinDirectory:cvsBinDirectoryHolder value. |
|
6322 CVSSourceCodeManager initializeForRepository:cvsRootHolder value. |
|
6323 CVSSourceCodeManager repositoryNamesPerModule:rootsPerModule. |
|
6324 ! |
|
6325 |
|
6326 fontBoxForEncoding:encodingMatch |
|
6327 "open a fontBox, showing fonts which match some encoding |
|
6328 (used when changing to japanese ...)" |
|
6329 |
|
6330 |box y b |
|
6331 labelDef buttonDef listDef menuDef textDef |
|
6332 models labels allOfThem filter resources defaultButton| |
|
6333 |
|
6334 resources := self owningClass classResources. |
|
6335 |
|
6336 encodingMatch notNil ifTrue:[ |
|
6337 filter := [:f | f encoding notNil |
|
6338 and:[encodingMatch match:f encoding]]. |
|
6339 ]. |
|
6340 |
|
6341 models := OrderedCollection new. |
|
6342 labels := OrderedCollection new. |
|
6343 |
|
6344 models add:(allOfThem := nil asValue). |
|
6345 models add:(labelDef := Label defaultFont asValue). |
|
6346 models add:(buttonDef := Button defaultFont asValue). |
|
6347 models add:(listDef := SelectionInListView defaultFont asValue). |
|
6348 models add:(menuDef := MenuView defaultFont asValue). |
|
6349 models add:(textDef := TextView defaultFont asValue). |
|
6350 |
|
6351 box := Dialog new. |
|
6352 box label:(resources string:'Font Settings'). |
|
6353 |
|
6354 models |
|
6355 with:(resources array:#('All' 'Labels' 'Buttons' 'Lists' 'Menus' 'Edited Text')) |
|
6356 do:[:model :title | |
|
6357 |y2 lbl f i| |
|
6358 |
|
6359 f := model value. |
|
6360 |
|
6361 (box addTextLabel:title) adjust:#left. |
|
6362 |
|
6363 y := box yPosition. |
|
6364 b := box addComponent:(Button label:(resources string:'Change ...')) tabable:true. |
|
6365 b relativeExtent:nil; extent:(b preferredExtent). |
|
6366 y2 := box yPosition. |
|
6367 box yPosition:y. |
|
6368 i := box leftIndent. |
|
6369 box leftIndent:(b widthIncludingBorder + View viewSpacing). |
|
6370 (lbl := box addTextLabel:'') |
|
6371 adjust:#left; |
|
6372 font:(model value); |
|
6373 labelChannel:(BlockValue |
|
6374 with:[:v | |f| |
|
6375 f := v value. |
|
6376 f isNil ifTrue:[ |
|
6377 '' |
|
6378 ] ifFalse:[ |
|
6379 f userFriendlyName |
|
6380 ] |
|
6381 ] |
|
6382 argument:model). |
|
6383 labels add:lbl. |
|
6384 |
|
6385 box leftIndent:i. |
|
6386 box yPosition:(box yPosition max:y2). |
|
6387 |
|
6388 box addVerticalSpace; addHorizontalLine; addVerticalSpace. |
|
6389 |
|
6390 b action:[ |
|
6391 |f| |
|
6392 |
|
6393 f := FontPanel |
|
6394 fontFromUserInitial:(model value) |
|
6395 title:(resources string:'Font for %1' with:title) |
|
6396 filter:filter. |
|
6397 f notNil ifTrue:[ |
|
6398 model == allOfThem ifTrue:[ |
|
6399 models do:[:m | m value:f]. |
|
6400 labels do:[:l | l font:f] |
|
6401 ] ifFalse:[ |
|
6402 model value:f. |
|
6403 lbl font:f. |
|
6404 ]. |
|
6405 ] |
|
6406 ]. |
|
6407 model == allOfThem ifTrue:[ |
|
6408 box addVerticalSpace |
|
6409 ] |
|
6410 ]. |
|
6411 |
|
6412 box addAbortAndOkButtons. |
|
6413 defaultButton := Button label:(resources string:'Defaults'). |
|
6414 |
|
6415 (DialogBox styleSheet at:'dialogBox.okAtLeft') ifTrue:[ |
|
6416 box addButton:defaultButton after:nil. |
|
6417 ] ifFalse:[ |
|
6418 box addButton:defaultButton before:nil. |
|
6419 ]. |
|
6420 defaultButton |
|
6421 action:[ |
|
6422 "/ fetch defaults |
|
6423 View readStyleSheetAndUpdateAllStyleCaches. |
|
6424 labelDef value: Label defaultFont. |
|
6425 buttonDef value: Button defaultFont. |
|
6426 listDef value: SelectionInListView defaultFont. |
|
6427 menuDef value: MenuView defaultFont. |
|
6428 textDef value: TextView defaultFont. |
|
6429 ]. |
|
6430 |
|
6431 box open. |
|
6432 box accepted ifTrue:[ |
|
6433 Label defaultFont:labelDef value. |
|
6434 Button defaultFont:buttonDef value. |
|
6435 Toggle defaultFont:buttonDef value. |
|
6436 TextView withAllSubclasses do:[:cls | cls defaultFont:textDef value]. |
|
6437 SelectionInListView withAllSubclasses do:[:cls | cls defaultFont:listDef value]. |
|
6438 MenuView defaultFont:menuDef value. |
|
6439 PullDownMenu defaultFont:menuDef value. |
|
6440 ]. |
|
6441 box destroy. |
|
6442 ^ box accepted |
|
6443 |
|
6444 "Created: / 27.2.1996 / 01:44:16 / cg" |
|
6445 "Modified: / 17.6.1996 / 13:38:48 / stefan" |
|
6446 "Modified: / 15.9.1998 / 22:04:51 / cg" |
|
6447 ! |
|
6448 |
|
6449 formattingConfigurationDialog |
|
6450 |dialog |
|
6451 resources exampleText formattedText reformatAction |
|
6452 reformatLocked |
|
6453 oldUserPreferences |
|
6454 currentUserPrefs |
|
6455 tabIndent |
|
6456 spaceAroundTemporaries emptyLineAfterTemporaries |
|
6457 spaceAfterReturnToken spaceAfterKeywordSelector cStyleBlocks |
|
6458 blockArgumentsOnNewLine |
|
6459 maxLengthForSingleLineBlocks resetValue bindings| |
|
6460 |
|
6461 RBFormatter isNil ifTrue:[ |
|
6462 ^ self warn:'Sorry, no RBFormatter class'. |
|
6463 ]. |
|
6464 |
|
6465 RBFormatter isLoaded ifFalse:[ |
|
6466 WindowGroup activeGroup withWaitCursorDo:[ |
|
6467 RBFormatter autoload |
|
6468 ] |
|
6469 ]. |
|
6470 |
|
6471 resources := self owningClass classResources. |
|
6472 currentUserPrefs := UserPreferences current. |
|
6473 |
|
6474 exampleText := |
|
6475 'methodSelector:methodArg |
|
6476 "method comment: |
|
6477 some stupid code to show the current settings" |
|
6478 |
|
6479 |index| |
|
6480 |
|
6481 "/ another comment ... |
|
6482 self at:index. "/ a message |
|
6483 self at:index put:methodArg. "/ a two arg message |
|
6484 self from:1 to:index put:methodArg. "/ a three arg message |
|
6485 methodArg ifTrue:[ |
|
6486 Transcript showCR:''hello''. "/ condition |
|
6487 ]. |
|
6488 methodArg ifTrue:[ |
|
6489 Transcript showCR:''hello''. "/ condition |
|
6490 ] ifFalse:[ |
|
6491 Transcript showCR:''world''. |
|
6492 ]. |
|
6493 [methodArg] whileTrue:[ |
|
6494 Transcript showCR:''hello''. "/ looping |
|
6495 ]. |
|
6496 [self aVeryLongConditionBlock and:[self toMakeBlockLonger]] whileTrue:[ |
|
6497 Transcript showCR:''hello''. "/ long blocks |
|
6498 ]. |
|
6499 methodArg do:[:element | |
|
6500 Transcript showCR:''hello''. "/ looping |
|
6501 ]. |
|
6502 1 to:methodArg size do:[:index | |
|
6503 Transcript showCR:''hello''. "/ looping |
|
6504 ]. |
|
6505 methodArg keysAndValuesDo:[:index | |
|
6506 Transcript showCR:''hello''. "/ looping |
|
6507 ]. |
|
6508 Object errorSignal handle:[:ex | |
|
6509 ex return |
|
6510 ] do:[ "/ exception handling |
|
6511 self someAction "/ blocks |
|
6512 ]. |
|
6513 ^ self. |
|
6514 '. |
|
6515 |
|
6516 formattedText := '' asValue. |
|
6517 reformatLocked := false. |
|
6518 |
|
6519 reformatAction := [ |tree |
|
6520 s_tabIndent s_spaceAroundTemporaries s_emptyLineAfterTemporaries |
|
6521 s_spaceAfterReturnToken s_spaceAfterKeywordSelector s_cStyleBlocks |
|
6522 s_maxLengthForSingleLineBlocks s_blockArgumentsOnNewLine| |
|
6523 |
|
6524 reformatLocked ifFalse:[ |
|
6525 "/ |
|
6526 "/ temporary change the RBFormatters settings ... |
|
6527 "/ |
|
6528 s_tabIndent := RBFormatter tabIndent. |
|
6529 s_spaceAroundTemporaries := RBFormatter spaceAroundTemporaries. |
|
6530 s_emptyLineAfterTemporaries := RBFormatter emptyLineAfterTemporaries. |
|
6531 s_spaceAfterReturnToken := RBFormatter spaceAfterReturnToken. |
|
6532 s_spaceAfterKeywordSelector := RBFormatter spaceAfterKeywordSelector. |
|
6533 s_cStyleBlocks := RBFormatter cStyleBlocks. |
|
6534 s_blockArgumentsOnNewLine := RBFormatter blockArgumentsOnNewLine. |
|
6535 s_maxLengthForSingleLineBlocks := RBFormatter maxLengthForSingleLineBlocks. |
|
6536 |
|
6537 RBFormatter |
|
6538 tabIndent:tabIndent value; |
|
6539 spaceAroundTemporaries:spaceAroundTemporaries value; |
|
6540 emptyLineAfterTemporaries:emptyLineAfterTemporaries value; |
|
6541 spaceAfterReturnToken:spaceAfterReturnToken value; |
|
6542 spaceAfterKeywordSelector:spaceAfterKeywordSelector value; |
|
6543 cStyleBlocks:cStyleBlocks value; |
|
6544 blockArgumentsOnNewLine:blockArgumentsOnNewLine value; |
|
6545 maxLengthForSingleLineBlocks:maxLengthForSingleLineBlocks value. |
|
6546 |
|
6547 tree := RBParser |
|
6548 parseMethod:exampleText |
|
6549 onError: [:aString :position | nil]. |
|
6550 tree do:[:node | |
|
6551 (node ~~ tree and:[node parent isNil]) ifTrue:[ |
|
6552 self error:'No parent for node'. |
|
6553 ] |
|
6554 ]. |
|
6555 formattedText value:tree printString. |
|
6556 |
|
6557 RBFormatter |
|
6558 tabIndent:s_tabIndent; |
|
6559 spaceAroundTemporaries:s_spaceAroundTemporaries; |
|
6560 emptyLineAfterTemporaries:s_emptyLineAfterTemporaries; |
|
6561 spaceAfterReturnToken:s_spaceAfterReturnToken; |
|
6562 spaceAfterKeywordSelector:s_spaceAfterKeywordSelector; |
|
6563 cStyleBlocks:s_cStyleBlocks; |
|
6564 blockArgumentsOnNewLine:s_blockArgumentsOnNewLine; |
|
6565 maxLengthForSingleLineBlocks:s_maxLengthForSingleLineBlocks. |
|
6566 ]. |
|
6567 ]. |
|
6568 |
|
6569 bindings := IdentityDictionary new. |
|
6570 bindings at:#formattedText put:formattedText. |
|
6571 |
|
6572 oldUserPreferences := currentUserPrefs copy. |
|
6573 |
|
6574 tabIndent := RBFormatter tabIndent asValue. |
|
6575 tabIndent onChangeEvaluate:reformatAction. |
|
6576 bindings at:#tabIndent put:tabIndent. |
|
6577 |
|
6578 spaceAroundTemporaries := RBFormatter spaceAroundTemporaries asValue. |
|
6579 spaceAroundTemporaries onChangeEvaluate:reformatAction. |
|
6580 bindings at:#spaceAroundTemporaries put:spaceAroundTemporaries. |
|
6581 |
|
6582 emptyLineAfterTemporaries := RBFormatter emptyLineAfterTemporaries asValue. |
|
6583 emptyLineAfterTemporaries onChangeEvaluate:reformatAction. |
|
6584 bindings at:#emptyLineAfterTemporaries put:emptyLineAfterTemporaries. |
|
6585 |
|
6586 spaceAfterReturnToken := RBFormatter spaceAfterReturnToken asValue. |
|
6587 spaceAfterReturnToken onChangeEvaluate:reformatAction. |
|
6588 bindings at:#spaceAfterReturnToken put:spaceAfterReturnToken. |
|
6589 |
|
6590 spaceAfterKeywordSelector := RBFormatter spaceAfterKeywordSelector asValue. |
|
6591 spaceAfterKeywordSelector onChangeEvaluate:reformatAction. |
|
6592 bindings at:#spaceAfterKeywordSelector put:spaceAfterKeywordSelector. |
|
6593 |
|
6594 cStyleBlocks := RBFormatter cStyleBlocks asValue. |
|
6595 cStyleBlocks onChangeEvaluate:reformatAction. |
|
6596 bindings at:#cStyleBlocks put:cStyleBlocks. |
|
6597 |
|
6598 blockArgumentsOnNewLine := RBFormatter blockArgumentsOnNewLine asValue. |
|
6599 blockArgumentsOnNewLine onChangeEvaluate:reformatAction. |
|
6600 bindings at:#blockArgumentsOnNewLine put:blockArgumentsOnNewLine. |
|
6601 |
|
6602 maxLengthForSingleLineBlocks := RBFormatter maxLengthForSingleLineBlocks asValue. |
|
6603 maxLengthForSingleLineBlocks onChangeEvaluate:reformatAction. |
|
6604 bindings at:#maxLengthForSingleLineBlocks put:maxLengthForSingleLineBlocks. |
|
6605 |
|
6606 bindings at:#resetList put:#( 'ST/X default' 'RB default' ). |
|
6607 bindings at:#resetValue put:(resetValue := nil asValue). |
|
6608 resetValue onChangeEvaluate: |
|
6609 [ |
|
6610 resetValue value == 1 ifTrue:[ |
|
6611 "/ ST/X defaults |
|
6612 reformatLocked := true. |
|
6613 tabIndent value: 4. |
|
6614 spaceAfterReturnToken value: true. |
|
6615 spaceAfterKeywordSelector value: false. |
|
6616 spaceAroundTemporaries value: false. |
|
6617 emptyLineAfterTemporaries value: true. |
|
6618 cStyleBlocks value: true. |
|
6619 blockArgumentsOnNewLine value:false. |
|
6620 maxLengthForSingleLineBlocks value: 20. |
|
6621 reformatLocked := false. |
|
6622 reformatAction value. |
|
6623 ]. |
|
6624 resetValue value == 2 ifTrue:[ |
|
6625 "/ RBParser defaults |
|
6626 reformatLocked := true. |
|
6627 tabIndent value: 8. |
|
6628 spaceAfterReturnToken value: false. |
|
6629 spaceAfterKeywordSelector value: true. |
|
6630 spaceAroundTemporaries value: true. |
|
6631 emptyLineAfterTemporaries value: false. |
|
6632 cStyleBlocks value: false. |
|
6633 blockArgumentsOnNewLine value:false. |
|
6634 maxLengthForSingleLineBlocks value: 20. |
|
6635 reformatLocked := false. |
|
6636 reformatAction value. |
|
6637 ]. |
|
6638 resetValue value:nil. "/ to force default label |
|
6639 ]. |
|
6640 |
|
6641 reformatAction value. |
|
6642 |
|
6643 "/ |
|
6644 "/ create a box on those ... |
|
6645 "/ |
|
6646 dialog := SimpleDialog new. |
|
6647 dialog postBuildBlock:[:builder | |
|
6648 (builder componentAt:#sampleTextView) |
|
6649 cursorMovementWhenUpdating:nil; |
|
6650 scrollWhenUpdating:nil. |
|
6651 ]. |
|
6652 (dialog openFor:nil |
|
6653 spec:(self formatterDialogSpec) |
|
6654 withBindings:bindings) |
|
6655 ifTrue:[ |
|
6656 currentUserPrefs at:#'formatter.tabIndent' put:tabIndent value. |
|
6657 currentUserPrefs at:#'formatter.spaceAroundTemporaries' put:spaceAroundTemporaries value. |
|
6658 currentUserPrefs at:#'formatter.emptyLineAfterTemporaries' put:emptyLineAfterTemporaries value. |
|
6659 currentUserPrefs at:#'formatter.spaceAfterReturnToken' put:spaceAfterReturnToken value. |
|
6660 currentUserPrefs at:#'formatter.spaceAfterKeywordSelector' put:spaceAfterKeywordSelector value. |
|
6661 currentUserPrefs at:#'formatter.cStyleBlocks' put:cStyleBlocks value. |
|
6662 currentUserPrefs at:#'formatter.blockArgumentsOnNewLine' put:blockArgumentsOnNewLine value. |
|
6663 currentUserPrefs at:#'formatter.maxLengthForSingleLineBlocks' put:maxLengthForSingleLineBlocks value. |
|
6664 RBFormatter |
|
6665 tabIndent:tabIndent value; |
|
6666 spaceAroundTemporaries:spaceAroundTemporaries value; |
|
6667 emptyLineAfterTemporaries:emptyLineAfterTemporaries value; |
|
6668 spaceAfterReturnToken:spaceAfterReturnToken value; |
|
6669 spaceAfterKeywordSelector:spaceAfterKeywordSelector value; |
|
6670 cStyleBlocks:cStyleBlocks value; |
|
6671 blockArgumentsOnNewLine:blockArgumentsOnNewLine value; |
|
6672 maxLengthForSingleLineBlocks:maxLengthForSingleLineBlocks value. |
|
6673 ] ifFalse: [ |
|
6674 (UserPreferences reset; current) declareAllFrom: oldUserPreferences |
|
6675 ]. |
|
6676 ! |
|
6677 |
|
6678 syntaxColorConfigurationDialog |
|
6679 |box frame exampleView y |
|
6680 resources exampleText coloredText recolorAction |
|
6681 syntaxColor syntaxColors colorMenu oldUserPreferences |
|
6682 syntaxEmphasises syntaxColorSelector syntaxEmphasisSelector syntaxColoringBox |
|
6683 syntaxEmphasisesBox syntaxColoringResetButton b resetList |
|
6684 resetListBox currentUserPrefs| |
|
6685 |
|
6686 resources := self owningClass classResources. |
|
6687 currentUserPrefs := UserPreferences current. |
|
6688 |
|
6689 exampleText := |
|
6690 'methodSelector:methodArg |
|
6691 "method comment: |
|
6692 some stupid code to show the current settings" |
|
6693 |
|
6694 |methodVar| |
|
6695 |
|
6696 "/ another comment ... |
|
6697 self at:methodArg. "/ a message |
|
6698 self fooBarBaz:methodVar. "/ a bad message |
|
6699 methodVar := Array new:1. |
|
6700 unknonVar := 1. "/ a bad variable |
|
6701 UnknonVar := 1. "/ another bad variable |
|
6702 "self bar:methodVar. detect commented code easily" |
|
6703 1 to:5 do:[:i | self at:i + 1]. |
|
6704 Transcript showCR:''some string'' , #someSymbol. |
|
6705 ^ self. |
|
6706 '. |
|
6707 |
|
6708 coloredText := '' asValue. |
|
6709 recolorAction := [ coloredText value:(SyntaxHighlighter formatMethod:exampleText in:nil) ]. |
|
6710 recolorAction value. |
|
6711 |
|
6712 "/ |
|
6713 "/ create a box on those values ... |
|
6714 "/ |
|
6715 box := DialogBox new. |
|
6716 box label:(resources string:'Syntax Colors'). |
|
6717 |
|
6718 frame := View new. |
|
6719 frame extent:1.0 @ 200. |
|
6720 frame borderWidth:0. |
|
6721 |
|
6722 exampleView := HVScrollableView for:TextView in:frame. |
|
6723 exampleView model:coloredText. |
|
6724 exampleView origin:0.0@0.0 corner:1.0@1.0; inset:2. |
|
6725 |
|
6726 frame topInset:box yPosition. |
|
6727 box addComponent:frame withExtent:1.0@200. |
|
6728 box makeTabable:exampleView. |
|
6729 frame width:1.0. |
|
6730 |
|
6731 box addVerticalSpace. |
|
6732 |
|
6733 oldUserPreferences := currentUserPrefs copy. |
|
6734 |
|
6735 syntaxColoringBox := box addComboListOn: (syntaxColors := SelectionInList with:UserPreferences syntaxColorNames initialSelection:1). |
|
6736 syntaxColorSelector := [(syntaxColors selection replChar:$ withString: '') asLowercaseFirst asSymbol]. |
|
6737 syntaxEmphasisSelector := [((syntaxColorSelector value readStream upToAll: 'Color'), 'Emphasis') asLowercaseFirst asSymbol]. |
|
6738 syntaxColor := (currentUserPrefs perform: syntaxColorSelector value) asValue. |
|
6739 colorMenu := ColorMenu new. |
|
6740 colorMenu model: syntaxColor. |
|
6741 syntaxColor onChangeEvaluate: |
|
6742 [currentUserPrefs at: syntaxColorSelector value put: syntaxColor value. |
|
6743 recolorAction value.]. |
|
6744 syntaxColors onChangeEvaluate: |
|
6745 [|eVal| |
|
6746 syntaxColor value: (currentUserPrefs perform:syntaxColorSelector value). |
|
6747 eVal := currentUserPrefs perform: syntaxEmphasisSelector value. |
|
6748 eVal isArray ifTrue:[ |
|
6749 eVal = (Array with:#underwave with:#underlineColor->(Color red:100.0 green:0.0 blue:0.0)) ifTrue:[ |
|
6750 eVal := #'red underwave' |
|
6751 ]. |
|
6752 eVal = (Array with:#bold with:#underwave with:#underlineColor->(Color red:100.0 green:0.0 blue:0.0)) ifTrue:[ |
|
6753 eVal := #'bold+red underwave' |
|
6754 ]. |
|
6755 eVal = (Array with:#bold with:#underlineColor->(Color red:100.0 green:0.0 blue:0.0)) ifTrue:[ |
|
6756 eVal := #'bold+red underline' |
|
6757 ]. |
|
6758 eVal = (Array with:#italic with:#underwave with:#underlineColor->(Color red:100.0 green:0.0 blue:0.0)) ifTrue:[ |
|
6759 eVal := #'italic+red underwave' |
|
6760 ]. |
|
6761 eVal = (Array with:#italic with:#underlineColor->(Color red:100.0 green:0.0 blue:0.0)) ifTrue:[ |
|
6762 eVal := #'italic+red underline' |
|
6763 ]. |
|
6764 ]. |
|
6765 syntaxEmphasises selection: eVal. |
|
6766 recolorAction value.]. |
|
6767 |
|
6768 syntaxEmphasises := SelectionInList |
|
6769 with:#( |
|
6770 normal |
|
6771 underline |
|
6772 #'red underline' |
|
6773 underwave |
|
6774 #'red underwave' |
|
6775 bold |
|
6776 boldUnderline |
|
6777 #'bold+red underline' |
|
6778 boldUnderwave |
|
6779 #'bold+red underwave' |
|
6780 italic |
|
6781 italicUnderline |
|
6782 #'italic+red underline' |
|
6783 italicUnderwave |
|
6784 #'italic+red underwave' |
|
6785 reverse |
|
6786 ) |
|
6787 initialSelection:1. |
|
6788 syntaxEmphasisesBox := box addComboListOn:syntaxEmphasises. |
|
6789 syntaxEmphasises |
|
6790 onChangeEvaluate:[ |em| |
|
6791 em := syntaxEmphasises selection. |
|
6792 em notNil ifTrue:[ |
|
6793 em := em asSymbol. |
|
6794 em == #'red underline' ifTrue:[ em := Array with:#underline with:(#underlineColor->Color red)]. |
|
6795 em == #'red underwave' ifTrue:[ em := Array with:#underwave with:(#underlineColor->Color red)]. |
|
6796 em == #'bold+red underline' ifTrue:[ em := Array with:#bold with:#underline with:(#underlineColor->Color red)]. |
|
6797 em == #'bold+red underwave' ifTrue:[ em := Array with:#bold with:#underwave with:(#underlineColor->Color red)]. |
|
6798 em == #'italic+red underline' ifTrue:[ em := Array with:#italic with:#underline with:(#underlineColor->Color red)]. |
|
6799 em == #'italic+red underwave' ifTrue:[ em := Array with:#italic with:#underwave with:(#underlineColor->Color red)]. |
|
6800 |
|
6801 currentUserPrefs at: syntaxEmphasisSelector value put:em. |
|
6802 ]. |
|
6803 recolorAction value |
|
6804 ]. |
|
6805 syntaxColors changed:#value. "/ to force initial update of emphasis |
|
6806 box addComponent:colorMenu tabable:true. |
|
6807 |
|
6808 y := box yPosition. |
|
6809 |
|
6810 b := Button new label: (resources string:'reset to:'). |
|
6811 b action:[ |
|
6812 |resetSelector| |
|
6813 |
|
6814 resetSelector := (currentUserPrefs listOfPredefinedSyntaxColoringSchemes |
|
6815 collect:[:eachEntry | eachEntry first]) |
|
6816 at:resetList selectionIndex. |
|
6817 currentUserPrefs perform:resetSelector. |
|
6818 recolorAction value. |
|
6819 ]. |
|
6820 syntaxColoringResetButton := box addComponent:b. |
|
6821 box makeTabable:syntaxColoringResetButton. |
|
6822 |
|
6823 box yPosition:y. |
|
6824 |
|
6825 resetList := SelectionInList |
|
6826 with:(currentUserPrefs listOfPredefinedSyntaxColoringSchemes |
|
6827 collect:[:eachEntry | eachEntry second]) |
|
6828 initialSelection:1. |
|
6829 resetListBox := box addComboListOn:resetList. |
|
6830 box makeTabable:resetListBox. |
|
6831 |
|
6832 syntaxColoringBox enable. |
|
6833 colorMenu enable. |
|
6834 syntaxEmphasisesBox enable. |
|
6835 syntaxColoringResetButton enable. |
|
6836 |
|
6837 box |
|
6838 "/ addHelpButtonFor:'Launcher/sourceSettings.html'; |
|
6839 addAbortAndOkButtons. |
|
6840 |
|
6841 box stickAtBottomWithVariableHeight:frame. |
|
6842 box stickAtBottomWithFixHeight:syntaxColoringBox. |
|
6843 box stickAtBottomWithFixHeight:syntaxEmphasisesBox. |
|
6844 box stickAtBottomWithFixHeight:colorMenu. |
|
6845 box stickAtBottomWithFixHeight:syntaxColoringResetButton left:0.0 right:0.5. |
|
6846 box stickAtBottomWithFixHeight:resetListBox left:0.5 right:1.0. |
|
6847 |
|
6848 "/ |
|
6849 "/ show the box ... |
|
6850 "/ |
|
6851 box extent:600@400. |
|
6852 box openModal. |
|
6853 |
|
6854 "/ |
|
6855 "/ update system settings |
|
6856 "/ |
|
6857 box accepted ifTrue:[ |
|
6858 ] ifFalse: [ |
|
6859 (UserPreferences reset; current) declareAllFrom: oldUserPreferences |
|
6860 ]. |
|
6861 box destroy |
|
6862 |
|
6863 "Modified: / 16.4.1998 / 17:18:16 / ca" |
|
6864 "Modified: / 7.7.1999 / 00:27:02 / cg" |
|
6865 ! ! |
|
6866 |
|
6867 !AbstractLauncherApplication::LauncherDialogs class methodsFor:'interface specs'! |
|
6868 |
|
6869 cvsSetupSpec |
|
6870 "This resource specification was automatically generated |
|
6871 by the UIPainter of ST/X." |
|
6872 |
|
6873 "Do not manually edit this!! If it is corrupted, |
|
6874 the UIPainter may not be able to read the specification." |
|
6875 |
|
6876 " |
|
6877 UIPainter new openOnClass:AbstractLauncherApplication::LauncherDialogs andSelector:#cvsSetupSpec |
|
6878 " |
|
6879 |
|
6880 <resource: #canvas> |
|
6881 |
|
6882 ^ |
|
6883 #(#FullSpec |
|
6884 #name: #cvsSetupSpec |
|
6885 #window: |
|
6886 #(#WindowSpec |
|
6887 #label: 'CVS Setup' |
|
6888 #name: 'CVS Setup' |
|
6889 #min: #(#Point 436 316) |
|
6890 #max: #(#Point 1280 1024) |
|
6891 #bounds: #(#Rectangle 13 23 449 377) |
|
6892 ) |
|
6893 #component: |
|
6894 #(#SpecCollection |
|
6895 #collection: #( |
|
6896 #(#LabelSpec |
|
6897 #label: 'CVS BinDirectory:' |
|
6898 #name: 'Label1' |
|
6899 #layout: #(#LayoutFrame 0 0.0 36 0 40 0.25 53 0) |
|
6900 #level: 0 |
|
6901 #translateLabel: true |
|
6902 #adjust: #right |
|
6903 ) |
|
6904 #(#InputFieldSpec |
|
6905 #name: 'BinDirectoryField' |
|
6906 #layout: #(#LayoutFrame 44 0.25 34 0 -1 1 56 0) |
|
6907 #tabable: true |
|
6908 #model: #cvsBinDirectoryHolder |
|
6909 #acceptChannel: #acceptChannel |
|
6910 #acceptOnPointerLeave: false |
|
6911 ) |
|
6912 #(#DividerSpec |
|
6913 #name: 'Separator3' |
|
6914 #layout: #(#LayoutFrame 0 0.0 60 0 0 1.0 64 0) |
|
6915 ) |
|
6916 #(#LabelSpec |
|
6917 #label: 'CVS SourceCodeManager setup' |
|
6918 #name: 'label' |
|
6919 #layout: #(#LayoutFrame 1 0.0 3 0 -1 1.0 20 0) |
|
6920 #translateLabel: true |
|
6921 #adjust: #left |
|
6922 ) |
|
6923 #(#LabelSpec |
|
6924 #label: 'CVSRoot default:' |
|
6925 #name: 'defaultCvsRootLabel' |
|
6926 #layout: #(#LayoutFrame 0 0.0 71 0 40 0.25 88 0) |
|
6927 #level: 0 |
|
6928 #translateLabel: true |
|
6929 #adjust: #right |
|
6930 ) |
|
6931 #(#ComboBoxSpec |
|
6932 #name: 'cvsRootComboBox' |
|
6933 #layout: #(#LayoutFrame 44 0.25 71 0 -1 1.0 93 0) |
|
6934 #tabable: true |
|
6935 #model: #cvsRootHolder |
|
6936 #immediateAccept: true |
|
6937 #acceptOnLeave: true |
|
6938 #acceptOnReturn: true |
|
6939 #acceptOnTab: true |
|
6940 #acceptOnLostFocus: true |
|
6941 #acceptChannel: #acceptChannel |
|
6942 #acceptOnPointerLeave: false |
|
6943 #comboList: #cvsRootPrototypeList |
|
6944 ) |
|
6945 #(#DividerSpec |
|
6946 #name: 'Separator1' |
|
6947 #layout: #(#LayoutFrame 0 0.0 96 0 0 1.0 100 0) |
|
6948 ) |
|
6949 #(#LabelSpec |
|
6950 #label: 'CVSRoot per Module:' |
|
6951 #name: 'knownModulesLabel' |
|
6952 #layout: #(#LayoutFrame 0 0.0 109 0 40 0.25 126 0) |
|
6953 #translateLabel: true |
|
6954 #adjust: #right |
|
6955 ) |
|
6956 #(#SequenceViewSpec |
|
6957 #name: 'List1' |
|
6958 #layout: #(#LayoutFrame 44 0.25 104 0 -1 1 202 0) |
|
6959 #tabable: true |
|
6960 #model: #selectedPerModuleRoot |
|
6961 #hasHorizontalScrollBar: true |
|
6962 #hasVerticalScrollBar: true |
|
6963 #miniScrollerHorizontal: true |
|
6964 #useIndex: false |
|
6965 #sequenceList: #listOfModules |
|
6966 ) |
|
6967 #(#LabelSpec |
|
6968 #label: 'Module:' |
|
6969 #name: 'moduleLabel' |
|
6970 #layout: #(#LayoutFrame 0 0.0 209 0 40 0.25 226 0) |
|
6971 #translateLabel: true |
|
6972 #adjust: #right |
|
6973 ) |
|
6974 #(#InputFieldSpec |
|
6975 #name: 'perModuleRootModuleEntryField' |
|
6976 #layout: #(#LayoutFrame 44 0.25 205 0 -1 1 227 0) |
|
6977 #tabable: true |
|
6978 #model: #perModuleRootModule |
|
6979 #acceptChannel: #acceptChannel |
|
6980 #acceptOnPointerLeave: false |
|
6981 ) |
|
6982 #(#LabelSpec |
|
6983 #label: 'CVSRoot:' |
|
6984 #name: 'cvsRootLabel' |
|
6985 #layout: #(#LayoutFrame 0 0.0 236 0 40 0.25 253 0) |
|
6986 #translateLabel: true |
|
6987 #adjust: #right |
|
6988 ) |
|
6989 #(#ComboBoxSpec |
|
6990 #name: 'perModuleRootComboBox' |
|
6991 #layout: #(#LayoutFrame 44 0.25 232 0 -1 1.0 254 0) |
|
6992 #tabable: true |
|
6993 #model: #perModuleRoot |
|
6994 #immediateAccept: true |
|
6995 #acceptOnLeave: true |
|
6996 #acceptOnReturn: true |
|
6997 #acceptOnTab: true |
|
6998 #acceptOnLostFocus: true |
|
6999 #acceptChannel: #acceptChannel |
|
7000 #acceptOnPointerLeave: false |
|
7001 #comboList: #cvsRootPrototypeList |
|
7002 ) |
|
7003 #(#HorizontalPanelViewSpec |
|
7004 #name: 'HorizontalPanel1' |
|
7005 #layout: #(#LayoutFrame 44 0.25 258 0 -1 1 289 0) |
|
7006 #horizontalLayout: #fitSpace |
|
7007 #verticalLayout: #center |
|
7008 #horizontalSpace: 3 |
|
7009 #verticalSpace: 3 |
|
7010 #component: |
|
7011 #(#SpecCollection |
|
7012 #collection: #( |
|
7013 #(#ActionButtonSpec |
|
7014 #label: 'Add/Apply' |
|
7015 #name: 'addButton' |
|
7016 #translateLabel: true |
|
7017 #tabable: true |
|
7018 #model: #addPerModuleRoot |
|
7019 #extent: #(#Point 136 22) |
|
7020 ) |
|
7021 #(#ActionButtonSpec |
|
7022 #label: 'Remove' |
|
7023 #name: 'removeButton' |
|
7024 #translateLabel: true |
|
7025 #tabable: true |
|
7026 #model: #removePerModuleRoot |
|
7027 #enableChannel: #removeEnabled |
|
7028 #extent: #(#Point 137 22) |
|
7029 ) |
|
7030 ) |
|
7031 |
|
7032 ) |
|
7033 ) |
|
7034 #(#DividerSpec |
|
7035 #name: 'Separator2' |
|
7036 #layout: #(#LayoutFrame 0 0.0 -45 1 0 1.0 -34 1) |
|
7037 ) |
|
7038 #(#HorizontalPanelViewSpec |
|
7039 #name: 'buttonPanel' |
|
7040 #layout: #(#LayoutFrame 0 0.0 -29 1.0 0 1.0 -3 1.0) |
|
7041 #horizontalLayout: #fitSpace |
|
7042 #verticalLayout: #center |
|
7043 #horizontalSpace: 3 |
|
7044 #verticalSpace: 3 |
|
7045 #ignoreInvisibleComponents: true |
|
7046 #reverseOrderIfOKAtLeft: true |
|
7047 #component: |
|
7048 #(#SpecCollection |
|
7049 #collection: #( |
|
7050 #(#ActionButtonSpec |
|
7051 #label: 'Cancel' |
|
7052 #name: 'cancelButton' |
|
7053 #translateLabel: true |
|
7054 #tabable: true |
|
7055 #model: #cancel |
|
7056 #extent: #(#Point 141 21) |
|
7057 ) |
|
7058 #(#ActionButtonSpec |
|
7059 #label: 'Help' |
|
7060 #name: 'helpButton' |
|
7061 #translateLabel: true |
|
7062 #tabable: true |
|
7063 #model: #help |
|
7064 #extent: #(#Point 141 21) |
|
7065 ) |
|
7066 #(#ActionButtonSpec |
|
7067 #label: 'OK' |
|
7068 #name: 'okButton' |
|
7069 #translateLabel: true |
|
7070 #tabable: true |
|
7071 #model: #accept |
|
7072 #isDefault: true |
|
7073 #extent: #(#Point 142 21) |
|
7074 ) |
|
7075 ) |
|
7076 |
|
7077 ) |
|
7078 ) |
|
7079 ) |
|
7080 |
|
7081 ) |
|
7082 ) |
|
7083 ! |
|
7084 |
|
7085 formatterDialogSpec |
|
7086 "This resource specification was automatically generated |
|
7087 by the UIPainter of ST/X." |
|
7088 |
|
7089 "Do not manually edit this!! If it is corrupted, |
|
7090 the UIPainter may not be able to read the specification." |
|
7091 |
|
7092 " |
|
7093 UIPainter new openOnClass:AbstractLauncherApplication::LauncherDialogs andSelector:#formatterDialogSpec |
|
7094 " |
|
7095 |
|
7096 <resource: #canvas> |
|
7097 |
|
7098 ^ |
|
7099 #(#FullSpec |
|
7100 #name: #formatterDialogSpec |
|
7101 #window: |
|
7102 #(#WindowSpec |
|
7103 #label: 'Formatting parameters' |
|
7104 #name: 'Formatting parameters' |
|
7105 #min: #(#Point 10 10) |
|
7106 #max: #(#Point 1280 1024) |
|
7107 #bounds: #(#Rectangle 10 406 606 989) |
|
7108 ) |
|
7109 #component: |
|
7110 #(#SpecCollection |
|
7111 #collection: #( |
|
7112 #(#LabelSpec |
|
7113 #label: 'Sample output:' |
|
7114 #name: 'Label2' |
|
7115 #layout: #(#LayoutFrame 0 0.0 4 0 0 1.0 26 0) |
|
7116 #translateLabel: true |
|
7117 #adjust: #left |
|
7118 ) |
|
7119 #(#TextEditorSpec |
|
7120 #name: 'sampleTextView' |
|
7121 #layout: #(#LayoutFrame 0 0.0 30 0.0 0 1.0 -234 1.0) |
|
7122 #level: -1 |
|
7123 #model: #formattedText |
|
7124 #hasHorizontalScrollBar: true |
|
7125 #hasVerticalScrollBar: true |
|
7126 ) |
|
7127 #(#FramedBoxSpec |
|
7128 #label: 'Parameters' |
|
7129 #name: 'FramedBox1' |
|
7130 #layout: #(#LayoutFrame 0 0.0 -225 1 0 1.0 -30 1) |
|
7131 #labelPosition: #topLeft |
|
7132 #translateLabel: true |
|
7133 #component: |
|
7134 #(#SpecCollection |
|
7135 #collection: #( |
|
7136 #(#LabelSpec |
|
7137 #label: 'Max length for single line blocks:' |
|
7138 #name: 'Label1' |
|
7139 #layout: #(#LayoutFrame 185 0.0 127 0 66 0.7 153 0) |
|
7140 #level: 0 |
|
7141 #adjust: #right |
|
7142 ) |
|
7143 #(#CheckBoxSpec |
|
7144 #label: 'Space around temporaries ' |
|
7145 #name: 'checkBox' |
|
7146 #layout: #(#LayoutFrame 2 0 3 0 260 0 32 0) |
|
7147 #level: 0 |
|
7148 #tabable: true |
|
7149 #model: #spaceAroundTemporaries |
|
7150 #translateLabel: true |
|
7151 ) |
|
7152 #(#CheckBoxSpec |
|
7153 #label: 'Blank line after local var declaration' |
|
7154 #name: 'CheckBox1' |
|
7155 #layout: #(#LayoutFrame 267 0 3 0 567 0 32 0) |
|
7156 #level: 0 |
|
7157 #tabable: true |
|
7158 #model: #emptyLineAfterTemporaries |
|
7159 #translateLabel: true |
|
7160 ) |
|
7161 #(#CheckBoxSpec |
|
7162 #label: 'Space after ''^''' |
|
7163 #name: 'CheckBox2' |
|
7164 #layout: #(#LayoutFrame 2 0 31 0 260 0 60 0) |
|
7165 #level: 0 |
|
7166 #tabable: true |
|
7167 #model: #spaceAfterReturnToken |
|
7168 #translateLabel: true |
|
7169 ) |
|
7170 #(#CheckBoxSpec |
|
7171 #label: 'Space after '':'' in keywords' |
|
7172 #name: 'CheckBox3' |
|
7173 #layout: #(#LayoutFrame 267 0 31 0 567 0 60 0) |
|
7174 #level: 0 |
|
7175 #tabable: true |
|
7176 #model: #spaceAfterKeywordSelector |
|
7177 #translateLabel: true |
|
7178 ) |
|
7179 #(#CheckBoxSpec |
|
7180 #label: 'C-Style blocks' |
|
7181 #name: 'CheckBox4' |
|
7182 #layout: #(#LayoutFrame 2 0 59 0 260 0 88 0) |
|
7183 #level: 0 |
|
7184 #tabable: true |
|
7185 #model: #cStyleBlocks |
|
7186 #translateLabel: true |
|
7187 ) |
|
7188 #(#InputFieldSpec |
|
7189 #name: 'editField' |
|
7190 #layout: #(#LayoutFrame 74 0.7 93 0 -38 1.0 119 0) |
|
7191 #level: -1 |
|
7192 #tabable: true |
|
7193 #model: #tabIndent |
|
7194 #type: #number |
|
7195 #immediateAccept: false |
|
7196 #acceptOnLeave: true |
|
7197 #acceptOnReturn: true |
|
7198 #acceptOnTab: true |
|
7199 #acceptOnLostFocus: true |
|
7200 #acceptOnPointerLeave: true |
|
7201 ) |
|
7202 #(#LabelSpec |
|
7203 #label: 'Indent:' |
|
7204 #name: 'label' |
|
7205 #layout: #(#LayoutFrame 242 0.0 93 0 66 0.7 119 0) |
|
7206 #level: 0 |
|
7207 #adjust: #right |
|
7208 ) |
|
7209 #(#InputFieldSpec |
|
7210 #name: 'EntryField1' |
|
7211 #layout: #(#LayoutFrame 74 0.7 127 0 -38 1.0 153 0) |
|
7212 #level: -1 |
|
7213 #tabable: true |
|
7214 #model: #maxLengthForSingleLineBlocks |
|
7215 #type: #number |
|
7216 #immediateAccept: false |
|
7217 #acceptOnLeave: true |
|
7218 #acceptOnReturn: true |
|
7219 #acceptOnTab: true |
|
7220 #acceptOnLostFocus: true |
|
7221 #acceptOnPointerLeave: true |
|
7222 ) |
|
7223 #(#PopUpListSpec |
|
7224 #label: 'Reset to...' |
|
7225 #name: 'PopUpList1' |
|
7226 #layout: #(#LayoutFrame 2 0 129 0 127 0 151 0) |
|
7227 #tabable: true |
|
7228 #model: #resetValue |
|
7229 #menu: #resetList |
|
7230 #useIndex: true |
|
7231 ) |
|
7232 #(#CheckBoxSpec |
|
7233 #label: 'Block args on new line' |
|
7234 #name: 'CheckBox5' |
|
7235 #layout: #(#LayoutFrame 267 0 59 0 567 0 88 0) |
|
7236 #level: 0 |
|
7237 #tabable: true |
|
7238 #model: #blockArgumentsOnNewLine |
|
7239 #translateLabel: true |
|
7240 ) |
|
7241 ) |
|
7242 |
|
7243 ) |
|
7244 ) |
|
7245 #(#HorizontalPanelViewSpec |
|
7246 #name: 'horizontalPanelView' |
|
7247 #layout: #(#LayoutFrame 0 0.0 -35 1.0 0 1.0 0 1.0) |
|
7248 #level: 0 |
|
7249 #horizontalLayout: #fitSpace |
|
7250 #verticalLayout: #center |
|
7251 #horizontalSpace: 4 |
|
7252 #verticalSpace: 4 |
|
7253 #ignoreInvisibleComponents: true |
|
7254 #component: |
|
7255 #(#SpecCollection |
|
7256 #collection: #( |
|
7257 #(#ActionButtonSpec |
|
7258 #label: 'Cancel' |
|
7259 #name: 'button' |
|
7260 #translateLabel: true |
|
7261 #tabable: true |
|
7262 #model: #cancel |
|
7263 #useDefaultExtent: true |
|
7264 ) |
|
7265 #(#ActionButtonSpec |
|
7266 #label: 'OK' |
|
7267 #name: 'Button1' |
|
7268 #translateLabel: true |
|
7269 #tabable: true |
|
7270 #model: #accept |
|
7271 #isDefault: true |
|
7272 #useDefaultExtent: true |
|
7273 ) |
|
7274 ) |
|
7275 |
|
7276 ) |
|
7277 ) |
|
7278 ) |
|
7279 |
|
7280 ) |
|
7281 ) |
|
7282 ! ! |
|
7283 |
|
7284 !AbstractLauncherApplication::SettingsDialog class methodsFor:'applications'! |
|
7285 |
|
7286 addApplClass:aClass withName:aName |
|
7287 |
|
7288 ApplicationList isNil ifTrue:[ |
|
7289 self initialize. |
|
7290 ]. |
|
7291 ApplicationList add:(Array with:aName with:aClass asString asSymbol) |
|
7292 ! |
|
7293 |
|
7294 applList |
|
7295 ApplicationList isNil ifTrue:[ |
|
7296 self initialize. |
|
7297 ]. |
|
7298 ^ ApplicationList |
|
7299 ! |
|
7300 |
|
7301 defaultAppList |
|
7302 " list of settings applications |
|
7303 format: nameString applicationClassNameMethod" |
|
7304 |
|
7305 ^ #( |
|
7306 #('Tools' #'AbstractLauncherApplication::ToolsSettingsAppl') |
|
7307 #('Language' #'AbstractLauncherApplication::LanguageSettingsAppl') |
|
7308 #('Keyboard Mappings' #'AbstractLauncherApplication::KbdMappingSettingsAppl') |
|
7309 #('Style Selection' #'AbstractLauncherApplication::StyleSettingsAppl') |
|
7310 |
|
7311 ). |
|
7312 ! |
|
7313 |
|
7314 removeApplClass:aClass |
|
7315 |
|
7316 |index| |
|
7317 |
|
7318 ApplicationList isNil ifTrue:[ |
|
7319 self initialize. |
|
7320 ]. |
|
7321 index := ApplicationList findFirst:[:el | |
|
7322 el second == aClass asSymbol |
|
7323 ]. |
|
7324 index ~~ 0 ifTrue:[ |
|
7325 ApplicationList removeIndex:index. |
|
7326 ]. |
|
7327 ! |
|
7328 |
|
7329 settingsAppListClasses |
|
7330 |
|
7331 ^ self applList collect:[:entry | entry last]. |
|
7332 ! |
|
7333 |
|
7334 settingsAppListNames |
|
7335 |
|
7336 ^ self applList collect:[:entry | entry first]. |
|
7337 ! ! |
|
7338 |
|
7339 !AbstractLauncherApplication::SettingsDialog class methodsFor:'initialize'! |
|
7340 |
|
7341 initialize |
|
7342 |
|
7343 ApplicationList := self defaultAppList. |
|
7344 |
|
7345 " |
|
7346 self initialize |
|
7347 " |
|
7348 ! ! |
|
7349 |
|
7350 !AbstractLauncherApplication::SettingsDialog class methodsFor:'interface specs'! |
|
7351 |
|
7352 windowSpec |
|
7353 "This resource specification was automatically generated |
|
7354 by the UIPainter of ST/X." |
|
7355 |
|
7356 "Do not manually edit this!! If it is corrupted, |
|
7357 the UIPainter may not be able to read the specification." |
|
7358 |
|
7359 " |
|
7360 UIPainter new openOnClass:AbstractLauncherApplication::SettingsDialog andSelector:#windowSpec |
|
7361 AbstractLauncherApplication::SettingsDialog new openInterface:#windowSpec |
|
7362 AbstractLauncherApplication::SettingsDialog open |
|
7363 " |
|
7364 |
|
7365 <resource: #canvas> |
|
7366 |
|
7367 ^ |
|
7368 #(#FullSpec |
|
7369 #name: #windowSpec |
|
7370 #window: |
|
7371 #(#WindowSpec |
|
7372 #label: 'Settings Dialog' |
|
7373 #name: 'Settings Dialog' |
|
7374 #min: #(#Point 10 10) |
|
7375 #max: #(#Point 1024 768) |
|
7376 #bounds: #(#Rectangle 16 42 516 562) |
|
7377 #menu: #mainMenu |
|
7378 ) |
|
7379 #component: |
|
7380 #(#SpecCollection |
|
7381 #collection: #( |
|
7382 #(#NoteBookViewSpec |
|
7383 #name: 'SettingsNoteBook' |
|
7384 #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
7385 #model: #selectionHolder |
|
7386 #menu: #settingsAppList |
|
7387 #useIndex: true |
|
7388 #canvas: #canvasHolder |
|
7389 #keepCanvasAlive: true |
|
7390 ) |
|
7391 ) |
|
7392 |
|
7393 ) |
|
7394 ) |
|
7395 ! ! |
|
7396 |
|
7397 !AbstractLauncherApplication::SettingsDialog class methodsFor:'menu specs'! |
|
7398 |
|
7399 mainMenu |
|
7400 "This resource specification was automatically generated |
|
7401 by the MenuEditor of ST/X." |
|
7402 |
|
7403 "Do not manually edit this!! If it is corrupted, |
|
7404 the MenuEditor may not be able to read the specification." |
|
7405 |
|
7406 " |
|
7407 MenuEditor new openOnClass:SettingsDialog andSelector:#mainMenu |
|
7408 (Menu new fromLiteralArrayEncoding:(SettingsDialog mainMenu)) startUp |
|
7409 " |
|
7410 |
|
7411 <resource: #menu> |
|
7412 |
|
7413 ^ |
|
7414 #(#Menu |
|
7415 #( |
|
7416 #(#MenuItem |
|
7417 #label: 'File' |
|
7418 #translateLabel: true |
|
7419 #submenu: |
|
7420 #(#Menu |
|
7421 #( |
|
7422 #(#MenuItem |
|
7423 #label: 'Load Settings...' |
|
7424 #itemValue: #loadSettings |
|
7425 #translateLabel: true |
|
7426 ) |
|
7427 #(#MenuItem |
|
7428 #label: 'Save Settings...' |
|
7429 #itemValue: #saveSettings |
|
7430 #translateLabel: true |
|
7431 ) |
|
7432 #(#MenuItem |
|
7433 #label: 'Exit' |
|
7434 #itemValue: #closeRequest |
|
7435 #translateLabel: true |
|
7436 ) |
|
7437 ) |
|
7438 nil |
|
7439 nil |
|
7440 ) |
|
7441 ) |
|
7442 ) |
|
7443 nil |
|
7444 nil |
|
7445 ) |
|
7446 ! ! |
|
7447 |
|
7448 !AbstractLauncherApplication::SettingsDialog methodsFor:'accessing'! |
|
7449 |
|
7450 requestor |
|
7451 "return the 'requestor' of the SettingsDialog" |
|
7452 |
|
7453 ^ requestor |
|
7454 ! |
|
7455 |
|
7456 requestor:something |
|
7457 "set the value of the instance variable 'requestor' (automatically generated)" |
|
7458 |
|
7459 requestor := something. |
|
7460 ! ! |
|
7461 |
|
7462 !AbstractLauncherApplication::SettingsDialog methodsFor:'actions'! |
|
7463 |
|
7464 sendLoadRequest |
|
7465 |
|
7466 colOfInstances do:[:settInst| |
|
7467 settInst loadRequest. |
|
7468 ]. |
|
7469 ! |
|
7470 |
|
7471 sendSaveRequest |
|
7472 |
|
7473 |oldClient| |
|
7474 |
|
7475 oldClient := self canvasHolder value application. |
|
7476 oldClient notNil ifTrue:[ |
|
7477 oldClient saveRequest ifFalse:[^ false]. |
|
7478 ]. |
|
7479 ^ true |
|
7480 ! ! |
|
7481 |
|
7482 !AbstractLauncherApplication::SettingsDialog methodsFor:'aspects'! |
|
7483 |
|
7484 canvasHolder |
|
7485 |
|
7486 canvasHolder isNil ifTrue:[ |
|
7487 canvasHolder := ValueHolder new. |
|
7488 ]. |
|
7489 ^ canvasHolder. |
|
7490 ! |
|
7491 |
|
7492 selection |
|
7493 "get the selection |
|
7494 " |
|
7495 ^ selection |
|
7496 ! |
|
7497 |
|
7498 selection:something |
|
7499 "set the selection; update canvas |
|
7500 " |
|
7501 selection ~~ something ifTrue:[ |
|
7502 |
|
7503 self sendSaveRequest ifFalse:[ ^ self]. |
|
7504 selection := something. |
|
7505 selection ~~ 0 ifTrue:[ |
|
7506 self canvasHolder value:((colOfInstances at:selection) window). |
|
7507 ]. |
|
7508 ]. |
|
7509 ! |
|
7510 |
|
7511 selectionHolder |
|
7512 |
|
7513 selectionHolder isNil ifTrue:[ |
|
7514 selectionHolder := AspectAdaptor new subject:self; forAspect:#selection. |
|
7515 ]. |
|
7516 ^ selectionHolder. |
|
7517 ! |
|
7518 |
|
7519 settingsAppList |
|
7520 |
|
7521 ^ self class settingsAppListNames. |
|
7522 ! ! |
|
7523 |
|
7524 !AbstractLauncherApplication::SettingsDialog methodsFor:'initialization & release'! |
|
7525 |
|
7526 closeDownViews |
|
7527 "This is a hook method generated by the Browser. |
|
7528 It will be invoked when your app/dialog-window is really closed. |
|
7529 See also #closeDownViews, which is invoked before and may suppress the close |
|
7530 or ask the user for confirmation." |
|
7531 |
|
7532 "/ change the code below as required ... |
|
7533 "/ This should cleanup any leftover resources |
|
7534 "/ (for example, temporary files) |
|
7535 "/ super closeRequest will initiate the closeDown |
|
7536 |
|
7537 "/ add your code here |
|
7538 |
|
7539 "/ do not remove the one below ... |
|
7540 ^ super closeDownViews |
|
7541 ! |
|
7542 |
|
7543 closeRequest |
|
7544 "This is a hook method generated by the Browser. |
|
7545 It will be invoked when your app/dialog-window is about to be |
|
7546 closed (this method has a chance to suppress the close). |
|
7547 See also #closeDownViews, which is invoked when the close is really done." |
|
7548 |
|
7549 self sendSaveRequest ifFalse:[ ^ self]. |
|
7550 ^ super closeRequest |
|
7551 ! |
|
7552 |
|
7553 initialize |
|
7554 |
|
7555 selectionHolder := AspectAdaptor new subject:self; forAspect:#selection. |
|
7556 super initialize. |
|
7557 ! |
|
7558 |
|
7559 postBuildWith:aBuilder |
|
7560 "This is a hook method generated by the Browser. |
|
7561 It will be invoked during the initialization of your app/dialog, |
|
7562 after all of the visual components have been built, |
|
7563 but BEFORE the top window is made visible. |
|
7564 Add any app-specific actions here (reading files, setting up values etc.) |
|
7565 See also #postOpenWith:, which is invoked after opening." |
|
7566 |
|
7567 "/ add any code here ... |
|
7568 |
|
7569 ^ super postBuildWith:aBuilder |
|
7570 ! |
|
7571 |
|
7572 postOpenWith:aBuilder |
|
7573 "This is a hook method generated by the Browser. |
|
7574 It will be invoked right after the applications window has been opened. |
|
7575 Add any app-specific actions here (starting background processes etc.). |
|
7576 See also #postBuildWith:, which is invoked before opening." |
|
7577 |
|
7578 "/ add any code here ... |
|
7579 |
|
7580 colOfInstances := OrderedCollection new. |
|
7581 self class settingsAppListClasses do:[:cls| | className | |
|
7582 className := Smalltalk classNamed:cls. |
|
7583 cls isNil ifTrue:[ |
|
7584 Transcript showCR:'no class named:' , className |
|
7585 ] ifFalse:[ |
|
7586 | appl window| |
|
7587 appl := className new. |
|
7588 window := ApplicationSubView new. |
|
7589 appl createBuilder. |
|
7590 window client:appl. |
|
7591 |
|
7592 colOfInstances add:appl. |
|
7593 ] |
|
7594 ]. |
|
7595 self selectionHolder value:1. |
|
7596 ^ super postOpenWith:aBuilder |
|
7597 ! ! |
|
7598 |
|
7599 !AbstractLauncherApplication::SettingsDialog methodsFor:'menu actions'! |
|
7600 |
|
7601 loadSettings |
|
7602 |
|
7603 "restore settings from a settings-file." |
|
7604 |
|
7605 "a temporary kludge - we need a central systemSettings object for this, |
|
7606 which can be saved/restored with a single store/read." |
|
7607 |
|
7608 |fileName| |
|
7609 |
|
7610 fileName := Dialog |
|
7611 requestFileName:(resources string:'Load Settings From:') |
|
7612 default:'settings.stx' |
|
7613 ok:(resources string:'Load') |
|
7614 abort:(resources string:'Cancel') |
|
7615 pattern:'*.stx' |
|
7616 fromDirectory:nil. |
|
7617 |
|
7618 (fileName size == 0) ifTrue:[ |
|
7619 "/ canceled |
|
7620 ^ self |
|
7621 ]. |
|
7622 |
|
7623 self withWaitCursorDo:[ |
|
7624 Smalltalk fileIn:fileName. |
|
7625 Transcript current topView model reOpen. |
|
7626 self sendLoadRequest. |
|
7627 ]. |
|
7628 ! |
|
7629 |
|
7630 saveSettings |
|
7631 |
|
7632 |fileName resources| |
|
7633 |
|
7634 resources := self class owningClass classResources. |
|
7635 |
|
7636 fileName := Dialog |
|
7637 requestFileName:(resources string:'Save settings in:') |
|
7638 default:'settings.stx' |
|
7639 ok:(resources string:'Save') |
|
7640 abort:(resources string:'Cancel') |
|
7641 pattern:'*.stx' |
|
7642 fromDirectory:'.'. |
|
7643 |
|
7644 fileName size ~~ 0 ifTrue:[ |
|
7645 "not canceled" |
|
7646 self saveSettingsIn:fileName. |
|
7647 ] |
|
7648 ! |
|
7649 |
|
7650 saveSettingsIn:fileName |
|
7651 "save settings to a settings-file." |
|
7652 |
|
7653 "a temporary kludge - we need a central systemSettings object for this, |
|
7654 which can be saved/restored with a single store/read. |
|
7655 Will move entries over to UserPreferences over time; |
|
7656 new items should always go there." |
|
7657 |
|
7658 |resources s screen currentUserPrefs| |
|
7659 |
|
7660 resources := self class owningClass classResources. |
|
7661 |
|
7662 s := fileName asFilename writeStream. |
|
7663 s isNil ifTrue:[ |
|
7664 self warn:(resources string:'Cannot write the %1 file !!' with:fileName). |
|
7665 ^ self |
|
7666 ]. |
|
7667 |
|
7668 currentUserPrefs := UserPreferences current. |
|
7669 screen := Screen current. |
|
7670 |
|
7671 s nextPutLine:'"/ ST/X saved settings'; |
|
7672 nextPutLine:'"/ DO NOT MODIFY MANUALLY'; |
|
7673 nextPutLine:'"/ (modifications would be lost with next save-settings)'; |
|
7674 nextPutLine:'"/'; |
|
7675 nextPutLine:'"/ this file was automatically generated by the'; |
|
7676 nextPutLine:'"/ ''save settings'' function of the Launcher'; |
|
7677 nextPutLine:'"/'. |
|
7678 s cr. |
|
7679 |
|
7680 s nextPutLine:'"/'. |
|
7681 s nextPutLine:'"/ saved by ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName , ' at ' , AbsoluteTime now printString. |
|
7682 s nextPutLine:'"/'. |
|
7683 s cr. |
|
7684 |
|
7685 s nextPutLine:'"/'. |
|
7686 s nextPutLine:'"/ Display settings:'. |
|
7687 s nextPutLine:'"/'. |
|
7688 s nextPutLine:'"/ only restore the display settings, if on the same Display ...'. |
|
7689 s nextPutLine:'Display notNil ifTrue:['. |
|
7690 s nextPutLine:' Display displayName = ' , (screen displayName storeString) , ' ifTrue:['. |
|
7691 screen fixColors notNil ifTrue:[ |
|
7692 s nextPutLine:' Image flushDeviceImages.'. |
|
7693 s nextPutLine:' Color colorAllocationFailSignal catch:['. |
|
7694 s nextPutLine:' Color getColorsRed:6 green:6 blue:4 on:Display'. |
|
7695 s nextPutLine:' ].'. |
|
7696 ] ifFalse:[ |
|
7697 s nextPutLine:' Display releaseFixColors.'. |
|
7698 ]. |
|
7699 s nextPutLine:' Display hasColors: ' , (screen hasColors storeString) , '.'. |
|
7700 s nextPutLine:' Display widthInMillimeter: ' , (screen widthInMillimeter storeString) , '.'. |
|
7701 s nextPutLine:' Display heightInMillimeter: ' , (screen heightInMillimeter storeString) , '.'. |
|
7702 s nextPutLine:' Display supportsDeepIcons: ' , (screen supportsDeepIcons storeString) , '.'. |
|
7703 s nextPutLine:' Image ditherAlgorithm: ' , (Image ditherAlgorithm storeString) , '.'. |
|
7704 s nextPutLine:' View defaultStyle:' , View defaultStyle storeString , '.'. |
|
7705 s nextPutLine:' ].'. |
|
7706 s nextPutLine:'].'. |
|
7707 s cr. |
|
7708 |
|
7709 s nextPutLine:'"/'. |
|
7710 s nextPutLine:'"/ Compiler settings:'. |
|
7711 s nextPutLine:'"/'. |
|
7712 s nextPutLine:'Compiler warnSTXSpecials: ' , (Compiler warnSTXSpecials storeString) , '.'; |
|
7713 nextPutLine:'Compiler warnUnderscoreInIdentifier: ' , (Compiler warnUnderscoreInIdentifier storeString) , '.'; |
|
7714 nextPutLine:'Compiler warnOldStyleAssignment: ' , (Compiler warnOldStyleAssignment storeString) , '.'; |
|
7715 nextPutLine:'Compiler warnCommonMistakes: ' , (Compiler warnCommonMistakes storeString) , '.'; |
|
7716 nextPutLine:'Compiler warnPossibleIncompatibilities: ' , (Compiler warnPossibleIncompatibilities storeString) , '.'; |
|
7717 nextPutLine:'Compiler allowUnderscoreInIdentifier: ' , (Compiler allowUnderscoreInIdentifier storeString) , '.'; |
|
7718 nextPutLine:'Compiler allowSqueakExtensions: ' , (Compiler allowSqueakExtensions storeString) , '.'; |
|
7719 nextPutLine:'Compiler allowDolphinExtensions: ' , (Compiler allowDolphinExtensions storeString) , '.'; |
|
7720 nextPutLine:'Compiler arraysAreImmutable: ' , (Compiler arraysAreImmutable storeString) , '.'; |
|
7721 nextPutLine:'Compiler lineNumberInfo: ' , (Compiler lineNumberInfo storeString) , '.'; |
|
7722 |
|
7723 nextPutLine:'Compiler foldConstants: ' , (Compiler foldConstants storeString) , '.'; |
|
7724 nextPutLine:'Compiler stcCompilation: ' , (Compiler stcCompilation storeString) , '.'; |
|
7725 nextPutLine:'OperatingSystem getOSType = ' , (OperatingSystem getOSType storeString) , ' ifTrue:['; |
|
7726 nextPutLine:' Compiler stcCompilationIncludes: ' , (Compiler stcCompilationIncludes storeString) , '.'; |
|
7727 nextPutLine:' Compiler stcCompilationDefines: ' , (Compiler stcCompilationDefines storeString) , '.'; |
|
7728 nextPutLine:' Compiler stcCompilationOptions: ' , (Compiler stcCompilationOptions storeString) , '.'; |
|
7729 nextPutLine:' ' , (Compiler stcModulePath storeString) , ' asFilename exists ifTrue:['; |
|
7730 nextPutLine:' Compiler stcModulePath: ' , (Compiler stcModulePath storeString) , '.'; |
|
7731 nextPutLine:' ].'; |
|
7732 nextPutLine:' Compiler stcPath: ' , (Compiler stcPath storeString) , '.'; |
|
7733 nextPutLine:' Compiler ccCompilationOptions: ' , (Compiler ccCompilationOptions storeString) , '.'; |
|
7734 nextPutLine:' Compiler ccPath: ' , (Compiler ccPath storeString) , '.'; |
|
7735 nextPutLine:' ObjectFileLoader linkArgs: ' , (ObjectFileLoader linkArgs storeString) , '.'; |
|
7736 nextPutLine:' ObjectFileLoader linkCommand: ' , (ObjectFileLoader linkCommand storeString) , '.'; |
|
7737 nextPutLine:' ObjectFileLoader libPath: ' , (ObjectFileLoader libPath storeString) , '.'; |
|
7738 nextPutLine:' ObjectFileLoader searchedLibraries: ' , (ObjectFileLoader searchedLibraries storeString) , '.'; |
|
7739 nextPutLine:'].'; |
|
7740 |
|
7741 nextPutLine:'ObjectMemory justInTimeCompilation: ' , (ObjectMemory justInTimeCompilation storeString) , '.'; |
|
7742 nextPutLine:'ObjectMemory fullSingleStepSupport: ' , (ObjectMemory fullSingleStepSupport storeString) , '.'. |
|
7743 |
|
7744 HistoryManager notNil ifTrue:[ |
|
7745 HistoryManager isActive ifTrue:[ |
|
7746 s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager activate].'. |
|
7747 s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager fullHistoryUpdate:' , HistoryManager fullHistoryUpdate storeString , '].'. |
|
7748 ] ifFalse:[ |
|
7749 s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager deactivate].'. |
|
7750 ]. |
|
7751 ]. |
|
7752 |
|
7753 ObjectFileLoader notNil ifTrue:[ |
|
7754 s nextPutLine:'ObjectFileLoader searchedLibraries: ' , (ObjectFileLoader searchedLibraries storeString) , '.'. |
|
7755 s nextPutLine:'ObjectFileLoader libPath: ' , (ObjectFileLoader libPath storeString) , '.'. |
|
7756 ]. |
|
7757 |
|
7758 s nextPutLine:'Class catchMethodRedefinitions: ' , (Class catchMethodRedefinitions storeString) , '.'. |
|
7759 s nextPutLine:'ClassCategoryReader sourceMode: ' , (ClassCategoryReader sourceMode storeString) , '.'. |
|
7760 |
|
7761 s cr. |
|
7762 s nextPutLine:'"/'. |
|
7763 s nextPutLine:'"/ Info & Debug Messages:'. |
|
7764 s nextPutLine:'"/'. |
|
7765 s nextPutLine:'ObjectMemory infoPrinting: ' , (ObjectMemory infoPrinting storeString) , '.'; |
|
7766 nextPutLine:'ObjectMemory debugPrinting: ' , (ObjectMemory debugPrinting storeString) , '.'; |
|
7767 nextPutLine:'Object infoPrinting: ' , (Object infoPrinting storeString) , '.'; |
|
7768 nextPutLine:'DeviceWorkstation errorPrinting: ' , (DeviceWorkstation errorPrinting storeString) , '.'. |
|
7769 |
|
7770 FlyByHelp isActive ifTrue:[ |
|
7771 s nextPutLine:'FlyByHelp start.' |
|
7772 ]. |
|
7773 |
|
7774 s cr. |
|
7775 s nextPutLine:'"/'. |
|
7776 s nextPutLine:'"/ Edit settings:'. |
|
7777 s nextPutLine:'"/'. |
|
7778 "/ s nextPutLine:'EditTextView st80Mode: ' , (EditTextView st80Mode storeString) , '.'. |
|
7779 s nextPutLine:'TextView st80SelectMode: ' , (TextView st80SelectMode storeString) , '.'. |
|
7780 s nextPutLine:'UserPreferences current syntaxColoring: ' , (currentUserPrefs syntaxColoring storeString) , '.'. |
|
7781 (ListView userDefaultTabPositions = ListView tab4Positions) ifTrue:[ |
|
7782 s nextPutLine:'ListView userDefaultTabPositions:(ListView tab4Positions).'. |
|
7783 ] ifFalse:[ |
|
7784 s nextPutLine:'ListView userDefaultTabPositions:(ListView tab8Positions).'. |
|
7785 ]. |
|
7786 |
|
7787 s nextPutLine:'"/'. |
|
7788 s nextPutLine:'"/ User preference values:'. |
|
7789 s nextPutLine:'"/'. |
|
7790 currentUserPrefs keysAndValuesDo:[:k :v | |
|
7791 (UserPreferences includesSelector:(k , ':') asSymbol) ifTrue:[ |
|
7792 s nextPutLine:'UserPreferences current ' , k , ':' , v storeString , '.'. |
|
7793 ] ifFalse:[ |
|
7794 s nextPutLine:'UserPreferences current at:' , k storeString , ' put:' , v storeString , '.'. |
|
7795 ] |
|
7796 ]. |
|
7797 |
|
7798 s cr. |
|
7799 s nextPutLine:'"/'. |
|
7800 s nextPutLine:'"/ Misc settings:'. |
|
7801 s nextPutLine:'"/'. |
|
7802 s nextPutLine:'Class keepMethodHistory: ' , (Class methodHistory notNil storeString) , '.'; |
|
7803 nextPutLine:'Smalltalk logDoits: ' , (Smalltalk logDoits storeString) , '.'; |
|
7804 nextPutLine:'Autoload compileLazy: ' , (Autoload compileLazy storeString) , '.'; |
|
7805 nextPutLine:'Smalltalk loadBinaries: ' , (Smalltalk loadBinaries storeString) , '.'; |
|
7806 nextPutLine:'StandardSystemView includeHostNameInLabel: ' , (StandardSystemView includeHostNameInLabel storeString) , '.'; |
|
7807 |
|
7808 "/ claus - I dont think its a good idea to save those ... |
|
7809 nextPutLine:'"/ Class updateChanges: ' , (Class updatingChanges storeString) , '.'; |
|
7810 nextPutLine:'"/ ObjectMemory nameForChanges: ' , (ObjectMemory nameForChanges storeString) , '.'; |
|
7811 |
|
7812 nextPutLine:'StandardSystemView returnFocusWhenClosingModalBoxes: ' , (StandardSystemView returnFocusWhenClosingModalBoxes storeString) , '.'; |
|
7813 nextPutLine:'StandardSystemView takeFocusWhenMapped: ' , (StandardSystemView takeFocusWhenMapped storeString) , '.'; |
|
7814 nextPutLine:'Display notNil ifTrue:['; |
|
7815 nextPutLine:' Display activateOnClick: ' , ((screen activateOnClick:nil) storeString) , '.'; |
|
7816 nextPutLine:'].'; |
|
7817 nextPutLine:'MenuView showAcceleratorKeys: ' , (MenuView showAcceleratorKeys storeString) , '.'; |
|
7818 nextPutLine:'Class tryLocalSourceFirst: ' , (Class tryLocalSourceFirst storeString) , '.'. |
|
7819 (Exception emergencyHandler == AbstractLauncherApplication notifyingEmergencyHandler) ifTrue:[ |
|
7820 s nextPutLine:'Exception emergencyHandler:(AbstractLauncherApplication notifyingEmergencyHandler).'. |
|
7821 ]. |
|
7822 Processor isTimeSlicing ifTrue:[ |
|
7823 s nextPutLine:'Processor startTimeSlicing.'. |
|
7824 s nextPutLine:('Processor supportDynamicPriorities:' , (Processor supportDynamicPriorities ? false) storeString , '.'). |
|
7825 ] ifFalse:[ |
|
7826 s nextPutLine:'Processor stopTimeSlicing.'. |
|
7827 ]. |
|
7828 |
|
7829 s cr. |
|
7830 s nextPutLine:'"/'. |
|
7831 s nextPutLine:'"/ Printer settings:'. |
|
7832 s nextPutLine:'"/'. |
|
7833 s nextPutLine:'Printer := ' , (Printer name) , '.'; |
|
7834 nextPutLine:'Printer printCommand: ' , (Printer printCommand storeString) , '.'. |
|
7835 |
|
7836 Printer supportsPageSizes ifTrue:[ |
|
7837 s nextPutLine:'Printer pageFormat: ' , (Printer pageFormat storeString) , '.'. |
|
7838 s nextPutLine:'Printer landscape: ' , (Printer landscape storeString) , '.'. |
|
7839 ]. |
|
7840 Printer supportsMargins ifTrue:[ |
|
7841 s nextPutLine:'Printer topMargin: ' , (Printer topMargin storeString) , '.'. |
|
7842 s nextPutLine:'Printer leftMargin: ' , (Printer leftMargin storeString) , '.'. |
|
7843 s nextPutLine:'Printer rightMargin: ' , (Printer rightMargin storeString) , '.'. |
|
7844 s nextPutLine:'Printer bottomMargin: ' , (Printer bottomMargin storeString) , '.'. |
|
7845 ]. |
|
7846 Printer supportsPostscript ifTrue:[ |
|
7847 s nextPutLine:'Printer supportsColor: ' , (Printer supportsColor storeString) , '.'. |
|
7848 ]. |
|
7849 |
|
7850 s cr. |
|
7851 s nextPutLine:'"/'. |
|
7852 s nextPutLine:'"/ Font settings:'. |
|
7853 s nextPutLine:'"/ (only restored, if image is restarted on the same display)'. |
|
7854 s nextPutLine:'"/'. |
|
7855 s nextPutLine:'Display notNil ifTrue:['. |
|
7856 s nextPutLine:' Display displayName = ' , (screen displayName storeString) , ' ifTrue:['. |
|
7857 s nextPutLine:' View defaultFont: ' , (View defaultFont storeString) , '.'. |
|
7858 s nextPutLine:' Label defaultFont: ' , (Label defaultFont storeString) , '.'. |
|
7859 s nextPutLine:' Button defaultFont: ' , (Button defaultFont storeString) , '.'. |
|
7860 s nextPutLine:' Toggle defaultFont: ' , (Toggle defaultFont storeString) , '.'. |
|
7861 s nextPutLine:' SelectionInListView defaultFont: ' , (SelectionInListView defaultFont storeString) , '.'. |
|
7862 s nextPutLine:' MenuView defaultFont: ' , (MenuView defaultFont storeString) , '.'. |
|
7863 s nextPutLine:' PullDownMenu defaultFont: ' , (PullDownMenu defaultFont storeString) , '.'. |
|
7864 s nextPutLine:' TextView defaultFont: ' , (TextView defaultFont storeString) , '.'. |
|
7865 s nextPutLine:' EditTextView defaultFont: ' , (EditTextView defaultFont storeString) , '.'. |
|
7866 s nextPutLine:' CodeView defaultFont: ' , (CodeView defaultFont storeString) , '.'. |
|
7867 s nextPutLine:' ].'. |
|
7868 s nextPutLine:'].'. |
|
7869 |
|
7870 s cr. |
|
7871 s nextPutLine:'"/'. |
|
7872 s nextPutLine:'"/ Language setting:'. |
|
7873 s nextPutLine:'"/'. |
|
7874 s nextPutLine:'Smalltalk language: ' , (Smalltalk language storeString) , '.'. |
|
7875 s nextPutLine:'Smalltalk languageTerritory: ' , (Smalltalk languageTerritory storeString) , '.'. |
|
7876 |
|
7877 s cr. |
|
7878 s nextPutLine:'"/'. |
|
7879 s nextPutLine:'"/ SourceCodeManager settings:'. |
|
7880 s nextPutLine:'"/ (only restored, if image is restarted on the same host)'. |
|
7881 s nextPutLine:'"/'. |
|
7882 s nextPutLine:'OperatingSystem getHostName = ' , (OperatingSystem getHostName storeString) , ' ifTrue:['. |
|
7883 s nextPutLine:' Class tryLocalSourceFirst:' , Class tryLocalSourceFirst storeString , '.'. |
|
7884 (Smalltalk at:#SourceCodeManager) == CVSSourceCodeManager ifTrue:[ |
|
7885 s nextPutLine:' Smalltalk at:#SourceCodeManager put: CVSSourceCodeManager.'. |
|
7886 s nextPutLine:' AbstractSourceCodeManager cacheDirectoryName:' , AbstractSourceCodeManager cacheDirectoryName storeString , '.'. |
|
7887 s nextPutLine:' CVSSourceCodeManager cvsBinDirectory:' , CVSSourceCodeManager cvsBinDirectory storeString , '.'. |
|
7888 s nextPutLine:' CVSSourceCodeManager repositoryNamesPerModule:' , CVSSourceCodeManager repositoryNamesPerModule storeString , '.'. |
|
7889 s nextPutLine:' CVSSourceCodeManager initializeForRepository:' , CVSSourceCodeManager repositoryName storeString , '.'. |
|
7890 ]. |
|
7891 s nextPutLine:'].'. |
|
7892 |
|
7893 s close. |
|
7894 |
|
7895 " |
|
7896 Transcript topView application saveSettings |
|
7897 " |
|
7898 |
|
7899 "Modified: / 6.1.1999 / 14:24:16 / cg" |
|
7900 ! ! |
|
7901 |
1987 !AbstractLauncherApplication::StyleSettingsAppl class methodsFor:'defaults'! |
7902 !AbstractLauncherApplication::StyleSettingsAppl class methodsFor:'defaults'! |
1988 |
7903 |
1989 efaults' |
7904 standardStyles |
|
7905 |
|
7906 ^ #( |
|
7907 'decWindows' |
|
7908 'iris' |
|
7909 'motif' |
|
7910 'mswindows95' |
|
7911 'next' |
|
7912 'normal' |
|
7913 'os2' |
|
7914 'st80' |
|
7915 ) |
1990 ! ! |
7916 ! ! |
1991 |
7917 |
1992 !AbstractLauncherApplication::StyleSettingsAppl class methodsFor:'interface specs'! |
7918 !AbstractLauncherApplication::StyleSettingsAppl class methodsFor:'interface specs'! |
1993 |
7919 |
1994 e specs' |
7920 windowSpec |
|
7921 "This resource specification was automatically generated |
|
7922 by the UIPainter of ST/X." |
|
7923 |
|
7924 "Do not manually edit this!! If it is corrupted, |
|
7925 the UIPainter may not be able to read the specification." |
|
7926 |
|
7927 " |
|
7928 UIPainter new openOnClass:AbstractLauncherApplication::StyleSettingsAppl andSelector:#windowSpec |
|
7929 AbstractLauncherApplication::StyleSettingsAppl new openInterface:#windowSpec |
|
7930 AbstractLauncherApplication::StyleSettingsAppl open |
|
7931 " |
|
7932 |
|
7933 <resource: #canvas> |
|
7934 |
|
7935 ^ |
|
7936 #(#FullSpec |
|
7937 #name: #windowSpec |
|
7938 #window: |
|
7939 #(#WindowSpec |
|
7940 #label: 'Style Selection' |
|
7941 #name: 'Style Selection' |
|
7942 #min: #(#Point 10 10) |
|
7943 #max: #(#Point 1024 768) |
|
7944 #bounds: #(#Rectangle 12 22 487 553) |
|
7945 ) |
|
7946 #component: |
|
7947 #(#SpecCollection |
|
7948 #collection: #( |
|
7949 #(#LabelSpec |
|
7950 #label: 'Label' |
|
7951 #name: 'Label1' |
|
7952 #layout: #(#LayoutFrame 0 0.0 -71 1 0 1.0 -34 1) |
|
7953 #style: #(#FontDescription #helvetica #bold #roman 12) |
|
7954 #translateLabel: true |
|
7955 #labelChannel: #infoLabelHolder |
|
7956 #resizeForLabel: true |
|
7957 #adjust: #left |
|
7958 ) |
|
7959 #(#HorizontalPanelViewSpec |
|
7960 #name: 'HorizontalPanel1' |
|
7961 #layout: #(#LayoutFrame 0 0.0 -34 1 0 1.0 0 1) |
|
7962 #horizontalLayout: #center |
|
7963 #verticalLayout: #center |
|
7964 #horizontalSpace: 3 |
|
7965 #verticalSpace: 3 |
|
7966 #component: |
|
7967 #(#SpecCollection |
|
7968 #collection: #( |
|
7969 #(#ActionButtonSpec |
|
7970 #label: 'OK' |
|
7971 #name: 'OK' |
|
7972 #translateLabel: true |
|
7973 #model: #saveSettings |
|
7974 #enableChannel: #modifiedChannel |
|
7975 #extent: #(#Point 125 22) |
|
7976 ) |
|
7977 #(#ActionButtonSpec |
|
7978 #label: 'Cancel' |
|
7979 #name: 'Cancel' |
|
7980 #translateLabel: true |
|
7981 #model: #doCancel |
|
7982 #extent: #(#Point 125 22) |
|
7983 ) |
|
7984 #(#ActionButtonSpec |
|
7985 #label: 'Help' |
|
7986 #name: 'Help' |
|
7987 #translateLabel: true |
|
7988 #model: #help |
|
7989 #extent: #(#Point 125 22) |
|
7990 ) |
|
7991 ) |
|
7992 |
|
7993 ) |
|
7994 ) |
|
7995 #(#LabelSpec |
|
7996 #label: 'NoticeText' |
|
7997 #name: 'Text' |
|
7998 #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 160 0) |
|
7999 #translateLabel: true |
|
8000 #labelChannel: #noticeLabelHolder |
|
8001 #resizeForLabel: true |
|
8002 #adjust: #left |
|
8003 ) |
|
8004 #(#CheckBoxSpec |
|
8005 #label: 'standard styles only' |
|
8006 #name: 'CheckBox1' |
|
8007 #layout: #(#LayoutFrame 0 0.0 160 0 0 1.0 182 0) |
|
8008 #model: #showStandardStylesOnly |
|
8009 #translateLabel: true |
|
8010 ) |
|
8011 #(#SequenceViewSpec |
|
8012 #name: 'StyleList' |
|
8013 #layout: #(#LayoutFrame 0 0.0 182 0 0 1.0 -74 1) |
|
8014 #model: #selectedStyle |
|
8015 #hasHorizontalScrollBar: true |
|
8016 #hasVerticalScrollBar: true |
|
8017 #useIndex: false |
|
8018 #sequenceList: #styleList |
|
8019 ) |
|
8020 ) |
|
8021 |
|
8022 ) |
|
8023 ) |
1995 ! ! |
8024 ! ! |
1996 |
8025 |
1997 !AbstractLauncherApplication::StyleSettingsAppl methodsFor:'actions'! |
8026 !AbstractLauncherApplication::StyleSettingsAppl methodsFor:'actions'! |
1998 |
8027 |
1999 actions' |
8028 doCancel |
2000 ! |
8029 |
2001 |
8030 self isPartOfSettinsDialog ifTrue:[ |
2002 equest. |
8031 self loadRequest. |
2003 ! |
8032 ]. |
2004 |
8033 self closeRequest. |
2005 anges). |
8034 ! |
2006 ! |
8035 |
2007 |
8036 evaluateModified |
2008 html']. |
8037 |
2009 ! |
8038 self modifiedChannel value:(self hasUnsavedChanges). |
2010 |
8039 ! |
2011 :false. |
8040 |
|
8041 help |
|
8042 |
|
8043 self warn:'no help available here'. |
|
8044 "/ self withWaitCursorDo:[HTMLDocumentView openFullOnHelpFile:'Launcher/keyboardSetting.html']. |
|
8045 ! |
|
8046 |
|
8047 loadRequest |
|
8048 |
|
8049 self modifiedChannel value:false. |
|
8050 ! |
|
8051 |
|
8052 saveRequest |
|
8053 | result | |
|
8054 |
|
8055 (self hasUnsavedChanges) ifTrue:[ |
|
8056 result := self confirmWithCancel:(resources string:'Save changed Tool Settings ?'). |
|
8057 result isNil ifTrue:[ ^ false]. |
|
8058 result ifTrue:[ |
|
8059 self saveSettings. |
|
8060 ] |
|
8061 ]. |
|
8062 ^ true |
2012 ! |
8063 ! |
2013 |
8064 |
2014 saveSettings |
8065 saveSettings |
2015 |
8066 |
2016 | newStyle master requestor| |
8067 | newStyle master requestor| |
2017 |
8068 |
|
8069 self halt. |
2018 newStyle := self selectedStyle value. |
8070 newStyle := self selectedStyle value. |
2019 master := self masterApplication. |
8071 master := self masterApplication. |
2020 master notNil ifTrue:[ |
8072 master notNil ifTrue:[ |
2021 requestor := master requestor. |
8073 requestor := master requestor. |
2022 ]. |
8074 ]. |
|
8075 self halt. |
2023 self hasUnsavedChanges ifTrue:[ |
8076 self hasUnsavedChanges ifTrue:[ |
2024 | launcher | |
|
2025 requestor notNil ifTrue:[ |
|
2026 launcher := requestor. |
|
2027 ] ifFalse:[ |
|
2028 | transcript | |
|
2029 transcript := Transcript current. |
|
2030 transcript notNil ifTrue:[ |
|
2031 | app| |
|
2032 app := transcript topView application. |
|
2033 (app respondsTo:#reopenLauncher) ifTrue:[ |
|
2034 launcher := app. |
|
2035 ]. |
|
2036 ]. |
|
2037 ]. |
|
2038 self withWaitCursorDo:[ |
8077 self withWaitCursorDo:[ |
2039 Transcript showCR:'change style to ' , newStyle , ' ...'. |
8078 Transcript showCR:'change style to ' , newStyle , ' ...'. |
2040 View defaultStyle:newStyle asSymbol. |
8079 View defaultStyle:newStyle asSymbol. |
2041 ]. |
8080 ]. |
2042 launcher notNil ifTrue:[ |
8081 requestor notNil ifTrue:[ |
2043 launcher reopenLauncher. |
8082 self halt. |
|
8083 requestor reopenLauncher. |
2044 ]. |
8084 ]. |
2045 DebugView newDebugger. |
8085 DebugView newDebugger. |
2046 self modifiedChannel value:false. |
8086 self modifiedChannel value:false. |
2047 ]. |
8087 ]. |
2048 ! ! |
8088 ! ! |
2049 |
8089 |
2050 !AbstractLauncherApplication::StyleSettingsAppl methodsFor:'aspects'! |
8090 !AbstractLauncherApplication::StyleSettingsAppl methodsFor:'aspects'! |
2051 |
8091 |
2052 aspects' |
8092 infoLabelHolder |
2053 ! |
8093 |
2054 |
8094 infoLabelHolder isNil ifTrue:[ |
2055 Holder. |
8095 infoLabelHolder := '' asValue. |
2056 ! |
8096 ]. |
2057 |
8097 ^ infoLabelHolder. |
2058 Channel |
8098 ! |
2059 ! |
8099 |
2060 |
8100 modifiedChannel |
2061 Holder. |
8101 |
2062 ! |
8102 modifiedChannel isNil ifTrue:[ |
2063 |
8103 modifiedChannel := false asValue. |
2064 dStyle. |
8104 ]. |
2065 ! |
8105 ^ modifiedChannel |
2066 |
8106 ! |
2067 esOnly. |
8107 |
|
8108 noticeLabelHolder |
|
8109 |
|
8110 noticeLabelHolder isNil ifTrue:[ |
|
8111 noticeLabelHolder := '' asValue. |
|
8112 ]. |
|
8113 ^ noticeLabelHolder. |
|
8114 ! |
|
8115 |
|
8116 selectedStyle |
|
8117 |
|
8118 selectedStyle isNil ifTrue:[ |
|
8119 selectedStyle := ValueHolder new. |
|
8120 selectedStyle addDependent:self. |
|
8121 ]. |
|
8122 ^ selectedStyle. |
|
8123 ! |
|
8124 |
|
8125 showStandardStylesOnly |
|
8126 |
|
8127 showStandardStylesOnly isNil ifTrue:[ |
|
8128 showStandardStylesOnly := true asValue. |
|
8129 showStandardStylesOnly addDependent:self. |
|
8130 ]. |
|
8131 ^ showStandardStylesOnly. |
|
8132 ! |
|
8133 |
|
8134 styleList |
|
8135 |
|
8136 styleList isNil ifTrue:[ |
|
8137 styleList := List new. |
|
8138 styleList addDependent:self. |
|
8139 ]. |
|
8140 ^ styleList. |
2068 ! ! |
8141 ! ! |
2069 |
8142 |
2070 !AbstractLauncherApplication::StyleSettingsAppl methodsFor:'change & update'! |
8143 !AbstractLauncherApplication::StyleSettingsAppl methodsFor:'change & update'! |
2071 |
8144 |
2072 update' |
8145 changeInfoLabel |
2073 ! |
8146 |
2074 |
8147 |nm sheet comment| |
2075 comment |
8148 |
|
8149 comment := ''. |
|
8150 nm := self selectedStyle value. |
|
8151 nm notNil ifTrue:[ |
|
8152 sheet := ViewStyle fromFile:(nm , '.style'). |
|
8153 comment := (sheet at:#comment ifAbsent:'') withoutSeparators. |
|
8154 ]. |
|
8155 comment := comment withCRs asStringCollection. |
|
8156 comment size == 1 ifTrue:[ |
|
8157 comment := comment first |
|
8158 ]. |
|
8159 self infoLabelHolder value:comment |
|
8160 ! |
|
8161 |
|
8162 update:something with:aParameter from:changedObject |
|
8163 "Invoked when an object that I depend upon sends a change notification." |
|
8164 |
|
8165 "stub code automatically generated - please change as required" |
|
8166 |
|
8167 changedObject == self showStandardStylesOnly ifTrue:[ |
|
8168 self updateList. |
|
8169 ^ self. |
|
8170 ]. |
|
8171 changedObject == self selectedStyle ifTrue:[ |
|
8172 self changeInfoLabel. |
|
8173 self evaluateModified. |
|
8174 ^ self. |
|
8175 ]. |
|
8176 |
|
8177 super update:something with:aParameter from:changedObject |
2076 ! |
8178 ! |
2077 |
8179 |
2078 updateList |
8180 updateList |
2079 |
8181 |
2080 |listOfStyles lastSelection| |
8182 |listOfStyles lastSelection| |