diff --git a/repository/Grafoscopio/GfUIHelpers.class.st b/repository/Grafoscopio/GfUIHelpers.class.st index 5ea6025..fdabe45 100644 --- a/repository/Grafoscopio/GfUIHelpers.class.st +++ b/repository/Grafoscopio/GfUIHelpers.class.st @@ -49,6 +49,39 @@ GfUIHelpers class >> addToHelpMenu: aGrafoscopioNotebook [ self updateUI ] +{ #category : #updating } +GfUIHelpers class >> installDataviz [ + "I install the Dataviz package. + DataViz contains Data visualization helpers" + "self isDatavizInstalled ifTrue: [ ^ self ]." + Metacello new + smalltalkhubUser: 'Offray' project: 'Dataviz'; + configuration: 'Dataviz'; + load. + self inform: 'Dataviz package install finished.' +] + +{ #category : #updating } +GfUIHelpers class >> installDatavizUI [ + "I'm the User Interface for installing the Dataviz package for the first time." + | install | + install := (UIManager default + confirm: + 'Dataviz is data visualization package, with several', String cr, + 'Domain Specific Examples, like Panama Papers, Twitter Data Selfies.', + String cr, 'Do you want to install it?' + label: 'Install Dataviz package'). + install ifFalse: [ ^ self ]. + self installDataviz +] + +{ #category : #updating } +GfUIHelpers class >> isDatavizInstalled [ + ^ (Metacello image + configuration: #('Dataviz'); + list) isNotEmpty +] + { #category : #'graphical interface' } GfUIHelpers class >> messageAbout [ "I show the author(s), license, sponsors and main contributors to the project @@ -156,11 +189,15 @@ GfUIHelpers class >> updateDataviz [ "I update the Dataviz package with new versions of itself take from the source code repository. DataViz contains Data visualization helpers" - Gofer it - smalltalkhubUser: 'Offray' project: 'Dataviz'; - configurationOf: 'Dataviz'; - load. - self inform: 'Dataviz package update finished.' + self isDatavizInstalled + ifFalse: [ self installDatavizUI ] + ifTrue: [ + Gofer it + smalltalkhubUser: 'Offray' project: 'Dataviz'; + configurationOf: 'Dataviz'; + load. + self inform: 'Dataviz package update finished.']. + ] { #category : #updating } diff --git a/repository/Grafoscopio/GrafoscopioNotebook.class.st b/repository/Grafoscopio/GrafoscopioNotebook.class.st index 4e72dfd..b30888e 100644 --- a/repository/Grafoscopio/GrafoscopioNotebook.class.st +++ b/repository/Grafoscopio/GrafoscopioNotebook.class.st @@ -10,7 +10,7 @@ nb openWithSpec " Class { #name : #GrafoscopioNotebook, - #superclass : #ComposableModel, + #superclass : #ComposablePresenter, #instVars : [ 'tree', 'header', @@ -218,7 +218,7 @@ GrafoscopioNotebook >> exportAsHTML [ ifFalse: [ self inform: 'Exportation unsuccesful. Please review that you have installed Pandoc and have used the exportation options properly.' ]]]. Smalltalk platformName = 'Win32' - ifTrue: [WinProcess createProcess: 'pandoc --standalone ', self markdownFile fullName, ' -o ', htmlFile]. + ifTrue: ["WinProcess createProcess: 'pandoc --standalone ', self markdownFile fullName, ' -o ', htmlFile"]. ] { #category : #persistence } @@ -403,8 +403,9 @@ GrafoscopioNotebook >> initializeWidgets [ body := self newText. body disable. body text: '<- Select a node'. + body autoAccept: true. links := self newTextInput. - tree := TreeModel new. + tree := self newTree. tree childrenBlock: [:node | node children]; displayBlock: [:node | node title ]. @@ -729,40 +730,44 @@ GrafoscopioNotebook >> pdfFile [ { #category : #initialization } GrafoscopioNotebook >> projectSubMenu [ - ^ MenuModel new - addGroup: [ :group | - group addItem: [ :item | - item - name: 'Activate remote repository...'; - icon: Smalltalk ui icons smallPushpinIcon; - action: [ self inform: 'To be implemented ...' ] ]. - group addItem: [ :item | - item - name: 'Activate local repository...'; - icon: Smalltalk ui icons homeIcon; - action: [ self inform: 'To be implemented ...' ] ]. - group addItem: [ :item | - item - name: 'Add file...'; - icon: Smalltalk ui icons newerPackagesAvailableIcon; - action: [ self inform: 'To be implemented ...' ] ]. - group addItem: [ :item | - item - name: 'Delete file...'; - icon: Smalltalk ui icons packageDeleteIcon; - action: [ self inform: 'To be implemented ...' ] ]. - group addItem: [ :item | - item - name: 'Commit to repository'; - icon: Smalltalk ui icons smallScreenshotIcon; - action: [ self inform: 'To be implemented ...' ] ]. - group addItem: [ :item | - item - name: 'Credentials'; - icon: Smalltalk ui icons userIcon; - action: [ self inform: 'To be implemented ...' ] ] ] - + addGroup: [ :group | + group + addItem: [ :item | + item + name: 'Activate remote repository...'; + icon: Smalltalk ui icons smallPushpinIcon; + action: [ self inform: 'To be implemented ...' ] ]. + group + addItem: [ :item | + item + name: 'Activate local repository...'; + icon: Smalltalk ui icons homeIcon; + action: [ self inform: 'To be implemented ...' ] ]. + group + addItem: [ :item | + item + name: 'Add file...'; + icon: Smalltalk ui icons newerPackagesAvailableIcon; + action: [ self inform: 'To be implemented ...' ] ]. + group + addItem: [ :item | + item + name: 'Delete file...'; + icon: Smalltalk ui icons packageDeleteIcon; + action: [ self inform: 'To be implemented ...' ] ]. + group + addItem: [ :item | + item + name: 'Commit to repository'; + icon: Smalltalk ui icons smallScreenshotIcon; + action: [ self inform: 'To be implemented ...' ] ]. + group + addItem: [ :item | + item + name: 'Credentials'; + icon: (self iconNamed: #userIcon); + action: [ self inform: 'To be implemented ...' ] ] ] ] { #category : #'editing nodes' }