Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Francis <francis@sugarlabs.org>2012-07-05 22:56:30 (GMT)
committer Daniel Francis <francis@sugarlabs.org>2012-07-05 22:56:30 (GMT)
commit7150528df30821673ecfce51fb288ee0f58b7360 (patch)
tree2da4c5ee1ca0f1651443f75db524b50dbc53582d
parent855c4cf8b1b26c6fc407aec6f9ebe49d05b4e266 (diff)
Add new slide function; Empty slide at the moment :(
-rw-r--r--cover.py28
-rwxr-xr-xpresent.py16
-rw-r--r--slides.py16
-rw-r--r--toolbars.py11
4 files changed, 42 insertions, 29 deletions
diff --git a/cover.py b/cover.py
index a8b5712..d0dfd06 100644
--- a/cover.py
+++ b/cover.py
@@ -26,22 +26,6 @@ from gettext import gettext as _
import gtk
from widgets import ImageEditor
-langs = {"en": _("English"),
- "es": _("Spanish"),
- "ca": _("Catalonian"),
- "cs": _("Czech"),
- "nl": _("Dutch"),
- "de": _("German"),
- "pl": _("Polish"),
- "fr": _("French"),
- "hu": _("Hungarian"),
- "it": _("Italian"),
- "el": _("Greek"),
- "jp": _("Japanese"),
- "zh": _("Chinese"),
- "ru": _("Russian"),
- "sv": _("Swedish")}
-
class CoverSlide(gtk.VPaned):
def set_copyright(self, title):
@@ -180,7 +164,7 @@ class CoverSlide(gtk.VPaned):
self._copyright.set_tooltip_text("Copyright")
self._copyright.show()
hbox.pack_start(self._copyright, True, True)
- self.count_time = gtk.CheckButton("Presentation duration: ")
+ self.count_time = gtk.CheckButton(_("Presentation duration: "))
self.count_time.connect("toggled", self.activate_time)
self.count_time.show()
hbox.pack_start(self.count_time, False, False, 0)
@@ -192,7 +176,7 @@ class CoverSlide(gtk.VPaned):
self._time.show()
self._time.set_sensitive(False)
hbox.pack_start(self._time, True, True)
- self.label = gtk.Label("minutes")
+ self.label = gtk.Label(_("min"))
self.label.show()
hbox.pack_start(self.label, False, False)
hbox.show()
@@ -200,7 +184,7 @@ class CoverSlide(gtk.VPaned):
style_box = gtk.HBox()
self.style_model = gtk.ListStore(str)
self.styles_list = gtk.TreeView(self.style_model)
- column = gtk.TreeViewColumn("Presentation Color")
+ column = gtk.TreeViewColumn(_("Presentation Color"))
cell = gtk.CellRendererPixbuf()
cell.set_property("stock-size", gtk.ICON_SIZE_DIALOG)
column.pack_start(cell, True)
@@ -223,7 +207,7 @@ class CoverSlide(gtk.VPaned):
self.bullet_list = gtk.TreeView(self.bullet_model)
hadjustment = self.bullet_list.get_hadjustment()
hadjustment.set_page_size(hadjustment.get_upper())
- column = gtk.TreeViewColumn("Bullet Type")
+ column = gtk.TreeViewColumn(_("Bullets Type"))
cell = gtk.CellRendererPixbuf()
cell.set_property("stock-size", gtk.ICON_SIZE_DIALOG)
column.pack_start(cell, True)
@@ -243,7 +227,7 @@ class CoverSlide(gtk.VPaned):
style_box.pack_start(bullet_scrollbar, False, True, 0)
self.head_bullet_check = gtk.CheckButton(
- "Display a big bullet at the top of the slides")
+ _("Display a big bullet at the top of the slides"))
self.head_bullet_check.set_active(True)
self.head_bullet_check.show()
images_check_view = gtk.TreeView()
@@ -251,7 +235,7 @@ class CoverSlide(gtk.VPaned):
images_check_view.set_model(self.images_check_model)
null_column = gtk.TreeViewColumn()
images_check_view.append_column(null_column)
- column = gtk.TreeViewColumn("Select an image item to edit it")
+ column = gtk.TreeViewColumn(_("Select an image item to edit it"))
images_check_view.append_column(column)
check_cell = gtk.CellRendererToggle()
check_cell.connect("toggled", self.activate_image)
diff --git a/present.py b/present.py
index e0e1797..bc0f5b8 100755
--- a/present.py
+++ b/present.py
@@ -39,20 +39,24 @@ class PresentActivity(activity.Activity):
stop_button = StopButton(self)
toolbarbox = PresentToolbarBox(activity_button, stop_button)
toolbarbox.connect('insert-picture', self.load_picture)
+ toolbarbox.connect('new-slide', self._append_slide)
toolbarbox.show()
self.set_toolbar_box(toolbarbox)
self.images_galery = ImagesGalery()
self.images_galery.show()
self.set_tray(self.images_galery, gtk.POS_RIGHT)
- canvas = SlidesNotebook()
- canvas.cover.top_image_editor.connect("get-image-from-galery",
+ self.slides = SlidesNotebook()
+ self.slides.cover.top_image_editor.connect("get-image-from-galery",
self.images_galery.image_request)
- canvas.cover.top_image_editor.connect("load-toolbar",
- toolbarbox.load_image_toolbar)
- self.set_canvas(canvas)
- canvas.show_all()
+ self.slides.cover.top_image_editor.connect("load-toolbar",
+ toolbarbox.load_image_toolbar)
+ self.set_canvas(self.slides)
+ self.slides.show_all()
self.show()
+ def _append_slide(self, widget):
+ self.slides.append_slide()
+
def load_picture(self, widget):
chooser = ObjectChooser(parent=self,
what_filter=mime.GENERIC_TYPE_IMAGE)
diff --git a/slides.py b/slides.py
index be9a815..01178e1 100644
--- a/slides.py
+++ b/slides.py
@@ -35,3 +35,19 @@ class SlidesNotebook(gtk.Notebook):
self.set_tab_pos(gtk.POS_LEFT)
self.cover = CoverSlide()
self.append_page(self.cover, self.cover.get_title_label())
+
+ def append_slide(self):
+ slide = Slide()
+ slide.show()
+ self.append_page(slide, slide.get_title_label())
+
+
+class Slide(gtk.HBox):
+ def get_title_label(self):
+ return self.title_entry
+
+ def __init__(self):
+ gtk.HBox.__init__(self)
+ self.title_entry = gtk.Entry()
+ self.title_entry.set_text("Slide")
+ self.title_entry.show()
diff --git a/toolbars.py b/toolbars.py
index 9206f72..b81b4af 100644
--- a/toolbars.py
+++ b/toolbars.py
@@ -117,12 +117,21 @@ class ImageOptions(ToolbarButton):
class PresentToolbarBox(ToolbarBox):
__gsignals__ = {'insert-picture': (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
- tuple())}
+ tuple()),
+ 'new-slide': (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ tuple())}
def __init__(self, activitybutton, stopbutton):
ToolbarBox.__init__(self)
self.toolbar.insert(activitybutton, -1)
activitybutton.show_all()
+ append_slide = ToolButton('gtk-add')
+ append_slide.props.tooltip = 'Insert slide'
+ append_slide.connect('clicked',
+ lambda w: self.emit('new-slide'))
+ append_slide.show()
+ self.toolbar.insert(append_slide, -1)
insert_image_button = ToolButton('insert-picture')
insert_image_button.props.tooltip = 'Load a picture'
insert_image_button.connect('clicked',