[glom] Don't add a new row when cancelling a placeholder edit.



commit 91de0552a6fc41abc13f2c63fa7ba8699e586972
Author: Daniel Borgmann <danielb openismus com>
Date:   Tue May 11 18:38:31 2010 +0100

    Don't add a new row when cancelling a placeholder edit.
    
    * glom/utility_widgets/db_adddel/db_adddel.cc: Don't add a new row
    if the edited row was a placeholder and no text was entered.

 ChangeLog                                   |    7 +++++++
 glom/utility_widgets/db_adddel/db_adddel.cc |    4 ++++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4b5bdbe..cced08d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-05-11  Daniel Borgmann  <danielb openismus com>
+
+	Don't add a new row when cancelling a placeholder edit.
+
+	* glom/utility_widgets/db_adddel/db_adddel.cc: Don't add a new row
+	if the edited row was a placeholder and no text was entered.
+
 2010-05-10  Daniel Elstner  <danielk openismus com>
 
 	Move list of libglom sources to separate file
diff --git a/glom/utility_widgets/db_adddel/db_adddel.cc b/glom/utility_widgets/db_adddel/db_adddel.cc
index 0b0cfd1..7971fa5 100644
--- a/glom/utility_widgets/db_adddel/db_adddel.cc
+++ b/glom/utility_widgets/db_adddel/db_adddel.cc
@@ -1750,6 +1750,10 @@ void DbAddDel::on_treeview_cell_edited(const Glib::ustring& path_string, const G
         const bool bPreventUserSignals = get_prevent_user_signals();
         set_prevent_user_signals(true); //Stops extra signal_user_changed.
 
+        //Don't add a new row if nothing was entered into the placeholder.
+        if (new_text.empty())
+          return;
+
         //Mark this row as no longer a placeholder, because it has data now. The client code must set an actual key for this in the signal_user_added() or m_signal_user_changed signal handlers.
         m_refListStore->set_is_not_placeholder(iter);
         //Don't mark this as not a placeholder, because it's still a placeholder until it has a key value.



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