[glade] Move GladeWidgetAdaptor code for GtkAction into it's own C file
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] Move GladeWidgetAdaptor code for GtkAction into it's own C file
- Date: Sat, 4 May 2013 07:26:33 +0000 (UTC)
commit 411535efba7012176b93b583ce8bf4661c364c68
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Sat May 4 16:08:19 2013 +0900
Move GladeWidgetAdaptor code for GtkAction into it's own C file
plugins/gtk+/Makefile.am | 1 +
plugins/gtk+/glade-gtk-action.c | 45 +++++++++++++++++++++++++++++++++++++++
plugins/gtk+/glade-gtk.c | 20 -----------------
plugins/gtk+/glade-gtk.h | 2 +
po/POTFILES.in | 1 +
5 files changed, 49 insertions(+), 20 deletions(-)
---
diff --git a/plugins/gtk+/Makefile.am b/plugins/gtk+/Makefile.am
index 8778ef9..bc3ff22 100644
--- a/plugins/gtk+/Makefile.am
+++ b/plugins/gtk+/Makefile.am
@@ -34,6 +34,7 @@ libgladegtk_la_SOURCES = \
glade-fixed.c \
glade-gtk.c \
glade-gtk-about-dialog.c \
+ glade-gtk-action.c \
glade-gtk-action-widgets.c \
glade-gtk-adjustment.c \
glade-gtk-assistant.c \
diff --git a/plugins/gtk+/glade-gtk-action.c b/plugins/gtk+/glade-gtk-action.c
new file mode 100644
index 0000000..76aed93
--- /dev/null
+++ b/plugins/gtk+/glade-gtk-action.c
@@ -0,0 +1,45 @@
+/*
+ * glade-gtk-action.c - GladeWidgetAdaptor for GtkAction
+ *
+ * Copyright (C) 2013 Tristan Van Berkom
+ *
+ * Authors:
+ * Tristan Van Berkom <tristan van berkom gmail com>
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <config.h>
+#include <glib/gi18n-lib.h>
+#include <gladeui/glade.h>
+
+#include "glade-gtk.h"
+
+void
+glade_gtk_action_post_create (GladeWidgetAdaptor * adaptor,
+ GObject * object, GladeCreateReason reason)
+{
+ GladeWidget *gwidget = glade_widget_get_from_gobject (object);
+
+ if (reason == GLADE_CREATE_REBUILD)
+ return;
+
+ if (!gtk_action_get_name (GTK_ACTION (object)))
+ glade_widget_property_set (gwidget, "name", "untitled");
+
+ glade_widget_set_action_sensitive (gwidget, "launch_editor", FALSE);
+ glade_widget_property_set_sensitive (gwidget, "accelerator", FALSE,
+ ACTION_ACCEL_INSENSITIVE_MSG);
+}
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index 9abbf93..28c8efa 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -79,26 +79,6 @@ glade_gtk_init (const gchar * name)
}
-/*--------------------------- GtkAction ---------------------------------*/
-#define ACTION_ACCEL_INSENSITIVE_MSG _("The accelerator can only be set when inside an Action Group.")
-
-void
-glade_gtk_action_post_create (GladeWidgetAdaptor * adaptor,
- GObject * object, GladeCreateReason reason)
-{
- GladeWidget *gwidget = glade_widget_get_from_gobject (object);
-
- if (reason == GLADE_CREATE_REBUILD)
- return;
-
- if (!gtk_action_get_name (GTK_ACTION (object)))
- glade_widget_property_set (gwidget, "name", "untitled");
-
- glade_widget_set_action_sensitive (gwidget, "launch_editor", FALSE);
- glade_widget_property_set_sensitive (gwidget, "accelerator", FALSE,
- ACTION_ACCEL_INSENSITIVE_MSG);
-}
-
/*--------------------------- GtkActionGroup ---------------------------------*/
gboolean
glade_gtk_action_group_add_verify (GladeWidgetAdaptor *adaptor,
diff --git a/plugins/gtk+/glade-gtk.h b/plugins/gtk+/glade-gtk.h
index 4306742..b3796b0 100644
--- a/plugins/gtk+/glade-gtk.h
+++ b/plugins/gtk+/glade-gtk.h
@@ -38,6 +38,8 @@
#define ONLY_THIS_GOES_IN_THAT_MSG _("Only objects of type %s can be added to objects of type %s.")
+#define ACTION_ACCEL_INSENSITIVE_MSG _("The accelerator can only be set when inside an Action Group.")
+
#define GLADE_TAG_ATTRIBUTES "attributes"
#define GLADE_TAG_ATTRIBUTE "attribute"
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 0fdc46f..7de6d6d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -63,6 +63,7 @@ plugins/gtk+/glade-entry-editor.c
plugins/gtk+/glade-fixed.c
plugins/gtk+/glade-gtk.c
plugins/gtk+/glade-gtk-about-dialog.c
+plugins/gtk+/glade-gtk-action.c
plugins/gtk+/glade-gtk-action-widgets.c
plugins/gtk+/glade-gtk-adjustment.c
plugins/gtk+/glade-gtk-assistant.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]