Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Commit

Permalink
Fix bug where editing sections were off index when they were on multi…
Browse files Browse the repository at this point in the history
…ple semesters
  • Loading branch information
morinted committed May 30, 2014
1 parent 5183c21 commit cb3c881
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ University of Ottawa students have no easy way to generate a conflict-free, opti

Now that that class is done, we are continuing development on the project, as it is a useful utility when working with uOttawa's Rabaska course-registration system.

## [Download](https://github.com/morinted/schedule-generator/releases/download/v1.0.2/uOttawa-Schedule-Generator-v1.0.2.jar)
## [Download](https://github.com/morinted/schedule-generator/releases/download/v1.1.0/uOttawa-Schedule-Generator-v1.1.0.jar)

If you just want to get started generating schedules right away, then [download the program for Windows, Mac, and Linux](https://github.com/morinted/schedule-generator/releases/download/v1.0.2/uOttawa-Schedule-Generator-v1.0.2.jar). Note that you need Java to run the .jar file. Check out the user's guide below if you get confused while using the program.
If you just want to get started generating schedules right away, then [download the program for Windows, Mac, and Linux](https://github.com/morinted/schedule-generator/releases/download/v1.1.0/uOttawa-Schedule-Generator-v1.1.0.jar). Note that you need Java to run the .jar file. Check out the user's guide below if you get confused while using the program.

## Features

Expand Down
19 changes: 15 additions & 4 deletions schedule-generator/ca/uottawa/ui/ClientGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ public static void main(String[] args) {
{
port = DEFAULT_PORT; //Else default to the default port.
}
new ClientGUI("uOttawa Schedule Generator - v1.0.2", host, port);
new ClientGUI("uOttawa Schedule Generator - v1.1.0", host, port);
}

/**
Expand Down Expand Up @@ -914,7 +914,6 @@ public void run() {
clear();
btnPrint.setEnabled(false);
btnExport.setEnabled(false);
System.out.println("Clearing");
} else {
if (schedules.size() == 1000) {
display("There were more than 1000 results. Narrow your search to see other options.");
Expand Down Expand Up @@ -1071,6 +1070,18 @@ public void editCourse(Course edit, String semester) {
editSections.add(s);
}
}

List<Section> sectionsToRemove = new ArrayList<Section>();
for (Section s: edit.getSections()) {
if (!s.getSemester().equals(semester)) {
sectionsToRemove.add(s);
}
}
while (!sectionsToRemove.isEmpty()) {
Section toRemove = sectionsToRemove.get(0);
sectionsToRemove.remove(0);
toRemove.delete();
}
courseEditing = edit;

//Now edit sections contains the current semester's lists.
Expand Down Expand Up @@ -1189,8 +1200,8 @@ public void actionPerformed(ActionEvent e) {

Dimension preferred = editFrame.getPreferredSize();
if (preferred.height > EDIT_HEIGHT) {
preferred.height = EDIT_HEIGHT;
preferred.width+=20; //This is to handle the extra width of the scrollbar.
preferred.height = EDIT_HEIGHT+20;
preferred.width+=40; //This is to handle the extra width of the scrollbar.
}


Expand Down

0 comments on commit cb3c881

Please sign in to comment.