Patch by Simon to make sugar start when not connected to wireless.

This commit is contained in:
Marco Pesenti Gritti 2007-08-16 17:32:29 +02:00
parent d0a564e035
commit f056056691
2 changed files with 15 additions and 4 deletions

View File

@ -52,6 +52,8 @@ class ActivityToolbar(gtk.Toolbar):
self._activity = activity
activity.connect('shared', self._activity_shared_cb)
activity.connect('joined', self._activity_shared_cb)
activity.connect('notify::max_participants',
self._max_participants_changed_cb)
if activity.metadata:
self.title = gtk.Entry()
@ -94,10 +96,11 @@ class ActivityToolbar(gtk.Toolbar):
self._update_title_sid = None
def _update_share(self):
max_participants = self._activity.props.max_participants
if self._activity.get_shared():
self.share.set_sensitive(False)
self.share.combo.set_active(self.SHARE_NEIGHBORHOOD)
else:
elif max_participants == -1 or max_participants > 0:
self.share.set_sensitive(True)
self.share.combo.set_active(self.SHARE_PRIVATE)
@ -139,6 +142,9 @@ class ActivityToolbar(gtk.Toolbar):
def _activity_shared_cb(self, activity):
self._update_share()
def _max_participants_changed_cb(self, activity, pspec):
self._update_share()
class EditToolbar(gtk.Toolbar):
def __init__(self):
gtk.Toolbar.__init__(self)
@ -185,7 +191,8 @@ class Activity(Window, gtk.Container):
}
__gproperties__ = {
'active': (bool, None, None, False, gobject.PARAM_READWRITE)
'active': : (bool, None, None, False, gobject.PARAM_READWRITE)
'max-participants': (int, -1, 1000, 0, gobject.PARAM_READWRITE)
}
def __init__(self, handle, create_jobject=True):
@ -235,6 +242,7 @@ class Activity(Window, gtk.Container):
self._preview = None
self._updating_jobject = False
self._closing = False
self._max_participants = -1
shared_activity = handle.get_shared_activity()
if shared_activity:
@ -284,6 +292,8 @@ class Activity(Window, gtk.Container):
def do_get_property(self, pspec):
if pspec.name == 'active':
return self._active
elif pspec.name == 'max-participants':
return self._max_participants
def get_id(self):
return self._activity_id

View File

@ -175,6 +175,7 @@ class Palette(gtk.Window):
return gtk.gdk.Rectangle(x, y, width, height)
def set_primary_text(self, label, accel_path=None):
if label is not None:
self._label.set_text(label)
self._label.show()