diff options
author | Ignacio Rodríguez <ignaciorodriguez@sugarlabs.org> | 2012-10-29 13:45:26 (GMT) |
---|---|---|
committer | Ignacio Rodríguez <ignaciorodriguez@sugarlabs.org> | 2012-10-29 13:45:26 (GMT) |
commit | 410b145d6e118dcee0bf5fba0c4cd16dd23cb32f (patch) | |
tree | 7d42b55c0cd32ecb0d73f8457f782b3c3d1bed05 | |
parent | 22ca74050cff3fa35421596958b011bd5d4d3758 (diff) |
Programa Finalizado, necesitamos una traducción!
-rw-r--r-- | Combo.py | 38 | ||||
-rw-r--r-- | README | 0 | ||||
-rw-r--r-- | abook.py | 695 | ||||
-rw-r--r-- | activity/activity-adventurebook.svg | 4 | ||||
-rw-r--r-- | activity/activity.info | 8 | ||||
-rw-r--r-- | book.py | 121 | ||||
-rw-r--r-- | icons/broken.svg | 38 | ||||
-rw-r--r-- | icons/credits.svg | 87 | ||||
-rw-r--r-- | icons/edit-c.svg | 128 | ||||
-rw-r--r-- | icons/edit-p.svg | 86 | ||||
-rw-r--r-- | icons/edit.svg | 93 | ||||
-rw-r--r-- | icons/home.svg | 82 | ||||
-rw-r--r-- | icons/new.svg | 101 | ||||
-rw-r--r-- | icons/open-from-journal.svg | 131 | ||||
-rw-r--r-- | icons/read.svg | 89 | ||||
-rw-r--r-- | setup.py | 21 | ||||
-rw-r--r-- | textbook.py | 95 |
17 files changed, 1817 insertions, 0 deletions
diff --git a/Combo.py b/Combo.py new file mode 100644 index 0000000..0c93d9c --- /dev/null +++ b/Combo.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Combo.py +# Extraido de CeibalNotifica +# Flavio Danesse +import gtk +import gobject +class Combo(gtk.ComboBox): + __gsignals__ = {"change_selection": (gobject.SIGNAL_RUN_FIRST, + gobject.TYPE_NONE, (gobject.TYPE_STRING, ))} + def __init__(self): + gtk.ComboBox.__init__(self, gtk.ListStore(str)) + cell = gtk.CellRendererText() + self.pack_start(cell, True) + self.add_attribute(cell, 'text', 0) + self.show_all() + self.connect("changed", self.emit_selection) + + def set_items(self, items): + self.get_model().clear() + + for item in items: + self.append_text(str(item)) + self.set_active(0) + + def emit_selection(self, widget): + indice = widget.get_active() + if indice < 0: return + iter = widget.get_model().get_iter(indice) + value = widget.get_model().get_value(iter, 0) + self.emit("change_selection", value) + + def get_value_select(self): + indice = self.get_active() + if indice < 0: return None + iter = self.get_model().get_iter(indice) + value = self.get_model().get_value(iter, 0) + return value diff --git a/abook.py b/abook.py new file mode 100644 index 0000000..0f78f88 --- /dev/null +++ b/abook.py @@ -0,0 +1,695 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# abook.py + +# Copyright 2012 Gabriel Eirea +# Copyright 2012 Ignacio Rodríguez + +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# Contact information: + +# Gabriel Eirea geirea@gmail.com +# ceibalJAM! ceibaljam.org + +# Ignacio Rodríguez nachoel01@gmail.com +# ceibalJAM! ceibaljam.org + +import json + +from gettext import gettext as _ +import gtk + +from sugar import profile +from sugar import mime +from sugar.activity import activity +from sugar.activity.widgets import StopButton +from sugar.activity.widgets import ActivityToolbarButton +from sugar.activity.widgets import ToolbarButton +from sugar.graphics.icon import Icon +from sugar.graphics.colorbutton import ColorToolButton +from sugar.graphics.toolbarbox import ToolbarBox +from sugar.graphics.toolbutton import ToolButton +from sugar.graphics.objectchooser import ObjectChooser +from sugar.graphics.alert import Alert, NotifyAlert +import pango + +from book import cBook +from book import cPage +from book import cOption +from textbook import tutorial_book +from textbook import empty_book +from textbook import credits_book +from Combo import Combo +# ColorToolButton +# Color for Font +Tamano = Combo() +Tamano.set_items(["8","10","12","24","32","48","72"]) +Colore = ColorToolButton() + +class AdventureBookActivity(activity.Activity): + + def __init__(self, handle): + activity.Activity.__init__(self, handle, True) + + # Toolbar + toolbarbox = ToolbarBox() + Colore.set_title(_('Select color for font and go to home page')) + Colore.connect('notify::color', self.Home) + Tamano.connect('change_selection', self.Home) + # The Activity Button: + activity_button = ActivityToolbarButton(self) + W = gtk.Label(_('Select a size for font\nand go to home page')) + # Insert the Activity Toolbar Button in the toolbarbox + toolbarbox.toolbar.insert(activity_button, 0) + + # Separator + separator = gtk.SeparatorToolItem() + separator.set_expand(False) + separator.set_draw(True) + toolbarbox.toolbar.insert(separator, -1) + Item = gtk.ToolItem() + Item.add(Tamano) + It = gtk.ToolItem() + It.add(W) + toolbarbox.toolbar.insert(Colore, -1) + toolbarbox.toolbar.insert(It, -1) + toolbarbox.toolbar.insert(Item, -1) + Item.show() + It.show() + W.show() + Tamano.show() + toolbarbox.toolbar.insert(gtk.SeparatorToolItem(), -1) + Colore.show() + + + # read toolbar + read_button = ToolbarButton(icon_name="read") + read_toolbar = gtk.Toolbar() + + restart_button = ToolButton("home") + restart_button.set_tooltip(_("Start from the begining")) + restart_button.connect("clicked", self._restart_button_cb) + read_toolbar.insert(restart_button, -1) + reading_button = ToolButton("read") + reading_button.set_tooltip(_("Read the book")) + reading_button.connect("clicked", self._read_button_cb) + read_toolbar.insert(reading_button, -1) + load_button = ToolButton("open-from-journal") + load_button.set_tooltip(_("Load book from Journal")) + load_button.connect("clicked", self._load_button_cb) + read_toolbar.insert(load_button, -1) + read_button.props.page = read_toolbar + read_toolbar.show_all() + toolbarbox.toolbar.insert(read_button, -1) + Sep = gtk.SeparatorToolItem() + Sep.set_expand(False) + Sep.set_draw(True) + read_toolbar.insert(Sep, -1) + Sep.show() + credits = ToolButton("credits") + credits.set_tooltip(_("Credits")) + credits.connect("clicked", self.Credits) + read_toolbar.insert(credits, -1) + credits.show() + # write toolbar + write_button = ToolbarButton(icon_name="edit") + write_toolbar = gtk.Toolbar() + new_button = ToolButton("new") + new_button.set_tooltip(_("New book")) + new_button.connect("clicked", self._new_button_cb) + write_toolbar.insert(new_button, -1) + book_button = ToolButton("edit-p") + book_button.set_tooltip(_("Edit book properties")) + book_button.connect("clicked", self._edit_book_button_cb, Colore.get_color()) + write_toolbar.insert(book_button, -1) + page_button = ToolButton("edit-c") + page_button.set_tooltip(_("Edit book contents")) + page_button.connect("clicked", self._edit_page_button_cb) + write_toolbar.insert(page_button, -1) + check_button = ToolButton("broken") + check_button.set_tooltip(_("Check book for missing parts")) + check_button.connect("clicked", self._check_button_cb, Colore.get_color()) + write_toolbar.insert(check_button, -1) + write_button.props.page = write_toolbar + write_toolbar.show_all() + toolbarbox.toolbar.insert(write_button, -1) + # Separator + separator = gtk.SeparatorToolItem() + separator.set_expand(True) + separator.set_draw(False) + toolbarbox.toolbar.insert(separator, -1) + + # Stop button + stopbtn = StopButton(self) + toolbarbox.toolbar.insert(stopbtn, -1) + + # Set toolbar box + self.set_toolbar_box(toolbarbox) + + # Define main view as a vbox container + self._main_view = gtk.VBox() + self.set_canvas(self._main_view) + + # Load tutorial book for first-time runs + self._book = tutorial_book() + self._start_book(Colore.get_color()) + + def Home(self, widget, pspec): + self._restart_button_cb(None) + def _clean_main_view(self): + + for w in self._main_view.get_children(): + self._main_view.remove(w) + + + def _start_book(self, Color): + Tam = pango.FontDescription(Tamano.get_active_text()) + self._clean_main_view() + title_label = gtk.Label(self._book.get_title()) + title_label.modify_fg(gtk.STATE_NORMAL, Color) + title_label.modify_font(Tam) + title_label.show() + author_label = gtk.Label(self._book.get_author()) + author_label.modify_fg(gtk.STATE_NORMAL, Color) + author_label.show() + author_label.modify_font(Tam) + license_label = gtk.Label(self._book.get_license()) + license_label.modify_fg(gtk.STATE_NORMAL, Color) + license_label.show() + license_label.modify_font(Tam) + start_button = gtk.Button(_("Start reading")) + start_button.connect('clicked', self._start_button_cb) + + self._main_view.pack_start(title_label) + self._main_view.pack_start(author_label) + self._main_view.pack_start(license_label) + self._main_view.pack_start(start_button) + + self.show_all() + + self._current_page = self._book.get_pages()[0] + + + def _start_button_cb(self, widget): + + self._current_page = self._book.get_pages()[0] + self._show_page(Colore.get_color()) + + + def _restart_button_cb(self, widget): + + self._start_book(Colore.get_color()) + + + def _read_button_cb(self, widget): + + self._show_page(Colore.get_color()) + + + def _show_page(self, Color): + self._clean_main_view() + Tam = pango.FontDescription(Tamano.get_active_text()) + + title_label = gtk.Label(self._current_page.get_title()) + title_label.modify_fg(gtk.STATE_NORMAL, Color) + title_label.show() + title_label.modify_font(Tam) + + text_label = gtk.Label(self._current_page.get_text()) + text_label.modify_fg(gtk.STATE_NORMAL, Color) + text_label.show() + text_label.modify_font(Tam) + + self._main_view.pack_start(title_label) + self._main_view.pack_start(text_label) + + for o in self._current_page.get_options(): + o_button = gtk.Button(o.get_text()) + o_button.connect('clicked', self._option_button_cb, o) + self._main_view.pack_start(o_button) + + self.show_all() + + + def _option_button_cb(self, widget, option): + + self._current_page = option.get_page() + self._show_page(Colore.get_color()) + + + def _load_button_cb(self, widget): + + chooser = ObjectChooser(parent=self) + result = chooser.run() + if result == gtk.RESPONSE_ACCEPT: + try: + jobject = chooser.get_selected_object() + _file_path = str(jobject.get_file_path()) + self.read_file(_file_path) + alerta = NotifyAlert(10) + alerta.props.title = _('Good!') + alerta.props.msg = _('Book loaded') + alerta.connect('response', lambda w, i: self.remove_alert(w)) + self.add_alert(alerta) + except IOError: + alerta = NotifyAlert(10) + alerta.props.title = 'Error' + alerta.props.msg = _('Error in load book') + alerta.connect('response', lambda w, i: self.remove_alert(w)) + self.add_alert(alerta) + else: + return + + + def _new_button_cb(self, widget): + + self._book = empty_book() + self._start_book(Colore.get_color()) +# self._start_button_cb(widget) + def Credits(self, widget): + self._book = credits_book() + self._start_book(Colore.get_color()) + + def _edit_book_button_cb(self, widget, Color): + Tam = pango.FontDescription('8') + + self._clean_main_view() + + header_label = gtk.Label(_("Edit book properties")) + header_label.modify_font(Tam) + header_label.modify_fg(gtk.STATE_NORMAL, Color) + self._main_view.pack_start(header_label) + + title_hbox = gtk.HBox() + title_label = gtk.Label(_("Book title")) + title_label.modify_font(Tam) + title_label.modify_fg(gtk.STATE_NORMAL, Color) + + title_hbox.pack_start(title_label) + title_entry = gtk.Entry() + title_entry.set_text(self._book.get_title()) + title_entry.connect("changed", self._title_changed_cb) + title_hbox.pack_start(title_entry) + self._main_view.pack_start(title_hbox) + + author_hbox = gtk.HBox() + author_label = gtk.Label(_("Book author")) + author_label.modify_font(Tam) + author_label.modify_fg(gtk.STATE_NORMAL, Color) + author_hbox.pack_start(author_label) + author_entry = gtk.Entry() + author_entry.set_text(self._book.get_author()) + author_entry.connect("changed", self._author_changed_cb) + author_hbox.pack_start(author_entry) + self._main_view.pack_start(author_hbox) + + license_hbox = gtk.HBox() + license_label = gtk.Label(_("Book license")) + license_label.modify_font(Tam) + license_label.modify_fg(gtk.STATE_NORMAL, Color) + license_hbox.pack_start(license_label) + license_combo = gtk.combo_box_new_text() + license_combo.append_text(_("CC-BY")) + license_combo.append_text(_("CC-BY-SA")) + license_combo.append_text(_("CC-BY-NC")) + license_combo.append_text(_("CC-BY-NC-SA")) + license_combo.append_text(_("Copyright")) + license_tree_model = license_combo.get_model() + # next loop is to set the right entry in the combo + for i in license_tree_model: + license_combo.set_active_iter(i.iter) + if self._book.get_license() == license_combo.get_active_text(): + break + license_combo.connect("changed", self._license_changed_cb) + license_hbox.pack_start(license_combo) + self._main_view.pack_start(license_hbox) + + self.show_all() + + + def _title_changed_cb(self, w): + + self._book.set_title(w.get_text()) + + + def _author_changed_cb(self, w): + + self._book.set_author(w.get_text()) + + + def _license_changed_cb(self, w): + + self._book.set_license(w.get_active_text()) + + + def _edit_page_button_cb(self, widget): + + self._clean_main_view() + + page_hbox = gtk.HBox() + list_vbox = gtk.VBox() + page_vbox = gtk.VBox() + page_list_model = gtk.ListStore(str) + for p in self._book.get_pages(): + page_list_model.append([p.get_title()]) + page_list_view = gtk.TreeView(model=page_list_model) + page_list_view.get_selection().set_mode(gtk.SELECTION_SINGLE) + page_list_view.connect("cursor-changed", + self._page_selected_for_edition_cb, + page_vbox, Colore.get_color()) + page_list_view.set_cursor(0) # need to change to point to page + page_list_column = gtk.TreeViewColumn(_("Book pages")) + page_list_view.append_column(page_list_column) + page_list_cell = gtk.CellRendererText() + page_list_column.pack_start(page_list_cell) + page_list_column.add_attribute(page_list_cell, 'text', 0) + + add_page_button = gtk.Button(_("Add page")) + add_page_button.connect("clicked", self._add_page_button_cb, + page_list_model, page_list_view) + remove_page_button = gtk.Button(_("Remove page")) + remove_page_button.connect("clicked", self._remove_page_button_cb, + page_list_model, page_list_view) + + list_vbox.pack_start(page_list_view) + list_vbox.pack_start(add_page_button) + list_vbox.pack_start(remove_page_button) + + page_hbox.pack_start(list_vbox) + page_hbox.pack_start(page_vbox) + + self._main_view.pack_start(page_hbox) + + self.show_all() + + + def _add_page_button_cb(self, w, page_list_model, page_list_view): + + new_page = cPage(_("New page")) + self._book.add_page(new_page) + page_list_model.append([new_page.get_title()]) + # TODO: seleccionar nueva pagina + page_list_view.set_cursor(-1) + + + def _remove_page_button_cb(self, w, page_list_model, page_list_view): + + selection = page_list_view.get_selection() + treemodel, treeiter = selection.get_selected() + page_title = treemodel.get_value(treeiter, 0) + # next loop is to retrieve page from title + selected_page = None + for p in self._book.get_pages(): + if p.get_title() == page_title: + selected_page = p + break + if selected_page == None: + print "ERROR: couldn't find page " + page_title + + # before remove, check that no option points to it!!!!!!!! + pointed_to = False + for p in self._book.get_pages(): + for o in p.get_options(): + if o.get_page() == selected_page: + pointed_to = True + if pointed_to: + # error: can't remove + print "Can't remove" + return + + # ... and add confirmation? + + self._book.remove_page(selected_page) + page_list_model.remove(treeiter) + # TODO: seleccionar nueva pagina + page_list_view.set_cursor(0) + + + def _page_selected_for_edition_cb(self, w, page_vbox, Color): + Tam = pango.FontDescription(Tamano.get_active_text()) + + for ch in page_vbox.get_children(): + page_vbox.remove(ch) + + selection = w.get_selection() + treemodel, treeiter = selection.get_selected() + page_title = treemodel.get_value(treeiter, 0) + # next loop is to retrieve page from title + selected_page = None + for p in self._book.get_pages(): + if p.get_title() == page_title: + selected_page = p + break + + if selected_page == None: + print "ERROR: couldn't find page " + page_title + + title_hbox = gtk.HBox() + title_label = gtk.Label(_("Page title")) + title_label.modify_font(Tam) + title_label.modify_fg(gtk.STATE_NORMAL, Color) + title_hbox.pack_start(title_label) + title_entry = gtk.Entry() + title_entry.set_text(selected_page.get_title()) + title_entry.connect("changed", self._page_title_changed_cb, + p, treemodel, treeiter) + title_hbox.pack_start(title_entry) + page_vbox.pack_start(title_hbox) + + text_hbox = gtk.HBox() + text_label = gtk.Label(_("Page text")) + text_label.modify_font(Tam) + text_label.modify_fg(gtk.STATE_NORMAL, Color) + text_hbox.pack_start(text_label) + text_entry = gtk.TextBuffer() + text_entry_view = gtk.TextView(text_entry) + text_entry.set_text(selected_page.get_text()) + text_entry.connect("changed", self._page_text_changed_cb, + selected_page, treemodel, treeiter) + text_hbox.pack_start(text_entry_view) + page_vbox.pack_start(text_hbox) + + options_vbox =gtk.VBox() + option_label = gtk.Label(_("Options")) + option_label.modify_font(Tam) + option_label.modify_fg(gtk.STATE_NORMAL, Color) + options_vbox.pack_start(option_label) + page_options = selected_page.get_options() + for o in page_options: + option_hbox = gtk.HBox() + remove_button = gtk.Button(_("Remove")) + remove_button.connect("clicked", self._remove_option_button_cb, + selected_page, o, option_hbox) + option_hbox.pack_start(remove_button) + option_entry = gtk.Entry() + option_entry.set_text(o.get_text()) + option_entry.connect("changed", self._option_text_changed_cb, + o) + option_hbox.pack_start(option_entry) + page_dest_combo = gtk.combo_box_new_text() + for p in self._book.get_pages(): + page_dest_combo.append_text(p.get_title()) + page_dest_tree_model = page_dest_combo.get_model() + # next loop is to set the right entry in the combo + for i in page_dest_tree_model: + page_dest_combo.set_active_iter(i.iter) + if o.get_page().get_title() == \ + page_dest_combo.get_active_text(): + break + page_dest_combo.connect("changed", self._page_dest_changed_cb, + o) + option_hbox.pack_start(page_dest_combo) + options_vbox.pack_start(option_hbox) + + option_hbox = gtk.HBox() + add_button = gtk.Button(_("Add option")) + add_button.connect("clicked", self._add_option_button_cb, + selected_page, option_hbox, options_vbox) + option_hbox.pack_start(add_button) + options_vbox.pack_start(option_hbox) + + page_vbox.pack_start(options_vbox) + + page_vbox.show_all() + + + def _page_title_changed_cb(self, w, p, treemodel, treeiter): + + p.set_title(w.get_text()) + treemodel.set_value(treeiter, 0, w.get_text()) + + + def _page_text_changed_cb(self, w, p, treemodel, treeiter): + + p.set_text(w.get_text()) + + + def _option_text_changed_cb(self, w, option): + + option.set_text(w.get_text()) + + + def _remove_option_button_cb(self, w, page, option, option_hbox): + + page.remove_option(option) + option_hbox.get_parent().remove(option_hbox) + + + def _add_option_button_cb(self, w, page, option_hbox, options_vbox): + Tam = pango.FontDescription(Tamano.get_active_text()) + + w.get_parent().remove(w) + + new_option = cOption(_("Text"), self._book.get_pages()[0]) + page.add_option(new_option) + + remove_button = gtk.Button(_("Remove")) + remove_button.connect("clicked", self._remove_option_button_cb, + page, new_option, option_hbox) + option_hbox.pack_start(remove_button) + option_entry = gtk.Entry() + option_entry.set_text(new_option.get_text()) + option_entry.connect("changed", self._option_text_changed_cb, + new_option) + option_hbox.pack_start(option_entry) + page_dest_combo = gtk.combo_box_new_text() + for p in self._book.get_pages(): + page_dest_combo.append_text(p.get_title()) + page_dest_tree_model = page_dest_combo.get_model() + # next loop is to set the right entry in the combo + for i in page_dest_tree_model: + page_dest_combo.set_active_iter(i.iter) + if new_option.get_page().get_title() == \ + page_dest_combo.get_active_text(): + break + page_dest_combo.connect("changed", self._page_dest_changed_cb, + new_option) + option_hbox.pack_start(page_dest_combo) + option_hbox.show_all() + + option_new_hbox = gtk.HBox() + add_button = gtk.Button(_("Add option")) + add_button.connect("clicked", self._add_option_button_cb, + page, option_new_hbox, options_vbox) + option_new_hbox.pack_start(add_button) + options_vbox.pack_start(option_new_hbox) + options_vbox.show_all() + + + def _page_dest_changed_cb(self, w, option): + + for p in self._book.get_pages(): + if p.get_title() == w.get_active_text(): + option.set_page(p) + break + + + def _check_button_cb(self, widget, Color): + Tam = pango.FontDescription(Tamano.get_active_text()) + + self._clean_main_view() + # check that all pages are referenced + everything_ok = True + for p1 in self._book.get_pages(): + pointed_to = False + for p in self._book.get_pages(): + for o in p.get_options(): + if o.get_page() == p1: + pointed_to = True + if not pointed_to: + print "Page "+ p1.get_title() + " not referenced" + msg_label = gtk.Label("Error: Page '"+ p1.get_title() + "' not referenced from any other page") + msg_label.modify_fg(gtk.STATE_NORMAL, Color) + msg_label.modify_font(Tam) + self._main_view.pack_start(msg_label) + everything_ok = False + # check that all pages have different names + for p1 in self._book.get_pages(): + for p in self._book.get_pages(): + if p1.get_title() == p.get_title() and p1 != p: + msg_label = gtk.Label("Error: Page title '"+ p1.get_title() + "' is not unique") + msg_label.modify_fg(gtk.STATE_NORMAL, Color) + msg_label.modify_font(Tam) + self._main_view.pack_start(msg_label) + everything_ok = False + + if everything_ok: + msg_label = gtk.Label(_("Everything is OK")) + msg_label.modify_font(Tam) + msg_label.modify_fg(gtk.STATE_NORMAL, Color) + self._main_view.pack_start(msg_label) + + self._main_view.show_all() + + + def write_file(self, file_path): + + jfile = open(file_path, "w") + + pages_props = [] + for p in self._book.get_pages(): + options_props = [] + for o in p.get_options(): + options_props.append({'text': o.get_text(), + 'page': o.get_page().get_title()}) + pages_props.append({'title': p.get_title(), + 'text': p.get_text(), + 'options': options_props}) + book_props = {'title': self._book.get_title(), + 'author': self._book.get_author(), + 'license': self._book.get_license(), + 'pages': pages_props} + + try: + json.dump(book_props, jfile) + finally: + jfile.close() + + + def read_file(self, file_path): + + jfile = open(file_path, "r") + + try: + book_props = json.load(jfile) + finally: + jfile.close() + + self._book = cBook(book_props['title']) + self._book.set_author(book_props['author']) + self._book.set_license(book_props['license']) + page_list = book_props['pages'] + for p in page_list: + page_props = cPage(p['title']) + page_props.set_text(p['text']) + self._book.add_page(page_props) + for p in page_list: + for o in p['options']: + page_dest = None + page_orig = None + for pp in self._book.get_pages(): + if pp.get_title() == o['page']: + page_dest = pp + if pp.get_title() == p['title']: + page_orig = pp + if page_dest == None or page_orig == None: + print(_("Error while loading file")) + option_props = cOption(o['text'], page_dest) + page_orig.add_option(option_props) + + self._start_book(Colore.get_color()) + + diff --git a/activity/activity-adventurebook.svg b/activity/activity-adventurebook.svg new file mode 100644 index 0000000..2db8236 --- /dev/null +++ b/activity/activity-adventurebook.svg @@ -0,0 +1,4 @@ +<?xml version="1.0" ?><!-- Created with Inkscape (http://www.inkscape.org/) --><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [ + <!ENTITY stroke_color "#000000"> + <!ENTITY fill_color "#ffffff"> +]><svg height="55" id="svg2441" version="1.1" viewBox="0 0 55 55" width="55" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"><defs id="defs2453"/><g id="activity-read" style="display:block" transform="matrix(0.9254349,-0.00278581,0.0025781,0.9999961,3.8538887,-1.1596019)"><path d="m 27.904,11.023 -0.002,0 c 0,-0.002 -1.71,-2.053 -9.376,-2.504 C 10.86,8.07 6.843,10.121 6.84,10.122 4.942,10.741 3.345,11.857 3.345,13.616 l 0,27.702 c 0,2.025 1.235,3.494 3.495,3.494 0.003,0 4.41,-1.35 10.004,-1.35 5.589,-0.001 11.061,2.253 11.061,2.253" id="path2444" style="fill:&fill_color;;stroke:&stroke_color;;stroke-width:3.5;stroke-linejoin:round;display:inline"/><path d="m 27.898,11.023 0,0 c 0,-0.002 1.715,-2.053 9.377,-2.504 7.668,-0.449 11.686,1.602 11.688,1.603 1.897,0.619 3.494,1.735 3.494,3.494 l 0,27.702 c 0,2.025 -1.233,3.494 -3.494,3.494 -0.003,0 -4.409,-1.35 -10.004,-1.35 -5.589,-0.001 -11.062,2.253 -11.062,2.253" id="path2446" style="fill:&fill_color;;stroke:&stroke_color;;stroke-width:3.5;stroke-linejoin:round;display:inline"/><line display="inline" id="line2448" style="fill:none;stroke:&stroke_color;;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;display:inline" x1="27.898001" x2="27.9" y1="11.023" y2="45.716999"/><path d="m 32.566,44.275 c 0,0 -0.031,2.906 -4.666,2.906 -4.632,0 -4.663,-2.906 -4.663,-2.906" id="path2450" style="fill:none;stroke:&stroke_color;;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;display:inline"/></g><path d="m 17.5461,24.404762 a 0.41666666,0 0 0 1 0.01378,0 l -3.59e-4,0 z" id="path2489" style="fill:&fill_color;;fill-opacity:1;stroke:&stroke_color;;stroke-linecap:square;stroke-linejoin:bevel;stroke-opacity:1"/><path d="m 11.82657,15.969433 c 13.027924,0.02555 13.027924,0.02555 13.027924,0.02555" id="path2563" style="fill:none;stroke:&stroke_color;;stroke-width:1.22445309px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/><path d="m 11.861038,18.862225 c 13.027924,0.02555 13.027924,0.02555 13.027924,0.02555" id="path2563-0" style="fill:none;stroke:&stroke_color;;stroke-width:1.22445309px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/><path d="m 11.345619,12.792644 c 15.274294,0.02192 15.274294,0.02192 15.274294,0.02192" id="path2563-7" style="fill:none;stroke:&stroke_color;;stroke-width:1.22808146px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/><path d="m 10.005172,24.560521 c 15.399124,0.02175 15.399124,0.02175 15.399124,0.02175" id="path2563-0-5" style="fill:none;stroke:&stroke_color;;stroke-width:1.22825301px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/><path d="m 11.84488,27.791905 c 14.275772,0.0234 14.275772,0.0234 14.275772,0.0234" id="path2563-7-9" style="fill:none;stroke:&stroke_color;;stroke-width:1.22660446px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/><path d="m 11.879147,30.684496 c 14.026174,0.0238 14.026174,0.0238 14.026174,0.0238" id="path2563-0-5-2" style="fill:none;stroke:&stroke_color;;stroke-width:1.22620356px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/><path d="m 11.86181,34.112997 c 13.90138,0.02401 13.90138,0.02401 13.90138,0.02401" id="path2563-0-2" style="fill:none;stroke:&stroke_color;;stroke-width:1.22599804px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/><g id="Pencil" style="fill:&fill_color;;stroke:&stroke_color;" transform="matrix(0.49233604,0,0,0.49233604,49.171015,3.234495)"><g id="g3872" style="fill:&fill_color;;stroke:&stroke_color;;display:inline"><path d="m -54.808174,41.652842 c -0.053,0.132 -0.02,0.281 0.09,0.373 0.11,0.092 0.264,0.103 0.385,0.025 l 4.635,-2.984 -3.009,-2.407 -2.101,4.993 z m 30.24,-31.8979997 c 0,-0.073 -0.004,-0.15 -0.014,-0.227 -0.112,-0.949 -0.903,-2.109 -2.062,-3.025 -1.16,-0.915 -2.474,-1.413 -3.424,-1.304 -0.414,0.052 -0.747,0.228 -0.973,0.491 l -0.021,-0.015 -16.757,22.1789997 -0.073,0.073 -0.011,0.015 c -0.026,0.029 -0.029,0.069 -0.05,0.103 l -2.177,2.677 c 0,0 0.128,0.099 0.256,0.201 l -0.002,0.004 -0.009,0.011 c -0.128,-0.103 -0.252,-0.197 -0.252,-0.197 l -0.042,0.051 c -0.097,0.121 -0.155,0.271 -0.203,0.429 -0.015,0.019 -0.046,0.025 -0.057,0.048 l -1.361,3.236 4.097,3.278 3.202,-2.062 c 0.019,-0.011 0.015,-0.037 0.031,-0.052 0.083,-0.065 0.178,-0.121 0.243,-0.201 0.008,-0.011 0.043,-0.059 0.048,-0.062 l 2.237,-2.79 0.033,-0.033 -0.004,-0.004 0.023,-0.029 0.006,0.004 16.939,-21.85 c 0.029,-0.029 0.071,-0.044 0.1,-0.077 0.032,-0.044 0.049,-0.103 0.076,-0.15 l 0.015,-0.019 -0.003,-0.003 c 0.117,-0.205 0.189,-0.432 0.189,-0.6999997 z" id="path3874" style="fill:&fill_color;;stroke:&stroke_color;"/></g></g></svg>
\ No newline at end of file diff --git a/activity/activity.info b/activity/activity.info new file mode 100644 index 0000000..9e404cb --- /dev/null +++ b/activity/activity.info @@ -0,0 +1,8 @@ +[Activity] +name = Adventure Book +activity_version = 1 +show_launcher = 1 +bundle_id = org.ceibaljam.AdventureBook +exec = sugar-activity abook.AdventureBookActivity -s +icon = activity-adventurebook +license = GPLv3+ @@ -0,0 +1,121 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# book.py + +# Copyright 2012 Gabriel Eirea +# geirea@gmail.com + +# Copyright 2012 Ignacio Rodríguez +# nachoel01@gmail.com + +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import random + +class cBook(object): + + def __init__(self, title, author = '', book_license=''): + self._title = title + self._author = author + self._license = book_license + self._pages = [] + self._pageids = set() + + def set_title(self, text): + self._title = text + + def get_title(self): + return self._title + + def set_author(self, text): + self._author = text + + def get_author(self): + return self._author + + def set_license(self, text): + self._license = text + + def get_license(self): + return self._license + + def add_page(self, page): + self._pages.append(page) +# while page.get_id() in self._pageids: +# page.set_id() + self._pageids.add(page.get_id()) + + def get_pages(self): + return self._pages + + def remove_page(self, page): + self._pages.remove(page) + self._pageids.remove(page.get_id()) + + +class cPage(object): + + def __init__(self, title, text = ''): + self._title = title + self._text = text + self._options = [] + self.set_id() + + def set_title(self, text): + self._title = text + + def get_title(self): + return self._title + + def set_id(self): + self._id = random.randrange(100000) + + def get_id(self): + return self._id + + def set_text(self, text): + self._text = text + + def get_text(self): + return self._text + + def add_option(self, option): + self._options.append(option) + + def get_options(self): + return self._options + + def remove_option(self, option): + self._options.remove(option) + + +class cOption(object): + + def __init__(self, text, page): + self._text = text + self._page = page + + def set_text(self, text): + self._text = text + + def get_text(self): + return self._text + + def set_page(self, page): + self._page = page + + def get_page(self): + return self._page + diff --git a/icons/broken.svg b/icons/broken.svg new file mode 100644 index 0000000..bf05d05 --- /dev/null +++ b/icons/broken.svg @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.1" + width="55" + height="55" + viewBox="0 0 55 55" + id="svg2441" + xml:space="preserve"><metadata + id="metadata22"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs2453" /><g + transform="matrix(1.0438471,-0.00307797,0.00290798,1.1048696,-1.4972545,-2.8103146)" + id="activity-read" + style="fill:#ffffff;display:block"><path + d="m 27.400478,21.760432 -0.800483,3.279086 C 26.599995,25.037518 26.192,8.97 18.526,8.519 10.86,8.07 6.843,10.121 6.84,10.122 4.942,10.741 3.345,11.857 3.345,13.616 l 0,27.702 c 0,2.025 1.235,3.494 3.495,3.494 0.003,0 4.41,-1.35 10.004,-1.35 5.589,-0.001 9.995809,-12.068414 9.995809,-12.068414" + id="path2444" + style="fill:#ffffff;stroke:#000000;stroke-width:3.5;stroke-linejoin:round;display:inline" /><path + d="m 27.875563,19.077064 -0.01745,6.264271 C 27.858112,25.339335 29.613,8.97 37.275,8.519 44.943,8.07 48.292396,9.6972761 48.294396,9.6982761 50.191396,10.317276 52.457,11.857 52.457,13.616 l 0,27.702 c 0,2.025 -1.233,3.494 -3.494,3.494 -0.003,0 -4.409,-1.35 -10.004,-1.35 C 33.37,43.461 26.830147,31.990183 26.830147,31.990183" + id="path2446" + style="fill:#ffffff;stroke:#000000;stroke-width:3.5;stroke-linejoin:round;display:inline" /><line + display="inline" + id="line2448" + style="fill:#ffffff;stroke:#000000;stroke-width:0.24227618;stroke-linecap:round;stroke-linejoin:round;display:inline" + x1="27.800886" + x2="27.9" + y1="45.882965" + y2="45.716999" /></g><path + d="m 13.946917,21.706271 a 0.007775,0 180 0 0 0.01555,0 l -4.05e-4,0 z" + id="path2489" + style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.11635375;stroke-linecap:square;stroke-linejoin:bevel;stroke-opacity:1" /></svg>
\ No newline at end of file diff --git a/icons/credits.svg b/icons/credits.svg new file mode 100644 index 0000000..675c7b7 --- /dev/null +++ b/icons/credits.svg @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + height="55" + id="svg2441" + version="1.1" + viewBox="0 0 55 55" + width="55" + xml:space="preserve" + inkscape:version="0.48.2 r9819" + sodipodi:docname="credits.svg"><metadata + id="metadata22"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1259" + inkscape:window-height="577" + id="namedview20" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="1.5051873" + inkscape:cy="27.5" + inkscape:window-x="149" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="svg2441" + showguides="true" + inkscape:guide-bbox="true" /><defs + id="defs2453" /><g + id="activity-read" + style="display:block;fill:#ffffff" + transform="matrix(1.0438471,-0.00307797,0.00290798,1.1048696,-1.4972545,-6.5391282)"><path + d="m 27.904,11.023 -0.002,0 c 0,-0.002 -1.71,-2.053 -9.376,-2.504 C 10.86,8.07 6.843,10.121 6.84,10.122 4.942,10.741 3.345,11.857 3.345,13.616 l 0,27.702 c 0,2.025 1.235,3.494 3.495,3.494 0.003,0 4.41,-1.35 10.004,-1.35 5.589,-0.001 11.061,2.253 11.061,2.253" + id="path2444" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /><path + d="m 27.898,11.023 0,0 c 0,-0.002 1.715,-2.053 9.377,-2.504 7.668,-0.449 11.686,1.602 11.688,1.603 1.897,0.619 3.494,1.735 3.494,3.494 l 0,27.702 c 0,2.025 -1.233,3.494 -3.494,3.494 -0.003,0 -4.409,-1.35 -10.004,-1.35 -5.589,-0.001 -11.062,2.253 -11.062,2.253" + id="path2446" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /><line + display="inline" + id="line2448" + style="fill:#ffffff;stroke:#000000;stroke-width:0.24227618000000001;stroke-linecap:round;stroke-linejoin:round;display:inline" + x1="27.800886" + x2="27.9" + y1="45.882965" + y2="45.716999" /><path + d="m 32.566,44.275 c 0,0 -0.031,2.906 -4.666,2.906 -4.632,0 -4.663,-2.906 -4.663,-2.906" + id="path2450" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linecap:round;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /></g><path + d="m 13.946917,21.706271 a 0.007775,0 180 0 0 0.01555,0 l -4.05e-4,0 z" + id="path2489" + style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.11635375;stroke-linecap:square;stroke-linejoin:bevel;stroke-opacity:1" + inkscape:connector-curvature="0" /><path + sodipodi:type="star" + style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="path2992" + sodipodi:sides="5" + sodipodi:cx="21.673729" + sodipodi:cy="5.5932202" + sodipodi:r1="18.137587" + sodipodi:r2="9.0687923" + sodipodi:arg1="0.48088728" + sodipodi:arg2="1.1092058" + inkscape:flatsided="false" + inkscape:rounded="0" + inkscape:randomized="0" + d="M 37.754238,13.983051 25.712722,13.71292 18.663676,23.479294 15.199553,11.943656 3.7329046,8.2575907 13.633475,1.3983053 13.595742,-10.646182 23.178755,-3.3498157 34.622083,-7.1076527 30.64414,4.2610351 z" + inkscape:transform-center-x="-1.0885745" + inkscape:transform-center-y="-0.64342817" + transform="matrix(-0.31330237,0.84484885,-0.78750376,-0.29203662,38.952668,7.2253948)" /></svg>
\ No newline at end of file diff --git a/icons/edit-c.svg b/icons/edit-c.svg new file mode 100644 index 0000000..40322a1 --- /dev/null +++ b/icons/edit-c.svg @@ -0,0 +1,128 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + height="55" + id="svg2441" + version="1.1" + viewBox="0 0 55 55" + width="55" + xml:space="preserve" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="edit-c.svg"><metadata + id="metadata22"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1024" + inkscape:window-height="541" + id="namedview20" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="56.291048" + inkscape:cy="27.774791" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="svg2441" + showguides="true" + inkscape:guide-bbox="true" /><defs + id="defs2453" /><g + id="activity-read" + style="display:block;fill:#ffffff" + transform="matrix(1.0438471,-0.00307797,0.00290798,1.1048696,-1.4972545,-6.5391282)"><path + d="m 27.904,11.023 -0.002,0 c 0,-0.002 -1.71,-2.053 -9.376,-2.504 C 10.86,8.07 6.843,10.121 6.84,10.122 4.942,10.741 3.345,11.857 3.345,13.616 l 0,27.702 c 0,2.025 1.235,3.494 3.495,3.494 0.003,0 4.41,-1.35 10.004,-1.35 5.589,-0.001 11.061,2.253 11.061,2.253" + id="path2444" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /><path + d="m 27.898,11.023 0,0 c 0,-0.002 1.715,-2.053 9.377,-2.504 7.668,-0.449 11.686,1.602 11.688,1.603 1.897,0.619 3.494,1.735 3.494,3.494 l 0,27.702 c 0,2.025 -1.233,3.494 -3.494,3.494 -0.003,0 -4.409,-1.35 -10.004,-1.35 -5.589,-0.001 -11.062,2.253 -11.062,2.253" + id="path2446" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /><line + display="inline" + id="line2448" + style="fill:#ffffff;stroke:#000000;stroke-width:0.24227618000000001;stroke-linecap:round;stroke-linejoin:round;display:inline" + x1="27.800886" + x2="27.9" + y1="45.882965" + y2="45.716999" /><path + d="m 32.566,44.275 c 0,0 -0.031,2.906 -4.666,2.906 -4.632,0 -4.663,-2.906 -4.663,-2.906" + id="path2450" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linecap:round;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /></g><path + d="m 13.946917,21.706271 a 0.007775,0 180 0 0 0.01555,0 l -4.05e-4,0 z" + id="path2489" + style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.11635375;stroke-linecap:square;stroke-linejoin:bevel;stroke-opacity:1" + inkscape:connector-curvature="0" /> +<rect + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="rect2990" + width="38.919491" + height="2.5635593" + x="7.2245765" + y="12.817797" /><rect + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="rect2990-9" + width="38.919491" + height="2.5635593" + x="7.1080513" + y="20.158899" /><rect + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="rect2990-9-1" + width="38.919491" + height="2.5635593" + x="6.4088988" + y="26.684322" /><g + id="g3108" + transform="translate(59.454016,-11.507561)"><g + transform="matrix(1.0438471,-0.00307797,0.00290798,1.1048696,-1.4972545,-6.5391282)" + style="fill:#ffffff;display:block" + id="activity-read-9"><line + y2="45.716999" + y1="45.882965" + x2="27.9" + x1="27.800886" + style="fill:#ffffff;stroke:#000000;stroke-width:0.24227618;stroke-linecap:round;stroke-linejoin:round;display:inline" + id="line2448-5" + display="inline" /></g><path + inkscape:connector-curvature="0" + style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.11635375;stroke-linecap:square;stroke-linejoin:bevel;stroke-opacity:1" + id="path2489-6" + d="m 13.946917,21.706271 a 0.007775,0 180 0 0 0.01555,0 l -4.05e-4,0 z" /><g + transform="matrix(0.674165,0,0,0.66037088,7.8209795,4.6452138)" + display="block" + id="preferences-system" + style="fill:#ffffff;stroke:#000000;stroke-width:2.3485074;stroke-miterlimit:4;stroke-dasharray:none;display:block"> + <path + inkscape:connector-curvature="0" + d="m -35.442942,67.840467 c -2.538054,2.256734 -6.654404,2.256734 -9.191375,0 L -69.337826,45.876072 c -2.538054,-2.256734 -2.538054,-5.916825 0,-8.172597 l 0,0 c 2.538054,-2.256733 6.654403,-2.256733 9.191374,0 l 24.702427,21.964395 c 2.538054,2.255772 2.538054,5.915863 0.0011,8.172597 l 0,0 z" + style="fill:#ffffff;stroke:#000000;stroke-width:2.39889026;stroke-miterlimit:4;stroke-dasharray:none" + id="path9173" /> + <g + style="fill:#ffffff;stroke:#000000;stroke-width:2.3485074;stroke-miterlimit:4;stroke-dasharray:none" + id="g9175"> + <g + style="fill:#ffffff;stroke:#000000;stroke-width:2.3485074;stroke-miterlimit:4;stroke-dasharray:none" + id="g9177"> + <path + inkscape:connector-curvature="0" + d="m -71.504326,20.990347 c -0.870933,0 -1.719117,0.07802 -2.554303,0.192636 l 11.435867,10.169273 -13.85693,12.32102 -11.436951,-10.169273 c -0.128906,0.742613 -0.21665,1.497748 -0.21665,2.273109 0,8.166817 7.445176,14.786765 16.628967,14.786765 9.183791,0 16.628967,-6.619948 16.628967,-14.786765 0,-8.166816 -7.445176,-14.786765 -16.628967,-14.786765 z" + style="fill:#ffffff;stroke:#000000;stroke-width:2.39889026;stroke-miterlimit:4;stroke-dasharray:none" + id="path9179" /> + </g> + </g> +</g></g></svg>
\ No newline at end of file diff --git a/icons/edit-p.svg b/icons/edit-p.svg new file mode 100644 index 0000000..b3648cf --- /dev/null +++ b/icons/edit-p.svg @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + height="55" + id="svg2441" + version="1.1" + viewBox="0 0 55 55" + width="55" + xml:space="preserve" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="edit-c.svg"><metadata + id="metadata22"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1024" + inkscape:window-height="541" + id="namedview20" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="56.291048" + inkscape:cy="27.5" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="svg2441" + showguides="true" + inkscape:guide-bbox="true" /><defs + id="defs2453" /><g + id="activity-read" + style="display:block;fill:#ffffff" + transform="matrix(1.0438471,-0.00307797,0.00290798,1.1048696,-1.4972545,-6.5391282)"><path + d="m 27.904,11.023 -0.002,0 c 0,-0.002 -1.71,-2.053 -9.376,-2.504 C 10.86,8.07 6.843,10.121 6.84,10.122 4.942,10.741 3.345,11.857 3.345,13.616 l 0,27.702 c 0,2.025 1.235,3.494 3.495,3.494 0.003,0 4.41,-1.35 10.004,-1.35 5.589,-0.001 11.061,2.253 11.061,2.253" + id="path2444" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /><path + d="m 27.898,11.023 0,0 c 0,-0.002 1.715,-2.053 9.377,-2.504 7.668,-0.449 11.686,1.602 11.688,1.603 1.897,0.619 3.494,1.735 3.494,3.494 l 0,27.702 c 0,2.025 -1.233,3.494 -3.494,3.494 -0.003,0 -4.409,-1.35 -10.004,-1.35 -5.589,-0.001 -11.062,2.253 -11.062,2.253" + id="path2446" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /><line + display="inline" + id="line2448" + style="fill:#ffffff;stroke:#000000;stroke-width:0.24227618000000001;stroke-linecap:round;stroke-linejoin:round;display:inline" + x1="27.800886" + x2="27.9" + y1="45.882965" + y2="45.716999" /><path + d="m 32.566,44.275 c 0,0 -0.02689,1.429497 -4.885146,1.428875 C 23.048853,45.703282 23.237,44.275 23.237,44.275" + id="path2450" + style="fill:#ffffff;stroke:#000000;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" + sodipodi:nodetypes="csc" /></g><path + d="m 13.946917,21.706271 a 0.007775,0 180 0 0 0.01555,0 l -4.05e-4,0 z" + id="path2489" + style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.11635375;stroke-linecap:square;stroke-linejoin:bevel;stroke-opacity:1" + inkscape:connector-curvature="0" /><text + xml:space="preserve" + style="font-size:10.41984367000000056px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" + x="9.6616058" + y="17.897673" + id="text3637" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan3639" + x="9.6616058" + y="17.897673">Hello</tspan><tspan + sodipodi:role="line" + x="9.6616058" + y="30.922478" + id="tspan3641">World!</tspan></text> +</svg>
\ No newline at end of file diff --git a/icons/edit.svg b/icons/edit.svg new file mode 100644 index 0000000..dd86571 --- /dev/null +++ b/icons/edit.svg @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + height="55" + id="svg2441" + version="1.1" + viewBox="0 0 55 55" + width="55" + xml:space="preserve" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="edit.svg"><metadata + id="metadata22"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1024" + inkscape:window-height="550" + id="namedview20" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="1.5051873" + inkscape:cy="27.5" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2441" + showguides="true" + inkscape:guide-bbox="true" /><defs + id="defs2453" /><g + id="activity-read" + style="display:block;fill:#ffffff" + transform="matrix(1.0438471,-0.00307797,0.00290798,1.1048696,-1.4972545,-6.5391282)"><path + d="m 27.904,11.023 -0.002,0 c 0,-0.002 -1.71,-2.053 -9.376,-2.504 C 10.86,8.07 6.843,10.121 6.84,10.122 4.942,10.741 3.345,11.857 3.345,13.616 l 0,27.702 c 0,2.025 1.235,3.494 3.495,3.494 0.003,0 4.41,-1.35 10.004,-1.35 5.589,-0.001 11.061,2.253 11.061,2.253" + id="path2444" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /><path + d="m 27.898,11.023 0,0 c 0,-0.002 1.715,-2.053 9.377,-2.504 7.668,-0.449 11.686,1.602 11.688,1.603 1.897,0.619 3.494,1.735 3.494,3.494 l 0,27.702 c 0,2.025 -1.233,3.494 -3.494,3.494 -0.003,0 -4.409,-1.35 -10.004,-1.35 -5.589,-0.001 -11.062,2.253 -11.062,2.253" + id="path2446" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /><line + display="inline" + id="line2448" + style="fill:#ffffff;stroke:#000000;stroke-width:0.24227618000000001;stroke-linecap:round;stroke-linejoin:round;display:inline" + x1="27.800886" + x2="27.9" + y1="45.882965" + y2="45.716999" /><path + d="m 32.566,44.275 c 0,0 -0.031,2.906 -4.666,2.906 -4.632,0 -4.663,-2.906 -4.663,-2.906" + id="path2450" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linecap:round;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /></g><path + d="m 13.946917,21.706271 a 0.007775,0 180 0 0 0.01555,0 l -4.05e-4,0 z" + id="path2489" + style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.11635375;stroke-linecap:square;stroke-linejoin:bevel;stroke-opacity:1" + inkscape:connector-curvature="0" /><g + style="fill:#ffffff;stroke:#000000;stroke-width:2.3485074;stroke-miterlimit:4;stroke-dasharray:none;display:block" + id="preferences-system" + display="block" + transform="matrix(0.674165,0,0,0.66037088,7.8209795,4.6452138)"> + <path + id="path9173" + style="fill:#ffffff;stroke:#000000;stroke-width:2.3485074;stroke-miterlimit:4;stroke-dasharray:none" + d="m 51.103,50.895 c -2.343,2.343 -6.143,2.343 -8.485,0 L 19.813,28.091 c -2.343,-2.343 -2.343,-6.143 0,-8.485 l 0,0 c 2.343,-2.343 6.143,-2.343 8.485,0 L 51.102,42.41 c 2.343,2.342 2.343,6.142 0.001,8.485 l 0,0 z" + inkscape:connector-curvature="0" /> + <g + id="g9175" + style="fill:#ffffff;stroke:#000000;stroke-width:2.3485074;stroke-miterlimit:4;stroke-dasharray:none"> + <g + id="g9177" + style="fill:#ffffff;stroke:#000000;stroke-width:2.3485074;stroke-miterlimit:4;stroke-dasharray:none"> + <path + id="path9179" + style="fill:#ffffff;stroke:#000000;stroke-width:2.3485074;stroke-miterlimit:4;stroke-dasharray:none" + d="m 17.813,2.254 c -0.804,0 -1.587,0.081 -2.358,0.2 L 26.012,13.012 13.22,25.804 2.662,15.246 c -0.119,0.771 -0.2,1.555 -0.2,2.36 0,8.479 6.873,15.352 15.351,15.352 8.478,0 15.351,-6.873 15.351,-15.352 0,-8.479 -6.873,-15.352 -15.351,-15.352 z" + inkscape:connector-curvature="0" /> + </g> + </g> +</g></svg>
\ No newline at end of file diff --git a/icons/home.svg b/icons/home.svg new file mode 100644 index 0000000..0497711 --- /dev/null +++ b/icons/home.svg @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + height="55" + id="svg2441" + version="1.1" + viewBox="0 0 55 55" + width="55" + xml:space="preserve" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="edit-c.svg"><metadata + id="metadata22"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1024" + inkscape:window-height="541" + id="namedview20" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="56.291048" + inkscape:cy="27.774791" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="svg2441" + showguides="true" + inkscape:guide-bbox="true" /><defs + id="defs2453" /><g + id="activity-read" + style="display:block;fill:#ffffff" + transform="matrix(1.0438471,-0.00307797,0.00290798,1.1048696,-1.4972545,-6.5391282)"><path + d="m 27.904,11.023 -0.002,0 c 0,-0.002 -1.71,-2.053 -9.376,-2.504 C 10.86,8.07 6.843,10.121 6.84,10.122 4.942,10.741 3.345,11.857 3.345,13.616 l 0,27.702 c 0,2.025 1.235,3.494 3.495,3.494 0.003,0 4.41,-1.35 10.004,-1.35 5.589,-0.001 11.061,2.253 11.061,2.253" + id="path2444" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /><path + d="m 27.898,11.023 0,0 c 0,-0.002 1.715,-2.053 9.377,-2.504 7.668,-0.449 11.686,1.602 11.688,1.603 1.897,0.619 3.494,1.735 3.494,3.494 l 0,27.702 c 0,2.025 -1.233,3.494 -3.494,3.494 -0.003,0 -4.409,-1.35 -10.004,-1.35 -5.589,-0.001 -11.062,2.253 -11.062,2.253" + id="path2446" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /><line + display="inline" + id="line2448" + style="fill:#ffffff;stroke:#000000;stroke-width:0.24227618000000001;stroke-linecap:round;stroke-linejoin:round;display:inline" + x1="27.800886" + x2="27.9" + y1="45.882965" + y2="45.716999" /><path + d="m 32.566,44.275 c 0,0 -0.031,2.906 -4.666,2.906 -4.632,0 -4.663,-2.906 -4.663,-2.906" + id="path2450" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linecap:round;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /></g><path + d="m 13.946917,21.706271 a 0.007775,0 180 0 0 0.01555,0 l -4.05e-4,0 z" + id="path2489" + style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.11635375;stroke-linecap:square;stroke-linejoin:bevel;stroke-opacity:1" + inkscape:connector-curvature="0" /> +<g + id="go-home" + transform="matrix(0.74148531,0,0,0.74148531,7.3751619,0.554007)" + style="fill:#ffffff;stroke:#000000"><path + id="path3224" + d="M 27.5,15.96256 8.48131,32.4005 8.55256,48.0374 17,48.0052 l 0,-17.0809 9,0 0,17.0809 21.59,0 -0.1679,-15.726 z m 4,14.96174 8,0 0,8 -8,0 z" + inkscape:connector-curvature="0" + style="fill:#ffffff;stroke:#000000" /><path + id="path3226" + d="M 5.48131,31.362365 27.5,12.924424 l 11.3997,9.114941 -0.036,-8.816281 4.0299,0.01041 -0.0104,12.052971 7.5389,5.9546" + inkscape:connector-curvature="0" + style="fill:none;stroke:#000000;stroke-width:4.5;stroke-linecap:round" /></g></svg>
\ No newline at end of file diff --git a/icons/new.svg b/icons/new.svg new file mode 100644 index 0000000..30a11d6 --- /dev/null +++ b/icons/new.svg @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.1" + width="55" + height="55" + id="svg2"> + <defs + id="defs4" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + transform="translate(0,-997.36218)" + id="layer1"> + <g + transform="translate(-0.15462128,1000.9789)" + id="g3053"> + <g + transform="matrix(1.0438471,-0.00307797,0.00290798,1.1048696,-1.4972545,-6.5391282)" + id="activity-read" + style="fill:#ffffff;display:block"> + <path + d="m 27.904,11.023 -0.002,0 c 0,-0.002 -1.71,-2.053 -9.376,-2.504 C 10.86,8.07 6.843,10.121 6.84,10.122 4.942,10.741 3.345,11.857 3.345,13.616 l 0,27.702 c 0,2.025 1.235,3.494 3.495,3.494 0.003,0 4.41,-1.35 10.004,-1.35 5.589,-0.001 11.061,2.253 11.061,2.253" + id="path2444" + style="fill:#ffffff;stroke:#000000;stroke-width:3.5;stroke-linejoin:round;display:inline" /> + <path + d="m 27.898,11.023 0,0 c 0,-0.002 1.715,-2.053 9.377,-2.504 7.668,-0.449 11.686,1.602 11.688,1.603 1.897,0.619 3.494,1.735 3.494,3.494 l 0,27.702 c 0,2.025 -1.233,3.494 -3.494,3.494 -0.003,0 -4.409,-1.35 -10.004,-1.35 -5.589,-0.001 -11.062,2.253 -11.062,2.253" + id="path2446" + style="fill:#ffffff;stroke:#000000;stroke-width:3.5;stroke-linejoin:round;display:inline" /> + <line + y2="45.716999" + y1="45.882965" + x2="27.9" + x1="27.800886" + style="fill:#ffffff;stroke:#000000;stroke-width:0.24227618;stroke-linecap:round;stroke-linejoin:round;display:inline" + id="line2448" + display="inline" /> + <path + d="m 32.566,44.275 c 0,0 -0.031,2.906 -4.666,2.906 -4.632,0 -4.663,-2.906 -4.663,-2.906" + id="path2450" + style="fill:#ffffff;stroke:#000000;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;display:inline" /> + </g> + <path + d="m 13.946917,21.706271 a 0.007775,0 180 0 0 0.01555,0 l -4.05e-4,0 z" + id="path2489" + style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.11635375;stroke-linecap:square;stroke-linejoin:bevel;stroke-opacity:1" /> + <g + transform="matrix(0.674165,0,0,0.66037088,7.8209795,4.6452138)" + id="preferences-system" + style="fill:#ffffff;stroke:#000000;stroke-width:2.3485074;stroke-miterlimit:4;stroke-dasharray:none;display:block"> + + <g + id="g9175" + style="fill:#ffffff;stroke:#000000;stroke-width:2.3485074;stroke-miterlimit:4;stroke-dasharray:none"> + <g + id="g9177" + style="fill:#ffffff;stroke:#000000;stroke-width:2.3485074;stroke-miterlimit:4;stroke-dasharray:none"> + + </g> + + </g> + +</g> + </g> + <rect + width="6.6354995" + height="2.8641834" + x="24" + y="1042.498" + id="rect3066" + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.44150427px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <g + transform="translate(137.75943,986.89113)" + id="g3126"> + <path + d="m 14.516366,23.366123 a 0.00775,0 180 0 0 0.0155,0 l -4.03e-4,0 z" + id="path2489-4" + style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.12501132;stroke-linecap:square;stroke-linejoin:bevel;stroke-opacity:1" /> + <path + d="m -97.74442,37.903664 c -1.23708,0 -2.25236,1.033402 -2.25236,2.292537 l 0,5.257541 -3.66384,-3.729187 c -0.87567,-0.889397 -2.27949,-0.891288 -3.15329,0 -0.87381,0.891291 -0.87564,2.35072 0,3.240113 l 3.69386,3.729188 -5.22548,0 c -1.23707,0 -2.25236,1.033401 -2.25236,2.292537 0,1.259135 1.01529,2.261965 2.25236,2.261965 l 5.19545,0 -3.66383,3.729188 c -0.87381,0.891293 -0.87564,2.35072 0,3.240115 0.87566,0.889391 2.30952,0.860724 3.18333,-0.03061 l 3.6338,-3.729185 0,5.318675 c 0,1.259138 1.01528,2.261968 2.25236,2.261968 1.23707,0 2.22233,-1.00283 2.22233,-2.261968 l 0,-5.349241 3.7239,3.759751 c 0.87567,0.889394 2.2795,0.891293 3.1533,0 0.87381,-0.89129 0.87568,-2.320152 0,-3.209542 l -3.69386,-3.729191 5.19543,0 c 1.23708,0 2.22235,-1.002832 2.22235,-2.261964 0,-1.259138 -0.98527,-2.292538 -2.22235,-2.292538 l -5.22547,0 3.69388,-3.790322 c 0.87381,-0.891292 0.87567,-2.289586 0,-3.17898 -0.87568,-0.889392 -2.27951,-0.921863 -3.15331,-0.0306 l -3.69387,3.790319 0,-5.288104 c 0,-1.259138 -0.98526,-2.292538 -2.22233,-2.292538 z" + id="rect3894" + style="fill:#ffffff;fill-opacity:1;stroke:#282828;stroke-width:1.93908417;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + </g> + </g> +</svg> diff --git a/icons/open-from-journal.svg b/icons/open-from-journal.svg new file mode 100644 index 0000000..befd9d1 --- /dev/null +++ b/icons/open-from-journal.svg @@ -0,0 +1,131 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + enable-background="new 0 0 55 55" + height="55px" + id="Layer_1" + version="1.1" + viewBox="0 0 55 55" + width="55px" + x="0px" + xml:space="preserve" + y="0px" + inkscape:version="0.48.2 r9819" + sodipodi:docname="open-from-journal.svg"><metadata + id="metadata36"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs + id="defs34" /><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview32" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="27.5" + inkscape:cy="42.782185" + inkscape:window-x="0" + inkscape:window-y="26" + inkscape:window-maximized="0" + inkscape:current-layer="g4" /> +<g + display="block" + id="document-save"> + <g + id="g4"> + <g + id="g6"> + <g + id="g8"> + <path + d="M6.736,49.002 h24.52c2.225,0,3.439-1.447,3.439-3.441V18.281c0-1.73-1.732-3.441-3.439-3.441h-4.389" + id="path10" + stroke-linejoin="round" + stroke-linecap="round" + stroke-width="3.5" + stroke="#010101" + fill="#FFFFFF" /> + </g> + </g> + <g + id="g12"> + <g + id="g14"> + <path + d="M26.867,38.592 c0,1.836-1.345,3.201-3.441,4.047l-16.69,6.363V14.84l16.69-8.599c2.228-0.394,3.441,0.84,3.441,2.834V38.592z" + fill="#FFFFFF" + stroke="#010101" + stroke-linecap="round" + stroke-linejoin="round" + stroke-width="3.5" + id="path16" /> + </g> + </g> + <path + d="M9.424,42.607 c0,0-1.351-0.543-2.702-0.543s-2.703,0.543-2.703,0.543" + fill="none" + stroke="#010101" + stroke-linecap="round" + stroke-linejoin="round" + stroke-width="2.25" + id="path18" /> + <path + d="M9.424,32.006 c0,0-1.239-0.543-2.815-0.543c-1.577,0-2.59,0.543-2.59,0.543" + fill="none" + stroke="#010101" + stroke-linecap="round" + stroke-linejoin="round" + stroke-width="2.25" + id="path20" /> + <path + d="M9.424,21.678 c0,0-1.125-0.544-2.927-0.544c-1.802,0-2.478,0.544-2.478,0.544" + fill="none" + stroke="#010101" + stroke-linecap="round" + stroke-linejoin="round" + stroke-width="2.25" + id="path22" /> + + <line + fill="none" + stroke="#010101" + stroke-linecap="round" + stroke-linejoin="round" + stroke-width="2.25" + x1="13.209" + x2="13.209" + y1="46.533" + y2="11.505" + id="line24" /> + + <g + id="g26" + transform="matrix(-0.9995945,-0.02847492,0.02847492,-0.9995945,93.291195,22.433532)"> + <line + x1="41.169998" + x2="52.441002" + y1="16.188" + y2="4.9169998" + id="line28" + style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round" /> + <polyline + points=" 51.562,15.306 41.17,16.188 42.053,5.794 " + id="polyline30" + style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round" /> + </g> + </g> +</g> +</svg> diff --git a/icons/read.svg b/icons/read.svg new file mode 100644 index 0000000..31f13de --- /dev/null +++ b/icons/read.svg @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + height="55" + id="svg2441" + version="1.1" + viewBox="0 0 55 55" + width="55" + xml:space="preserve" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="read.svg"><metadata + id="metadata22"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1024" + inkscape:window-height="550" + id="namedview20" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="0.074921967" + inkscape:cy="28.049509" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2441" + showguides="true" + inkscape:guide-bbox="true" /><defs + id="defs2453" /><g + id="activity-read" + style="display:block;stroke:#000000;fill:#ffffff" + transform="matrix(1.0411248,-0.00313407,0.0029004,1.1250069,-0.88752716,-5.3940759)"><path + d="m 27.904,11.023 -0.002,0 c 0,-0.002 -1.71,-2.053 -9.376,-2.504 C 10.86,8.07 6.843,10.121 6.84,10.122 4.942,10.741 3.345,11.857 3.345,13.616 l 0,27.702 c 0,2.025 1.235,3.494 3.495,3.494 0.003,0 4.41,-1.35 10.004,-1.35 5.589,-0.001 11.061,2.253 11.061,2.253" + id="path2444" + style="fill:#ffffff;stroke:#000000;stroke-width:3.50000000000000000;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" /><path + d="m 27.898,11.023 0.223844,6.71e-4 c 0,-0.002 1.491156,-2.053624 9.153156,-2.504624 7.668,-0.449 11.686,1.602 11.688,1.603 1.897,0.619 3.494,1.735 3.494,3.494 l 0,27.702 c 0,2.025 -1.233,3.494 -3.494,3.494 -0.003,0 -4.409,-1.35 -10.004,-1.35 -5.589,-10e-4 -11.062,2.253 -11.062,2.253" + id="path2446" + style="fill:#ffffff;stroke:#000000;stroke-width:3.5;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccssscc" /><line + display="inline" + id="line2448" + style="fill:#ffffff;stroke:#000000;stroke-width:0.37684922999999998;stroke-linecap:round;stroke-linejoin:round;display:inline" + x1="27.802471" + x2="27.9" + y1="45.314518" + y2="45.716999" /><path + d="m 32.566,44.275 c 0,0 0.421881,1.042866 -4.213119,1.042866 -4.632,0 -5.115881,-1.042866 -5.115881,-1.042866" + id="path2450" + style="fill:#ffffff;stroke:#000000;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;display:inline" + inkscape:connector-curvature="0" + sodipodi:nodetypes="csc" /></g><path + d="m 14.516366,23.366123 a 0.00775,0 180 0 0 0.0155,0 l -4.03e-4,0 z" + id="path2489" + style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.12501132;stroke-linecap:square;stroke-linejoin:bevel;stroke-opacity:1" + inkscape:connector-curvature="0" /><circle + transform="matrix(2.1156047,0,0,2.1156047,-29.741153,-37.196361)" + id="circle9619" + r="1.9910001" + display="inline" + cy="29.597" + cx="27.504" + sodipodi:cx="27.504" + sodipodi:cy="29.597" + sodipodi:rx="1.9910001" + sodipodi:ry="1.9910001" + style="fill:#000000;display:inline;stroke:#000000" + d="m 29.495,29.597 c 0,1.099599 -0.891401,1.991 -1.991,1.991 -1.099599,0 -1.991,-0.891401 -1.991,-1.991 0,-1.099599 0.891401,-1.991 1.991,-1.991 1.099599,0 1.991,0.891401 1.991,1.991 z" /><path + id="path9617" + display="inline" + d="m 28.44644,12.186083 c -13.239455,0 -24.2681026,13.203488 -24.2681026,13.203488 0,0 11.0286476,13.266957 24.2681026,13.258495 13.241567,-0.01055 24.276561,-13.273303 24.276561,-13.273303 0,0 -11.034994,-13.197142 -24.276561,-13.18868 z m 0,22.514265 c -5.12611,0 -9.281159,-4.159279 -9.281159,-9.285389 0,-5.117648 4.155049,-9.283273 9.281159,-9.283273 5.119763,0 9.279042,4.165625 9.279042,9.283273 0,5.128226 -4.159279,9.285389 -9.279042,9.285389 z" + inkscape:connector-curvature="0" + style="fill:#ffffff;display:inline;stroke:#000000" /></svg>
\ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..530f97c --- /dev/null +++ b/setup.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +# Copyright (C) 2006, Red Hat, Inc. +# +# 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +from sugar.activity import bundlebuilder + +bundlebuilder.start() diff --git a/textbook.py b/textbook.py new file mode 100644 index 0000000..26d0b6a --- /dev/null +++ b/textbook.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from gettext import gettext as _ +from book import cBook +from book import cPage +from book import cOption + + +def tutorial_book(): + + mybook = cBook(_("How to use Adventure Book")) + mybook.set_license(_("CC-BY")) + + p1 = cPage(_("What are Adventure Books?")) + mybook.add_page(p1) + p1.set_text(_("""Adventure Books are books that allow the reader to choose between different alternatives.""")) + + p2 = cPage(_("How can I read an Adventure Book?")) + mybook.add_page(p2) + p2.set_text(_("""Adventure Books can be read with the eyes.""")) + + p3 = cPage(_("How can I create an Adventure Book?")) + mybook.add_page(p3) + p3.set_text(_("""Adventure Books can be created with hard work.""")) + + p4 = cPage(_("How can I modify an Adventure Book?")) + mybook.add_page(p4) + p4.set_text(_("""Adventure Books can be modified fearlessly.""")) + + o1 = cOption(_("How to read"),p2) + o2 = cOption(_("How to create"), p3) + o3 = cOption(_("How to modify"), p4) + p1.add_option(o1) + p1.add_option(o2) + p1.add_option(o3) + + o4 = cOption(_("Return"), p1) + p2.add_option(o4) + p3.add_option(o4) + p4.add_option(o4) + + return mybook + +def empty_book(): + + mybook = cBook(_("Title")) + mybook.set_license(_("CC-BY")) + + p1 = cPage(_("First page")) + op = cOption(_("Return"), mybook) + p1.add_option(op) + mybook.add_page(p1) + + return mybook +def credits_book(): + + mybook = cBook(_("Credits")) + p1 = cPage(_("Credits")) + p1.set_text(_("""Authors: +Gabriel Eirea <geirea@gmail.com> +Ignacio Rodriguez <nachoel01@gmail.com> +Thanks to: Flavio Danesse <fdanesse@gmail.com> + +¡Thanks for use this program! :) + +To continue create a empty book!""")) + mybook.add_page(p1) + return mybook + +def print_text_book(mybook): + + print "TITLE: " + mybook.get_title() + print "AUTHOR: " + mybook.get_author() + print "LICENSE: " + mybook.get_license() + print + + for p in mybook.get_pages(): + print "PAGE: " + p.get_title() + print p.get_text() + for o in p.get_options(): + print "-> " + o.get_text() + print + + +if __name__ == "__main__": + + mybook = tutorial_book() + print_text_book(mybook) + + + + + + |