Skip to content

Commit adaf394

Browse files
authored
Removed ShowNotification and NotifyWindow
Removed code that was not being used.
1 parent 4c35c2f commit adaf394

8 files changed

Lines changed: 2 additions & 805 deletions

File tree

Src/Common/FwUtils/EventConstants.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public static class EventConstants
4242
public const string SetInitialContentObject = "SetInitialContentObject";
4343
public const string SetToolFromName = "SetToolFromName";
4444
public const string SFMImport = "SFMImport";
45-
public const string ShowNotification = "ShowNotification";
4645
public const string StopParser = "StopParser";
4746
/// <summary>
4847
/// Called before opening and after closing UploadToWebonaryDlg to prevent bits of the main window from reloading (comment on LT-21480).

Src/LexText/ParserCore/ParserScheduler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ private void HandleTaskUpdate(TaskReport task)
315315
if (IsDisposed)
316316
return;
317317

318-
if (ParserUpdateNormal != null && ((task.Depth == 0) || (task.NotificationMessage != null)))
318+
if (ParserUpdateNormal != null && task.Depth == 0)
319319
{
320320
//notify any delegates
321321
ParserUpdateNormal(this, new ParserUpdateEventArgs(task));

Src/LexText/ParserCore/TaskReport.cs

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace SIL.FieldWorks.WordWorks.Parser
1414
/// </summary>
1515
public sealed class TaskReport : IDisposable
1616
{
17-
public enum TaskPhase {Started, Working, Finished, ErrorEncountered};
17+
public enum TaskPhase {Started, Finished, ErrorEncountered};
1818

1919
private readonly Action<TaskReport> m_taskUpdate;
2020
private List<TaskReport> m_subTasks;
@@ -23,7 +23,6 @@ public enum TaskPhase {Started, Working, Finished, ErrorEncountered};
2323
private long m_finish;
2424
private TaskPhase m_phase;
2525
private TaskReport m_owningTask;
26-
private string m_notificationMessage;
2726
private bool m_isInDispose; // ture if we're in the dispose method
2827
/// <summary>
2928
/// this was added to hold the results of a trace request
@@ -156,7 +155,6 @@ private void Dispose(bool disposing)
156155
m_owningTask = null;
157156
m_details = null;
158157
m_description = null;
159-
m_notificationMessage = null;
160158
m_subTasks = null;
161159

162160
m_isDisposed = true;
@@ -273,28 +271,6 @@ private void InformListeners(TaskReport task)
273271
m_owningTask.InformListeners(this);
274272
}
275273

276-
/// <summary>
277-
/// a message to pass to the client which is not quite an error, but which warrants telling the user in a
278-
/// non intrusive fashion.
279-
/// </summary>
280-
public string NotificationMessage
281-
{
282-
get
283-
{
284-
CheckDisposed();
285-
286-
return m_notificationMessage;
287-
}
288-
set
289-
{
290-
CheckDisposed();
291-
292-
m_notificationMessage = value;
293-
if (value != null)
294-
InformListeners(TaskPhase.Working);
295-
}
296-
}
297-
298274
public TaskPhase Phase
299275
{
300276
get

Src/LexText/ParserUI/ParserConnection.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public sealed class ParserConnection : DisposableBase, IAsyncResult
2323
private readonly ParserScheduler m_scheduler;
2424

2525
private string m_activity;
26-
private string m_notificationMessage;
2726
private XDocument m_traceResult;
2827
private readonly ManualResetEvent m_event = new ManualResetEvent(false);
2928

@@ -155,9 +154,6 @@ public void ParserUpdateHandlerForPolling(object sender, ParserUpdateEventArgs a
155154
m_activity = args.Task.Description;
156155
if (args.Task.Phase == TaskReport.TaskPhase.Finished)
157156
m_activity = "";
158-
//keeps us from getting the notification at the end of the task.
159-
if (args.Task.NotificationMessage != null && args.Task.Phase != TaskReport.TaskPhase.Finished)
160-
m_notificationMessage = args.Task.NotificationMessage;
161157

162158
//will have to do something more smart something when details is used for something else
163159
if (args.Task.Details != null)
@@ -184,22 +180,6 @@ public string Activity
184180
}
185181
}
186182

187-
/// <summary>
188-
/// gives a notification string, if there is any.
189-
/// </summary>
190-
/// <returns></returns>
191-
public string GetAndClearNotification()
192-
{
193-
CheckDisposed();
194-
195-
lock (SyncRoot)
196-
{
197-
string result = m_notificationMessage;
198-
m_notificationMessage = null;
199-
return result;
200-
}
201-
}
202-
203183
#region Implementation of IAsyncResult
204184

205185
bool IAsyncResult.IsCompleted

Src/LexText/ParserUI/ParserListener.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,6 @@ private void UpdateStatusPanelProgress()
228228
ErrorReporter.ReportException(ex, app.SettingsKey, app.SupportEmailAddress,
229229
app.ActiveMainWindow, false);
230230
}
231-
else
232-
{
233-
string notification = m_parserConnection.GetAndClearNotification();
234-
if (notification != null)
235-
{
236-
#pragma warning disable 618 // suppress obsolete warning
237-
m_mediator.SendMessage("ShowNotification", notification);
238-
#pragma warning restore 618
239-
}
240-
}
241231
}
242232
if (ParserActivityString == ParserUIStrings.ksIdle_ && m_timer.Enabled)
243233
StopUpdateProgressTimer();

0 commit comments

Comments
 (0)