From 51e7ffbcb6622bfa3babc811f0dc86d0b9a493bd Mon Sep 17 00:00:00 2001 From: Ignacio Rodríguez Date: Sat, 07 Dec 2013 15:18:23 +0000 Subject: Add examples icon --- diff --git a/FileDialog.py b/FileDialog.py index 93457a8..ea6da02 100644 --- a/FileDialog.py +++ b/FileDialog.py @@ -15,12 +15,13 @@ class FileDialog(Gtk.Dialog): path = dialog.get_path() """ - def __init__(self, dirs, window=None): + def __init__(self, dirs, window=None, button=None): Gtk.Dialog.__init__(self, flags=Gtk.DialogFlags.DESTROY_WITH_PARENT) self.example_path = None self.expanders = [] self.dirs = dirs + self.button = button x, y = (Gdk.Screen.width() / 1.5, Gdk.Screen.height() / 1.5) self.set_size_request(x, y) @@ -51,6 +52,9 @@ class FileDialog(Gtk.Dialog): if sample: self.example_path = widget.get_tooltip_text() + if self.button: + self.button.set_icon_name("pippy-openoff") + self.destroy() def build_toolbar(self): diff --git a/icons/pippy-openoff.svg b/icons/pippy-openoff.svg new file mode 100644 index 0000000..605e62a --- /dev/null +++ b/icons/pippy-openoff.svg @@ -0,0 +1,133 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icons/pippy-openon.svg b/icons/pippy-openon.svg new file mode 100644 index 0000000..a3bc335 --- /dev/null +++ b/icons/pippy-openon.svg @@ -0,0 +1,147 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pippy_app.py b/pippy_app.py index 396f021..5277972 100644 --- a/pippy_app.py +++ b/pippy_app.py @@ -172,7 +172,7 @@ class PippyActivity(ViewSourceActivity, groupthink.sugar_tools.GroupActivity): activity_toolbar.show() - examples = ToolButton("pippy-create_bundle") + examples = ToolButton("pippy-openoff") examples.set_tooltip(_("Load example")) examples.connect("clicked", self.load_example) @@ -285,7 +285,8 @@ class PippyActivity(ViewSourceActivity, groupthink.sugar_tools.GroupActivity): return self.vpane def load_example(self, widget): - dialog = FileDialog(self.paths, self) + widget.set_icon_name("pippy-openon") + dialog = FileDialog(self.paths, self, widget) dialog.run() path = dialog.get_path() if path: -- cgit v0.9.1