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__()
49 self.isconfig=isconfig
52 def register_signals(cls):
55 gobject.signal_new(s, cls, gobject.SIGNAL_RUN_FIRST,
56 gobject.TYPE_NONE, (Icon,))
59 return(IconIter(self.icons))
61 def connect_one(self, which):
62 which.connect('long-press', self.signalLongpress)
63 which.connect('click', self.signalClick)
64 which.connect('tripple-click', self.signalTrippleClick)
66 def disconnect_one(self, which):
67 which.disconnect('long-press', self.signalLongpress)
68 which.disconnect('click', self.signalClick)
69 which.disconnect('tripple-click', self.signalTrippleClick)
71 def setSize(self, sz):
85 ico=Icon(self.isconfig)
91 self.disconnect_one(old[i])
95 def signalLongpress(self, icon):
96 print "signalLongpress()", icon
97 self.emit('long-press', icon)
99 def signalClick(self, icon):
100 print "signalClick()", icon
101 self.emit('click', icon)
103 def signalTrippleClick(self, icon):
104 print "signalTrippleClick()", icon
105 self.emit('tripple-click', icon)
109 if self.icons.has_key(k):
119 fn=["maegirls", "wifieye", 'battery-eye', 'image-viewer',
120 'tecnoballz', 'ncalc', 'rtcom-call-ui', 'rtcom-messaging-ui',
121 'extcalllog', 'browser', 'modest', 'osso-addressbook']
124 dt['icon2']=getIcon(dt['icon'])
126 self.get(x,y).setApp(dt)
131 # self.icons.append(p)
133 print "end of Icons init"
136 gobject.type_register(Icons)
137 Icons.register_signals()
139 # vim: set ts=8 sts=4 sw=4 noet formatoptions=r ai nocindent: