Mantid
Loading...
Searching...
No Matches
SaveWorkspaces.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include "DllOption.h"
11#include <QCheckBox>
12#include <QGridLayout>
13#include <QHash>
14#include <QLineEdit>
15#include <QListWidget>
16#include <QSignalMapper>
17#include <QString>
18
19namespace MantidQt {
20namespace MantidWidgets {
27 Q_OBJECT
28
29public:
30 SaveWorkspaces(QWidget *parent, const QString &suggFname, QHash<const QCheckBox *const, QString> &defSavs,
31 bool saveAsZeroErrorFree);
32 void initLayout();
34 static QString getSaveAlgExt(const QString &algName);
35public slots:
36 void onSaveAsZeroErrorFreeChanged(int state);
37 void onUpdateGeomtryInformation(QString &geometryID, QString &sampleHeight, QString &sampleWidth,
38 QString &sampleThickness);
39
40signals:
41 void closing();
42 void createZeroErrorFreeWorkspace(QString &originalWorkspace, QString &zeroFreeWorkspace);
43 void deleteZeroErrorFreeWorkspace(QString &zeroFreeWorkspace);
45
46private:
47 QLineEdit *m_fNameEdit;
48 QListWidget *m_workspaces;
49 QCheckBox *m_append;
50 QString m_lastName;
52 QString m_geometryID;
56
59
60 void setupLine1(QHBoxLayout *const lineOne);
61 void setupLine2(QHBoxLayout *const lineTwo, const QHash<const QCheckBox *const, QString> &defSavs);
62 void readSettings();
63 void setFileName(const QString &newName);
64 void setupFormatTicks(const QHash<const QCheckBox *const, QString> &defSavs);
65 void saveSettings() const;
66
67 void addButtonsDisab(int row);
68 void closeEvent(QCloseEvent *event) override;
69 QString saveList(const QList<QListWidgetItem *> &list, const QString &algorithm, QString fileBase, bool toAppend,
70 QHash<QString, QString> workspaceMap);
71 QHash<QString, QString> provideZeroFreeWorkspaces(const QListWidget *workspaces);
72 void removeZeroFreeWorkspaces(const QHash<QString, QString> &workspaces);
73 bool isValid();
74private slots:
75 void saveSel();
76 void setFileName(int row);
77 void saveFileBrowse();
78};
79} // namespace MantidWidgets
80} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
Implements a dialog box that allows users to save multiple Mantid workspaces.
QHash< QCheckBox *const, QString >::const_iterator SavFormatsConstIt
void deleteZeroErrorFreeWorkspace(QString &zeroFreeWorkspace)
void createZeroErrorFreeWorkspace(QString &originalWorkspace, QString &zeroFreeWorkspace)
QHash< QCheckBox *const, QString > m_savFormats
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...