82 lines
2.4 KiB
C++
Executable File
82 lines
2.4 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* ExerciseManangement - Exercise Edit Party Dialog
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <OperatorManagement/opm_ftc.h>
|
|
#include <OperatorManagement/opm_dtc.h>
|
|
|
|
#include <ExerciseManagement/logger.h>
|
|
#include "exm_edit_visible_parties_model.h"
|
|
#include "exm_edit_adler_visible_parties_model.h"
|
|
#include <LtsWidgets/lts_dialog.h>
|
|
#include <LtsUtilsGuiDds/request_helper.h>
|
|
|
|
|
|
namespace Ui
|
|
{
|
|
class ExerciseEditPartyDialog;
|
|
}
|
|
|
|
namespace LtsSession {
|
|
class LtsSession;
|
|
}
|
|
namespace ExerciseManagement
|
|
{
|
|
// --------------------------------------------------------
|
|
// OperatorManagementEditPartyDialog
|
|
// --------------------------------------------------------
|
|
class ExerciseEditPartyDialog : public LtsWidgets::LtsDialog
|
|
, protected OperatorManagement::Interface::Ftc::OperatorUpdateVisiblePartiesByExerciseReplyHandler
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ExerciseEditPartyDialog(const int operatorId,
|
|
const int exerciseId,
|
|
const QString &menuGroup,
|
|
QWidget *parent = nullptr);
|
|
~ExerciseEditPartyDialog();
|
|
|
|
bool init(LtsSession::LtsSessionDataDds *session);
|
|
void onOperatorUpdateVisiblePartiesByExerciseReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
|
|
|
private:
|
|
void retranslate() override;
|
|
bool apply() override final;
|
|
QByteArray adlerVisiblePartiesToJson() const;
|
|
void setAdlerVisiblePartiesUncheckable();
|
|
|
|
private slots:
|
|
void onContextMenuRequested(const QPoint &position);
|
|
void onSelectAllParties();
|
|
void onUnselectAllParties();
|
|
void onSwitchCheckbox(const QModelIndex &index);
|
|
void onDoubleClicked(const QModelIndex &index);
|
|
|
|
private:
|
|
int m_operatorId;
|
|
int m_exerciseId;
|
|
bool m_visiblePartiesChanged;
|
|
bool m_adlerVisiblePartiesChanged;
|
|
QString m_menuGroup;
|
|
|
|
ExerciseEditVisiblePartiesModel *m_visiblePartiesModel;
|
|
ExerciseEditAdlerVisiblePartiesModel *m_adlerVisiblePartiesModel;
|
|
std::shared_ptr<OperatorManagement::Interface::Dtc> m_opmDtc;
|
|
std::shared_ptr<OperatorManagement::Interface::Ftc> m_opmFtc;
|
|
Ui::ExerciseEditPartyDialog *m_ui;
|
|
LOGGER_T m_logger;
|
|
LtsUtils::RequestHelper *m_requestHelper;
|
|
|
|
bool operatorUpdateVisiblePartiesByExercise(const OperatorManagement::OperatorUpdateVisiblePartiesByExerciseRequest &req);
|
|
};
|
|
|
|
}
|