dde-dock/plugins/dcc-dock-plugin/config_watcher.h
范朋程 a3552ea728 feat: 个性化插件页面支持通过DTK配置管理控制中心页面元素的显示与否
个性化插件页面支持通过DTK配置管理控制中心页面元素的显示与否

Log:
Influence: 支持DTK配置管理
Task: https://pms.uniontech.com/zentao/task-view-91289.html
Change-Id: I350c0bdb0c32595747a594fd8d59862dd840bf34
2021-11-18 10:17:06 +08:00

60 lines
1.5 KiB
C++

/*
* Copyright (C) 2011 ~ 2021 Uniontech Technology Co., Ltd.
*
* Author: fanpengcheng <fanpengcheng@uniontech.com>
*
* Maintainer: fanpengcheng <fanpengcheng@uniontech.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GSETTINGWATCHER_H
#define GSETTINGWATCHER_H
#include <dtkcore_global.h>
#include <QObject>
#include <QHash>
#include <QMap>
class QGSettings;
class QListView;
class QStandardItem;
DCORE_BEGIN_NAMESPACE
class DConfig;
DCORE_END_NAMESPACE
namespace dcc_dock_plugin {
class ConfigWatcher : public QObject
{
Q_OBJECT
public:
ConfigWatcher(const QString &fileName, QObject *parent = nullptr);
~ConfigWatcher();
void bind(const QString &key, QWidget *binder);
private:
void setStatus(const QString &key, QWidget *binder);
void onStatusModeChanged(const QString &key);
private:
QMultiHash<QString, QWidget *> m_map;
DTK_CORE_NAMESPACE::DConfig *m_config;
};
}
#endif // GSETTINGWATCHER_H