Some build fixes. pygtk.require at least one time for process.

This commit is contained in:
Marco Pesenti Gritti 2006-07-20 16:49:11 +02:00
parent d6ec6db880
commit 32bb288389
4 changed files with 13 additions and 6 deletions

View File

@ -11,7 +11,7 @@ sugar_PYTHON = \
__init__.py \
ActivitiesModel.py \
ActivityRegistry.py \
ConsoleLogger.py \
ConsoleWindow.py \
Emulator.py \
Owner.py \
HomeWindow.py \

View File

@ -1,6 +1,8 @@
import os
import dbus
import pygtk
pygtk.require('2.0')
import gtk
import wnck
import gobject
@ -69,10 +71,14 @@ class Shell:
def get_current_activity(self):
window = self._screen.get_active_window()
if window and window.get_window_type() == wnck.WINDOW_NORMAL:
return ActivityHost(window.get_xid())
else:
return None
if window:
if window.get_window_type() == wnck.WINDOW_NORMAL:
return ActivityHost(window.get_xid())
elif window.get_window_type() == wnck.WINDOW_DIALOG:
parent = window.get_transient()
if not parent is None:
return ActivityHost(parent.get_xid())
return None
def show_people(self):
activity = self.get_current_activity()

View File

@ -2,6 +2,8 @@
import sys
import pygtk
pygtk.require('2.0')
import gobject
from sugar.activity import Activity

View File

@ -6,7 +6,6 @@ sugar_PYTHON = \
__installed__.py \
bots.py \
env.py \
keybindings.py \
theme.py \
util.py \
LogWriter.py