# HG changeset patch # User Claus Gittinger # Date 1391626623 -3600 # Node ID 732c224bdfb9c8359741705d27e39e5036a334df # Parent 2b090510c0b7b73c4093191b19aa693b2e8cec93 merged in jv's chenges diff -r 2b090510c0b7 -r 732c224bdfb9 XTermView.st --- a/XTermView.st Wed Feb 05 19:57:01 2014 +0100 +++ b/XTermView.st Wed Feb 05 19:57:03 2014 +0100 @@ -103,12 +103,18 @@ "But hackish..." app := self application. app ifNil:[^self]. + (app class == FileApplicationNoteBook::Terminal) ifTrue:[ + app doClose. + ^self. + ]. #(removeWorkspace "WorkspaceApplication" - doCloseApplication "FileBrowserNotebook" bufferMenuRemoveCurrentBuffer "NewSystemBrowser" ) do:[:closeSelector| - (app topApplication respondsTo: closeSelector) ifTrue: - [app topApplication perform: closeSelector]]. + (app topApplication respondsTo: closeSelector) ifTrue: [ + app topApplication perform: closeSelector. + ^self + ] + ]. "Created: / 06-06-2011 / 10:04:56 / Jan Vrany " ! ! @@ -138,8 +144,106 @@ "Created: / 25-11-2010 / 12:34:55 / Jan Vrany " ! ! +!XTermView methodsFor:'menu'! + +doClear + "reset the scroll-range etc, clear the text buffer" + +"/ rangeStartLine := 1. +"/ rangeEndLine := numberOfLines. +"/ +"/ self normal. +"/ self clear. + + "Created: / 03-04-2007 / 08:58:59 / cg" + "Modified: / 03-04-2012 / 10:34:20 / Jan Vrany " +! + +doReset + "reset the scroll-range; + may have to reset more in the future (current font-set; color; etc)" + +"/ rangeStartLine := 1. +"/ rangeEndLine := numberOfLines. +"/ +"/ self normal. + + "Modified: / 03-04-2012 / 10:34:24 / Jan Vrany " +! + +doSendInterrupt + "send an INT-signal to the shell (UNIX only)" + pid notNil ifTrue:[ + OperatingSystem sendSignal:(OperatingSystem sigINT) to:pid negated. + ]. + + "Modified: / 10-06-1998 / 17:49:49 / cg" + "Modified: / 03-04-2012 / 10:34:39 / Jan Vrany " +! + +doSendKillSignal + "send a KILL-signal to the shell (UNIX only)" + + pid notNil ifTrue:[ + OperatingSystem sendSignal:(OperatingSystem sigKILL) to:pid negated. + ] + + "Modified: / 03-04-2012 / 10:34:45 / Jan Vrany " +! ! + !XTermView methodsFor:'mimicry'! +defaultFileNameForFileDialog + + ^nil + + "Created: / 03-05-2012 / 12:29:04 / Jan Vrany " +! + +lineLimit:aSmallInteger + + "Nothing" + + "Created: / 03-04-2012 / 10:42:53 / Jan Vrany " +! + +list + ^nil + + "Created: / 17-07-2012 / 21:11:59 / Jan Vrany " +! + +modified + + ^false + + "Created: / 03-05-2012 / 11:42:36 / Jan Vrany " +! + +save + + Dialog warn: 'Not yet implemented for XTermView' + + "Created: / 03-04-2012 / 10:43:57 / Jan Vrany " +! + +selectionAsString + + ^ (device getSelectionOwnerOf: #PRIMARY) = drawableId ifTrue:[ + device getClipboardText:#selection for:drawableId + ] ifFalse:[ + nil + ] + + "Created: / 03-04-2012 / 10:30:12 / Jan Vrany " +! + +sendLine:aString + self halt:'please define sendLine: here'. + + "Created: / 03-04-2012 / 10:33:01 / Jan Vrany " +! + shellTerminateAction: aBlock "Nothing to do" @@ -167,12 +271,13 @@ ! xtermArgs + | args | args := OrderedCollection new. args add: self xtermExecutable; - add: (XTermType == #rxvt ifTrue:['-embed'] ifFalse:['-into']); add:self drawableId address printString; + add: (XTermType == #xterm ifTrue:['-into'] ifFalse:['-embed']); add: drawableId address printString; add: '-j'; add: '-font'; add: (device fullFontNameOf: (font fontId)); add: '-fg'; add: 'white'"(self xcolorNameFor: foreground)"; @@ -183,9 +288,9 @@ add: '-tn'; add: 'xterm' ]. - ^ args asArray + ^args asArray - "Modified: / 10-06-2011 / 19:51:23 / Jan Vrany " + "Modified: / 12-09-2013 / 00:12:59 / Jan Vrany " ! xtermExecutable @@ -248,7 +353,7 @@ isTextView - ^false + ^true "Created: / 13-09-2011 / 11:22:49 / Jan Vrany " ! ! @@ -256,11 +361,11 @@ !XTermView class methodsFor:'documentation'! version_CVS - ^ '$Header: /cvs/stx/stx/libtool/XTermView.st,v 1.4 2014-02-04 10:06:57 stefan Exp $' + ^ '$Header: /cvs/stx/stx/libtool/XTermView.st,v 1.5 2014-02-05 18:57:03 cg Exp $' ! version_SVN - ^ '$Id: XTermView.st,v 1.4 2014-02-04 10:06:57 stefan Exp $' + ^ '$Id: XTermView.st,v 1.5 2014-02-05 18:57:03 cg Exp $' ! !