[gnome-builder] GbDocumentStack: plumb save-as action for stack
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] GbDocumentStack: plumb save-as action for stack
- Date: Thu, 11 Dec 2014 00:15:19 +0000 (UTC)
commit d8e9730490efbaa2b971cc61fa46b3aaf7315665
Author: Christian Hergert <christian hergert me>
Date: Wed Dec 10 02:39:18 2014 -0800
GbDocumentStack: plumb save-as action for stack
src/documents/gb-document-stack.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/src/documents/gb-document-stack.c b/src/documents/gb-document-stack.c
index 5995678..b8119ef 100644
--- a/src/documents/gb-document-stack.c
+++ b/src/documents/gb-document-stack.c
@@ -465,6 +465,31 @@ gb_document_stack_save_activate (GSimpleAction *action,
}
static void
+gb_document_stack_save_as_activate (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data)
+{
+ GbDocumentStackPrivate *priv;
+ GbDocumentStack *stack = user_data;
+ GtkWidget *toplevel;
+
+ g_return_if_fail (GB_IS_DOCUMENT_STACK (stack));
+
+ priv = stack->priv;
+
+ if (priv->active_view)
+ {
+ GbDocument *document;
+
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (stack));
+ document = gb_document_view_get_document (priv->active_view);
+
+ if (document)
+ gb_document_save_as (document, toplevel);
+ }
+}
+
+static void
gb_document_stack_grab_focus (GtkWidget *widget)
{
GbDocumentStack *stack = (GbDocumentStack *)widget;
@@ -811,6 +836,7 @@ gb_document_stack_init (GbDocumentStack *self)
{ "close", gb_document_stack_close },
{ "preview", gb_document_stack_preview_activate },
{ "save", gb_document_stack_save_activate },
+ { "save-as", gb_document_stack_save_as_activate },
};
self->priv = gb_document_stack_get_instance_private (self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]