26 enum EnableProtocolType{
31 Q_ENUM(EnableProtocolType)
36 QString name()
const {
return name_;}
37 QString description()
const {
return description_;}
38 bool enabled()
const {
return enabled_;}
39 void setEnabled(
bool enable) {enabled_ = enable;}
41 EnableProtocolType type()
const;
46 virtual void applyValuePrivate(
bool value) = 0;
52 EnableProtocolType type_;
63 enum EnabledProtocolsColumn {
69 enum EnableProtocolData {
70 DATA_ENABLE = Qt::UserRole,
74 QModelIndex index(
int row,
int column,
75 const QModelIndex & = QModelIndex())
const;
76 QModelIndex parent(
const QModelIndex &)
const;
77 Qt::ItemFlags flags(
const QModelIndex &index)
const;
78 QVariant data(
const QModelIndex &index,
int role)
const;
79 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole);
81 QVariant headerData(
int section, Qt::Orientation orientation,
82 int role = Qt::DisplayRole)
const;
84 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
85 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
89 void applyChanges(
bool writeChanges =
true);
90 static void disableProtocol(
struct _protocol *protocol);
93 static void saveChanges(
bool writeChanges =
true);
123 virtual bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent)
const override;
124 virtual Qt::ItemFlags flags(
const QModelIndex &index)
const override;
126 void setFilter(
const QString& filter, EnabledProtocolsProxyModel::SearchType type,
127 EnabledProtocolItem::EnableProtocolType protocolType);
129 void setItemsEnable(EnabledProtocolsProxyModel::EnableType enable, QModelIndex parent = QModelIndex());
132 bool lessThan(
const QModelIndex &source_left,
const QModelIndex &source_right)
const override;
135 EnabledProtocolsProxyModel::SearchType type_;
136 EnabledProtocolItem::EnableProtocolType protocolType_;
139 bool filterAcceptsSelf(
int sourceRow,
const QModelIndex &sourceParent)
const;
140 bool filterAcceptsChild(
int sourceRow,
const QModelIndex &sourceParent)
const;