From 415c3f0b66ee3c12c2fd6b9239d85dd11b7a132a Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sun, 19 Feb 2023 22:40:15 -0500 Subject: [PATCH] Redoing Markdeep export/preview buttons to complain with new GUI conventions. --- src/MiniDocs/LePage.extension.st | 22 +++++++++++++ src/MiniDocs/LePageHeaderBuilder.extension.st | 32 ------------------- 2 files changed, 22 insertions(+), 32 deletions(-) delete mode 100644 src/MiniDocs/LePageHeaderBuilder.extension.st diff --git a/src/MiniDocs/LePage.extension.st b/src/MiniDocs/LePage.extension.st index 98ce295..559f638 100644 --- a/src/MiniDocs/LePage.extension.st +++ b/src/MiniDocs/LePage.extension.st @@ -226,3 +226,25 @@ LePage >> storage [ (self optionAt: 'storage') ifNil: [ ^ current ]. ^ self optionAt: 'storage' ] + +{ #category : #'*MiniDocs' } +LePage >> uiExportButtonFor: anAction [ + + ^ anAction button + tooltip: 'Export Page'; + icon: BrGlamorousVectorIcons down; + action: [:aButton | aButton phlow spawnObject: self page asMarkdeepFile ] +] + +{ #category : #'*MiniDocs' } +LePage >> uiRefrepshWebPreviewButtonFor: anAction [ + + ^ anAction button + tooltip: 'Refresh web view'; + icon: BrGlamorousVectorIcons refresh; + action: [ + self page asMarkdeep exportAsFileOn: (self page storage / self page markdeepFileName). + GoogleChrome openWindowOn: self page localHostAddress. + "TODO: If Chrome/Chromium are not installed, I should execute:" + "WebBrowser openOn: self page localHostAddress" ] +] diff --git a/src/MiniDocs/LePageHeaderBuilder.extension.st b/src/MiniDocs/LePageHeaderBuilder.extension.st deleted file mode 100644 index f5ac6bc..0000000 --- a/src/MiniDocs/LePageHeaderBuilder.extension.st +++ /dev/null @@ -1,32 +0,0 @@ -Extension { #name : #LePageHeaderBuilder } - -{ #category : #'*MiniDocs' } -LePageHeaderBuilder >> addExportPageButton [ - - | newButton | - - newButton := BrButton new - aptitude: BrGlamorousButtonWithIconAptitude; - label: 'Export Page'; - icon: BrGlamorousVectorIcons down; - action: [ :aButton | - aButton phlow spawnObject: self page asMarkdeepFile ]. - self toolbarElement addItem: newButton. -] - -{ #category : #'*MiniDocs' } -LePageHeaderBuilder >> addRefreshWebViewButton [ - - | newButton | - - newButton := BrButton new - aptitude: BrGlamorousButtonWithIconAptitude; - label: 'Refresh web view'; - icon: BrGlamorousVectorIcons refresh; - action: [ - self page asMarkdeep exportAsFileOn: (self page storage / self page markdeepFileName). - GoogleChrome openWindowOn: self page localHostAddress. - "TODO: If Chrome/Chromium are not installed, I should execute:" - "WebBrowser openOn: self page localHostAddress" ]. - self toolbarElement addItem: newButton. -]