mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1018 Added UI for export folder location
This commit is contained in:
parent
b3f294c133
commit
c25384b09c
@ -20,22 +20,26 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimMultiSnapshotDefinition.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimCase.h"
|
||||
#include "RimView.h"
|
||||
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafPdmUiTableView.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QAbstractItemView>
|
||||
#include <QBoxLayout>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMenu>
|
||||
#include <QTableView>
|
||||
#include <QWidget>
|
||||
#include <QPushButton>
|
||||
#include <QTableView>
|
||||
#include <QToolButton>
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -47,6 +51,10 @@ RiuExportMultipleSnapshotsWidget::RiuExportMultipleSnapshotsWidget(QWidget* pare
|
||||
{
|
||||
setWindowTitle("Export Multiple Snapshots");
|
||||
|
||||
int nWidth = 800;
|
||||
int nHeight = 300;
|
||||
resize(nWidth, nHeight);
|
||||
|
||||
QVBoxLayout* dialogLayout = new QVBoxLayout;
|
||||
setLayout(dialogLayout);
|
||||
|
||||
@ -63,6 +71,30 @@ RiuExportMultipleSnapshotsWidget::RiuExportMultipleSnapshotsWidget(QWidget* pare
|
||||
|
||||
dialogLayout->addWidget(m_pdmTableView);
|
||||
|
||||
// Export folder
|
||||
{
|
||||
QHBoxLayout* layout = new QHBoxLayout;
|
||||
|
||||
layout->addWidget(new QLabel("Export folder"));
|
||||
|
||||
// Save images in snapshot catalog relative to project directory
|
||||
QString snapshotFolderName = RiaApplication::instance()->createAbsolutePathFromProjectRelativePath("snapshots");
|
||||
|
||||
m_lineEdit = new QLineEdit(snapshotFolderName);
|
||||
|
||||
QToolButton* button = new QToolButton;
|
||||
button->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred));
|
||||
button->setText(QLatin1String("..."));
|
||||
|
||||
layout->addWidget(m_lineEdit);
|
||||
layout->addWidget(button);
|
||||
|
||||
connect(button, SIGNAL(clicked()), this, SLOT(folderSelectionClicked()));
|
||||
|
||||
dialogLayout->addLayout(layout);
|
||||
}
|
||||
|
||||
|
||||
// Buttons
|
||||
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
|
||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
@ -134,6 +166,25 @@ void RiuExportMultipleSnapshotsWidget::exportSnapshots()
|
||||
// RicExportMultipleSnapshotsFeature::staticMethod()
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuExportMultipleSnapshotsWidget::folderSelectionClicked()
|
||||
{
|
||||
QString defaultPath = m_lineEdit->text();
|
||||
|
||||
QString directoryPath = QFileDialog::getExistingDirectory(m_lineEdit,
|
||||
tr("Get existing directory"),
|
||||
defaultPath,
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
|
||||
|
||||
if (!directoryPath.isEmpty())
|
||||
{
|
||||
m_lineEdit->setText(directoryPath);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -27,6 +27,7 @@ namespace caf {
|
||||
}
|
||||
|
||||
class QWidget;
|
||||
class QLineEdit;
|
||||
|
||||
class RiuExportMultipleSnapshotsWidget : public QDialog
|
||||
{
|
||||
@ -41,7 +42,10 @@ private slots:
|
||||
void deleteAllSnapshotItems();
|
||||
void exportSnapshots();
|
||||
|
||||
void folderSelectionClicked();
|
||||
|
||||
private:
|
||||
RimProject* m_rimProject;
|
||||
caf::PdmUiTableView* m_pdmTableView;
|
||||
QLineEdit* m_lineEdit;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user