Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/model.py
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2007-08-31 19:29:18 (GMT)
committer Simon Schampijer <simon@schampijer.de>2007-08-31 19:29:18 (GMT)
commit62c03953e87719bb80e0e32c9bfb09147052dc4b (patch)
tree6b12476fe2752e634d17f1bdb95e7f07ab34fe96 /model.py
parentabaf48e58218dc397e723a87babf7e75cd19091b (diff)
Fixed the fixed size issue of the link toolbar
Use the sugar tray now
Diffstat (limited to 'model.py')
-rw-r--r--model.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/model.py b/model.py
index 284cb7f..e10774c 100644
--- a/model.py
+++ b/model.py
@@ -20,17 +20,25 @@ import libxml2
import os
import logging
import base64
-
+import sha
+import gobject
_logger = logging.getLogger('model')
-class Model(object):
+class Model(gobject.GObject):
+ #__gtype_name__ = 'Model'
+ __gsignals__ = {
+ 'add_link': (gobject.SIGNAL_RUN_FIRST,
+ gobject.TYPE_NONE, ([int]))
+ }
+
''' The model of the activity. Contains methods to read and write
the configuration for a browser session to and from xml.
'''
def __init__(self, dtdpath):
+ gobject.GObject.__init__(self)
self.links = []
self.data = {}
self.dtdpath = dtdpath
@@ -44,6 +52,12 @@ class Model(object):
self.dtd = None
self.ctxt = libxml2.newValidCtxt()
+ def add_link(self, url, title, thumb, owner, color):
+ print 'model: add link'
+ self.links.append( {'hash':sha.new(url).hexdigest(), 'url':url, 'title':title, 'thumb':thumb,
+ 'owner':owner, 'color':color, 'deleted':0} )
+ self.emit('add_link', len(self.links)-1)
+
def read(self, filepath):
''' reads the configuration from an xml file '''