[glom] Don't show error dialog when user cancels template creation.



commit 55d3a35a4b79293a50e94c3048990ec946fbedcc
Author: Daniel Borgmann <danielb openismus com>
Date:   Wed Mar 24 17:01:40 2010 +0000

    	Don't show error dialog when user cancels template creation.
    
    	* glom/application.cc: Display error message when trying to create
    	a document from template in client-only-mode.
    	* glom/bakery/app_withdoc.cc: Don't display error message if the
    	document is rejected, let the application decide about it.

 ChangeLog                  |    9 +++++++++
 glom/application.cc        |    1 +
 glom/bakery/app_withdoc.cc |    7 ++++++-
 3 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a29f75d..9584e9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-03-24  Daniel Borgmann  <danielb openismus com>
+
+	Don't show error dialog when user cancels template creation.
+
+	* glom/application.cc: Display error message when trying to create
+	a document from template in client-only-mode.
+	* glom/bakery/app_withdoc.cc: Don't display error message if the
+	document is rejected, let the application decide about it.
+
 1.13.9:
 
 2010-03-23  Murray Cumming  <murrayc murrayc com>
diff --git a/glom/application.cc b/glom/application.cc
index d43d2b2..b7db6f7 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -1053,6 +1053,7 @@ bool Application::on_document_load()
       // TODO_clientonly: Tell the user that opening example files is
       // not supported. This could alternatively also be done in
       // Document_after::load_after, I am not sure which is better.
+      ui_warning_load_failed(0);
       return false;
 #endif // GLOM_ENABLE_CLIENT_ONLY
     }
diff --git a/glom/bakery/app_withdoc.cc b/glom/bakery/app_withdoc.cc
index 5833d8e..13caa3f 100644
--- a/glom/bakery/app_withdoc.cc
+++ b/glom/bakery/app_withdoc.cc
@@ -122,8 +122,12 @@ bool App_WithDoc::open_document(const Glib::ustring& file_uri)
     const bool bTest = pApp->m_pDocument->load(failure_code);
 
     bool bOpenFailed = false;
+    bool bShowError = false;
     if(!bTest) //if open failed.
+    {
       bOpenFailed = true;
+      bShowError = true;
+    }
     else
     {
       //if open succeeded then let the App respond:
@@ -147,7 +151,8 @@ bool App_WithDoc::open_document(const Glib::ustring& file_uri)
 
     if(bOpenFailed)
     {
-      ui_warning_load_failed(failure_code);
+      if (bShowError)
+        ui_warning_load_failed(failure_code);
 
       //re-initialize document.
       delete pApp->m_pDocument;



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