Move all the canvas code that doesn't depend on goocanvas anymore in graphics.
This commit is contained in:
parent
717bdd66f4
commit
1f8ff1db1f
@ -1,14 +1,14 @@
|
||||
import os
|
||||
from ConfigParser import ConfigParser
|
||||
|
||||
from sugar.canvas import IconColor
|
||||
from sugar.graphics import iconcolor
|
||||
from sugar import env
|
||||
|
||||
class _Profile:
|
||||
def __init__(self,):
|
||||
self._path = env.get_profile_path()
|
||||
self._nick_name = None
|
||||
self._color = IconColor.IconColor()
|
||||
self._color = iconcolor.IconColor()
|
||||
|
||||
self._ensure_dirs()
|
||||
|
||||
@ -19,8 +19,8 @@ class _Profile:
|
||||
self._nick_name = cp.get('Buddy', 'NickName')
|
||||
if cp.has_option('Buddy', 'Color'):
|
||||
color = cp.get('Buddy', 'Color')
|
||||
if IconColor.is_valid(color):
|
||||
self._color = IconColor.IconColor(color)
|
||||
if iconcolor.is_valid(color):
|
||||
self._color = iconcolor.IconColor(color)
|
||||
|
||||
def _ensure_dirs(self):
|
||||
try:
|
||||
|
@ -1,5 +1,5 @@
|
||||
from sugar.presence import PresenceService
|
||||
from sugar.canvas.IconColor import IconColor
|
||||
from sugar.graphics.iconcolor import IconColor
|
||||
import gobject
|
||||
|
||||
_NOT_PRESENT_COLOR = "#888888,#BBBBBB"
|
||||
|
@ -2,7 +2,7 @@ import gobject
|
||||
|
||||
import conf
|
||||
from sugar.presence import PresenceService
|
||||
from sugar.canvas.IconColor import IconColor
|
||||
from sugar.graphics.iconcolor import IconColor
|
||||
|
||||
class Invite:
|
||||
def __init__(self, issuer, bundle_id, activity_id):
|
||||
|
@ -1,7 +1,7 @@
|
||||
import gobject
|
||||
|
||||
import conf
|
||||
from sugar.canvas.IconItem import IconColor
|
||||
from sugar.graphics.iconcolor import IconColor
|
||||
from sugar.presence import PresenceService
|
||||
from model.BuddyModel import BuddyModel
|
||||
|
||||
|
@ -4,7 +4,7 @@ import dbus
|
||||
import conf
|
||||
from sugar.activity import Activity
|
||||
from sugar.presence import PresenceService
|
||||
from sugar.canvas.IconColor import IconColor
|
||||
from sugar.graphics.iconcolor import IconColor
|
||||
from sugar.p2p import Stream
|
||||
from sugar.p2p import network
|
||||
from sugar.chat import ActivityChat
|
||||
|
@ -6,8 +6,8 @@ import wnck
|
||||
from view.frame.ActivitiesBox import ActivitiesBox
|
||||
from view.frame.ZoomBox import ZoomBox
|
||||
from view.frame.PanelWindow import PanelWindow
|
||||
from sugar.canvas.Timeline import Timeline
|
||||
from sugar.canvas.MenuShell import MenuShell
|
||||
from sugar.graphics.timeline import Timeline
|
||||
from sugar.graphics.menushell import MenuShell
|
||||
from sugar.graphics.grid import Grid
|
||||
|
||||
class EventFrame(gobject.GObject):
|
||||
|
@ -1,7 +1,7 @@
|
||||
import hippo
|
||||
|
||||
from sugar.graphics.CanvasIcon import CanvasIcon
|
||||
from sugar.canvas.IconColor import IconColor
|
||||
from sugar.graphics.iconcolor import IconColor
|
||||
from sugar.presence import PresenceService
|
||||
from view.BuddyIcon import BuddyIcon
|
||||
from model.BuddyModel import BuddyModel
|
||||
|
@ -4,7 +4,7 @@ import hippo
|
||||
import cairo
|
||||
|
||||
from sugar.canvas.CanvasView import CanvasView
|
||||
from sugar.canvas.MenuShell import MenuShell
|
||||
from sugar.graphics.menushell import MenuShell
|
||||
from view.home.MeshBox import MeshBox
|
||||
from view.home.HomeGroup import HomeGroup
|
||||
from view.home.FriendsBox import FriendsBox
|
||||
|
@ -5,7 +5,7 @@ import hippo
|
||||
from sugar.graphics.spreadlayout import SpreadLayout
|
||||
from sugar.graphics.canvasicon import CanvasIcon
|
||||
from view.BuddyIcon import BuddyIcon
|
||||
from sugar.canvas.SnowflakeLayout import SnowflakeLayout
|
||||
from sugar.graphics.snowflakelayout import SnowflakeLayout
|
||||
import conf
|
||||
|
||||
class ActivityView(hippo.CanvasBox):
|
||||
|
@ -1,6 +1,6 @@
|
||||
import conf
|
||||
from sugar.canvas.IconItem import IconItem
|
||||
from sugar.canvas.IconColor import IconColor
|
||||
from sugar.graphics.iconcolor import IconColor
|
||||
|
||||
class MyIcon(IconItem):
|
||||
def __init__(self, size):
|
||||
|
@ -7,7 +7,7 @@ import rsvg
|
||||
import cairo
|
||||
|
||||
from sugar.util import GObjectSingletonMeta
|
||||
from sugar.canvas.IconColor import IconColor
|
||||
from sugar.graphics.iconcolor import IconColor
|
||||
|
||||
class _IconCache:
|
||||
def __init__(self):
|
||||
|
@ -1,7 +1,7 @@
|
||||
import gtk
|
||||
|
||||
from sugar.graphics import style
|
||||
from sugar.canvas.IconColor import IconColor
|
||||
from sugar.graphics.iconcolor import IconColor
|
||||
|
||||
if gtk.gdk.screen_width() == 1200:
|
||||
_medium_icon_size = 75
|
||||
|
@ -6,7 +6,7 @@ import hippo
|
||||
import rsvg
|
||||
import cairo
|
||||
|
||||
from sugar.canvas.IconColor import IconColor
|
||||
from sugar.graphics.iconcolor import IconColor
|
||||
|
||||
class _IconCache:
|
||||
def __init__(self):
|
||||
|
@ -1,6 +1,6 @@
|
||||
import random
|
||||
|
||||
from sugar.canvas import Colors
|
||||
from sugar.graphics.colors import colors
|
||||
|
||||
def _parse_string(color_string):
|
||||
if color_string == 'white':
|
||||
@ -18,8 +18,8 @@ def is_valid(color_string):
|
||||
class IconColor:
|
||||
def __init__(self, color_string=None):
|
||||
if color_string == None or not is_valid(color_string):
|
||||
n = int(random.random() * (len(Colors.colors) - 1))
|
||||
[self._stroke, self._fill] = Colors.colors[n]
|
||||
n = int(random.random() * (len(colors) - 1))
|
||||
[self._stroke, self._fill] = colors[n]
|
||||
else:
|
||||
[self._stroke, self._fill] = _parse_string(color_string)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
from sugar.simulator import Bot
|
||||
from sugar.simulator import ShareActivityAction
|
||||
from sugar.canvas.IconColor import IconColor
|
||||
from sugar.graphics.iconcolor import IconColor
|
||||
import os, random, gobject
|
||||
|
||||
class KiuBot(Bot):
|
||||
|
@ -10,11 +10,11 @@ session.start()
|
||||
import gtk
|
||||
import goocanvas
|
||||
|
||||
from sugar.canvas.IconColor import IconColor
|
||||
from sugar.canvas.IconItem import IconItem
|
||||
from sugar.canvas.CanvasView import CanvasView
|
||||
from sugar.canvas.CanvasBox import CanvasBox
|
||||
from sugar.canvas.Grid import Grid
|
||||
from sugar.graphics.iconcolor import IconColor
|
||||
from sugar.graphics.IconItem import IconItem
|
||||
from sugar.graphics.CanvasView import CanvasView
|
||||
from sugar.graphics.CanvasBox import CanvasBox
|
||||
from sugar.graphics.Grid import Grid
|
||||
|
||||
def _new_icon_clicked_cb(icon):
|
||||
box.remove_child(icon)
|
||||
|
@ -15,10 +15,10 @@ import gtk
|
||||
import goocanvas
|
||||
|
||||
from view.home.IconLayout import IconLayout
|
||||
from sugar.canvas import IconColor
|
||||
from sugar.canvas.IconItem import IconItem
|
||||
from sugar.canvas.CanvasView import CanvasView
|
||||
from sugar.canvas.Grid import Grid
|
||||
from sugar.graphics import IconColor
|
||||
from sugar.graphics.IconItem import IconItem
|
||||
from sugar.graphics.CanvasView import CanvasView
|
||||
from sugar.graphics.Grid import Grid
|
||||
|
||||
def _create_icon():
|
||||
color = IconColor.IconColor()
|
||||
|
@ -13,9 +13,9 @@ import random
|
||||
import gtk
|
||||
import hippo
|
||||
|
||||
from sugar.canvas import IconColor
|
||||
from sugar.canvas.CanvasIcon import CanvasIcon
|
||||
from sugar.canvas.CanvasView import CanvasView
|
||||
from sugar.graphics import IconColor
|
||||
from sugar.graphics.CanvasIcon import CanvasIcon
|
||||
from sugar.graphics.CanvasView import CanvasView
|
||||
|
||||
window = gtk.Window()
|
||||
window.connect("destroy", lambda w: gtk.main_quit())
|
||||
|
@ -14,11 +14,11 @@ import random
|
||||
import gtk
|
||||
import goocanvas
|
||||
|
||||
from sugar.canvas.SnowflakeLayout import SnowflakeLayout
|
||||
from sugar.canvas import IconColor
|
||||
from sugar.canvas.IconItem import IconItem
|
||||
from sugar.canvas.CanvasView import CanvasView
|
||||
from sugar.canvas.Grid import Grid
|
||||
from sugar.graphics.snowflakelayout import SnowflakeLayout
|
||||
from sugar.graphics import IconColor
|
||||
from sugar.graphics.IconItem import IconItem
|
||||
from sugar.graphics.CanvasView import CanvasView
|
||||
from sugar.graphics.Grid import Grid
|
||||
|
||||
def _create_snowflake(group, children):
|
||||
color = IconColor.IconColor()
|
||||
|
@ -10,9 +10,9 @@ session.start()
|
||||
import gtk
|
||||
import goocanvas
|
||||
|
||||
from sugar.canvas import IconColor
|
||||
from sugar.canvas.IconItem import IconItem
|
||||
from sugar.canvas.CanvasView import CanvasView
|
||||
from sugar.graphics import IconColor
|
||||
from sugar.graphics.IconItem import IconItem
|
||||
from sugar.graphics.CanvasView import CanvasView
|
||||
|
||||
# Main window
|
||||
window = gtk.Window()
|
||||
|
Loading…
Reference in New Issue
Block a user