Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* PresentationManangement - Script Overview Dialog Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*
|
||||
* Created by Mike Wille, SLSE, 2017-03-15
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Services/PresentationManagement/pre_dtc.h>
|
||||
#include <Services/PresentationManagement/logger.h>
|
||||
#include <Plugins/PresentationManagement/Gui/Common/preguicommon_export.h>
|
||||
#include <Services/OperatorManagement/opm_dtc.h>
|
||||
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
#include <LtsWidgets/lts_column_filter_proxy_model.h>
|
||||
|
||||
|
||||
namespace PresentationManagement
|
||||
{
|
||||
|
||||
class PREGUICOMMON_EXPORT PresentationManagementDialogModel : public LtsWidgets::LtsAbstractTableModel<Presentation>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Columns
|
||||
{
|
||||
Id = 0,
|
||||
Name,
|
||||
Description,
|
||||
Operator,
|
||||
LastModified,
|
||||
Status
|
||||
};
|
||||
|
||||
explicit PresentationManagementDialogModel(QObject *parent = nullptr);
|
||||
~PresentationManagementDialogModel();
|
||||
|
||||
bool initModel(const std::shared_ptr<Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<OperatorManagement::Interface::Dtc> &opmDtc,
|
||||
const std::function<bool(const Presentation &)> &predicate);
|
||||
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
||||
QVariant data(const QModelIndex &, int) const override;
|
||||
|
||||
protected:
|
||||
bool isFiltered(const Presentation &data, DataModification modType) const override
|
||||
{
|
||||
if (!m_predicate(data))
|
||||
return true;
|
||||
return LtsWidgets::LtsAbstractTableModel<Presentation>::isFiltered(data, modType);
|
||||
}
|
||||
private:
|
||||
std::shared_ptr<OperatorManagement::Interface::Dtc> m_opmDtc;
|
||||
std::function<bool(const Presentation &)> m_predicate;
|
||||
friend class PresentationManagementDialogProxyModel;
|
||||
|
||||
QMap<int, QString> m_users;
|
||||
QVector <int> m_scriptUsers;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
|
||||
|
||||
class PREGUICOMMON_EXPORT PresentationManagementDialogProxyModel final : public LtsWidgets::LtsColumnFilterProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
using LtsWidgets::LtsColumnFilterProxyModel::LtsColumnFilterProxyModel;
|
||||
void setSourceModel(QAbstractItemModel *sourceModel) override;
|
||||
protected:
|
||||
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
|
||||
private:
|
||||
PresentationManagementDialogModel *m_sourceModel = nullptr;
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user