Commit 600828fe authored by Murray Cumming's avatar Murray Cumming
Browse files

ShowProgressMessage: Move to its own source files.

* Makefile_glom.am:
* glom/application.[h|cc]: Move the ShowProgressMessage class to separate
.h/.cc files because I generally prefer one .h/.cc per class.
parent 5772d758
2011-10-24 Murray Cumming <murrayc@murrayc.com>
ShowProgressMessage: Move to its own source files.
* Makefile_glom.am:
* glom/application.[h|cc]: Move the ShowProgressMessage class to separate
.h/.cc files because I generally prefer one .h/.cc per class.
2011-10-24 Murray Cumming <murrayc@murrayc.com>
ShowProgressMessage: Minor Cleanup.
......
......@@ -99,6 +99,8 @@ glom_source_files = \
glom/infobar_progress_creating.h \
glom/notebook_glom.cc \
glom/notebook_glom.h \
glom/show_progress_message.cc \
glom/show_progress_message.h \
glom/signal_reemitter.h \
glom/utils_ui.cc \
glom/utils_ui.h \
......
......@@ -2938,26 +2938,4 @@ void Application::clear_progress_message()
m_infobar_progress->hide();
}
ShowProgressMessage::ShowProgressMessage(const Glib::ustring& message)
: m_app(dynamic_cast<Application*>(Application::get_application())),
m_message(message)
{
g_return_if_fail(m_app);
m_app->set_progress_message(message);
};
ShowProgressMessage::~ShowProgressMessage()
{
g_return_if_fail(m_app);
m_app->clear_progress_message();
};
void ShowProgressMessage::pulse()
{
g_return_if_fail(m_app);
m_app->set_progress_message(m_message);
};
} //namespace Glom
......@@ -24,9 +24,9 @@
#include "config.h" // For GLOM_ENABLE_CLIENT_ONLY
#include <glom/bakery/app_withdoc_gtk.h>
#include <glom/frame_glom.h>
#include "infobar_progress_creating.h"
#include <glom/show_progress_message.h>
#include <glom/infobar_progress_creating.h>
//Avoid including the header here:
......@@ -273,22 +273,6 @@ 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:
explicit ShowProgressMessage(const Glib::ustring &message);
~ShowProgressMessage();
void pulse();
private:
Application* const m_app;
Glib::ustring m_message;
};
} //namespace Glom
#endif // GLOM_APPLICATION_H
Markdown is supported
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