mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1852 Curve Creator : Add RicSummaryCurveCreatorUi
This commit is contained in:
@@ -23,6 +23,7 @@ ${CEE_CURRENT_LIST_DIR}RicPasteTimeHistoryCurveFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicPasteAsciiDataCurveFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicEditSummaryCurves.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreator.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorUi.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@@ -43,6 +44,7 @@ ${CEE_CURRENT_LIST_DIR}RicPasteTimeHistoryCurveFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicPasteAsciiDataCurveFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicEditSummaryCurves.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreator.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorUi.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
@@ -17,9 +17,13 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicEditSummaryCurves.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RicSummaryCurveCreator.h"
|
||||
#include "RicSummaryCurveCreatorUi.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
|
||||
#include <QAction>
|
||||
@@ -53,6 +57,10 @@ void RicEditSummaryCurves::onActionTriggered(bool isChecked)
|
||||
if(!m_dialog->isVisible())
|
||||
m_dialog->show();
|
||||
|
||||
|
||||
RicSummaryCurveCreatorUi summaryCurveCreator(nullptr, m_curveCreator);
|
||||
summaryCurveCreator.exec();
|
||||
|
||||
// openSelector(summaryCase);
|
||||
}
|
||||
|
||||
|
||||
@@ -156,6 +156,7 @@ RicSummaryCurveCreator::RicSummaryCurveCreator() : m_selectedIdentifiers(
|
||||
for (const auto& itemInputType : itemTypes.second)
|
||||
{
|
||||
itemInputType->pdmField()->uiCapability()->setUiEditorTypeName(caf::PdmUiTreeSelectionEditor::uiEditorTypeName());
|
||||
itemInputType->pdmField()->uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicSummaryCurveCreatorUi.h"
|
||||
|
||||
#include "RicSummaryCurveCreator.h"
|
||||
|
||||
#include "RiuCustomObjectEditor.h"
|
||||
|
||||
#include <QBoxLayout>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCurveCreatorUi::RicSummaryCurveCreatorUi(QWidget* parent, RicSummaryCurveCreator* summaryCurveCreator)
|
||||
: QDialog(parent),
|
||||
m_summaryCurveCreator(summaryCurveCreator)
|
||||
{
|
||||
m_customObjectEditor = new RiuCustomObjectEditor;
|
||||
m_customObjectEditor->defineGridLayout(4, 2);
|
||||
|
||||
QWidget* propertyWidget = m_customObjectEditor->getOrCreateWidget(this);
|
||||
|
||||
QVBoxLayout* dummy = new QVBoxLayout(this);
|
||||
dummy->setContentsMargins(0, 0, 0, 0);
|
||||
dummy->addWidget(propertyWidget);
|
||||
|
||||
m_customObjectEditor->setPdmObject(m_summaryCurveCreator);
|
||||
m_customObjectEditor->updateUi();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCurveCreatorUi::~RicSummaryCurveCreatorUi()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class RicSummaryCurveCreator;
|
||||
class RiuCustomObjectEditor;
|
||||
|
||||
class RicSummaryCurveCreatorUi : public QDialog
|
||||
{
|
||||
public:
|
||||
RicSummaryCurveCreatorUi(QWidget* parent, RicSummaryCurveCreator* summaryCurveCreator);
|
||||
~RicSummaryCurveCreatorUi();
|
||||
|
||||
private:
|
||||
RicSummaryCurveCreator* m_summaryCurveCreator;
|
||||
RiuCustomObjectEditor* m_customObjectEditor;
|
||||
};
|
||||
@@ -132,6 +132,8 @@ QWidget* RiuCustomObjectEditor::createWidget(QWidget* parent)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuCustomObjectEditor::recursivelyConfigureAndUpdateTopLevelUiItems(const std::vector<caf::PdmUiItem*>& topLevelUiItems, const QString& uiConfigName)
|
||||
{
|
||||
if (!m_layout) return;
|
||||
|
||||
resetCellId();
|
||||
|
||||
QWidget* previousTabOrderWidget = NULL;
|
||||
|
||||
Reference in New Issue
Block a user