Commit 07ac99fb authored by John Tourtellott's avatar John Tourtellott
Browse files

Add paraview manager to store newt session id

So that project manager can add it to the export dialog
parent 28fa919f
......@@ -12,6 +12,8 @@
#include "smtk/cumulus/jobspanel/cumuluswidget.h"
#include "smtk/cumulus/jobspanel/job.h"
#include "pqApplicationCore.h"
#include <QAction>
#include <QDebug>
#include <QFormLayout>
......@@ -38,14 +40,18 @@ public:
QPushButton* AuthenticateButton;
cumulus::CumulusWidget* CumulusWidget;
// Used to provide NEWT session info to other plugins
QObject* JobsPanelObject;
};
pqCumulusJobsPanel::pqCumulusJobsPanelInternal::pqCumulusJobsPanelInternal()
: MainWidget(0)
, MainLayout(0)
, FirstWidget(0)
, CumulusUrlEdit(0)
, CumulusWidget(0)
: MainWidget(nullptr)
, MainLayout(nullptr)
, FirstWidget(nullptr)
, CumulusUrlEdit(nullptr)
, CumulusWidget(nullptr)
, JobsPanelObject(nullptr)
{
}
......@@ -103,6 +109,16 @@ pqCumulusJobsPanel::pqCumulusJobsPanel(QWidget* parent)
// Finish main widget
this->Internal->MainWidget->setLayout(this->Internal->MainLayout);
this->setWidget(this->Internal->MainWidget);
// Register JobsPanelInfo as a paraview manager, for use by other plugins
auto pqCore = pqApplicationCore::instance();
if (!pqCore)
{
qWarning() << "pqCumulusJobsPanel missing pqApplicationCore";
return;
}
this->Internal->JobsPanelObject = new QObject;
pqCore->registerManager(QString("jobs_panel"), this->Internal->JobsPanelObject);
}
pqCumulusJobsPanel::~pqCumulusJobsPanel()
......@@ -165,6 +181,9 @@ void pqCumulusJobsPanel::requestSimulationResults()
void pqCumulusJobsPanel::receivedNewtSessionId(const QString& sessionId, int lifetime)
{
this->Internal->JobsPanelObject->setProperty("newt_sessionid", sessionId);
// Todo add expiration datetime based on lifetime seconds
this->Internal->SessionIdEdit->setText(sessionId);
bool enable = sessionId.isEmpty();
this->Internal->AuthenticateButton->setEnabled(enable);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment