ValveSoftware/vogl — pull request #179 by lawlove (2014-11-22 03:25:12+00:00)
Title: UI: Use signal when modifying groups settings

When the vogleditor object instantiated a settings dialog (vogleditor_qsettingsdialog object), it would previously go through the following steps if the return status was "accept":

* tell the dialog object to save its self (its data) to the persistent
global vogleditor_settings object
* ask the dialog if the groups attributes had changed
* if true, would call its own function to reset the tree display.

This commit replaces the direct interaction between the vogleditor object and the settings dialog to use Qt's SIGNALS/SLOTS. This also allows any object to register itself to be notified when settings have changed.

The dialog object now handles the saving of its data to the vogleditor_settings object on "accept" and emits a SIGNAL if groups attributes have changed. The signal is connected to the vogleditor_settings object to update its groups data which in turn emits a signal that tells the vogleditor to reset its tree display.

NOTES:
The vogleditor_settings object has been commuted to a Q_OBJECT for SIGNAL/SLOT participation. Following protocol the file should be renamed from vogleditor_settings.{h,cpp} to vogleditor_**q** settings.{h,cpp} but thought I'd wait to see if (1) the commit is accepted and (2) it's OK to do the rename.

Signed-off-by: Lawrence L Love