X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Ficons.py;fp=src%2Ficons.py;h=0000000000000000000000000000000000000000;hb=94695a8c9a3ebf78e1f4c32d854e6b5a163d4667;hp=808d922ae4c560ebbe1959e922ef8e3e606e61d9;hpb=75247cf58d8d7f5a420aa300a01b1f50e4bffb23;p=drlaunch diff --git a/src/icons.py b/src/icons.py deleted file mode 100755 index 808d922..0000000 --- a/src/icons.py +++ /dev/null @@ -1,254 +0,0 @@ -#!/usr/bin/env python -# coding=UTF-8 -# -# Copyright (C) 2010 Stefanos Harhalakis -# -# This file is part of wifieye. -# -# wifieye is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# wifieye is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with wifieye. If not, see . -# -# $Id: 0.py 2265 2010-02-21 19:16:26Z v13 $ - -__version__ = "$Id: 0.py 2265 2010-02-21 19:16:26Z v13 $" - -#import config -import apps -import icon -from icon import getIcon, Icon -from sig import Disconnector - -import gobject -import gtk - -class IconIter: - def __init__(self, items): - self.iter=items.__iter__() - - def __iter__(self): - ret=self.iter.__iter__() - return(ret) - - def next(self): - ret=self.iter.next() - return(ret) - -class Icons(gobject.GObject, Disconnector): -#class Icons(gtk.Widget, Disconnector): - - #__gsignals__=Icon.gsignals - def __init__(self, isconfig, config): - self.__gobject_init__() - #gobject.GObject.__init__(self) - #gtk.Widget.__init__(self) - Disconnector.__init__(self) - - self.icons={} - self.allicons={} - self.size=0 - self.isconfig=isconfig - self.config=config - - # signal handlers - self.handlers={} - - self.maxsz=(0,0) - - # setup allicons - self.resizeMax() - -# print "icons-init" - - def finish(self): - self.dis_finish() - return -# self.icons=None -# self.allicons=None -# print "icons-finish" - -# def __del__(self): -# print "icons-del" - - def resizeMax(self): - sz=self.maxsz - maxsz=self.config.getMaxSize() - - # Create new entries in x - if maxsz[0]>sz[0]: - for x in xrange(maxsz[0]-sz[0]): - for y in xrange(sz[1]): - k=(x+sz[0],y) - ico=Icon(self.isconfig, self.config) - self.allicons[k]=ico - self.connect_one(ico) - sz=(maxsz[0], sz[1]) - elif maxsz[0]sz[1]: - for y in xrange(maxsz[1]-sz[1]): - for x in xrange(sz[0]): - k=(x,y+sz[1]) - ico=Icon(self.isconfig, self.config) - self.allicons[k]=ico - self.connect_one(ico) - sz=(sz[0], maxsz[1]) - elif maxsz[1]=sz or y>=sz: - continue - - appname=wapps[k] - if appname!=None: - app=apps.readOne(appname) - if app!=None: - app['icon2']=getIcon(app['icon'], self.config.getIconSize()) - self.get(x,y).setApp(app) - else: - ic=self.get(x,y) - ic.setApp(None) - - # Reload icons to make sure backgrounds, etc are valid - for x in xrange(sz[0]): - for y in xrange(sz[1]): - ic=self.get(x,y) - ic.reload() - - -# for f in fn: -# dt=apps.readOne(f) -# dt['icon2']=getIcon(dt['icon']) -# print x, y, dt -# self.get(x,y).setApp(dt) -# x+=1 -# if x>=config.getSize(getSize()): -# x=0 -# y+=1 -## self.icons.append(p) - -gobject.type_register(Icons) -Icons.register_signals() - -# vim: set ts=8 sts=4 sw=4 noet formatoptions=r ai nocindent: -