Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+68
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* PlanChooser - New Plan Dialog - Asks for Plan name
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*
|
||||
* Created by Mike Wille, SLSE, 2017-04-20
|
||||
*/
|
||||
|
||||
#include "new_plan_dialog.h"
|
||||
#include "ui_new_plan_dialog.h"
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <QDateTime>
|
||||
|
||||
namespace InfrastructureManagement
|
||||
{
|
||||
|
||||
NewPlanDialog::NewPlanDialog(LtsSession::LtsSession *session, QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::NewPlanDialog)
|
||||
, m_session(session)
|
||||
, m_logger(getLogger("NewPlanDialog"))
|
||||
{
|
||||
setWindowTitle(tr("Create New Plan"));
|
||||
m_ui->setupUi(this);
|
||||
|
||||
connect(m_ui->pbCreate, &QPushButton::clicked, this, &NewPlanDialog::accept);
|
||||
connect(m_ui->pbCancel, &QPushButton::clicked, this, &NewPlanDialog::reject);
|
||||
|
||||
Qt::WindowFlags wf = Qt::FramelessWindowHint; // make frameless, shadow replaces the border / frame
|
||||
|
||||
//setModal(true);
|
||||
wf |= Qt::Dialog;
|
||||
wf |= Qt::WindowStaysOnTopHint;
|
||||
|
||||
setWindowFlags(wf);
|
||||
|
||||
m_ui->dteBegin->setRetrieveCurrentTimeCallback([this]() { return m_session->partitionTime(); });
|
||||
m_ui->dteEnd->setRetrieveCurrentTimeCallback([this]() { return m_session->partitionTime(); });
|
||||
//m_ui->dteBegin->setMsecsSinceEpoch(QDateTime::currentMSecsSinceEpoch());
|
||||
//m_ui->dteEnd->setMsecsSinceEpoch(QDateTime::currentMSecsSinceEpoch());
|
||||
}
|
||||
|
||||
NewPlanDialog::~NewPlanDialog()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void NewPlanDialog::init(const std::shared_ptr<ForeignGuiComboboxInterface> &ismCbx)
|
||||
{
|
||||
ismCbx->fillScheduleStatusComboBox(m_ui->cbStatus);
|
||||
m_ui->cbStatus->setCurrentIndex(m_ui->cbStatus->findData(ScheduleStatus::Inactive));
|
||||
}
|
||||
|
||||
bool NewPlanDialog::getData(QString &name, qint64 &begin, qint64 &end, int &status)
|
||||
{
|
||||
if (exec() != QDialog::Accepted)
|
||||
return false;
|
||||
|
||||
name = m_ui->lePlanName->text();
|
||||
begin = m_ui->dteBegin->msecsSinceEpoch();
|
||||
end = m_ui->dteEnd->msecsSinceEpoch();
|
||||
status = static_cast<ScheduleStatus::type>(m_ui->cbStatus->currentData().toInt());
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace InfrastructureManagement
|
||||
Reference in new issue
Block a user