uisupport: Provide helpers for dealing with widget changes
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 17 Sep 2018 21:42:37 +0000 (23:42 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
commit900cce213a6ed000b7131a05a0dec7d04b35b023
treea557bff8d211cc1b91aee05168f5ad69228f30e0
parent004c48c0d8c943f366b94651e5a75f5e568f8a57
uisupport: Provide helpers for dealing with widget changes

In many places, we want to connect to a widget's changed signal,
i.e. a signal that is emitted whenever the widget changes. This
requires a great deal of boilerplate especially in settingspages,
since the signal to listen to varies between widget types.

Provide helpers that automate most of this by matching the given
widget against a static list of supported widgets' changed signals,
and connecting automatically. A sprinkle of template magic makes
it very easy to support a bunch of different widget types in a generic
way.

Make use of this feature to get rid of the remaining old-style
connects in SettingsPage. Also migrate a couple of specific
settingspages as proof-of-concept and API validation; others
can follow over time.
src/qtui/settingspages/backlogsettingspage.cpp
src/qtui/settingspages/networkssettingspage.cpp
src/qtui/settingspages/networkssettingspage.h
src/uisupport/CMakeLists.txt
src/uisupport/settingspage.cpp
src/uisupport/widgethelpers.h [new file with mode: 0644]