diff --git a/Pharo-IRC-GUI.package/IRCBasicChannelInput.class/class/defaultSpec.st b/Pharo-IRC-GUI.package/IRCBasicChannelInput.class/class/defaultSpec.st deleted file mode 100644 index e510011..0000000 --- a/Pharo-IRC-GUI.package/IRCBasicChannelInput.class/class/defaultSpec.st +++ /dev/null @@ -1,12 +0,0 @@ -specs -defaultSpec - - ^ SpecLayout composed - newColumn: [ :row | - row - newColumn: [ :column | - column newRow: [:r | - r newColumn: #logArea. - r newColumn: #users width: 200 ]. - ]; - newRow: #input height: 25 ]. \ No newline at end of file diff --git a/Pharo-IRC-GUI.package/IRCBasicChannelInput.class/instance/defaultLayout.st b/Pharo-IRC-GUI.package/IRCBasicChannelInput.class/instance/defaultLayout.st new file mode 100644 index 0000000..7efc26e --- /dev/null +++ b/Pharo-IRC-GUI.package/IRCBasicChannelInput.class/instance/defaultLayout.st @@ -0,0 +1,10 @@ +as yet unclassified +defaultLayout + + ^ SpBoxLayout newTopToBottom + add: (SpBoxLayout newLeftToRight + add: logArea; + add: users width: 200; + yourself); + add: input height: 25; + yourself \ No newline at end of file diff --git a/Pharo-IRC-GUI.package/IRCBasicChannelInput.class/instance/initializeWidgets.st b/Pharo-IRC-GUI.package/IRCBasicChannelInput.class/instance/initializeWidgets.st index ae9a4dd..38dbb3c 100644 --- a/Pharo-IRC-GUI.package/IRCBasicChannelInput.class/instance/initializeWidgets.st +++ b/Pharo-IRC-GUI.package/IRCBasicChannelInput.class/instance/initializeWidgets.st @@ -1,8 +1,8 @@ initialization initializeWidgets super initializeWidgets. - users := self instantiate: ListModel. + users := self newList. users - displayBlock: [ :item | + display: [ :item | item nickname ]. self commandHandler channel: self channel. \ No newline at end of file diff --git a/Pharo-IRC-GUI.package/IRCBasicDisplay.class/class/defaultSpec.st b/Pharo-IRC-GUI.package/IRCBasicDisplay.class/class/defaultSpec.st deleted file mode 100644 index 9975a62..0000000 --- a/Pharo-IRC-GUI.package/IRCBasicDisplay.class/class/defaultSpec.st +++ /dev/null @@ -1,6 +0,0 @@ -specs -defaultSpec - - ^ SpecLayout composed - newColumn: [ :column | - column add: #channelTabs ] \ No newline at end of file diff --git a/Pharo-IRC-GUI.package/IRCBasicDisplay.class/class/on..st b/Pharo-IRC-GUI.package/IRCBasicDisplay.class/class/on..st index 1f43815..3a21d21 100644 --- a/Pharo-IRC-GUI.package/IRCBasicDisplay.class/class/on..st +++ b/Pharo-IRC-GUI.package/IRCBasicDisplay.class/class/on..st @@ -5,5 +5,5 @@ on: anIRCConnection to connect" | model | model := self connection: anIRCConnection. - model openWithSpec. + model open. model window whenClosedDo: [ model windowCloseAction ]. \ No newline at end of file diff --git a/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/connection..st b/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/connection..st index 8be5464..285eb1e 100644 --- a/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/connection..st +++ b/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/connection..st @@ -1,19 +1,17 @@ accessing connection: anIRCConnection - | newTab | - newTab := TabModel new. + connection := anIRCConnection. - self serverLog + self serverLog connection: anIRCConnection; addSubscriber: anIRCConnection on: #handleInputAnnouncement:; - commandHandler: (IRCTextCommandHandler new connection: anIRCConnection). - anIRCConnection - addSubscriber: (self serverLog) on: #handleIncoming:. + commandHandler: + (IRCTextCommandHandler new connection: anIRCConnection). + anIRCConnection addSubscriber: self serverLog on: #handleIncoming:. anIRCConnection privAnnouncer when: IRCJoinedChannelAnnouncement send: #handleJoinChannel: to: self. - newTab - label: (anIRCConnection hostname); - contents: (self serverLog buildWithSpec). - self channelTabs addTab: newTab. \ No newline at end of file + self channelTabs addPage: (SpNotebookPage + title: anIRCConnection hostname + provider: [ self serverLog ]) \ No newline at end of file diff --git a/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/defaultLayout.st b/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/defaultLayout.st new file mode 100644 index 0000000..9acefcf --- /dev/null +++ b/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/defaultLayout.st @@ -0,0 +1,6 @@ +accessing +defaultLayout + + ^ SpBoxLayout newTopToBottom + add: channelTabs; + yourself \ No newline at end of file diff --git a/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/handleJoinChannel..st b/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/handleJoinChannel..st index 3454b59..0eccbbe 100644 --- a/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/handleJoinChannel..st +++ b/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/handleJoinChannel..st @@ -1,28 +1,23 @@ as yet unclassified handleJoinChannel: anAnnouncement - | newTab chanInput | - newTab := TabModel new. - chanInput := IRCBasicChannelInput new. + + | chanInput | + chanInput := self instantiate: IRCBasicChannelInput. chanInput - addSubscriber: (anAnnouncement channel connection) on: #handleInputAnnouncement:; - channelName: (anAnnouncement channel name); - channel: (anAnnouncement channel); + addSubscriber: anAnnouncement channel connection + on: #handleInputAnnouncement:; + channelName: anAnnouncement channel name; + channel: anAnnouncement channel; formatter: (IRCBasicTextFormatter new showOutbound: false). - anAnnouncement channel - addSubscriber: chanInput on: #handleIncoming:. - (anAnnouncement channel privAnnouncer) + anAnnouncement channel addSubscriber: chanInput on: #handleIncoming:. + anAnnouncement channel privAnnouncer when: IRCChanInfoAnnouncement send: #channelInfoUpdate: to: chanInput. - (anAnnouncement channel privAnnouncer) + anAnnouncement channel privAnnouncer when: IRCQuitAnnouncement send: #connectionQuit: to: chanInput. - newTab - label: (anAnnouncement channel name); - contents: chanInput buildWithSpec. - self channelTabs addTab: newTab. - newTab selected: true. - chanInput input textArea keyboardFocusChange: true. - - \ No newline at end of file + self channelTabs addPage: (SpNotebookPage + title: anAnnouncement channel name + provider: [ chanInput ]) \ No newline at end of file diff --git a/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/initializeWidgets.st b/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/initializeWidgets.st index fd5144e..038f889 100644 --- a/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/initializeWidgets.st +++ b/Pharo-IRC-GUI.package/IRCBasicDisplay.class/instance/initializeWidgets.st @@ -1,11 +1,5 @@ initialization initializeWidgets - | tabItem | - channelTabs := self instantiate: TabManagerModel. - serverLog := IRCBasicInput new. - tabItem := TabModel new. - tabItem - label: 'No Connection'; - contents: serverLog buildWithSpec. - + channelTabs := self newNotebook. + serverLog := IRCBasicInput new diff --git a/Pharo-IRC-GUI.package/IRCBasicDisplay.class/properties.json b/Pharo-IRC-GUI.package/IRCBasicDisplay.class/properties.json index aa727b7..caf7f6f 100644 --- a/Pharo-IRC-GUI.package/IRCBasicDisplay.class/properties.json +++ b/Pharo-IRC-GUI.package/IRCBasicDisplay.class/properties.json @@ -1,6 +1,6 @@ { "commentStamp" : "EricGade 2/23/2018 17:58", - "super" : "ComposableModel", + "super" : "SpPresenter", "category" : "Pharo-IRC-GUI", "classinstvars" : [ ], "pools" : [ ], diff --git a/Pharo-IRC-GUI.package/IRCBasicInput.class/class/connection..st b/Pharo-IRC-GUI.package/IRCBasicInput.class/class/connection..st index 70d3900..fc1e1e5 100644 --- a/Pharo-IRC-GUI.package/IRCBasicInput.class/class/connection..st +++ b/Pharo-IRC-GUI.package/IRCBasicInput.class/class/connection..st @@ -10,4 +10,4 @@ connection: anIRCConnection when: IRCJoinedChannelAnnouncement send: #handleJoinChannel: to: inst. - ^ inst openWithSpec. \ No newline at end of file + ^ inst open. \ No newline at end of file diff --git a/Pharo-IRC-GUI.package/IRCBasicInput.class/class/defaultSpec.st b/Pharo-IRC-GUI.package/IRCBasicInput.class/class/defaultSpec.st deleted file mode 100644 index 428965b..0000000 --- a/Pharo-IRC-GUI.package/IRCBasicInput.class/class/defaultSpec.st +++ /dev/null @@ -1,11 +0,0 @@ -specs -defaultSpec - - ^ SpecLayout composed - newColumn: [ :row | - row - newColumn: [ :column | - column newRow: [:r | - r newColumn: #logArea ] - ]; - newRow: #input height: 25 ]. \ No newline at end of file diff --git a/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/addTextToLog..st b/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/addTextToLog..st index 9836f3c..9dcd38f 100644 --- a/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/addTextToLog..st +++ b/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/addTextToLog..st @@ -1,5 +1,5 @@ adding addTextToLog: aText self logText: aText. - self logArea textArea appendText: aText. + self logArea insert: aText at: self logArea text size. "self logArea sourceTextArea setScrollValue: (self logArea sourceTextArea extent)." \ No newline at end of file diff --git a/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/defaultLayout.st b/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/defaultLayout.st new file mode 100644 index 0000000..fec0bd7 --- /dev/null +++ b/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/defaultLayout.st @@ -0,0 +1,7 @@ +initialization +defaultLayout + + ^ SpBoxLayout newTopToBottom + add: logArea; + add: input height: 25; + yourself \ No newline at end of file diff --git a/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/handleInput.st b/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/handleInput..st similarity index 79% rename from Pharo-IRC-GUI.package/IRCBasicInput.class/instance/handleInput.st rename to Pharo-IRC-GUI.package/IRCBasicInput.class/instance/handleInput..st index ce64669..e081b59 100644 --- a/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/handleInput.st +++ b/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/handleInput..st @@ -1,12 +1,11 @@ as yet unclassified -handleInput +handleInput: text "Action to take when the user has submitted text in the input area" - | inputText | "inputText := self input text veryDeepCopy. (inputText beginsWith: '/') ifTrue: [ self doCommand: inputText ] ifFalse: [ self doNonCommandText: inputText ]." - self commandHandler parse: (self input text). + self commandHandler parse: text. self input text: ''. \ No newline at end of file diff --git a/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/initializeWidgets.st b/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/initializeWidgets.st index e70a7ee..f6f4819 100644 --- a/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/initializeWidgets.st +++ b/Pharo-IRC-GUI.package/IRCBasicInput.class/instance/initializeWidgets.st @@ -1,10 +1,16 @@ initialization initializeWidgets - logArea := self instantiate: TextModel. - logArea color: (Color r: 0.301 g: 0.301 b: 0.301 alpha: 1.0). - input := self instantiate: TextInputFieldModel. + + logArea := self newText. + logArea beNotEditable. + logArea color: (Color + r: 0.301 + g: 0.301 + b: 0.301 + alpha: 1.0). + input := self newTextInput. ann := Announcer new. formatter := IRCBasicTextFormatter new. cmdHandler := IRCTextCommandHandler new. cmdHandler connection: self connection. - self input whenTextIsAccepted: [self handleInput]. \ No newline at end of file + self input whenSubmitDo: [ :text | text ifNotEmpty: [ self handleInput: text ] ] \ No newline at end of file diff --git a/Pharo-IRC-GUI.package/IRCBasicInput.class/properties.json b/Pharo-IRC-GUI.package/IRCBasicInput.class/properties.json index 6006b19..5bc9b42 100644 --- a/Pharo-IRC-GUI.package/IRCBasicInput.class/properties.json +++ b/Pharo-IRC-GUI.package/IRCBasicInput.class/properties.json @@ -1,6 +1,6 @@ { "commentStamp" : "EricGade 2/23/2018 18:05", - "super" : "ComposableModel", + "super" : "SpPresenter", "category" : "Pharo-IRC-GUI", "classinstvars" : [ ], "pools" : [ ], diff --git a/README.md b/README.md index 2bcffbf..130ad5a 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ To easily install everything with Metacello: ```smalltalk Metacello new baseline: 'PharoIRC'; - repository: 'github://darth-cheney/pharo-irc'; + repository: 'github://badetitou/pharo-irc'; load. ``` @@ -26,7 +26,7 @@ connection nickname: 'pharo-user'; hostname: 'irc.freenode.net'. display := IRCBasicDisplay connection: connection. -display openWithSpec. +display open. connection connect. ``` ## IRCBasicDisplay commands ##