mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
Add RiuTools with function for default window flags
This commit is contained in:
parent
f3a05994ad
commit
1d9d8f6794
@ -25,6 +25,7 @@
|
||||
#include "RimWellLogPlot.h"
|
||||
|
||||
#include "RiuMainPlotWindow.h"
|
||||
#include "RiuTools.h"
|
||||
|
||||
#include "cafSelectionManagerTools.h"
|
||||
|
||||
@ -105,7 +106,7 @@ void RiuQPlainTextEdit::slotSelectAll()
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicTextWidget::RicTextWidget(QWidget* parent)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
||||
: QDialog(parent, RiuTools::defaultDialogFlags())
|
||||
{
|
||||
m_textEdit = new RiuQPlainTextEdit(this);
|
||||
m_textEdit->setReadOnly(true);
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "RimScriptCollection.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuTools.h"
|
||||
|
||||
#include "cafUtils.h"
|
||||
|
||||
@ -85,7 +86,13 @@ void RicNewScriptFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
|
||||
bool ok;
|
||||
fullPathFilenameNewScript = QInputDialog::getText(NULL, "Specify new script file", "File name", QLineEdit::Normal, fullPathFilenameNewScript, &ok);
|
||||
fullPathFilenameNewScript = QInputDialog::getText(NULL,
|
||||
"Specify new script file",
|
||||
"File name",
|
||||
QLineEdit::Normal,
|
||||
fullPathFilenameNewScript,
|
||||
&ok,
|
||||
RiuTools::defaultDialogFlags());
|
||||
|
||||
if (ok && !fullPathFilenameNewScript.isEmpty())
|
||||
{
|
||||
|
@ -25,26 +25,29 @@
|
||||
|
||||
#include "RiuMainPlotWindow.h"
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
#include "RiuTools.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QTextEdit>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QPushButton>
|
||||
#include "qwt_scale_draw.h"
|
||||
#include <qwt_plot.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_plot_histogram.h>
|
||||
#include <qwt_series_data.h>
|
||||
#include <qwt_plot_marker.h>
|
||||
#include <qwt_series_data.h>
|
||||
#include <qwt_symbol.h>
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QTextEdit>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include <vector>
|
||||
#include "qwt_scale_draw.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicGridStatisticsDialog::RicGridStatisticsDialog(QWidget* parent)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
||||
: QDialog(parent, RiuTools::defaultDialogFlags())
|
||||
{
|
||||
// Create widgets
|
||||
m_label = new QLabel();
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
#include "RimSummaryCalculation.h"
|
||||
|
||||
#include "RiuTools.h"
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QVBoxLayout>
|
||||
#include <QMessageBox>
|
||||
@ -32,7 +34,7 @@
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCurveCalculatorDialog::RicSummaryCurveCalculatorDialog(QWidget* parent)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
||||
: QDialog(parent, RiuTools::defaultDialogFlags())
|
||||
{
|
||||
setWindowTitle("Summary Curve Calculator");
|
||||
resize(1200, 800);
|
||||
|
@ -42,8 +42,9 @@
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
|
||||
#include "RiuMainPlotWindow.h"
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
#include "RiuSummaryCurveDefSelection.h"
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
#include "RiuTools.h"
|
||||
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
@ -655,7 +656,12 @@ void RicSummaryCurveCreator::createNewPlot()
|
||||
{
|
||||
candidatePlotName = QString("Summary Plot %1").arg(summaryPlotColl->summaryPlots().size() + 1);
|
||||
bool ok = false;
|
||||
candidatePlotName = QInputDialog::getText(NULL, "New Summary Plot Name", "New Summary Plot Name", QLineEdit::Normal, candidatePlotName, &ok);
|
||||
candidatePlotName = QInputDialog::getText(NULL,
|
||||
"New Summary Plot Name", "New Summary Plot Name",
|
||||
QLineEdit::Normal,
|
||||
candidatePlotName,
|
||||
&ok,
|
||||
RiuTools::defaultDialogFlags());
|
||||
if (!ok)
|
||||
{
|
||||
return;
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "RicSummaryCurveCreatorSplitterUi.h"
|
||||
|
||||
#include "RiuMainPlotWindow.h"
|
||||
#include "RiuTools.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
|
||||
@ -31,7 +32,7 @@
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCurveCreatorDialog::RicSummaryCurveCreatorDialog(QWidget* parent)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
||||
: QDialog(parent, RiuTools::defaultDialogFlags())
|
||||
{
|
||||
m_curveCreatorSplitterUi = new RicSummaryCurveCreatorSplitterUi(this);
|
||||
|
||||
|
@ -63,6 +63,7 @@ ${CEE_CURRENT_LIST_DIR}RiuSummaryVectorDescriptionMap.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuExpressionContextMenuManager.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuCalculationsContextMenuManager.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuGridStatisticsHistogramWidget.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuTools.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -122,6 +123,7 @@ ${CEE_CURRENT_LIST_DIR}RiuSummaryVectorDescriptionMap.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiuExpressionContextMenuManager.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiuCalculationsContextMenuManager.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiuGridStatisticsHistogramWidget.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiuTools.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include "RimPerforationCollection.h"
|
||||
|
||||
#include "RiuTools.h"
|
||||
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafPdmUiTableView.h"
|
||||
#include "cafSelectionManager.h"
|
||||
@ -37,7 +39,7 @@
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuEditPerforationCollectionWidget::RiuEditPerforationCollectionWidget(QWidget* parent, RimPerforationCollection* perforationCollection)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
: QDialog(parent, RiuTools::defaultDialogFlags()),
|
||||
m_perforationCollection(perforationCollection)
|
||||
{
|
||||
setWindowTitle("Edit Perforation Intervals");
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "RimProject.h"
|
||||
#include "RimView.h"
|
||||
|
||||
#include "RiuTools.h"
|
||||
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafPdmUiTableView.h"
|
||||
#include "cafSelectionManager.h"
|
||||
@ -51,7 +53,7 @@
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuExportMultipleSnapshotsWidget::RiuExportMultipleSnapshotsWidget(QWidget* parent, RimProject* project)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
: QDialog(parent, RiuTools::defaultDialogFlags()),
|
||||
m_rimProject(project)
|
||||
{
|
||||
setWindowTitle("Export Multiple Snapshots");
|
||||
|
@ -17,13 +17,18 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiuMultiCaseImportDialog.h"
|
||||
#include "ui_RiuMultiCaseImportDialog.h"
|
||||
#include <QFileSystemModel>
|
||||
#include <QFileDialog>
|
||||
#include <QStringListModel>
|
||||
#include <QFileIconProvider>
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RiuTools.h"
|
||||
|
||||
#include "ui_RiuMultiCaseImportDialog.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QFileIconProvider>
|
||||
#include <QFileSystemModel>
|
||||
#include <QStringListModel>
|
||||
|
||||
class FileListModel: public QStringListModel
|
||||
{
|
||||
public:
|
||||
@ -76,7 +81,7 @@ private:
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuMultiCaseImportDialog::RiuMultiCaseImportDialog(QWidget *parent /*= 0*/)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
||||
: QDialog(parent, RiuTools::defaultDialogFlags())
|
||||
{
|
||||
ui = new Ui::RiuMultiCaseImportDialog;
|
||||
ui->setupUi(this);
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "RiuSummaryCurveDefSelection.h"
|
||||
#include "RiuSummaryCurveDefSelectionEditor.h"
|
||||
#include "RiuTools.h"
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QDialogButtonBox>
|
||||
@ -32,7 +33,7 @@
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuSummaryCurveDefSelectionDialog::RiuSummaryCurveDefSelectionDialog(QWidget* parent)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
||||
: QDialog(parent, RiuTools::defaultDialogFlags())
|
||||
{
|
||||
m_addrSelWidget = std::unique_ptr<RiuSummaryCurveDefSelectionEditor>(new RiuSummaryCurveDefSelectionEditor());
|
||||
QWidget* addrWidget = m_addrSelWidget->getOrCreateWidget(this);
|
||||
|
29
ApplicationCode/UserInterface/RiuTools.cpp
Normal file
29
ApplicationCode/UserInterface/RiuTools.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RiuTools.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Qt::WindowFlags RiuTools::defaultDialogFlags()
|
||||
{
|
||||
Qt::WindowFlags f = Qt::WindowTitleHint | Qt::WindowSystemMenuHint;
|
||||
|
||||
return f;
|
||||
}
|
26
ApplicationCode/UserInterface/RiuTools.h
Normal file
26
ApplicationCode/UserInterface/RiuTools.h
Normal file
@ -0,0 +1,26 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "qnamespace.h"
|
||||
|
||||
namespace RiuTools
|
||||
{
|
||||
Qt::WindowFlags defaultDialogFlags();
|
||||
} // end namespace RiuTools
|
Loading…
Reference in New Issue
Block a user