mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
2a7892836e
when enabled , user's manual collapsed dictionary will remain collapsed in the successive search until user expand the dictionary again.
42 lines
912 B
C++
42 lines
912 B
C++
#ifndef GLOBAL_GLOBALBROADCASTER_H
|
|
#define GLOBAL_GLOBALBROADCASTER_H
|
|
|
|
#include <QObject>
|
|
#include <vector>
|
|
#include <QWebEngineProfile>
|
|
#include "config.hh"
|
|
|
|
struct ActiveDictIds
|
|
{
|
|
QString word;
|
|
QStringList dictIds;
|
|
};
|
|
|
|
class GlobalBroadcaster : public QObject
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
Config::Preferences * preference;
|
|
QSet<QString> whitelist;
|
|
|
|
public:
|
|
void setPreference( Config::Preferences * _pre );
|
|
Config::Preferences * getPreference();
|
|
GlobalBroadcaster( QObject * parent = nullptr );
|
|
void addWhitelist(QString host);
|
|
bool existedInWhitelist(QString host);
|
|
static GlobalBroadcaster * instance();
|
|
unsigned currentGroupId;
|
|
QString translateLineText{};
|
|
QWebEngineProfile * profile;
|
|
//hold the dictionary id;
|
|
QSet<QString> collapsedDicts;
|
|
|
|
|
|
signals:
|
|
void dictionaryChanges( ActiveDictIds ad );
|
|
void dictionaryClear( ActiveDictIds ad );
|
|
};
|
|
|
|
#endif // GLOBAL_GLOBALBROADCASTER_H
|