-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added document store, download dowcument into selected directory on c…
…lick on document message icon
- Loading branch information
Showing
21 changed files
with
94 additions
and
14 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-Core.package/TCCCore.class/instance/documentStore..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
documentStore: aDocumentStore | ||
|
||
documentStore := aDocumentStore |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-Core.package/TCCCore.class/instance/documentStore.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
documentStore | ||
|
||
^ documentStore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/documentId..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
documentId: aNumber | ||
|
||
documentId := aNumber |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-Core.package/TCCDocumentMessage.class/instance/documentId.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
documentId | ||
|
||
^ documentId |
4 changes: 3 additions & 1 deletion
4
packages/TelegramClient-Core.package/TCCDocumentMessage.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
{ | ||
"class" : { | ||
"newFrom:" : "JK 6/23/2024 11:52" }, | ||
"newFrom:" : "JK 6/26/2024 14:23" }, | ||
"instance" : { | ||
"asSnippet" : "AH 6/21/2024 13:54", | ||
"asText" : "AH 6/21/2024 13:54", | ||
"documentId" : "JK 6/26/2024 14:14", | ||
"documentId:" : "JK 6/26/2024 14:14", | ||
"filename" : "AH 6/21/2024 13:54", | ||
"filename:" : "AH 6/21/2024 13:55" } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
7 changes: 7 additions & 0 deletions
7
packages/TelegramClient-Core.package/TCCDocumentStore.class/instance/getDocumentFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
as yet unclassified | ||
getDocumentFor: aDocumentId | ||
|
||
| promise | | ||
promise := self getDocumentPromiseFor: aDocumentId. | ||
promise wait. | ||
^ promise value |
10 changes: 10 additions & 0 deletions
10
...ges/TelegramClient-Core.package/TCCDocumentStore.class/instance/getDocumentPromiseFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
as yet unclassified | ||
getDocumentPromiseFor: aDocumentId | ||
|
||
| promise | | ||
promise := self at: aDocumentId ifAbsent: [ | ||
self at: aDocumentId put: Promise new. | ||
self requestFileFor: aDocumentId with: (self at: aDocumentId). | ||
self at: aDocumentId | ||
]. | ||
^ promise |
6 changes: 6 additions & 0 deletions
6
packages/TelegramClient-Core.package/TCCDocumentStore.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"getDocumentFor:" : "JK 6/26/2024 14:17", | ||
"getDocumentPromiseFor:" : "JK 6/26/2024 14:17" } } |
14 changes: 14 additions & 0 deletions
14
packages/TelegramClient-Core.package/TCCDocumentStore.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "TelegramClient-Core", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "TCCDocumentStore", | ||
"pools" : [ | ||
], | ||
"super" : "TCCFileStore", | ||
"type" : "normal" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/TelegramClient-UI.package/TCUChoice.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/addIcon.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
constructing | ||
addIcon | ||
|
||
| iconForm | | ||
| iconForm iconMorph| | ||
iconForm := self class getIcon. | ||
iconForm := iconForm scaledToHeight: self class maxHeight. | ||
self addMorphBack: iconForm asMorph | ||
iconMorph := (iconForm scaledToHeight: self class maxHeight) asMorph. | ||
iconMorph on: #mouseDown send: #moveDocument to: self. | ||
self addMorphBack: iconMorph |
17 changes: 17 additions & 0 deletions
17
packages/TelegramClient-UI.package/TCUDocumentMessage.class/instance/moveDocument.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
constructing | ||
moveDocument | ||
|
||
| sourceFile destinationFile sourceStream destinationStream | | ||
|
||
sourceFile := self messageModel core documentStore getDocumentFor: self messageModel documentId. | ||
destinationFile := (DirectoryChooserDialog openOn:FileDirectory default label: 'Select Directory for download') pathName, '\', self messageModel filename. | ||
Transcript show: destinationFile. | ||
|
||
sourceStream := StandardFileStream readOnlyFileNamed: sourceFile. | ||
destinationStream := StandardFileStream newFileNamed: destinationFile. | ||
destinationStream binary. | ||
[sourceStream atEnd] whileFalse: [ | ||
destinationStream nextPutAll: (sourceStream next: 1024). | ||
]. | ||
sourceStream close. | ||
destinationStream close. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters