Skip to content

Commit

Permalink
adds enhancement issue #9
Browse files Browse the repository at this point in the history
  • Loading branch information
EdLoach committed Feb 2, 2019
1 parent d5f3b40 commit 870cdd8
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 17 deletions.
41 changes: 28 additions & 13 deletions CheckPublicTransportRelations/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 25 additions & 4 deletions CheckPublicTransportRelations/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1975,7 +1975,8 @@ private void ShowMatchedStopsCheckBox_CheckedChanged(object sender, EventArgs e)
? this.RouteBusStops
: this.RouteBusStops.Where(item => item.NamesMatch == false)
.ToList();

this.downloadUnmatchedStopsButton.Visible =
!this.showMatchedStopsCheckBox.Checked && this.stopsDataGridView.Rows.Count > 0;
Settings.Default.ShowMatchedStops = this.showMatchedStopsCheckBox.Checked;
Settings.Default.Save();
}
Expand All @@ -1996,7 +1997,7 @@ private void StopsDataGridView_CellContentClick(object sender, DataGridViewCellE
return;
}

string value = "http://127.0.0.1:8111/load_object?new_layer=false&objects=n"
string value = "http://127.0.0.1:8111/zoom?left=0&right=0&top=0&bottom=0&select=n"
+ this.stopsDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
Process.Start(value);
}
Expand Down Expand Up @@ -2024,7 +2025,7 @@ private void StopsDataGridView_SelectionChanged(object sender, EventArgs e)
}
}

this.AddNodeButton.Visible = false;
this.addNodeButton.Visible = false;
if (this.travelineStopsDataGridView.SelectedCells.Count > 0)
{
if (this.OverpassBusStops != null)
Expand All @@ -2036,7 +2037,7 @@ private void StopsDataGridView_SelectionChanged(object sender, EventArgs e)
if (naptanStop != null)
{
travelineStopName = naptanStop.JourneyStopName;
this.AddNodeButton.Visible = true;
this.addNodeButton.Visible = true;
}
}
}
Expand Down Expand Up @@ -2232,5 +2233,25 @@ private void AddNodeButton_Click(object sender, EventArgs e)

Process.Start(remoteCommand.ToString());
}

// ===========================================================================================================
/// <createdBy>EdLoach - 2 February 2019 (1.1.0.0)</createdBy>
///
/// <summary>Event handler. Called by downloadUnmatchedStopsButton for click events.</summary>
///
/// <param name="sender">Source of the event.</param>
/// <param name="e"> Event information.</param>
// ===========================================================================================================
private void DownloadUnmatchedStopsButton_Click(object sender, EventArgs e)
{
if (this.showMatchedStopsCheckBox.Checked != false || this.stopsDataGridView.Rows.Count <= 0)
{
return;
}

string value = this.stopsDataGridView.Rows.Cast<DataGridViewRow>().Aggregate("http://127.0.0.1:8111/load_object?new_layer=false&objects=", (current, row) => current + "n" + row.Cells[this.stopsDataGridView.Columns["stopIdColumn"].Index].Value + ",");
value = value.Substring(0, value.Length - 1);
Process.Start(value);
}
}
}

0 comments on commit 870cdd8

Please sign in to comment.