Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Src/Common/FwUtils/EventConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public static class EventConstants
public const string SetInitialContentObject = "SetInitialContentObject";
public const string SetToolFromName = "SetToolFromName";
public const string SFMImport = "SFMImport";
public const string ShowNotification = "ShowNotification";
public const string StopParser = "StopParser";
/// <summary>
/// Called before opening and after closing UploadToWebonaryDlg to prevent bits of the main window from reloading (comment on LT-21480).
Expand Down
2 changes: 1 addition & 1 deletion Src/LexText/ParserCore/ParserScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ private void HandleTaskUpdate(TaskReport task)
if (IsDisposed)
return;

if (ParserUpdateNormal != null && ((task.Depth == 0) || (task.NotificationMessage != null)))
if (ParserUpdateNormal != null && task.Depth == 0)
{
//notify any delegates
ParserUpdateNormal(this, new ParserUpdateEventArgs(task));
Expand Down
26 changes: 1 addition & 25 deletions Src/LexText/ParserCore/TaskReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace SIL.FieldWorks.WordWorks.Parser
/// </summary>
public sealed class TaskReport : IDisposable
{
public enum TaskPhase {Started, Working, Finished, ErrorEncountered};
public enum TaskPhase {Started, Finished, ErrorEncountered};

private readonly Action<TaskReport> m_taskUpdate;
private List<TaskReport> m_subTasks;
Expand All @@ -23,7 +23,6 @@ public enum TaskPhase {Started, Working, Finished, ErrorEncountered};
private long m_finish;
private TaskPhase m_phase;
private TaskReport m_owningTask;
private string m_notificationMessage;
private bool m_isInDispose; // ture if we're in the dispose method
/// <summary>
/// this was added to hold the results of a trace request
Expand Down Expand Up @@ -156,7 +155,6 @@ private void Dispose(bool disposing)
m_owningTask = null;
m_details = null;
m_description = null;
m_notificationMessage = null;
m_subTasks = null;

m_isDisposed = true;
Expand Down Expand Up @@ -273,28 +271,6 @@ private void InformListeners(TaskReport task)
m_owningTask.InformListeners(this);
}

/// <summary>
/// a message to pass to the client which is not quite an error, but which warrants telling the user in a
/// non intrusive fashion.
/// </summary>
public string NotificationMessage
{
get
{
CheckDisposed();

return m_notificationMessage;
}
set
{
CheckDisposed();

m_notificationMessage = value;
if (value != null)
InformListeners(TaskPhase.Working);
}
}

public TaskPhase Phase
{
get
Expand Down
20 changes: 0 additions & 20 deletions Src/LexText/ParserUI/ParserConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public sealed class ParserConnection : DisposableBase, IAsyncResult
private readonly ParserScheduler m_scheduler;

private string m_activity;
private string m_notificationMessage;
private XDocument m_traceResult;
private readonly ManualResetEvent m_event = new ManualResetEvent(false);

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

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

/// <summary>
/// gives a notification string, if there is any.
/// </summary>
/// <returns></returns>
public string GetAndClearNotification()
{
CheckDisposed();

lock (SyncRoot)
{
string result = m_notificationMessage;
m_notificationMessage = null;
return result;
}
}

#region Implementation of IAsyncResult

bool IAsyncResult.IsCompleted
Expand Down
10 changes: 0 additions & 10 deletions Src/LexText/ParserUI/ParserListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,6 @@ private void UpdateStatusPanelProgress()
ErrorReporter.ReportException(ex, app.SettingsKey, app.SupportEmailAddress,
app.ActiveMainWindow, false);
}
else
{
string notification = m_parserConnection.GetAndClearNotification();
if (notification != null)
{
#pragma warning disable 618 // suppress obsolete warning
m_mediator.SendMessage("ShowNotification", notification);
#pragma warning restore 618
}
}
}
if (ParserActivityString == ParserUIStrings.ksIdle_ && m_timer.Enabled)
StopUpdateProgressTimer();
Expand Down
Loading
Loading