Skip to content

Commit

Permalink
Fixes a compiler error in TrainerPresenter
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkratz committed Oct 4, 2023
1 parent d79878f commit ac5c5db
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private List<Section> sections() {
}
catch (Exception e) {
logException(e, "Sync failed");
showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.invalidurl.message");
context.showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.invalidurl.message");
}
return new ArrayList<>();
}
Expand All @@ -208,7 +208,7 @@ private List<Section> section() {
}
catch (Exception e) {
logException(e, "Sync failed");
showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.invalidurl.message");
context.showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.invalidurl.message");
}
return new ArrayList<>();
}
Expand Down Expand Up @@ -247,7 +247,7 @@ private List<Course> courses() {
}
catch (Exception e) {
logException(e, "Sync failed");
showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error" +
context.showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error" +
".invalidurl.message");
config.setRecentCourse(null);
course = null;
Expand Down Expand Up @@ -336,7 +336,7 @@ private void openCourseDirectory() {
desktop.open(dirToOpen);
} catch (Throwable e) {
logException(e, "Sync failed");
showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.path.unknown.message");
context.showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.path.unknown.message");
}
}

Expand Down Expand Up @@ -387,7 +387,7 @@ else if (course != newCourse) {
//view.setCourse(config.recentCourseProperty());
} catch (Exception e) {
logException(e, "Sync failed");
showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.message");
context.showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.message");
}
}

Expand Down Expand Up @@ -425,7 +425,7 @@ private void changeSection(Section newSection) {
}
} catch (Exception e) {
logException(e, "Sync failed");
showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.message");
context.showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.message");
}
}

Expand All @@ -442,7 +442,7 @@ private ObservableList<SyncTableElement> setGuestData() {
}
catch (Exception e) {
logException(e, "Sync failed");
showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.message");
context.showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.message");
}

List<Path> sectionList = List.of();
Expand Down Expand Up @@ -495,7 +495,7 @@ private ObservableList<SyncTableElement> setGuestData() {

} catch (Exception e){
logException(e, "Sync failed");
showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.message");
context.showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.message");
}
return data;
}
Expand All @@ -513,7 +513,7 @@ private ObservableList<SyncTableElement> setTrainerData() {
}
catch (Exception e) {
logException(e, "Sync failed");
showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.message");
context.showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.message");
}

//sectionList: if "all sections" is chosen, all section-directories are stored. -> Needed to detect new
Expand Down Expand Up @@ -656,7 +656,7 @@ private ObservableList<SyncTableElement> setTrainerData() {
}
} catch (Exception e) {
logException(e, "Sync failed");
showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.message");
context.showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.message");
}

courseData = data;
Expand Down Expand Up @@ -730,12 +730,12 @@ private void downloadCourse() {
private void onSync() {
//Several security checks to prevent unwanted behaviour.
if (config.getRecentCourse() == null) {
showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.course.message");
context.showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.course.message");
return;
}
//Checks whether Root-Directory is existing.
if (!Files.isDirectory(Paths.get(config.getSyncRootPath()))) {
showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.path.message");
context.showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.path.message");
return;
}
//Calls the API-Call functions depending on the "selected" property and the MoodleAction.
Expand All @@ -759,7 +759,7 @@ else if (courseData.getAction() != MoodleAction.UploadSection) {
catch (Exception e) {
logException(e, "Sync failed");

showNotification(NotificationType.ERROR, "start.sync.error.title",
context.showNotification(NotificationType.ERROR, "start.sync.error.title",
MessageFormat.format(context.getDictionary().get("start.sync.error.upload.message"),
courseData.getModuleName()));
}
Expand All @@ -774,7 +774,7 @@ else if (courseData.getAction() != MoodleAction.UploadSection) {
catch (Exception e) {
logException(e, "Sync failed");

showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.upload" +
context.showNotification(NotificationType.ERROR, "start.sync.error.title", "start.sync.error.upload" +
".message");
}
}
Expand Down

0 comments on commit ac5c5db

Please sign in to comment.