From 93350e0573fb2a973905b7b0e1283938915faecd Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sun, 13 Jan 2013 23:41:33 +0000 Subject: work-arounds --- diff --git a/activity.py b/activity.py index c4a4a12..5848918 100644 --- a/activity.py +++ b/activity.py @@ -38,7 +38,8 @@ from sugar3.graphics.radiotoolbutton import RadioToolButton from toolkit.toolitem import ToolWidget from toolkit.combobox import ComboBox -from toolkit.toolbarbox import ToolbarBox +# from toolkit.toolbarbox import ToolbarBox +from sugar3.graphics.toolbarbox import ToolbarBox from toolkit.activity import SharedActivity from toolkit.activity_widgets import * @@ -114,8 +115,8 @@ class SpeakActivity(SharedActivity): # make the text box active right away self.entry.grab_focus() - self.entry.connect("move-cursor", self._cursor_moved_cb) - self.entry.connect("changed", self._cursor_moved_cb) + # self.entry.connect("move-cursor", self._cursor_moved_cb) + # self.entry.connect("changed", self._cursor_moved_cb) # toolbar toolbox = ToolbarBox() @@ -251,10 +252,10 @@ class SpeakActivity(SharedActivity): self.pitchadj = Gtk.Adjustment(self.face.status.pitch, 0, espeak.PITCH_MAX, 1, espeak.PITCH_MAX/10, 0) - pitchbar = Gtk.HScale(self.pitchadj) + pitchbar = Gtk.HScale() # self.pitchadj) pitchbar.set_draw_value(False) # pitchbar.set_inverted(True) - pitchbar.set_update_policy(Gtk.UPDATE_DISCONTINUOUS) + # pitchbar.set_update_policy(Gtk.UPDATE_DISCONTINUOUS) pitchbar.set_size_request(240, 15) pitchbar_toolitem = ToolWidget( @@ -264,10 +265,10 @@ class SpeakActivity(SharedActivity): self.rateadj = Gtk.Adjustment(self.face.status.rate, 0, espeak.RATE_MAX, 1, espeak.RATE_MAX / 10, 0) - ratebar = Gtk.HScale(self.rateadj) + ratebar = Gtk.HScale()# self.rateadj) ratebar.set_draw_value(False) # ratebar.set_inverted(True) - ratebar.set_update_policy(Gtk.UPDATE_DISCONTINUOUS) + # ratebar.set_update_policy(Gtk.UPDATE_DISCONTINUOUS) ratebar.set_size_request(240, 15) ratebar_toolitem = ToolWidget( @@ -311,9 +312,9 @@ class SpeakActivity(SharedActivity): facebar.insert(eye_shape_toolitem, -1) self.numeyesadj = Gtk.Adjustment(2, 1, 5, 1, 1, 0) - numeyesbar = Gtk.HScale(self.numeyesadj) - numeyesbar.set_draw_value(False) - numeyesbar.set_update_policy(Gtk.UPDATE_DISCONTINUOUS) + numeyesbar = Gtk.HScale() #self.numeyesadj) + # numeyesbar.set_draw_value(False) + # numeyesbar.set_update_policy(Gtk.UPDATE_DISCONTINUOUS) numeyesbar.set_size_request(240, 15) numeyesbar_toolitem = ToolWidget( diff --git a/toolkit/activity.py b/toolkit/activity.py index 4a8b670..dd90d32 100644 --- a/toolkit/activity.py +++ b/toolkit/activity.py @@ -240,12 +240,12 @@ class Activity(activity.Activity): elif self.__state == _POST_INSTANCE: self.share_instance(tube_conn, initiator) """ -""" + class SharedActivity(Activity): - Basic activity class with sharing features + # Basic activity class with sharing features def __init__(self, canvas, service, handle): - + ''' Initialise the Activity. canvas -- Gtk.Widget @@ -258,13 +258,14 @@ class SharedActivity(Activity): instance providing the activity id and access to the presence service which *may* provide sharing for this application - + ''' Activity.__init__(self, canvas, handle) self.service = service - self.connect('shared', self._shared_cb) + # self.connect('shared', self._shared_cb) + ''' # Owner.props.key if self._shared_activity: # We are joining the activity @@ -272,6 +273,7 @@ class SharedActivity(Activity): if self.get_shared(): # We've already joined self._joined_cb() + ''' def _shared_cb(self, activity): logging.debug('My activity was shared') @@ -330,4 +332,4 @@ class SharedActivity(Activity): group_iface=self._text_chan[telepathy.CHANNEL_INTERFACE_GROUP]) self._share(tube_conn, self.__initiator) -""" + diff --git a/toolkit/activity_widgets.py b/toolkit/activity_widgets.py index a3e3364..8cc8a6f 100644 --- a/toolkit/activity_widgets.py +++ b/toolkit/activity_widgets.py @@ -28,7 +28,8 @@ from sugar3.graphics.xocolor import XoColor from sugar3.graphics.icon import Icon from sugar3.bundle.activitybundle import ActivityBundle -from toolkit.toolbarbox import ToolbarButton +from sugar3.graphics.toolbarbox import ToolbarButton +#from toolkit.toolbarbox import ToolbarButton from toolkit.radiopalette import RadioPalette from toolkit.radiopalette import RadioMenuButton from sugar3.graphics import style @@ -168,7 +169,7 @@ class TitleEntry(Gtk.ToolItem): self.set_expand(False) self._update_title_sid = None - self.entry = Gtk.Entry(buffer=kwargs) + self.entry = Gtk.Entry() # buffer=kwargs) self.entry.set_size_request(int(Gdk.Screen.width() / 3), -1) self.entry.set_text(activity.metadata['title']) self.entry.connect('changed', self.__title_changed_cb, activity) diff --git a/toolkit/combobox.py b/toolkit/combobox.py index b7d3ca2..6e24080 100644 --- a/toolkit/combobox.py +++ b/toolkit/combobox.py @@ -22,7 +22,7 @@ STABLE. from gi.repository import GObject from gi.repository import Gtk -from gi.repository import Gdk +from gi.repository import Gdk, GdkPixbuf class ComboBox(Gtk.ComboBox): @@ -39,7 +39,7 @@ class ComboBox(Gtk.ComboBox): GObject.TYPE_BOOLEAN) self.set_model(model) - self.set_row_separator_func(self._is_separator) + self.set_row_separator_func(self._is_separator, True) def get_value(self): """ diff --git a/toolkit/toolbarbox.py b/toolkit/toolbarbox.py index 71766a1..6d6deef 100644 --- a/toolkit/toolbarbox.py +++ b/toolkit/toolbarbox.py @@ -61,7 +61,7 @@ class ToolbarButton(ToolButton): return self.page_widget, alignment_ = _embed_page(_Box, page) - w_, h = Gtk.icon_size_lookup(Gtk.IconSize.LARGE_TOOLBAR) + # w_, h = Gtk.icon_size_lookup(Gtk.IconSize.LARGE_TOOLBAR) page.show() if self.props.palette is None: @@ -272,7 +272,8 @@ class _Box(Gtk.EventBox): def __init__(self): GObject.GObject.__init__(self) - self.connect('expose-event', self.do_expose_event) + # self.connect('expose-event', self.do_expose_event) + self.connect('draw', self.do_expose_event) self.set_app_paintable(True) def do_expose_event(self, widget, event): -- cgit v0.9.1