Merge branch 'master' of git+ssh://guillaume@dev.laptop.org/git/sugar
This commit is contained in:
commit
2312aa6a99
@ -103,11 +103,27 @@ get_key_from_event(SugarKeyGrabber *grabber, XEvent *xev)
|
||||
keycode = xev->xkey.keycode;
|
||||
state = xev->xkey.state;
|
||||
|
||||
if(grabber->last_key_pressed == keycode) {
|
||||
grabber->last_key_pressed = 0;
|
||||
}
|
||||
if(grabber->last_key_pressed_modifier == state) {
|
||||
grabber->last_key_pressed_modifier = 0;
|
||||
}
|
||||
|
||||
for (l = grabber->keys; l != NULL; l = l->next) {
|
||||
Key *keyinfo = (Key *)l->data;
|
||||
if (keyinfo->keycode == keycode &&
|
||||
(state & USED_MODS) == keyinfo->state) {
|
||||
return g_strdup(keyinfo->key);
|
||||
if (keyinfo->keycode == keycode) {
|
||||
if (xev->type == KeyPress &&
|
||||
(state & USED_MODS) == keyinfo->state) {
|
||||
|
||||
return g_strdup(keyinfo->key);
|
||||
} else if (xev->type == KeyRelease) {
|
||||
if(!grabber->last_key_pressed &&
|
||||
!grabber->last_key_pressed_modifier) {
|
||||
|
||||
return g_strdup(keyinfo->key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -139,6 +155,9 @@ filter_events(GdkXEvent *xevent, GdkEvent *event, gpointer data)
|
||||
|
||||
key = get_key_from_event(grabber, xevent);
|
||||
if (key) {
|
||||
grabber->last_key_pressed = xev->xkey.keycode;
|
||||
grabber->last_key_pressed_modifier = xev->xkey.state;
|
||||
|
||||
g_signal_emit (grabber, signals[KEY_PRESSED], 0, key);
|
||||
g_free(key);
|
||||
|
||||
@ -161,6 +180,8 @@ sugar_key_grabber_init(SugarKeyGrabber *grabber)
|
||||
screen = gdk_screen_get_default();
|
||||
grabber->root = gdk_screen_get_root_window(screen);
|
||||
grabber->keys = NULL;
|
||||
grabber->last_key_pressed = 0;
|
||||
grabber->last_key_pressed_modifier = 0;
|
||||
|
||||
gdk_window_add_filter(grabber->root, filter_events, grabber);
|
||||
}
|
||||
|
@ -39,6 +39,8 @@ struct _SugarKeyGrabber {
|
||||
|
||||
GdkWindow *root;
|
||||
GList *keys;
|
||||
guint last_key_pressed;
|
||||
guint last_key_pressed_modifier;
|
||||
};
|
||||
|
||||
struct _SugarKeyGrabberClass {
|
||||
|
@ -358,9 +358,6 @@ class ServerPlugin(gobject.GObject):
|
||||
except dbus.DBusException, e:
|
||||
if str(e).startswith("org.freedesktop.DBus.Error.NoReply"):
|
||||
raise InvalidBuddyError("couldn't get properties")
|
||||
except KeyError, e:
|
||||
if str(e) == "'%s'" % CONN_INTERFACE_BUDDY_INFO:
|
||||
raise InvalidBuddyError("server doesn't support BuddyInfo interface")
|
||||
|
||||
if not props.has_key('color'):
|
||||
raise InvalidBuddyError("no color")
|
||||
|
@ -1,4 +1,7 @@
|
||||
confdir = $(pkgdatadir)
|
||||
conf_DATA = kbdconfig
|
||||
|
||||
EXTRA_DIST = $(conf_DATA)
|
||||
imagedir = $(pkgdatadir)
|
||||
image_DATA = default-picture.png
|
||||
|
||||
EXTRA_DIST = $(conf_DATA) $(image_DATA)
|
||||
|
BIN
shell/data/default-picture.png
Normal file
BIN
shell/data/default-picture.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
@ -300,7 +300,6 @@ class Device(gobject.GObject):
|
||||
|
||||
# Make sure the old one doesn't get a stuck state
|
||||
if self._active_network:
|
||||
self._active_network.disconnect(self._ssid_sid)
|
||||
self._active_network.set_state(NETWORK_STATE_NOTCONNECTED)
|
||||
|
||||
self._active_network = network
|
||||
|
@ -434,9 +434,8 @@ class NMInfo(object):
|
||||
is closed.
|
||||
"""
|
||||
if canceled:
|
||||
e = CanceledKeyRequestError("Request was canceled.")
|
||||
# key dialog dialog was canceled; send the error back to NM
|
||||
async_err_cb(e)
|
||||
async_err_cb(CanceledKeyRequestError())
|
||||
return
|
||||
|
||||
if not key or not auth_alg:
|
||||
|
@ -23,7 +23,7 @@ IW_AUTH_ALG_SHARED_KEY = 0x00000002
|
||||
|
||||
class WEPKeyDialog(gtk.Dialog):
|
||||
def __init__(self, net, async_cb, async_err_cb):
|
||||
gtk.Dialog.__init__(self)
|
||||
gtk.Dialog.__init__(self, flags=gtk.DIALOG_MODAL)
|
||||
self.set_title("Wireless Key Required")
|
||||
|
||||
self._net = net
|
||||
@ -48,6 +48,8 @@ class WEPKeyDialog(gtk.Dialog):
|
||||
self.set_default_response(gtk.RESPONSE_OK)
|
||||
self._update_response_sensitivity()
|
||||
|
||||
self._entry.grab_focus()
|
||||
|
||||
def get_key(self):
|
||||
return self._entry.get_text()
|
||||
|
||||
|
@ -63,6 +63,7 @@ class IntroFallbackVideo(gtk.EventBox):
|
||||
self._image = gtk.Image()
|
||||
self._image.set_from_stock(gtk.STOCK_OPEN, -1)
|
||||
self.add(self._image)
|
||||
self._image.show()
|
||||
self.connect('button-press-event', self._button_press_event_cb)
|
||||
|
||||
def play(self):
|
||||
@ -80,12 +81,15 @@ class IntroFallbackVideo(gtk.EventBox):
|
||||
resp = chooser.run()
|
||||
if resp == gtk.RESPONSE_ACCEPT:
|
||||
fname = chooser.get_filename()
|
||||
pixbuf = gtk.gdk.pixbuf_new_from_file(fname)
|
||||
self.emit('pixbuf', pixbuf)
|
||||
self.load_image(fname)
|
||||
chooser.hide()
|
||||
chooser.destroy()
|
||||
return True
|
||||
|
||||
def load_image(self, path):
|
||||
pixbuf = gtk.gdk.pixbuf_new_from_file(path)
|
||||
self.emit('pixbuf', pixbuf)
|
||||
|
||||
class VideoBox(hippo.CanvasBox, hippo.CanvasItem):
|
||||
__gtype_name__ = "SugarVideoBox"
|
||||
|
||||
@ -138,6 +142,10 @@ class VideoBox(hippo.CanvasBox, hippo.CanvasItem):
|
||||
self._img_widget = hippo.CanvasWidget()
|
||||
self._img_widget.props.widget = self._img
|
||||
|
||||
if not has_webcam:
|
||||
path = os.path.join(env.get_data_dir(),'default-picture.png')
|
||||
self._video.load_image(path)
|
||||
|
||||
def _clear_image_cb(self, widget, event):
|
||||
del self._pixbuf
|
||||
self._pixbuf = None
|
||||
|
@ -21,7 +21,7 @@ class DevicesModel(gobject.GObject):
|
||||
gobject.GObject.__init__(self)
|
||||
|
||||
self._devices = {}
|
||||
self.add_device(battery.Device())
|
||||
#self.add_device(battery.Device())
|
||||
|
||||
self._observe_network_manager()
|
||||
|
||||
|
@ -39,7 +39,7 @@ from sugar.emulator import Emulator
|
||||
import _sugar
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
program = 'sugar-shell'
|
||||
program = 'shell/sugar-shell'
|
||||
else:
|
||||
program = sys.argv[1]
|
||||
|
||||
@ -58,7 +58,7 @@ emulator = Emulator(width, height, fullscreen, dpi)
|
||||
emulator.start()
|
||||
|
||||
if sourcedir:
|
||||
program = os.path.join(os.path.join(sourcedir, 'shell'), program)
|
||||
program = os.path.join(sourcedir, program)
|
||||
os.execlp('dbus-launch', 'dbus-launch', '--exit-with-session', program, sourcedir)
|
||||
else:
|
||||
os.execlp('dbus-launch', 'dbus-launch', '--exit-with-session', program)
|
||||
|
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 12.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
||||
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
|
||||
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
|
||||
<!ENTITY stroke_color "#000000">
|
||||
<!ENTITY fill_color "#AAAAAA">
|
||||
]>
|
||||
<svg version="1.1" id="Icon" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="46.115" height="46.121"
|
||||
viewBox="0 0 46.115 46.121" overflow="visible" enable-background="new 0 0 46.115 46.121" xml:space="preserve">
|
||||
<path fill="&fill_color;" stroke="&stroke_color;" stroke-width="3.5" d="M23.059,1.75c11.77,0,21.307,9.543,21.307,21.309
|
||||
c0,11.768-9.537,21.312-21.307,21.312S1.75,34.826,1.75,23.059C1.751,11.293,11.29,1.75,23.059,1.75z"/>
|
||||
<line fill="&fill_color;" stroke="&stroke_color;" stroke-width="3.5" stroke-linecap="round" x1="15.351" y1="30.568" x2="30.564" y2="15.354"/>
|
||||
<line fill="&fill_color;" stroke="&stroke_color;" stroke-width="3.5" stroke-linecap="round" x1="15.351" y1="15.356" x2="30.564" y2="30.568"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.1 KiB |
@ -29,10 +29,6 @@ from sugar.graphics.entry import Entry
|
||||
def _button_activated_cb(button):
|
||||
print "_button_activated_cb"
|
||||
|
||||
import os
|
||||
theme = gtk.icon_theme_get_default()
|
||||
theme.prepend_search_path(os.path.join(os.path.dirname(__file__), 'data'))
|
||||
|
||||
window = gtk.Window()
|
||||
window.connect("destroy", lambda w: gtk.main_quit())
|
||||
window.show()
|
||||
|
@ -30,10 +30,6 @@ def _entry_button_activated_cb(entry, action_id):
|
||||
print "_entry_button_activated_cb: " + str(action_id)
|
||||
entry.props.text = ''
|
||||
|
||||
import os
|
||||
theme = gtk.icon_theme_get_default()
|
||||
theme.prepend_search_path(os.path.join(os.path.dirname(__file__), 'data'))
|
||||
|
||||
window = gtk.Window()
|
||||
window.connect("destroy", lambda w: gtk.main_quit())
|
||||
window.show()
|
||||
|
@ -22,10 +22,6 @@ from sugar.graphics.toolbar import Toolbar
|
||||
from sugar.graphics.label import Label
|
||||
from sugar.graphics.iconbutton import IconButton
|
||||
|
||||
import os
|
||||
theme = gtk.icon_theme_get_default()
|
||||
theme.prepend_search_path(os.path.join(os.path.dirname(__file__), 'data'))
|
||||
|
||||
BUTTON_DELETE = 1
|
||||
|
||||
window = gtk.Window()
|
||||
|
@ -30,10 +30,6 @@ from sugar.graphics.iconbutton import IconButton
|
||||
def _option_menu_changed_cb(option_menu):
|
||||
print '_option_menu_activated_cb: %i' % option_menu.props.value
|
||||
|
||||
import os
|
||||
theme = gtk.icon_theme_get_default()
|
||||
theme.prepend_search_path(os.path.join(os.path.dirname(__file__), 'data'))
|
||||
|
||||
window = gtk.Window()
|
||||
window.connect("destroy", lambda w: gtk.main_quit())
|
||||
window.show()
|
||||
|
@ -1,6 +1,6 @@
|
||||
VERSION=0.63
|
||||
DATE=`date +%Y%m%d`
|
||||
RELEASE=2.44
|
||||
RELEASE=2.47
|
||||
TARBALL=sugar-$VERSION-$RELEASE.${DATE}git.tar.bz2
|
||||
|
||||
rm sugar-$VERSION.tar.bz2
|
||||
|
Loading…
Reference in New Issue
Block a user