Skip to content

Commit 76993f7

Browse files
committed
added log statement in controller. renamed variable.
1 parent cd00e0e commit 76993f7

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

src/main/java/de/doubleslash/keeptime/controller/Controller.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,24 +209,23 @@ public void editWork(final Work workToBeEdited, final Work newValuedWork) {
209209
}
210210

211211
public void deleteWork(final Work workToBeDeleted) {
212+
LOG.info("Deleting work '{}'.", workToBeDeleted);
212213

213214
model.getPastWorkItems().removeIf(w -> (w.getId() == workToBeDeleted.getId()));
214-
215215
model.getWorkRepository().delete(workToBeDeleted);
216-
217216
}
218217

219218
/**
220219
* Changes the indexes of the originalList parameter to have a consistent order.
221220
*
222221
* @param originalList
223-
* list of all projects to adapt the indexes for
222+
* list of all projects to adapt the indexes for
224223
* @param changedProject
225-
* the project which has changed which already has the new index
224+
* the project which has changed which already has the new index
226225
* @param oldIndex
227-
* the old index of the changed project
226+
* the old index of the changed project
228227
* @param newIndex
229-
* the new index of the changed project (which the projects also already has)
228+
* the new index of the changed project (which the projects also already has)
230229
* @return all projects whose index has been adapted
231230
*/
232231
List<Project> resortProjectIndexes(final List<Project> originalList, final Project changedProject,
@@ -263,9 +262,9 @@ List<Project> resortProjectIndexes(final List<Project> originalList, final Proje
263262
* Decreases all indexes by one, after the removed index
264263
*
265264
* @param originalList
266-
* list of all projects to adapt the indexes for
265+
* list of all projects to adapt the indexes for
267266
* @param removedIndex
268-
* the index which has been removed
267+
* the index which has been removed
269268
* @return all projects whose index has been adapted
270269
*/
271270
List<Project> adaptProjectIndexesAfterRemoving(final List<Project> originalList, final int removedIndex) {

src/main/java/de/doubleslash/keeptime/view/ReportController.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,12 @@ public void updateItem(final LocalDate item, final boolean empty) {
272272
}
273273

274274
private Button createDeleteWorkButton(final Work w) {
275-
276-
// XXX Auto-generated method stub
277-
final Button editButton = new Button("delete");
278-
editButton.setOnAction(e -> {
275+
final Button deleteButton = new Button("delete");
276+
deleteButton.setOnAction(e -> {
279277
LOG.info("Delete work clicked.");
280278
final Alert alert = new Alert(AlertType.CONFIRMATION);
281279
alert.setTitle("Delete Work");
282-
alert.setHeaderText("You are about to delete this Work:");
280+
alert.setHeaderText("Delete work item");
283281
alert.setContentText(w.toString());
284282
alert.initOwner(stage);
285283

@@ -292,7 +290,7 @@ private Button createDeleteWorkButton(final Work w) {
292290
}
293291
});
294292
});
295-
return editButton;
293+
return deleteButton;
296294
}
297295

298296
private Button createEditWorkButton(final Work work) {

0 commit comments

Comments
 (0)