Skip to content

Commit 2604c74

Browse files
committed
Add (sort of) unique identifiers to notes. Why? This enables me to add drag-to-reorder functionality to StyncyNotes - and android app that enables you to view/edit your sticky notes on your android phone (should you have one).
1 parent a50b32d commit 2604c74

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

usr/lib/sticky/sticky.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import json
44
import os
55
import sys
6+
import uuid
67

78
import gi
89
gi.require_version('Gdk', '3.0')
@@ -125,6 +126,7 @@ def __init__(self, app, parent, info={}):
125126
self.changed_timer_id = 0
126127
self.invalid_cache = False
127128

129+
self.id = info.get('id', str(uuid.uuid4()))
128130
self.x = info.get('x', 0)
129131
self.y = info.get('y', 0)
130132
self.height = info.get('height', self.app.settings.get_uint('default-height'))
@@ -393,6 +395,7 @@ def get_info(self):
393395

394396
(width, height) = self.get_size()
395397
info = {
398+
'id': self.id,
396399
'x': self.x,
397400
'y': self.y,
398401
'height': self.height,

0 commit comments

Comments
 (0)