#!/usr/bin/python # -*- coding: utf-8 -*- #Copyright (C) 2010 Federico Moreira - # Alejandro Esperón - # Esteban Arias - # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see import gtk from gettext import gettext as _ from sugar.activity.activity import Activity, ActivityToolbox from toolbar import ConfigToolbar import grid import config_nuevo _TOOLBAR_CONFIG = 1 class PrestameTuVozActivity(Activity): def __init__(self, handle): Activity.__init__(self, handle) self.config_load = False toolbox = ActivityToolbox(self) toolbar_config = ConfigToolbar(toolbox, self) toolbox.add_toolbar(_('Configuration'), toolbar_config) toolbar_config.show() self.set_toolbox(toolbox) toolbox.show() self.lista_tarjetas =[] self.pos_actual = 0 self.recording = False self.rec_process = None self.mainbox = gtk.VBox() #self.mainbox.pack_start(self.image) self.tablebox = grid.VentanaPrincipal() self.control = grid.ControlBarrido(self.tablebox) self.chatbox = grid.get_chat_box() self.tablebox.show_all() self.control.show_all() self.chatbox.show_all() self.mainbox.pack_start(self.control) self.mainbox.pack_start(self.tablebox) self.mainbox.pack_start(self.chatbox) self.set_canvas(self.mainbox) self.mainbox.show_all() self.toolbox.connect('current-toolbar-changed', self.change_mode) def change_mode(self, notebook, index): if index == _TOOLBAR_CONFIG: if not self.config_load: self.config_load = True self.mainbox.remove(self.control) self.mainbox.remove(self.tablebox) self.mainbox.remove(self.chatbox) self.ventana_config = config_nuevo.VentanaConfig() self.mainbox.pack_start(self.ventana_config) self.ventana_config.show_all() else: self.mainbox.remove(self.ventana_config) self.mainbox.pack_start(self.control) self.mainbox.pack_start(self.tablebox) self.mainbox.pack_start(self.chatbox)