From 2b494ba78f4d17e9d376c0e727522191f55a95b4 Mon Sep 17 00:00:00 2001 From: noisymime Date: Mon, 4 Feb 2008 12:31:20 +0000 Subject: [PATCH] - Image previews in interfaces are now optional --- interfaces/Implementing Interfaces.txt | 2 ++ interfaces/ListMenu/ListMenu.py | 1 + interfaces/MenuItem.py | 6 ++++-- interfaces/WheelMenu/WheelMenu.py | 3 ++- modules/slideshow/slideshow.py | 7 +++++-- themeMgr.py | 2 +- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/interfaces/Implementing Interfaces.txt b/interfaces/Implementing Interfaces.txt index c0bb765..4f77f33 100644 --- a/interfaces/Implementing Interfaces.txt +++ b/interfaces/Implementing Interfaces.txt @@ -11,6 +11,8 @@ __init__ function takes form (self, glossMgr) #################################################### #Interfaces require the following to be implemented: #################################################### +Global Variables: +- usePreviewEffects (Bool) = Whether or not the modules should use preview effects Class Name = Interface - addItem(label) - display() diff --git a/interfaces/ListMenu/ListMenu.py b/interfaces/ListMenu/ListMenu.py index 11cfd14..29d7be3 100644 --- a/interfaces/ListMenu/ListMenu.py +++ b/interfaces/ListMenu/ListMenu.py @@ -10,6 +10,7 @@ from InputQueue import InputQueue #from interfaces.ListMenu import themeLoad class Interface(clutter.Group): + usePreviewEffects = True # Tells the modules to use any image preview effects where available font = "" menu_item_transition = None zoomLevel = 0.5 diff --git a/interfaces/MenuItem.py b/interfaces/MenuItem.py index 4af6b71..b0fc1a1 100644 --- a/interfaces/MenuItem.py +++ b/interfaces/MenuItem.py @@ -1,5 +1,7 @@ import clutter import pango +import gtk +import pygtk class MenuItem (clutter.Label): zoomLevel = 0.5 @@ -46,11 +48,11 @@ class MenuItem (clutter.Label): def add_image_from_path(self, path, x, y): - self.tempTexture = clutter.Texture() + tempTexture = clutter.Texture() pixbuf = gtk.gdk.pixbuf_new_from_file(path) tempTexture.set_pixbuf(pixbuf) - self.add_image_from_texture(tempTexture, x, y) + self.add_image_from_texture(tempTexture) def add_image_from_texture(self, texture): if texture is None: diff --git a/interfaces/WheelMenu/WheelMenu.py b/interfaces/WheelMenu/WheelMenu.py index 1fb1f77..db2e3cc 100644 --- a/interfaces/WheelMenu/WheelMenu.py +++ b/interfaces/WheelMenu/WheelMenu.py @@ -9,6 +9,7 @@ from interfaces.MenuItem import MenuItem from InputQueue import InputQueue class Interface(clutter.Group): + usePreviewEffects = False # Tells the modules NOT to use any effects on the images itemGroup = clutter.Group() menu_image_rotation = 0 @@ -122,7 +123,7 @@ class Interface(clutter.Group): tmpTexturesGroup.behaviour_opacity.apply(tmpItem) tmpTexturesGroup.behaviour_scale.apply(tmpItem) - tmpItem.set_position(tmpTexturesGroup.get_width(), 100) + tmpItem.set_position(-tmpTexturesGroup.get_width()*2, -1000) self.ang = self.ang + self.step tmpTexturesGroup.show() diff --git a/modules/slideshow/slideshow.py b/modules/slideshow/slideshow.py index 9e4a2bc..fe74ee2 100644 --- a/modules/slideshow/slideshow.py +++ b/modules/slideshow/slideshow.py @@ -391,8 +391,11 @@ class Module: img_previewer.add_texture(imgPath) #print imgPath #new_file_list = os.listdir(dirPath) - tempItem.itemTexturesGroup = img_previewer - img_previewer.set_position(tempItem.menu.menu_image_x, tempItem.menu.menu_image_y) + if tempMenu.usePreviewEffects: + tempItem.itemTexturesGroup = img_previewer + img_previewer.set_position(tempItem.menu.menu_image_x, tempItem.menu.menu_image_y) + else: + tempItem.add_image_from_path(imgPath, 0, 0) tempItem.setAction(self) diff --git a/themeMgr.py b/themeMgr.py index bd1d809..4b7d113 100644 --- a/themeMgr.py +++ b/themeMgr.py @@ -8,7 +8,7 @@ class ThemeMgr: defaultTheme = "default" currentTheme = "default" #currentTheme = "Pear" - #currentTheme = "Mich" + currentTheme = "Mich" def __init__(self, glossMgr): self.stage = glossMgr.stage