[glom] ShowProgressMessage: Move to its own source files.



commit 600828fe80d740470124ad90fd0ef01bc6145047
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Oct 24 09:52:07 2011 +0200

    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.

 ChangeLog           |    8 ++++++++
 Makefile_glom.am    |    2 ++
 glom/application.cc |   22 ----------------------
 glom/application.h  |   20 ++------------------
 4 files changed, 12 insertions(+), 40 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f39ea82..da87f49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 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.
 
 	* glom/application.[h|cc]: Move implementation into .cc file. Correct the code
diff --git a/Makefile_glom.am b/Makefile_glom.am
index 2b32b67..b69011a 100644
--- a/Makefile_glom.am
+++ b/Makefile_glom.am
@@ -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							\
diff --git a/glom/application.cc b/glom/application.cc
index 5e62c2f..464238f 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -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
diff --git a/glom/application.h b/glom/application.h
index a99cead..21e31c3 100644
--- a/glom/application.h
+++ b/glom/application.h
@@ -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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]