Commit 1ffd0383 authored by Emmanuel Promayon's avatar Emmanuel Promayon
Browse files

Merge branch 'feature-fix-nomainwindow-app-crash' into develop

parents 9e396dd6 49c4d89c
......@@ -266,6 +266,9 @@ void Application::refresh() {
// ----------------- showStatusBarMessage --------------------
void Application::showStatusBarMessage(QString msg, int timeout) {
// if this application has no main window (no GUI)
// there is no status bar, therefore nothing to do
if (mainWindow) {
QStatusBar * statusBar = mainWindow->statusBar();
if (statusBar) {
......@@ -273,29 +276,40 @@ void Application::showStatusBarMessage(QString msg, int timeout) {
} else {
CAMITK_INFO("Application", "showStatusBarMessage", msg.toStdString() << std::endl);
}
}
}
// ----------------- resetProgressBar --------------------
void Application::resetProgressBar() {
// if this application has no main window (no GUI)
// there is no status bar, therefore nothing to do
if (mainWindow) {
QProgressBar * progress = mainWindow->getProgressBar();
if (progress) {
progress->setValue(0);
}
}
}
// ----------------- setProgressBarValue --------------------
void Application::setProgressBarValue(int value) {
// if this application has no main window (no GUI)
// there is no status bar, therefore nothing to do
if (mainWindow) {
QProgressBar * progress = mainWindow->getProgressBar();
if (progress) {
progress->setValue(value);
}
}
}
// ----------------- vtkProgressFunction --------------------
void Application::vtkProgressFunction(vtkObject * caller, long unsigned int eventId, void * clientData, void * callData) {
// if this application has no main window (no GUI)
// there is no status bar, therefore nothing to do
if (mainWindow) {
QProgressBar * progress = mainWindow->getProgressBar();
vtkAlgorithm * filter = static_cast<vtkAlgorithm *>(caller);
int progressVal = filter->GetProgress() * 100;
......@@ -303,6 +317,7 @@ void Application::vtkProgressFunction(vtkObject * caller, long unsigned int even
if (progress) {
progress->setValue(progressVal);
}
}
}
// ----------------- addRecentDocument --------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment