Commit fe8aa967 authored by David King's avatar David King Committed by Murray Cumming
Browse files

Replace progress dialog with infobar, bug 661051

parent 79f4dd0e
2011-10-24 David King <davidk@openismus.com>
Replace progress dialog with infobar.
Bug #661051
2011-10-21 Murray Cumming <murrayc@murrayc.com>
Avoid calling g_thread_init() if possible.
......
......@@ -93,8 +93,7 @@ dist_glade_operator_DATA = \
ui/operator/dialog_image_save_progress.glade \
ui/operator/dialog_import_csv.glade \
ui/operator/dialog_import_csv_progress.glade \
ui/operator/window_main.glade \
ui/operator/window_progress.glade
ui/operator/window_main.glade
glade_developerdir = $(pkgdatadir)/glade/developer
dist_glade_developer_DATA = ui/developer/dialog_add_related_table.glade \
......
......@@ -89,14 +89,14 @@ glom_source_files = \
glom/dialog_existing_or_new.h \
glom/dialog_invalid_data.cc \
glom/dialog_invalid_data.h \
glom/dialog_progress_creating.cc \
glom/dialog_progress_creating.h \
glom/filechooser_export.cc \
glom/filechooser_export.h \
glom/frame_glom.cc \
glom/frame_glom.h \
glom/glade_utils.cc \
glom/glade_utils.h \
glom/infobar_progress_creating.cc \
glom/infobar_progress_creating.h \
glom/notebook_glom.cc \
glom/notebook_glom.h \
glom/signal_reemitter.h \
......
......@@ -23,8 +23,6 @@
#include <glom/application.h>
#include <glom/dialog_existing_or_new.h>
#include <glom/dialog_progress_creating.h>
#ifndef GLOM_ENABLE_CLIENT_ONLY
#include <glom/mode_design/translation/dialog_change_language.h>
#include <glom/mode_design/translation/window_translations.h>
......@@ -85,9 +83,6 @@ Application::Application(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builde
m_ui_save_extra_showextras(false),
m_ui_save_extra_newdb_hosting_mode(Document::HOSTING_MODE_DEFAULT),
m_avahi_progress_dialog(0),
m_dialog_progress_creating(0),
m_dialog_progess_save_backup(0),
m_dialog_progess_convert_backup(0),
#endif // !GLOM_ENABLE_CLIENT_ONLY
m_show_sql_debug(false)
{
......@@ -96,6 +91,7 @@ Application::Application(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builde
//Load widgets from glade file:
builder->get_widget("bakery_vbox", m_pBoxTop);
builder->get_widget_derived("vbox_frame", m_pFrame); //This one is derived. There's a lot happening here.
builder->get_widget_derived("infobar_progress", m_infobar_progress);
add_mime_type("application/x-glom"); //TODO: make this actually work - we need to register it properly.
......@@ -126,13 +122,6 @@ Application::~Application()
delete m_avahi_progress_dialog;
m_avahi_progress_dialog = 0;
delete m_dialog_progress_creating;
m_dialog_progress_creating = 0;
delete m_dialog_progess_save_backup;
delete m_dialog_progess_convert_backup;
m_dialog_progess_convert_backup = 0;
#endif // !GLOM_ENABLE_CLIENT_ONLY
delete m_pAbout;
......@@ -1275,18 +1264,12 @@ void Application::on_connection_close_progress()
void Application::on_connection_save_backup_progress()
{
if(!m_dialog_progess_save_backup)
m_dialog_progess_save_backup = Utils::get_and_show_pulse_dialog(_("Exporting Backup"), this);
m_dialog_progess_save_backup->pulse();
pulse_progress_message();
}
void Application::on_connection_convert_backup_progress()
{
if(!m_dialog_progess_convert_backup)
m_dialog_progess_convert_backup = Utils::get_and_show_pulse_dialog(_("Restoring Backup"), this);
m_dialog_progess_convert_backup->pulse();
pulse_progress_message();
}
void Application::on_document_close()
......@@ -1607,27 +1590,17 @@ void Application::on_menu_help_contents()
void Application::on_recreate_database_progress()
{
//Show the user that something is happening, because the INSERTS might take time.
//TOOD: This doesn't actually show up until near the end, even with Gtk::Main::instance()->iteration().
if(!m_dialog_progress_creating)
{
Utils::get_glade_widget_derived_with_warning(m_dialog_progress_creating);
m_dialog_progress_creating->set_message(_("Creating Glom Database"), _("Creating Glom database from example file."));
m_dialog_progress_creating->set_transient_for(*this);
m_dialog_progress_creating->show();
pulse_progress_message();
}
//Ensure that the dialog is shown, instead of waiting for the application to be idle:
//Ensure that the infobar is shown, instead of waiting for the application to be idle.
while(Gtk::Main::instance()->events_pending())
Gtk::Main::instance()->iteration();
m_dialog_progress_creating->pulse();
}
bool Application::recreate_database_from_example(bool& user_cancelled)
{
ShowProgressMessage progress_message(_("Creating Glom database from example file."));
//Create a database, based on the information in the current document:
Document* pDocument = static_cast<Document*>(get_document());
if(!pDocument)
......@@ -1689,21 +1662,12 @@ bool Application::recreate_database_from_example(bool& user_cancelled)
}
//Show the user that something is happening, because the INSERTS might take time.
//TOOD: This doesn't actually show up until near the end, even with Gtk::Main::instance()->iteration().
Dialog_ProgressCreating* dialog_progress_temp = 0;
Utils::get_glade_widget_derived_with_warning(dialog_progress_temp);
dialog_progress_temp->set_message(_("Creating Glom Database"), _("Creating Glom database from example file."));
std::auto_ptr<Dialog_ProgressCreating> dialog_progress(dialog_progress_temp); //Put the dialog in an auto_ptr so that it will be deleted (and hidden) when the current function returns.
pulse_progress_message();
dialog_progress->set_transient_for(*this);
dialog_progress->show();
//Ensure that the dialog is shown, instead of waiting for the application to be idle:
//Ensure that the infobar is shown, instead of waiting for the application to be idle.
while(Gtk::Main::instance()->events_pending())
Gtk::Main::instance()->iteration();
dialog_progress->pulse();
//Create the database: (This will show a connection dialog)
connection_pool->set_database( Glib::ustring() );
const bool db_created = m_pFrame->create_database(db_name, pDocument->get_database_title());
......@@ -1715,7 +1679,7 @@ bool Application::recreate_database_from_example(bool& user_cancelled)
else
connection_pool->set_database(db_name); //Specify the new database when connecting from now on.
dialog_progress->pulse();
pulse_progress_message();
BusyCursor busy_cursor(this);
sharedptr<SharedConnection> sharedconnection;
......@@ -1743,16 +1707,14 @@ bool Application::recreate_database_from_example(bool& user_cancelled)
return false;
}
dialog_progress->pulse();
//Create the developer group, and make this user a member of it:
dialog_progress->pulse();
pulse_progress_message();
bool test = DbUtils::add_standard_groups(pDocument);
if(!test)
return false;
//Add any extra groups from the example file:
dialog_progress->pulse();
pulse_progress_message();
test = DbUtils::add_groups_from_document(pDocument);
if(!test)
return false;
......@@ -1767,9 +1729,9 @@ bool Application::recreate_database_from_example(bool& user_cancelled)
Glib::ustring sql_fields;
Document::type_vec_fields fields = pDocument->get_table_fields(table_info->get_name());
dialog_progress->pulse();
pulse_progress_message();
const bool table_creation_succeeded = DbUtils::create_table(table_info, fields);
dialog_progress->pulse();
pulse_progress_message();
if(!table_creation_succeeded)
{
g_warning("Application::recreate_database_from_example(): CREATE TABLE failed with the newly-created database.");
......@@ -1777,11 +1739,11 @@ bool Application::recreate_database_from_example(bool& user_cancelled)
}
}
dialog_progress->pulse();
pulse_progress_message();
DbUtils::add_standard_tables(pDocument); //Add internal, hidden, tables.
//Set table priviliges, using the groups we just added:
dialog_progress->pulse();
pulse_progress_message();
test = DbUtils::set_table_privileges_groups_from_document(pDocument);
if(!test)
return false;
......@@ -1791,7 +1753,7 @@ bool Application::recreate_database_from_example(bool& user_cancelled)
sharedptr<const TableInfo> table_info = *iter;
//Add any example data to the table:
dialog_progress->pulse();
pulse_progress_message();
//try
//{
......@@ -1816,6 +1778,8 @@ bool Application::recreate_database_from_example(bool& user_cancelled)
bool Application::recreate_database_from_backup(const Glib::ustring& backup_uri, bool& user_cancelled)
{
ShowProgressMessage progress_message(_("Creating Glom database from backup file."));
//Create a database, based on the information in the current document:
Document* pDocument = static_cast<Document*>(get_document());
if(!pDocument)
......@@ -1877,20 +1841,13 @@ bool Application::recreate_database_from_backup(const Glib::ustring& backup_uri,
}
//Show the user that something is happening, because the INSERTS might take time.
//TOOD: This doesn't actually show up until near the end, even with Gtk::Main::instance()->iteration().
Dialog_ProgressCreating* dialog_progress_temp = 0;
Utils::get_glade_widget_derived_with_warning(dialog_progress_temp);
dialog_progress_temp->set_message(_("Creating Glom Database"), _("Creating Glom database from backup file."));
std::auto_ptr<Dialog_ProgressCreating> dialog_progress(dialog_progress_temp); //Put the dialog in an auto_ptr so that it will be deleted (and hidden) when the current function returns.
pulse_progress_message();
dialog_progress->set_transient_for(*this);
dialog_progress->show();
//Ensure that the dialog is shown, instead of waiting for the application to be idle:
//Ensure that the infobar is shown, instead of waiting for the application to be idle.
while(Gtk::Main::instance()->events_pending())
Gtk::Main::instance()->iteration();
dialog_progress->pulse();
pulse_progress_message();
//Create the database: (This will show a connection dialog)
connection_pool->set_database( Glib::ustring() );
......@@ -1915,18 +1872,17 @@ bool Application::recreate_database_from_backup(const Glib::ustring& backup_uri,
connection_pool->set_database(db_name); //Specify the new database when connecting from now on.
//Create the developer group, and make this user a member of it:
dialog_progress->pulse();
pulse_progress_message();
bool test = DbUtils::add_standard_groups(pDocument);
if(!test)
return false;
//Add any extra groups from the example file:
dialog_progress->pulse();
pulse_progress_message();
test = DbUtils::add_groups_from_document(pDocument);
if(!test)
return false;
//dialog_progress->pulse();
//m_pFrame->add_standard_tables(); //Add internal, hidden, tables.
//Restore the backup into the database:
......@@ -1960,9 +1916,6 @@ bool Application::recreate_database_from_backup(const Glib::ustring& backup_uri,
const bool restored = connection_pool->convert_backup(
sigc::mem_fun(*this, &Application::on_connection_convert_backup_progress), original_dir_path);
delete m_dialog_progess_convert_backup;
m_dialog_progess_convert_backup = 0;
if(!restored)
{
std::cerr << G_STRFUNC << ": Restore failed." << std::endl;
......@@ -2660,10 +2613,8 @@ void Application::on_menu_developer_export_backup()
if(saved)
{
ConnectionPool* connection_pool = ConnectionPool::get_instance();
ShowProgressMessage progress_message(_("Exporting backup"));
saved = connection_pool->save_backup(sigc::mem_fun(*this, &Application::on_connection_save_backup_progress), path_dir);
delete m_dialog_progess_save_backup;
m_dialog_progess_save_backup = 0;
}
//Compress the backup in a .tar.gz, so it is slightly more safe from changes:
......@@ -2698,6 +2649,7 @@ void Application::on_menu_developer_export_backup()
//std::cout << "DEBUG: command_tar=" << command_tar << std::endl;
ShowProgressMessage progress_message(_("Exporting backup"));
saved = Glom::Spawn::execute_command_line_and_wait(command_tar,
sigc::mem_fun(*this, &Application::on_connection_save_backup_progress));
......@@ -2705,9 +2657,6 @@ void Application::on_menu_developer_export_backup()
{
std::cerr << G_STRFUNC << "tar failed with command:" << command_tar << std::endl;
}
delete m_dialog_progess_save_backup;
m_dialog_progess_save_backup = 0;
}
}
......@@ -2793,6 +2742,7 @@ bool Application::do_restore_backup(const Glib::ustring& backup_uri)
//std::cout << "DEBUG: command_tar=" << command_tar << std::endl;
ShowProgressMessage progress_message(_("Restoring backup"));
const bool untarred = Glom::Spawn::execute_command_line_and_wait(command_tar,
sigc::mem_fun(*this, &Application::on_connection_convert_backup_progress));
if(!untarred)
......@@ -2800,8 +2750,7 @@ bool Application::do_restore_backup(const Glib::ustring& backup_uri)
std::cerr << G_STRFUNC << ": tar failed with command:" << command_tar << std::endl;
}
delete m_dialog_progess_convert_backup;
m_dialog_progess_convert_backup = 0;
clear_progress_message();
if(!untarred)
ui_warning(_("Restore Backup failed."), _("There was an error while restoring the backup. The tar utility failed to extract the archive."));
......@@ -2958,8 +2907,35 @@ void Application::print_layout()
void Application::start_new_record()
{
m_pFrame->on_menu_add_record();
}
void Application::set_progress_message(const Glib::ustring& message)
{
const Glib::ustring title = _("Processing");
const std::string collate_key = (title + message).collate_key();
if(collate_key != m_progress_collate_key)
{
// New progress message.
m_progress_collate_key = collate_key;
m_infobar_progress->set_message(title, message);
m_infobar_progress->show();
}
// Pulse the progress bar regardless of whether the message is new or not.
m_infobar_progress->pulse();
// TODO: Block interaction with the rest of the UI.
}
void Application::pulse_progress_message()
{
m_infobar_progress->pulse();
}
void Application::clear_progress_message()
{
m_progress_collate_key.clear();
m_infobar_progress->hide();
}
} //namespace Glom
......@@ -26,7 +26,7 @@
#include <glom/bakery/app_withdoc_gtk.h>
#include <glom/frame_glom.h>
#include "infobar_progress_creating.h"
//Avoid including the header here:
......@@ -41,7 +41,7 @@ namespace Glom
{
class Window_Translations;
class Dialog_ProgressCreating; //TODO: Rename this because it's not just about creating databases.
class ShowProgressMessage;
class Application : public GlomBakery::App_WithDoc_Gtk
{
......@@ -124,6 +124,10 @@ public:
*/
void start_new_record();
void set_progress_message(const Glib::ustring& message);
void pulse_progress_message();
void clear_progress_message();
static Application* get_application();
protected:
......@@ -230,6 +234,9 @@ private:
bool m_bAboutShown;
Gtk::AboutDialog* m_pAbout; //About box.
Infobar_ProgressCreating* m_infobar_progress;
std::string m_progress_collate_key;
#ifndef GLOM_ENABLE_CLIENT_ONLY
Window_Translations* m_window_translations;
......@@ -252,9 +259,6 @@ private:
Gtk::MessageDialog* m_avahi_progress_dialog;
Dialog_ProgressCreating* m_dialog_progress_creating;
Dialog_ProgressCreating* m_dialog_progess_save_backup;
Dialog_ProgressCreating* m_dialog_progess_convert_backup;
#endif // !GLOM_ENABLE_CLIENT_ONLY
// This is set to the URI of an example file that is loaded to be able to
......@@ -270,6 +274,31 @@ private:
bool m_show_sql_debug;
};
/* Use this class to ensure that the progress message is cleared upon exiting a
* method with multiple return points. */
class ShowProgressMessage
{
public:
ShowProgressMessage(const Glib::ustring &message)
: app(dynamic_cast<Application*>(Application::get_application())),
message(message)
{
g_return_if_fail(app);
app->set_progress_message(message);
};
~ShowProgressMessage()
{
app->clear_progress_message();
};
void pulse() { app->set_progress_message(message); };
private:
Application * const app;
const Glib::ustring &message;
};
} //namespace Glom
#endif // GLOM_APPLICATION_H
......@@ -94,10 +94,7 @@ Frame_Glom::Frame_Glom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
m_pDialog_Relationships(0),
m_dialog_addrelatedtable(0),
m_dialog_relationships_overview(0),
m_dialog_progess_connection_initialize(0),
#endif // !GLOM_ENABLE_CLIENT_ONLY
m_dialog_progess_connection_startup(0),
m_dialog_progess_connection_cleanup(0),
m_pDialogConnection(0)
{
m_pLabel_Table_DataMode = Gtk::manage(new Gtk::Label(_("No Table Selected")));
......@@ -185,17 +182,7 @@ Frame_Glom::~Frame_Glom()
m_pDialogConnection = 0;
}
delete m_dialog_progess_connection_startup;
m_dialog_progess_connection_startup = 0;
delete m_dialog_progess_connection_cleanup;
m_dialog_progess_connection_cleanup = 0;
#ifndef GLOM_ENABLE_CLIENT_ONLY
delete m_dialog_progess_connection_initialize;
m_dialog_progess_connection_initialize = 0;
if(m_pBox_Reports)
remove_view(m_pBox_Reports);
......@@ -984,11 +971,10 @@ void Frame_Glom::on_menu_file_toggle_share(const Glib::RefPtr<Gtk::ToggleAction>
sharedconnection.clear();
}
connectionpool->cleanup( sigc::mem_fun(*this, &Frame_Glom::on_connection_cleanup_progress) );
delete m_dialog_progess_connection_cleanup;
m_dialog_progess_connection_cleanup = 0;
ShowProgressMessage cleanup_message(_("Stopping Database Server"));
connectionpool->cleanup (sigc::mem_fun(*this, &Frame_Glom::on_connection_cleanup_progress) );
ShowProgressMessage startup_message(_("Starting Database Server"));
connectionpool->set_network_shared(sigc::mem_fun(*this, &Frame_Glom::on_connection_startup_progress), shared);
ConnectionPool::StartupErrors started = connectionpool->startup( sigc::mem_fun(*this, &Frame_Glom::on_connection_startup_progress) );
if(started != ConnectionPool::Backend::STARTUPERROR_NONE)
......@@ -998,9 +984,6 @@ void Frame_Glom::on_menu_file_toggle_share(const Glib::RefPtr<Gtk::ToggleAction>
}
connectionpool->set_ready_to_connect();
delete m_dialog_progess_connection_startup;
m_dialog_progess_connection_startup = 0;
}
//Update the UI:
......@@ -1777,27 +1760,24 @@ void Frame_Glom::on_developer_dialog_hide()
#ifndef GLOM_ENABLE_CLIENT_ONLY
void Frame_Glom::on_connection_initialize_progress()
{
if(!m_dialog_progess_connection_initialize)
m_dialog_progess_connection_initialize = Utils::get_and_show_pulse_dialog(_("Initializing Database Data"), get_app_window());
m_dialog_progess_connection_initialize->pulse();
Application *app = dynamic_cast<Application*>(Application::get_application());
if(app)
app->pulse_progress_message();
}
#endif //GLOM_ENABLE_CLIENT_ONLY
void Frame_Glom::on_connection_startup_progress()
{
if(!m_dialog_progess_connection_startup)
m_dialog_progess_connection_startup = Utils::get_and_show_pulse_dialog(_("Starting Database Server"), get_app_window());
m_dialog_progess_connection_startup->pulse();
Application *app = dynamic_cast<Application*>(Application::get_application());
if(app)
app->pulse_progress_message();
}
void Frame_Glom::on_connection_cleanup_progress()
{
if(!m_dialog_progess_connection_cleanup)
m_dialog_progess_connection_cleanup = Utils::get_and_show_pulse_dialog(_("Stopping Database Server"), get_app_window());
m_dialog_progess_connection_cleanup->pulse();
Application *app = dynamic_cast<Application*>(Application::get_application());
if(app)
app->pulse_progress_message();
}
bool Frame_Glom::handle_connection_initialize_errors(ConnectionPool::InitErrors error)
......@@ -1812,7 +1792,7 @@ bool Frame_Glom::handle_connection_initialize_errors(ConnectionPool::InitErrors
title = _("Directory Already Exists");
message = _("There is an existing directory with the same name as the directory that should be created for the new database files. You should specify a different filename to use a new directory instead.");
}
else if (error == ConnectionPool::Backend::INITERROR_COULD_NOT_CREATE_DIRECTORY)
else if(error == ConnectionPool::Backend::INITERROR_COULD_NOT_CREATE_DIRECTORY)
{
title = _("Could Not Create Directory");
message = _("There was an error when attempting to create the directory for the new database files.");
......@@ -1925,11 +1905,9 @@ bool Frame_Glom::connection_request_password_and_choose_new_database_name()
connection_pool->set_user(user);
connection_pool->set_password(password);
ShowProgressMessage progress_message(_("Initializing Database Data"));
const bool initialized = handle_connection_initialize_errors( connection_pool->initialize(
sigc::mem_fun(*this, &Frame_Glom::on_connection_initialize_progress) ) );
delete m_dialog_progess_connection_initialize;
m_dialog_progess_connection_initialize = 0;
sigc::mem_fun(*this, &Frame_Glom::on_connection_initialize_progress) ) );
if(!initialized)
return false;
......@@ -1996,6 +1974,7 @@ bool Frame_Glom::connection_request_password_and_choose_new_database_name()
}
// Do startup, such as starting the self-hosting database server
ShowProgressMessage progress_message(_("Starting Database Server"));
const ConnectionPool::StartupErrors started =
connection_pool->startup( sigc::mem_fun(*this, &Frame_Glom::on_connection_startup_progress) );
if(started != ConnectionPool::Backend::STARTUPERROR_NONE)
......@@ -2004,9 +1983,6 @@ bool Frame_Glom::connection_request_password_and_choose_new_database_name()
return false;
}
delete m_dialog_progess_connection_startup;
m_dialog_progess_connection_startup = 0;
const Glib::ustring database_name = document->get_connection_database();
//std::cout << "debug: database_name to create=" << database_name << std::endl;
......@@ -2110,10 +2086,8 @@ bool Frame_Glom::connection_request_password_and_choose_new_database_name()
void Frame_Glom::cleanup_connection()
{
ConnectionPool* connection_pool = ConnectionPool::get_instance();
ShowProgressMessage progress_message(_("Stopping Database Server"));
connection_pool->cleanup( sigc::mem_fun(*this, &Frame_Glom::on_connection_cleanup_progress) );
delete m_dialog_progess_connection_cleanup;
m_dialog_progess_connection_cleanup = 0;
}
bool Frame_Glom::handle_request_password_connection_error(bool asked_for_password, const ExceptionConnection& ex, bool& database_not_found)
......@@ -2158,6 +2132,7 @@ bool Frame_Glom::connection_request_password_and_attempt(bool& database_not_foun
//Start a self-hosted server if necessary:
ConnectionPool* connection_pool = ConnectionPool::get_instance();
ShowProgressMessage progress_message(_("Starting Database Server"));
connection_pool->setup_from_document(document);
const ConnectionPool::StartupErrors started =
connection_pool->startup( sigc::mem_fun(*this, &Frame_Glom::on_connection_startup_progress) );
......@@ -2167,8 +2142,8 @@ bool Frame_Glom::connection_request_password_and_attempt(bool& database_not_foun
return false;
}
delete m_dialog_progess_connection_startup;
m_dialog_progess_connection_startup = 0;
Application* app = dynamic_cast<Application*>(get_app_window());
app->clear_progress_message();
//Only ask for the password if we are shared on the network, or we are using a centrally hosted server.
//Otherwise, no password question is necessary, due to how our self-hosted database server is configured.
......
......@@ -57,8 +57,6 @@ class Dialog_AddRelatedTable;
class Dialog_RelationshipsOverview;
#endif // !GLOM_ENABLE_CLIENT_ONLY
class Dialog_ProgressCreating; //TODO: Rename this because it's not just about creating databases.
class Frame_Glom :
public PlaceHolder,
//public GlomBakery::View_Composite<Document>,
......@@ -285,12 +283,8 @@ private:
Dialog_AddRelatedTable* m_dialog_addrelatedtable;
Dialog_RelationshipsOverview* m_dialog_relationships_overview;
Dialog_ProgressCreating* m_dialog_progess_connection_initialize;
#endif //GLOM_ENABLE_CLIENT_ONLY
Dialog_ProgressCreating* m_dialog_progess_connection_startup;
Dialog_ProgressCreating* m_dialog_progess_connection_cleanup;
Dialog_Connection* m_pDialogConnection;
};
......
......@@ -27,28 +27,5 @@ namespace Glom
namespace Utils
{
Dialog_ProgressCreating* get_and_show_pulse_dialog(const Glib::ustring& message, Gtk::Window* parent_window)
{
if(!parent_window)
std::cerr << G_STRFUNC << ": parent_window is NULL" << std::endl;
Dialog_ProgressCreating* dialog_progress = 0;
Utils::get_glade_widget_derived_with_warning(dialog_progress);
if(!dialog_progress) //Unlikely and it already warns on stderr.
return 0;
dialog_progress->set_message(_("Processing"), message);
dialog_progress->set_modal();