#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
+
+"""
+ This file is part of Multilist.
+
+ Multilist is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Multilist is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Multilist. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright (C) 2008 Christoph Würstle
+"""
import gtk
import gobject
def checkout_rows(self):
- sql = "UPDATE items SET status=? WHERE list=? AND category=?"
- self.db.speichereSQL(sql,("-1",self.selection.get_list(),self.selection.get_category()))
+ sql = "UPDATE items SET status=? WHERE list=? AND category LIKE ? AND status=?"
+ self.db.speichereSQL(sql,("-1",self.selection.get_list(),self.selection.get_category(True),"1"))
for i in range(len(self.liststore)):
- self.liststore[i][1]="-1"
+ if self.liststore[i][1]=="1":
+ self.liststore[i][1]="-1"
- def add_row(self):
+ def add_row(self,title=""):
#self.update_row(-1,1,"-1")
#for x in self.liststore:
# print x[0],x[2]
import uuid
uid=str(uuid.uuid4())
sql = "INSERT INTO items (uid,list,category,status, title) VALUES (?,?,?,?,?)"
- self.db.speichereSQL(sql,(uid,self.selection.get_list(),self.selection.get_category(),status,""),rowid=uid)
+ self.db.speichereSQL(sql,(uid,self.selection.get_list(),self.selection.get_category(),status,title),rowid=uid)
logging.info("Insertet row: status = "+status+" with uid "+str(uid))
#self.liststore[irow][0]=str(uuid.uuid4())
- self.liststore.append([uid,status,""," ","","","","","","","","",""])
+ self.liststore.append([uid,status,title," ","","","","","","","","",""])
self.selection.comboLists_check_for_update()
# if (irow>-1):
# self.liststore[irow][icol]=new_text