Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--annoactivity.py2
-rw-r--r--annobookmark.py3
-rw-r--r--readdb.py9
3 files changed, 10 insertions, 4 deletions
diff --git a/annoactivity.py b/annoactivity.py
index 25a9f8f..bee5ab2 100644
--- a/annoactivity.py
+++ b/annoactivity.py
@@ -563,8 +563,6 @@ class AnnoActivity(activity.Activity):
page = self._view.get_current_page()
if self._annotator.props.active:
self._sidebar.add_annotation(page)
- else:
- self._sidebar.del_annotation(page)
def __annotator_syncer_toggled_cb(self, button):
self._sidebar.sync_annotations()
diff --git a/annobookmark.py b/annobookmark.py
index b5ac9fe..d6fbb33 100644
--- a/annobookmark.py
+++ b/annobookmark.py
@@ -132,6 +132,9 @@ class AnnoBookmark:
def get_id(self):
return self.id
+ def set_id(self, id):
+ self.id = id
+
def set_modified(self, modified):
self.modified = modified
diff --git a/readdb.py b/readdb.py
index 9bb04e3..547ada0 100644
--- a/readdb.py
+++ b/readdb.py
@@ -386,6 +386,8 @@ class AnnotationManager:
if self._userid == '':
self._userid = self.get_userid_for_username( self.get_user_string( user ) )
#get the clientuuid to schedule its deletion on the annotation server
+ _logger.debug('delete annotation with id %s', str(annotation_id) )
+
rows = self._conn.execute('select uuid, creator from annotations where md5=? and id=?', [self._filehash, annotation_id])
row = rows.fetchone()
if row[1] == self._userid:
@@ -597,9 +599,12 @@ class AnnotationManager:
t = (None, annotation.get_filehash(), annotation.get_page(), annotation.get_note_title(), annotation.get_note_body(), annotation.get_bodyurl(), annotation.get_texttitle(), annotation.get_textcreator(), annotation.get_created(), annotation.get_modified(), annotation.get_creator(), annotation.get_annotates(), annotation.get_color().to_string(), annotation.is_local(), annotation.get_mimetype(), annotation.get_uuid(), annotation.get_annotationurl())
self._conn.execute('insert into annotations values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', t)
self._conn.commit()
+ row = self._conn.execute('select id from annotations order by id desc limit 1')
+ r = row.fetchone()
+ tid = int( r[0] )
+ annotation.set_id( tid )
self.current_annotation = annotation
-
def update_annotation_db_record(self, annotation):
#(id INTEGER PRIMARY KEY, md5, page, title, content, bodyurl, texttitle, textcreator, created TIMESTAMP, modified TIMESTAMP, creator, annotates, color, local, mimetype, uuid, annotationurl)
@@ -672,8 +677,8 @@ class AnnotationManager:
self.remotecreators.append(remotecreator)
self.remotecolors[remotecreator] = XoColor()
a.color = self.remotecolors[remotecreator]
- self._annotations.append(a)
self.insert_annotation_db_record(a)
+ self._annotations.append(a)
self._sidebar.update_for_page(a.page)