Use Qt signals to process configuration name changes

This change maintains the encapsulation  of the MultiSettings class by
using  a  signal   to  notify  clients  of  changes   to  the  current
configuration name.

Modifications  to   the  MainWindow  class  to   display  the  current
configuration name in the status bar, if it is not "Default", based on
MultiSettings events rather than polling for changes.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7257 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville
2016-10-28 17:15:04 +00:00
parent 5fb0b05198
commit cfb1a3cbe2
4 changed files with 43 additions and 17 deletions
+7
View File
@@ -1,6 +1,7 @@
#ifndef MULTISETTINGS_HPP__
#define MULTISETTINGS_HPP__
#include <QObject>
#include <QVariant>
#include "pimpl_h.hpp"
@@ -59,7 +60,10 @@ class QString;
//
class MultiSettings
: public QObject
{
Q_OBJECT
public:
explicit MultiSettings ();
MultiSettings (MultiSettings const&) = delete;
@@ -86,6 +90,9 @@ public:
// again.
bool exit ();
// emitted when the name of the current configuration changes
Q_SIGNAL void configurationNameChanged (QString const& name) const;
private:
class impl;
pimpl<impl> m_;