OGS
OGSError Class Reference

Detailed Description

Manages error messages via message boxes.

Definition at line 22 of file OGSError.h.

#include <OGSError.h>

Static Public Member Functions

static void box (const QString &e)
 
static void box (const QString &e, const QString &t)
 
static bool question (const QString &e, const QString &t)
 

Protected Member Functions

 OGSError ()
 
 ~OGSError ()
 

Constructor & Destructor Documentation

◆ OGSError()

OGSError::OGSError ( )
protecteddefault

◆ ~OGSError()

OGSError::~OGSError ( )
protecteddefault

Member Function Documentation

◆ box() [1/2]

void OGSError::box ( const QString &  e)
static

Displays an error in a QMessageBox

Parameters
eThe error message.

Definition at line 23 of file OGSError.cpp.

24{
25 box(e, "OpenGeoSys");
26}
static void box(const QString &e)
Definition: OGSError.cpp:23

References box().

Referenced by MeshElementRemovalDialog::MeshElementRemovalDialog(), AddLayerToMeshDialog::accept(), CondFromRasterDialog::accept(), CreateStructuredGridDialog::accept(), DiagramPrefsDialog::accept(), GeoOnMeshMappingDialog::accept(), GMSHPrefsDialog::accept(), LineEditDialog::accept(), MergeGeometriesDialog::accept(), MeshElementRemovalDialog::accept(), MeshLayerEditDialog::accept(), MeshMapping2DDialog::accept(), MeshQualitySelectionDialog::accept(), MeshValueEditDialog::accept(), RasterDataToMeshDialog::accept(), SaveMeshDialog::accept(), SHPImportDialog::accept(), MeshFromRasterDialog::accept(), FileListDialog::accept(), GeoTreeModel::appendPolylines(), GeoTreeModel::appendSurfaces(), box(), MainWindow::callGMSH(), GEOModels::connectPolylineSegments(), OGSFileConverter::convertGLI2GML(), OGSFileConverter::convertGML2GLI(), OGSFileConverter::convertMSH2VTU(), MainWindow::convertPointsToStations(), OGSFileConverter::convertVTU2MSH(), MeshView::exportToShapefile(), MeshView::extractSurfaceMesh(), CreateStructuredGridDialog::inputIsEmpty(), DiagramPrefsDialog::loadFile(), MainWindow::loadFile(), MainWindow::mapGeometry(), MeshLayerEditDialog::nextButtonPressed(), MeshElementRemovalDialog::on_scalarArrayCheckBox_toggled(), MeshView::openAddLayerDialog(), MeshView::openMap2dMeshDialog(), MeshView::openRasterDataToMeshDialog(), FileIO::XmlPrjInterface::readFile(), GeoTreeView::removeGeometry(), MeshView::removeMesh(), StationTreeView::removeStationList(), MainWindow::save(), SHPImportDialog::setupDialog(), MainWindow::showDiagramPrefsDialog(), VtkVisPipelineView::showImageToMeshConversionDialog(), MainWindow::showMergeGeometriesDialog(), StationTreeView::writeToFile(), GeoTreeView::writeToFile(), and MeshView::writeToFile().

◆ box() [2/2]

void OGSError::box ( const QString &  e,
const QString &  t 
)
static

Displays an error in a QMessageBox

Parameters
eThe error message.
tThe title of the message box
See also
QMessageBox

Definition at line 28 of file OGSError.cpp.

29{
30 QMessageBox msgBox;
31 msgBox.setWindowTitle(t);
32 msgBox.setText(e);
33 msgBox.exec();
34}
static const double t

References MathLib::t.

◆ question()

bool OGSError::question ( const QString &  e,
const QString &  t 
)
static

Displays a question in a QMessageBox (offering Ok | Cancel options) Default value is 'Cancel' so that no bad things happen if the user presses enter without reading the text (e.g. when overwriting files)

Parameters
eThe error message.
tThe title of the message box
Returns
'true' if 'Ok' has been pressed, 'false' otherwise
See also
QMessageBox

Definition at line 36 of file OGSError.cpp.

37{
38 QMessageBox msgBox;
39 msgBox.setWindowTitle(t);
40 msgBox.setText(e);
41 msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
42 msgBox.setDefaultButton(QMessageBox::Cancel);
43
44 return msgBox.exec() == QMessageBox::Ok;
45}

References MathLib::t.

Referenced by OGSFileConverter::fileExists().


The documentation for this class was generated from the following files: