baykovr / AVPI

an open source voice command macro software
https://baykovr.github.io/gavpi.html
GNU General Public License v3.0
198 stars 42 forks source link

Implemented centralised logging. #15

Closed Ecky-Thump closed 9 years ago

Ecky-Thump commented 9 years ago

Implemented a trivial, thread-safe logging class: Logging.cs.

Instaniated Logging as GAVPI.Log, with a callback to GAVPI.OnLogMessage() when a log entry is made.

Implement GAVPI.CloseProfileEditor() to complement GAVPI.OpenProfileEditor().

Implement GAVPI.NotifyUnsavedChanges() to prompt a user to save an edited Profile if it remains unsaved. (Typically used prior to Profile-destructive actions, removing same functionality from VI.cs.)

Simplified GAVPI.NewProfile().

Removed the dependancy on a ListView as a status container in VI.cs, modifying VI.load_listen() to accept no parameters and redirecting VI.UpdateStatusLog() to the GAVPI.Log object.

Replaced the ListView control in frmGAVPI.Designer.cs with a ListBox (for the time being, at least). A ListBox can easily be bound to a DataSource - provided by a call to Logging.ToArray().

Updated frmGAVPI.frmGAVPI_Activated() and frmGAVPI.RefreshUI() to source the content of the log ListBox from GAVPI.Log.

I think that's it.