[gevice] add commit to operations



commit 744ffa67d4bd1b57a71890ba7ab17db920d88c24
Author: Alejandro Valdes Jimenez <avaldes utalca cl>
Date:   Tue May 5 23:40:23 2009 -0400

    add commit to operations
---
 src/gevicemaintainer.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gevicemaintainer.py b/src/gevicemaintainer.py
index 3c48e93..f3fccfb 100644
--- a/src/gevicemaintainer.py
+++ b/src/gevicemaintainer.py
@@ -57,6 +57,7 @@ class GeviceMaintainer:
             gobject.TYPE_INT,
             gobject.TYPE_STRING)
         
+        self.treeview.set_model (None)
         self.treeview.set_model (liststore)
         
         rows = gevice.gdbase.execute_sql_select(gevice,sql["select"])
@@ -91,7 +92,9 @@ class GeviceMaintainer:
         if not self.is_in_list:
             model.set(iter,1,newname)
             update = sql["update1"] + "'" + newname + "'" + sql["update2"] + str(id)
-            gevice.gdbase.execute_sql_update(gevice,update)
+            if (gevice.gdbase.execute_sql_update(gevice,update)):
+                gevice.gdbase.conn.commit()
+
         else:
             #show error message and delete the row.
             dialog = gtk.MessageDialog(None,gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR,gtk.BUTTONS_OK,_("Name exist: " + newname) )
@@ -119,7 +122,9 @@ class GeviceMaintainer:
             1,"New" + str(row[0][0]))
             
         insert = sql["insert"] + " (" + str(row[0][0]) + ",'" + "New" + str(row[0][0]) + "')"
-        gevice.gdbase.execute_sql_insert (gevice,insert)
+        
+        if (gevice.gdbase.execute_sql_insert (gevice,insert)):
+            gevice.gdbase.conn.commit()
     
     
     def on_button_rem_clicked(self,button,gevice,sql):



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