[glade] Move GladeWidgetAdaptor code for GtkFileChooserWidget into it's own C file



commit 4a91d9be6d87143122d7317748b90ade9b1492a2
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Fri May 3 22:55:39 2013 +0900

    Move GladeWidgetAdaptor code for GtkFileChooserWidget into it's own C file

 plugins/gtk+/Makefile.am                     |    1 +
 plugins/gtk+/glade-gtk-file-chooser-widget.c |   54 ++++++++++++++++++++++++++
 plugins/gtk+/glade-gtk.c                     |   28 -------------
 po/POTFILES.in                               |    1 +
 4 files changed, 56 insertions(+), 28 deletions(-)
---
diff --git a/plugins/gtk+/Makefile.am b/plugins/gtk+/Makefile.am
index dc30334..4634605 100644
--- a/plugins/gtk+/Makefile.am
+++ b/plugins/gtk+/Makefile.am
@@ -40,6 +40,7 @@ libgladegtk_la_SOURCES =              \
        glade-gtk-dialog.c              \
        glade-gtk-entry.c               \
        glade-gtk-expander.c            \
+       glade-gtk-file-chooser-widget.c \
        glade-gtk-fixed-layout.c        \
        glade-gtk-frame.c               \
        glade-gtk-grid.c                \
diff --git a/plugins/gtk+/glade-gtk-file-chooser-widget.c b/plugins/gtk+/glade-gtk-file-chooser-widget.c
new file mode 100644
index 0000000..6d58c80
--- /dev/null
+++ b/plugins/gtk+/glade-gtk-file-chooser-widget.c
@@ -0,0 +1,54 @@
+/*
+ * glade-gtk-file-chooser-widget.c - GladeWidgetAdaptor for GtkFileChooserWidget
+ *
+ * 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-dialog.h"
+
+void
+glade_gtk_file_chooser_widget_post_create (GladeWidgetAdaptor * adaptor,
+                                           GObject * object,
+                                           GladeCreateReason reason)
+{
+  gtk_container_forall (GTK_CONTAINER (object),
+                        glade_gtk_file_chooser_default_forall, NULL);
+}
+
+void
+glade_gtk_file_chooser_button_set_property (GladeWidgetAdaptor * adaptor,
+                                            GObject * object,
+                                            const gchar * id,
+                                            const GValue * value)
+{
+  /* Avoid a warning */
+  if (!strcmp (id, "action"))
+    {
+      if (g_value_get_enum (value) == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER ||
+          g_value_get_enum (value) == GTK_FILE_CHOOSER_ACTION_SAVE)
+        return;
+    }
+
+  GWA_GET_CLASS (GTK_TYPE_BOX)->set_property (adaptor, object, id, value);
+}
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index a154229..f7fce4d 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -79,34 +79,6 @@ glade_gtk_init (const gchar * name)
 }
 
 
-
-/* ----------------------------- GtkFileChooserWidget ------------------------------ */
-void
-glade_gtk_file_chooser_widget_post_create (GladeWidgetAdaptor * adaptor,
-                                           GObject * object,
-                                           GladeCreateReason reason)
-{
-  gtk_container_forall (GTK_CONTAINER (object),
-                        glade_gtk_file_chooser_default_forall, NULL);
-}
-
-void
-glade_gtk_file_chooser_button_set_property (GladeWidgetAdaptor * adaptor,
-                                            GObject * object,
-                                            const gchar * id,
-                                            const GValue * value)
-{
-  /* Avoid a warning */
-  if (!strcmp (id, "action"))
-    {
-      if (g_value_get_enum (value) == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER ||
-          g_value_get_enum (value) == GTK_FILE_CHOOSER_ACTION_SAVE)
-        return;
-    }
-
-  GWA_GET_CLASS (GTK_TYPE_BOX)->set_property (adaptor, object, id, value);
-}
-
 /* ----------------------------- GtkFontButton ------------------------------ */
 /* Use the font-buttons launch dialog to actually set the font-name
  * glade property through the glade-command api.
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 30f35a5..c9b6dc9 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -68,6 +68,7 @@ plugins/gtk+/glade-gtk-container.c
 plugins/gtk+/glade-gtk-dialog.c
 plugins/gtk+/glade-gtk-entry.c
 plugins/gtk+/glade-gtk-expander.c
+plugins/gtk+/glade-gtk-file-chooser-widget.c
 plugins/gtk+/glade-gtk-fixed-layout.c
 plugins/gtk+/glade-gtk-frame.c
 plugins/gtk+/glade-gtk-grid.c


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]