forked from linuxdeepin/dtkwidget
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. 增加特性对话框类接口; 2. dapplication增加特性对话框相关接口; 3. 重新布局关于对话框; Log: 新增特性介绍功能 Task: https://pms.uniontech.com/task-view-227391.html Influence: 特性介绍,关于介绍 Change-Id: Ie6244bd313bb385846f4c5c066108b65f5afcb4f
- Loading branch information
1 parent
cb689dc
commit 217cfc5
Showing
27 changed files
with
812 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/*! | ||
@~chinese | ||
@file dfeaturedisplaydialog.h | ||
@ingroup dtkwidget | ||
|
||
@class Dtk::Widget::DFeatureItem | ||
@brief 特性介绍中的每项特性 | ||
|
||
@fn explicit Dtk::Widget::DFeatureItem::DFeatureItem(const QIcon &icon, const QString &name, const QString &description, QObject *parent) | ||
@brief 特性项的构造函数 | ||
@param[in] icon 特性项的图标 | ||
@param[in] name 特性项的名称 | ||
@param[in] description 特性项的内容描述 | ||
@param[in] parent 特性项的父对象 | ||
|
||
@fn explicit Dtk::Widget::DFeatureItem::~DFeatureItem() | ||
@brief 特性项的析构函数 | ||
|
||
@fn QIcon Dtk::Widget::DFeatureItem::icon() const | ||
@brief 获取特性项的图标 | ||
@return 特性项的图标 | ||
|
||
@fn void Dtk::Widget::DFeatureItem::setIcon(const QIcon &icon) | ||
@brief 设置特性项的图标 | ||
@param[in] icon 特性项的图标 | ||
|
||
@fn QIcon Dtk::Widget::DFeatureItem::name() const | ||
@brief 获取特性项的名称 | ||
@return 特性项的名称 | ||
|
||
@fn QIcon Dtk::Widget::DFeatureItem::setName(const QString &name) const | ||
@brief 设置特性项的名称 | ||
@param[in] name 特性项的名称 | ||
|
||
@fn QIcon Dtk::Widget::DFeatureItem::description() const | ||
@brief 获取特性项的内容描述 | ||
@return 特性项的内容描述 | ||
|
||
@fn QIcon Dtk::Widget::DFeatureItem::setDescription(const QString &description) const | ||
@brief 设置特性项的内容描述 | ||
@param[in] description 特性项的内容描述 | ||
|
||
@class Dtk::Widget::DFeatureDisplayDialog | ||
@brief 特性介绍对话框,展示应用更新的新特性 | ||
|
||
@fn Dtk::Widget::DFeatureDisplayDialog::DFeatureDisplayDialog(QWidget *parent) | ||
@brief 特性介绍对话框的构造函数 | ||
@param[in] parent 特性介绍对话框的父对象 | ||
|
||
@fn explicit Dtk::Widget::DFeatureDisplayDialog::~DFeatureDisplayDialog() | ||
@brief 特性介绍对话框的析构函数 | ||
|
||
@fn void Dtk::Widget::DFeatureDisplayDialog::setTitle(const QString &title) | ||
@brief 设置特性介绍对话框的主题 | ||
@param[in] title 特性介绍对话框的主题 | ||
|
||
@fn void Dtk::Widget::DFeatureDisplayDialog::addItem(DFeatureItem *item) | ||
@brief 增加特性介绍对话框的特性项 | ||
@param[in] item 特性介绍对话框的特性项 | ||
|
||
@fn void Dtk::Widget::DFeatureDisplayDialog::removeItem(DFeatureItem *item) | ||
@brief 移除特性介绍对话框的特性项 | ||
@param[in] item 特性介绍对话框的特性项 | ||
|
||
@fn void Dtk::Widget::DFeatureDisplayDialog::addItems(QList<DFeatureItem*> items) | ||
@brief 增加多个特性介绍对话框的特性项 | ||
@param[in] items 特性介绍对话框的特性项列表 | ||
|
||
@fn void Dtk::Widget::DFeatureDisplayDialog::clearItems() | ||
@brief 清除特性介绍对话框的所有特性项 | ||
|
||
@fn void Dtk::Widget::DFeatureDisplayDialog::setLinkButtonVisible(bool isVisible) | ||
@brief 设置链接按钮是否可见 | ||
@param[in] isVisible 链接按钮是否可见 | ||
|
||
@fn void Dtk::Widget::DFeatureDisplayDialog::setLinkUrl(const QString &url) | ||
@brief 设置链接按钮链接地址 | ||
@param[in] isVisible 链接按钮的链接地址 | ||
|
||
@fn void Dtk::Widget::DFeatureDisplayDialog::show() | ||
@brief 显示特性介绍对话框 | ||
|
||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
examples/dwidget-examples/collections/org.deepin.dtkwiget.feature-display.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"magic": "dsg.config.override", | ||
"version": "1.0", | ||
"contents": { | ||
"autoDisplayFeature": { | ||
"value": true, | ||
"serial": 1, | ||
"permissions": "readwrite" | ||
}, | ||
"featureUpdated": { | ||
"value": true, | ||
"serial": 1, | ||
"permissions": "readwrite" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "dfeaturedisplaydialog.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. | ||
// | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
|
||
#ifndef DFEATUREDISPLAYDIALOG_H | ||
#define DFEATUREDISPLAYDIALOG_H | ||
|
||
#include <DDialog> | ||
|
||
class QLabel; | ||
DWIDGET_BEGIN_NAMESPACE | ||
|
||
class DFeatureItemPrivate; | ||
class DFeatureItem :public QObject, public DTK_CORE_NAMESPACE::DObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit DFeatureItem(const QIcon &icon = QIcon(), const QString &name = QString(), | ||
const QString &description = QString(), QObject *parent = nullptr); | ||
~DFeatureItem() override; | ||
|
||
QIcon icon() const; | ||
void setIcon(const QIcon &icon); | ||
|
||
QString name() const; | ||
void setName(const QString &name); | ||
|
||
QString description() const; | ||
void setDescription(const QString &description); | ||
|
||
private: | ||
D_DECLARE_PRIVATE(DFeatureItem) | ||
}; | ||
|
||
class DFeatureDisplayDialogPrivate; | ||
class DFeatureDisplayDialog : public DDialog | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit DFeatureDisplayDialog(QWidget *parent = nullptr); | ||
~DFeatureDisplayDialog() override; | ||
|
||
void setTitle(const QString &title); | ||
void addItem(DFeatureItem *item); | ||
void removeItem(DFeatureItem* item); | ||
void addItems(QList<DFeatureItem*> items); | ||
void clearItems(); | ||
void setLinkButtonVisible(bool isVisible); | ||
void setLinkUrl(const QString &url); | ||
void show(); | ||
|
||
private: | ||
D_DECLARE_PRIVATE(DFeatureDisplayDialog) | ||
D_PRIVATE_SLOT(void _q_toggleLinkBtn()) | ||
|
||
}; | ||
|
||
DWIDGET_END_NAMESPACE | ||
|
||
#endif // DFEATUREDISPLAYDIALOG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"magic": "dsg.config.meta", | ||
"version": "1.0", | ||
"contents": { | ||
"featureUpdated": { | ||
"value": false, | ||
"serial": 0, | ||
"flags": [], | ||
"name": "Whether the application has new feature updates", | ||
"name[zh_CN]": "配置应用的更新状态", | ||
"description": "Configure the update status of the application", | ||
"permissions": "readwrite", | ||
"visibility": "public" | ||
}, | ||
"autoDisplayFeature": { | ||
"value": false, | ||
"serial": 0, | ||
"flags": [], | ||
"name": "The application automatically display new features once", | ||
"name[zh_CN]": "配置应用是否自动展示一次新特性", | ||
"description": "The application automatically display updated contents once", | ||
"permissions": "readwrite", | ||
"visibility": "public" | ||
} | ||
} | ||
} |
Oops, something went wrong.