ValveSoftware / vogl

OpenGL capture / playback debugger.
MIT License
1.42k stars 126 forks source link

UI: Use signal when modifying groups settings #179

Closed lawlove closed 9 years ago

lawlove commented 9 years ago

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":

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 vogleditorsettings.{h,cpp} to vogleditorq 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 lawrencex.l.love@intel.com

PeterLValve commented 9 years ago

I think that's a brilliant solution and definitely in-line with the way that Qt is intended to be used. I like it! Yes, Feel free to do the rename, if you do it as a git mv, then the file history should be retained correctly.

lawlove commented 9 years ago

Done.

I made the changes on top of the previous commit but it wouldn't push; had to do a merge. I could probably have done a force push just as well.

lawlove commented 9 years ago

Hmmm - I see two of the same in this pull request...?

UI: Use signal when modifying groups settings … 43a4cf7 UI: Use signal when modifying groups settings … a5d6673

lawlove commented 9 years ago

A diff shows there is no difference between those two. I can try rebasing to get rid of the extra one and ... Shall I close this one, delete the branch and submit a separate pull request branch?

lawlove commented 9 years ago

A diff shows there's no difference in the source files but I found the commit messages are slightly different (I do remember editing the message but didn't realize a new SHA# was created - but it makes sense that it would do that)

lawlove commented 9 years ago

Close this one and replace with #180