Skip to content

Commit

Permalink
Merge pull request #96 from hpi-swa-teaching/83-selection-actions-in-…
Browse files Browse the repository at this point in the history
…context-menu

Add context menu and several selection actions for the history list
  • Loading branch information
MarcelGarus committed Jun 29, 2020
2 parents cbcbdd0 + cd4064f commit 9e97c77
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ buildHistoryListSpecWith: aBuilder
model: self;
list: #historyDescriptions;
getIndex: #historyListSelectionIndex;
setIndex: #historyListSelectionIndex:
setIndex: #historyListSelectionIndex:;
menu: #setUpHistoryListMenuMorph:
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ building
buttons

^ #(('Switch to detailed view' #switchToDetailedView 'Switch to a more detailed version of this window with more functionality')
('Invert selection' #invertSelection 'Select all unselected changes and vice versa')
('Load selected changes' #loadSelectedChanges 'Load the selected changes into this image'))
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
actions
ignoreAllOfHistoryList

self historyList do: [:each | each ignore]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
menu-actions
ignoreAllOfHistoryListAndUpdateUI

self
ignoreAllOfHistoryList;
updateAfterMenuAction
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
actions
ignoreAllOfHistoryListExceptSelected

(self historyList
reject: [:each | each = self selectedHistoryListItem])
do: [:each | each ignore]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
menu-actions
ignoreAllOfHistoryListExceptSelectedAndUpdateUI

self
ignoreAllOfHistoryListExceptSelected;
updateAfterMenuAction
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ initializeHistoryList
showWhile: [(self retrieveChangeRecordsFromChangesFile
reject: [:each | self isInImage: each]) reversed].
self historyList: (self getHistoryListFrom: changeRecords).
self historyList do: [:each |
each history first isSelected: true]
self selectAllLatestChangesOfHistoryList

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
actions
selectAllLatestChangesOfHistoryList

self historyList do: [:each | each selectLatest]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
menu-actions
selectAllLatestChangesOfHistoryListAndUpdateUI

self
selectAllLatestChangesOfHistoryList;
updateAfterMenuAction
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
building
setUpHistoryListMenuMorph: aMenuMorph

aMenuMorph addList: #(
('Ignore all' ignoreAllOfHistoryListAndUpdateUI)
('All latest changes' selectAllLatestChangesOfHistoryListAndUpdateUI)
('Ingore all except this one' ignoreAllOfHistoryListExceptSelectedAndUpdateUI)).
^ aMenuMorph
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
updating
updateAfterChangeSelection

self repaintChangeListSelection.
self refreshHistoryList.
self repaintHistoryListSelection.
self updateCodePane
self
repaintChangeListSelection;
refreshHistoryList;
repaintHistoryListSelection;
updateCodePane
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
updating
updateAfterHistorySelection

self refreshChangeList.
self repaintChangeListSelection.
self repaintHistoryListSelection
self
refreshChangeList;
repaintChangeListSelection;
repaintHistoryListSelection
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
updating
updateAfterMenuAction

self
refreshHistoryList;
refreshChangeList
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"instance" : {
"buildButtonPanelSpecWith:" : "mg 5/15/2020 09:24",
"buildButtonSpecsWith:" : "mg 5/14/2020 21:14",
"buildHistoryListSpecWith:" : "SV 6/12/2020 19:57",
"buildHistoryListSpecWith:" : "mg 6/26/2020 10:59",
"buildSingleSelectionChangeListSpecWith:" : "SV 6/21/2020 12:54",
"buildWith:" : "SV 6/21/2020 13:07",
"buttonHeight" : "mg 5/11/2020 19:05",
"buttons" : "mg 6/15/2020 18:46",
"buttons" : "mg 6/29/2020 17:53",
"buttonsFrame" : "mg 5/11/2020 18:56",
"changeListFrame" : "SV 6/21/2020 12:24",
"changeListSelectionIndex" : "SV 6/21/2020 12:53",
Expand All @@ -28,9 +28,12 @@
"historyListFrame" : "SV 6/21/2020 12:24",
"historyListSelectionIndex" : "SV 6/12/2020 19:58",
"historyListSelectionIndex:" : "SV 6/21/2020 13:35",
"initialize" : "SV 6/21/2020 13:10",
"initializeHistoryList" : "SV 6/22/2020 21:32",
"invertSelection" : "SV 6/12/2020 21:50",
"ignoreAllOfHistoryList" : "mg 6/29/2020 18:56",
"ignoreAllOfHistoryListAndUpdateUI" : "mg 6/29/2020 18:58",
"ignoreAllOfHistoryListExceptSelected" : "mg 6/29/2020 18:58",
"ignoreAllOfHistoryListExceptSelectedAndUpdateUI" : "mg 6/29/2020 18:59",
"initialize" : "mg 6/29/2020 18:50",
"initializeHistoryList" : "mg 6/26/2020 11:11",
"isAnyDisplayedChangeListItemSelected" : "SV 6/27/2020 19:38",
"isInImage:" : "SV 5/20/2020 13:03",
"loadSelectedChanges" : "mg 6/20/2020 09:52",
Expand All @@ -40,12 +43,16 @@
"repaintChangeListSelection" : "SV 6/27/2020 19:48",
"repaintHistoryListSelection" : "SV 6/12/2020 21:41",
"retrieveChangeRecordsFromChangesFile" : "SV 6/12/2020 22:03",
"selectAllLatestChangesOfHistoryList" : "mg 6/29/2020 18:58",
"selectAllLatestChangesOfHistoryListAndUpdateUI" : "mg 6/29/2020 18:59",
"selectedChangeListItems" : "SV 6/27/2020 19:39",
"selectedDisplayedChangeListItems" : "SV 6/27/2020 19:38",
"selectedHistoryListItem" : "SV 6/12/2020 21:37",
"setChangeListItemSelectionAt:to:" : "SV 6/12/2020 21:51",
"setUpHistoryListMenuMorph:" : "mg 6/29/2020 19:00",
"switchToDetailedView" : "mg 5/14/2020 21:26",
"updateAfterChangeSelection" : "SV 6/27/2020 19:48",
"updateAfterHistorySelection" : "SV 6/27/2020 19:48",
"updateAfterChangeSelection" : "mg 6/29/2020 18:04",
"updateAfterHistorySelection" : "mg 6/29/2020 18:04",
"updateAfterMenuAction" : "mg 6/29/2020 18:04",
"updateCodePane" : "SV 6/21/2020 13:16",
"wantsOptionalButtons" : "SV 6/21/2020 12:26" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
selecting
ignore

self history do: [:change | change isSelected: false]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
selecting
selectLatest

self ignore.
self history first isSelected: true
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"hasSelectedChangeListItem" : "SV 6/22/2020 21:08",
"history" : "SV 6/12/2020 13:46",
"history:" : "gf 6/15/2020 23:34",
"ignore" : "mg 6/26/2020 11:09",
"initialize" : "mg 6/20/2020 09:55",
"selectLatest" : "mg 6/26/2020 11:09",
"selectedChangeListItems" : "mg 6/20/2020 09:30",
"selector" : "SV 6/12/2020 13:49",
"selector:" : "SV 6/12/2020 13:49" } }

0 comments on commit 9e97c77

Please sign in to comment.