4 # Copyright (C) 2010 Stefanos Harhalakis
6 # This file is part of wifieye.
8 # wifieye is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # wifieye is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with wifieye. If not, see <http://www.gnu.org/licenses/>.
21 # $Id: 0.py 2265 2010-02-21 19:16:26Z v13 $
23 __version__ = "$Id: 0.py 2265 2010-02-21 19:16:26Z v13 $"
28 from icon import getIcon, Icon
33 def __init__(self, items):
34 self.iter=items.__iter__()
37 ret=self.iter.__iter__()
44 class Icons(gobject.GObject):
45 def __init__(self, isconfig):
46 self.__gobject_init__()
50 self.isconfig=isconfig
57 for x in xrange(maxsz):
58 for y in xrange(maxsz):
60 ico=Icon(self.isconfig)
65 def register_signals(cls):
68 gobject.signal_new(s, cls, gobject.SIGNAL_RUN_FIRST,
69 gobject.TYPE_NONE, (Icon,))
72 return(IconIter(self.icons))
74 def connect_one(self, which):
76 'longpress': which.connect('long-press', self.signalLongpress),
77 'click': which.connect('click', self.signalClick),
78 'tripple': which.connect('tripple-click',
79 self.signalTrippleClick)
82 def disconnect_one(self, which):
83 for i in self.h[which]:
84 which.disconnect(self.h[which][i])
86 # which.disconnect(self.h[which]_longpress)
87 # which.disconnect(self.h_click)
88 # which.disconnect(self.h_tripple)
90 def setSize(self, sz):
91 # print "sz:", sz, self.size
105 # old.pop(k) # Re-used
107 # self.connect_one(ico)
111 # self.disconnect_one(old[i])
115 def signalLongpress(self, icon):
116 #print "signalLongpress()", icon
117 self.emit('long-press', icon)
119 def signalClick(self, icon):
120 #print "signalClick()", icon
121 self.emit('click', icon)
123 def signalTrippleClick(self, icon):
124 #print "signalTrippleClick()", icon
125 self.emit('tripple-click', icon)
129 if self.icons.has_key(k):
139 # fn=["maegirls", "wifieye", 'battery-eye', 'image-viewer',
140 # 'tecnoballz', 'ncalc', 'rtcom-call-ui', 'rtcom-messaging-ui',
141 # 'extcalllog', 'browser', 'modest', 'osso-addressbook']
143 wapps=config.getApps()
153 app=apps.readOne(appname)
155 app['icon2']=getIcon(app['icon'])
156 self.get(x,y).setApp(app)
160 # dt['icon2']=getIcon(dt['icon'])
162 # self.get(x,y).setApp(dt)
164 # if x>=config.getSize(getSize()):
167 ## self.icons.append(p)
169 gobject.type_register(Icons)
170 Icons.register_signals()
172 # vim: set ts=8 sts=4 sw=4 noet formatoptions=r ai nocindent: