[glade] Added GladeAboutDialogEditor



commit 0ace3df4fd9f9e7e57d65451dddb25e57bfd4740
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Wed May 1 23:55:26 2013 +0900

    Added GladeAboutDialogEditor

 plugins/gtk+/Makefile.am                       |    5 +-
 plugins/gtk+/glade-about-dialog-editor.c       |  238 +++++++++
 plugins/gtk+/glade-about-dialog-editor.h       |   57 +++
 plugins/gtk+/glade-about-dialog-editor.ui      |  628 ++++++++++++++++++++++++
 plugins/gtk+/glade-gtk-resources.gresource.xml |    1 +
 plugins/gtk+/glade-gtk.c                       |   79 +++-
 plugins/gtk+/gtk+.xml.in                       |   35 +-
 po/POTFILES.in                                 |    1 +
 8 files changed, 1019 insertions(+), 25 deletions(-)
---
diff --git a/plugins/gtk+/Makefile.am b/plugins/gtk+/Makefile.am
index 559ecdf..12f2f73 100644
--- a/plugins/gtk+/Makefile.am
+++ b/plugins/gtk+/Makefile.am
@@ -23,6 +23,7 @@ libgladegtk_la_CFLAGS = $(AM_CFLAGS)
 
 libgladegtk_la_SOURCES =               \
        $(BUILT_SOURCES)                \
+       glade-about-dialog-editor.c     \
        glade-accels.c                  \
        glade-activatable-editor.c      \
        glade-attributes.c              \
@@ -56,6 +57,7 @@ libgladegtk_la_LDFLAGS     = -module -avoid-version $(AM_LDFLAGS)
 libgladegtk_la_LIBADD      = $(libgladeui) $(GTK_LIBS)
 
 noinst_HEADERS =                       \
+       glade-about-dialog-editor.h     \
        glade-accels.h                  \
        glade-activatable-editor.h      \
        glade-attributes.h              \
@@ -84,9 +86,7 @@ if PLATFORM_WIN32
 libgladegtk_la_LDFLAGS += -no-undefined
 endif
 
-
 # catalog data
-
 catalogsdir = $(pkgdatadir)/catalogs
 
 catalogs_DATA = gtk+.xml
@@ -104,6 +104,7 @@ BUILT_SOURCES =             \
        glade-gtk-resources.h
 
 UI_FILES =                             \
+       glade-about-dialog-editor.ui    \
        glade-activatable-editor.ui     \
        glade-button-editor.ui          \
        glade-entry-editor.ui           \
diff --git a/plugins/gtk+/glade-about-dialog-editor.c b/plugins/gtk+/glade-about-dialog-editor.c
new file mode 100644
index 0000000..3a53539
--- /dev/null
+++ b/plugins/gtk+/glade-about-dialog-editor.c
@@ -0,0 +1,238 @@
+/*
+ * Copyright (C) 2013 Tristan Van Berkom.
+ *
+ * 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.
+ *
+ * Authors:
+ *   Tristan Van Berkom <tvb gnome org>
+ */
+
+#include <config.h>
+#include <gladeui/glade.h>
+#include <glib/gi18n-lib.h>
+
+#include "glade-about-dialog-editor.h"
+
+static void glade_about_dialog_editor_editable_init (GladeEditableIface * iface);
+
+/* Callbacks */
+static void license_type_pre_commit     (GladePropertyShell     *shell,
+                                        GValue                 *value,
+                                        GladeAboutDialogEditor *editor);
+static void license_type_post_commit    (GladePropertyShell     *shell,
+                                        GValue                 *value,
+                                        GladeAboutDialogEditor *editor);
+static void logo_file_toggled           (GtkWidget              *widget,
+                                        GladeAboutDialogEditor *editor);
+static void logo_icon_toggled           (GtkWidget              *widget,
+                                        GladeAboutDialogEditor *editor);
+
+
+struct _GladeAboutDialogEditorPrivate
+{
+  GtkWidget *license_label;
+  GtkWidget *license_editor;
+  GtkWidget *wrap_license_editor;
+
+  GtkWidget *logo_file_radio;
+  GtkWidget *logo_icon_radio;
+};
+
+static GladeEditableIface *parent_editable_iface;
+
+G_DEFINE_TYPE_WITH_CODE (GladeAboutDialogEditor, glade_about_dialog_editor, GLADE_TYPE_WINDOW_EDITOR,
+                         G_IMPLEMENT_INTERFACE (GLADE_TYPE_EDITABLE,
+                                                glade_about_dialog_editor_editable_init));
+
+static void
+glade_about_dialog_editor_class_init (GladeAboutDialogEditorClass * klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+  gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/gladegtk/glade-about-dialog-editor.ui");
+
+  gtk_widget_class_bind_child (widget_class, GladeAboutDialogEditorPrivate, license_label);
+  gtk_widget_class_bind_child (widget_class, GladeAboutDialogEditorPrivate, license_editor);
+  gtk_widget_class_bind_child (widget_class, GladeAboutDialogEditorPrivate, wrap_license_editor);
+  gtk_widget_class_bind_child (widget_class, GladeAboutDialogEditorPrivate, logo_file_radio);
+  gtk_widget_class_bind_child (widget_class, GladeAboutDialogEditorPrivate, logo_icon_radio);
+
+  gtk_widget_class_bind_callback (widget_class, license_type_pre_commit);
+  gtk_widget_class_bind_callback (widget_class, license_type_post_commit);
+  gtk_widget_class_bind_callback (widget_class, logo_file_toggled);
+  gtk_widget_class_bind_callback (widget_class, logo_icon_toggled);
+
+  g_type_class_add_private (object_class, sizeof (GladeAboutDialogEditorPrivate));  
+}
+
+static void
+glade_about_dialog_editor_init (GladeAboutDialogEditor * self)
+{
+  self->priv = 
+    G_TYPE_INSTANCE_GET_PRIVATE (self,
+                                GLADE_TYPE_ABOUT_DIALOG_EDITOR,
+                                GladeAboutDialogEditorPrivate);
+
+  gtk_widget_init_template (GTK_WIDGET (self));
+}
+
+static void
+glade_about_dialog_editor_load (GladeEditable * editable, GladeWidget * widget)
+{
+  GladeAboutDialogEditor *dialog_editor = GLADE_ABOUT_DIALOG_EDITOR (editable);
+  GladeAboutDialogEditorPrivate *priv = dialog_editor->priv;
+
+  /* Chain up to default implementation */
+  parent_editable_iface->load (editable, widget);
+
+  if (widget)
+    {
+      GtkLicense license = GTK_LICENSE_UNKNOWN;
+      gboolean   as_file;
+      gboolean   sensitive;
+
+      /* Set sensitivity of the custom license text */
+      glade_widget_property_get (widget, "license-type", &license);
+
+      sensitive = (license == GTK_LICENSE_UNKNOWN || license == GTK_LICENSE_CUSTOM);
+      gtk_widget_set_sensitive (priv->license_label, sensitive);
+      gtk_widget_set_sensitive (priv->license_editor, sensitive);
+      gtk_widget_set_sensitive (priv->wrap_license_editor, sensitive);
+
+      /* Set the radio button state to our virtual property */
+      glade_widget_property_get (widget, "glade-logo-as-file", &as_file);
+
+      if (as_file)
+       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->logo_file_radio), TRUE);
+      else
+       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->logo_icon_radio), TRUE);
+    }
+}
+
+static void
+glade_about_dialog_editor_editable_init (GladeEditableIface * iface)
+{
+  parent_editable_iface = g_type_interface_peek_parent (iface);
+
+  iface->load = glade_about_dialog_editor_load;
+}
+
+
+static void
+license_type_pre_commit (GladePropertyShell     *shell,
+                        GValue                 *value,
+                        GladeAboutDialogEditor *editor)
+{
+  GladeWidget   *widget = glade_editable_loaded_widget (GLADE_EDITABLE (editor));
+  GladeProperty *property;
+  GtkLicense     license;
+
+  glade_command_push_group (_("Setting License type of %s"),
+                           glade_widget_get_name (widget));
+
+  license = g_value_get_enum (value);
+
+  if (!(license == GTK_LICENSE_UNKNOWN || license == GTK_LICENSE_CUSTOM))
+    {
+      property = glade_widget_get_property (widget, "license");
+      glade_command_set_property (property, NULL);
+
+      property = glade_widget_get_property (widget, "wrap-license");
+      glade_command_set_property (property, FALSE);
+    }
+}
+
+static void
+license_type_post_commit (GladePropertyShell     *shell,
+                         GValue                 *value,
+                         GladeAboutDialogEditor *editor)
+{
+  glade_command_pop_group ();
+}
+
+static void
+logo_icon_toggled (GtkWidget              *widget,
+                  GladeAboutDialogEditor *editor)
+{
+  GladeAboutDialogEditorPrivate *priv = editor->priv;
+  GladeWidget   *gwidget = glade_editable_loaded_widget (GLADE_EDITABLE (editor));
+  GladeProperty *property;
+
+  if (glade_editable_loading (GLADE_EDITABLE (editor)) || !gwidget)
+    return;
+
+  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->logo_icon_radio)))
+    return;
+
+  glade_editable_block (GLADE_EDITABLE (editor));
+
+  glade_command_push_group (_("Setting %s to use a logo icon"),
+                            glade_widget_get_name (gwidget));
+
+  property = glade_widget_get_property (gwidget, "logo-icon-name");
+  glade_command_set_property (property, NULL);
+  property = glade_widget_get_property (gwidget, "logo");
+  glade_command_set_property (property, NULL);
+  property = glade_widget_get_property (gwidget, "glade-logo-as-file");
+  glade_command_set_property (property, FALSE);
+
+  glade_command_pop_group ();
+
+  glade_editable_unblock (GLADE_EDITABLE (editor));
+
+  /* reload buttons and sensitivity and stuff... */
+  glade_editable_load (GLADE_EDITABLE (editor), gwidget);
+}
+
+static void
+logo_file_toggled (GtkWidget              *widget,
+                  GladeAboutDialogEditor *editor)
+{
+  GladeAboutDialogEditorPrivate *priv = editor->priv;
+  GladeWidget   *gwidget = glade_editable_loaded_widget (GLADE_EDITABLE (editor));
+  GladeProperty *property;
+
+  if (glade_editable_loading (GLADE_EDITABLE (editor)) || !gwidget)
+    return;
+
+  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->logo_file_radio)))
+    return;
+
+  glade_editable_block (GLADE_EDITABLE (editor));
+
+  glade_command_push_group (_("Setting %s to use logo file"),
+                            glade_widget_get_name (gwidget));
+
+  property = glade_widget_get_property (gwidget, "logo-icon-name");
+  glade_command_set_property (property, NULL);
+  property = glade_widget_get_property (gwidget, "logo");
+  glade_command_set_property (property, NULL);
+  property = glade_widget_get_property (gwidget, "glade-logo-as-file");
+  glade_command_set_property (property, TRUE);
+
+  glade_command_pop_group ();
+
+  glade_editable_unblock (GLADE_EDITABLE (editor));
+
+  /* reload buttons and sensitivity and stuff... */
+  glade_editable_load (GLADE_EDITABLE (editor), gwidget);
+}
+
+GtkWidget *
+glade_about_dialog_editor_new (void)
+{
+  return g_object_new (GLADE_TYPE_ABOUT_DIALOG_EDITOR, NULL);
+}
diff --git a/plugins/gtk+/glade-about-dialog-editor.h b/plugins/gtk+/glade-about-dialog-editor.h
new file mode 100644
index 0000000..dcf61f9
--- /dev/null
+++ b/plugins/gtk+/glade-about-dialog-editor.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2013 Tristan Van Berkom.
+ *
+ * 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.
+ *
+ * Authors:
+ *   Tristan Van Berkom <tvb gnome org>
+ */
+#ifndef _GLADE_ABOUT_DIALOG_EDITOR_H_
+#define _GLADE_ABOUT_DIALOG_EDITOR_H_
+
+#include <gtk/gtk.h>
+#include "glade-window-editor.h"
+
+G_BEGIN_DECLS
+
+#define GLADE_TYPE_ABOUT_DIALOG_EDITOR             (glade_about_dialog_editor_get_type ())
+#define GLADE_ABOUT_DIALOG_EDITOR(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GLADE_TYPE_ABOUT_DIALOG_EDITOR, GladeAboutDialogEditor))
+#define GLADE_ABOUT_DIALOG_EDITOR_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), 
GLADE_TYPE_ABOUT_DIALOG_EDITOR, GladeAboutDialogEditorClass))
+#define GLADE_IS_ABOUT_DIALOG_EDITOR(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
GLADE_TYPE_ABOUT_DIALOG_EDITOR))
+#define GLADE_IS_ABOUT_DIALOG_EDITOR_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), 
GLADE_TYPE_ABOUT_DIALOG_EDITOR))
+#define GLADE_ABOUT_DIALOG_EDITOR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), 
GLADE_TYPE_ABOUT_DIALOG_EDITOR, GladeAboutDialogEditorClass))
+
+typedef struct _GladeAboutDialogEditor        GladeAboutDialogEditor;
+typedef struct _GladeAboutDialogEditorClass   GladeAboutDialogEditorClass;
+typedef struct _GladeAboutDialogEditorPrivate GladeAboutDialogEditorPrivate;
+
+struct _GladeAboutDialogEditor
+{
+  GladeWindowEditor  parent;
+
+  GladeAboutDialogEditorPrivate *priv;
+};
+
+struct _GladeAboutDialogEditorClass
+{
+  GladeWindowEditorClass parent;
+};
+
+GType            glade_about_dialog_editor_get_type (void) G_GNUC_CONST;
+GtkWidget       *glade_about_dialog_editor_new      (void);
+
+G_END_DECLS
+
+#endif  /* _GLADE_ABOUT_DIALOG_EDITOR_H_ */
diff --git a/plugins/gtk+/glade-about-dialog-editor.ui b/plugins/gtk+/glade-about-dialog-editor.ui
new file mode 100644
index 0000000..b1aa8c2
--- /dev/null
+++ b/plugins/gtk+/glade-about-dialog-editor.ui
@@ -0,0 +1,628 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.10 -->
+  <!-- interface-requires gladeui 0.0 -->
+  <!-- interface-requires glade-gtk-plugin 0.0 -->
+  <template class="GladeAboutDialogEditor" parent="GladeWindowEditor">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="orientation">vertical</property>
+    <child internal-child="extension_port">
+      <object class="GtkBox" id="extension_port">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkGrid" id="grid">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="row_spacing">6</property>
+            <property name="column_spacing">6</property>
+            <child>
+              <object class="GtkLabel" id="params_title">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">start</property>
+                <property name="valign">center</property>
+                <property name="label" translatable="yes">Program Attributes</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">7</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyLabel" id="program_name_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="margin_left">12</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">program-name</property>
+                <property name="custom_text" translatable="yes">Name:</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="program_name_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">program-name</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+                <property name="width">2</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyLabel" id="license_type_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="margin_left">12</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">license-type</property>
+                <property name="custom_text" translatable="yes">License:</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">10</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyLabel" id="license_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">license</property>
+                <property name="custom_text" translatable="yes">License Text</property>
+              </object>
+              <packing>
+                <property name="left_attach">3</property>
+                <property name="top_attach">10</property>
+                <property name="width">2</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="license_type_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">license-type</property>
+                <signal name="post-commit" handler="license_type_post_commit" swapped="no"/>
+                <signal name="pre-commit" handler="license_type_pre_commit" swapped="no"/>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">10</property>
+                <property name="width">2</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyLabel" id="program_version_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">end</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">version</property>
+                <property name="custom_text" translatable="yes">Version:</property>
+              </object>
+              <packing>
+                <property name="left_attach">3</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="program_version_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">version</property>
+              </object>
+              <packing>
+                <property name="left_attach">4</property>
+                <property name="top_attach">1</property>
+                <property name="width">3</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="wrap_license_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="property_name">wrap-license</property>
+                <property name="editor_type">GladeEpropCheck</property>
+              </object>
+              <packing>
+                <property name="left_attach">5</property>
+                <property name="top_attach">10</property>
+                <property name="width">2</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="license_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="property_name">license</property>
+              </object>
+              <packing>
+                <property name="left_attach">3</property>
+                <property name="top_attach">11</property>
+                <property name="width">4</property>
+                <property name="height">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkRadioButton" id="logo_icon_radio">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="hexpand">False</property>
+                <property name="xalign">0</property>
+                <property name="active">True</property>
+                <property name="draw_indicator">True</property>
+                <signal name="toggled" handler="logo_icon_toggled" swapped="no"/>
+                <child>
+                  <object class="GladePropertyLabel" id="logo_icon_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="property_name">logo-icon-name</property>
+                    <property name="custom_text" translatable="yes">Icon</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">3</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkRadioButton" id="logo_file_radio">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="hexpand">False</property>
+                <property name="xalign">0</property>
+                <property name="active">True</property>
+                <property name="draw_indicator">True</property>
+                <property name="group">logo_icon_radio</property>
+                <signal name="toggled" handler="logo_file_toggled" swapped="no"/>
+                <child>
+                  <object class="GladePropertyLabel" id="logo_file_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="property_name">logo</property>
+                    <property name="custom_text" translatable="yes">File</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">4</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="logo_icon_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="property_name">logo-icon-name</property>
+              </object>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="top_attach">3</property>
+                <property name="width">5</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="logo_file_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="property_name">logo</property>
+              </object>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="top_attach">4</property>
+                <property name="width">5</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyLabel" id="website_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="margin_left">12</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">website</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">6</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="website_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">website</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">6</property>
+                <property name="width">2</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyLabel" id="website_label_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="property_name">website-label</property>
+              </object>
+              <packing>
+                <property name="left_attach">3</property>
+                <property name="top_attach">6</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="website_label_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="property_name">website-label</property>
+              </object>
+              <packing>
+                <property name="left_attach">4</property>
+                <property name="top_attach">6</property>
+                <property name="width">3</property>
+                <property name="height">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyLabel" id="authors_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="margin_left">12</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">authors</property>
+                <property name="custom_text" translatable="yes">Authors</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">13</property>
+                <property name="width">3</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="authors_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="margin_left">12</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">authors</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">14</property>
+                <property name="width">3</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyLabel" id="translators_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="property_name">translator-credits</property>
+                <property name="custom_text" translatable="yes">Translators</property>
+              </object>
+              <packing>
+                <property name="left_attach">3</property>
+                <property name="top_attach">13</property>
+                <property name="width">4</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="translators_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="property_name">translator-credits</property>
+              </object>
+              <packing>
+                <property name="left_attach">3</property>
+                <property name="top_attach">14</property>
+                <property name="width">4</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyLabel" id="artists_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="margin_left">12</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">artists</property>
+                <property name="custom_text" translatable="yes">Artists</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">15</property>
+                <property name="width">3</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="artists_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="margin_left">12</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">artists</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">16</property>
+                <property name="width">3</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyLabel" id="documenters_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="property_name">documenters</property>
+                <property name="custom_text" translatable="yes">Documenters</property>
+              </object>
+              <packing>
+                <property name="left_attach">3</property>
+                <property name="top_attach">15</property>
+                <property name="width">4</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="documenters_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="property_name">documenters</property>
+              </object>
+              <packing>
+                <property name="left_attach">3</property>
+                <property name="top_attach">16</property>
+                <property name="width">4</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyLabel" id="copyright_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="margin_left">12</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">copyright</property>
+                <property name="custom_text" translatable="yes">Copyright</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">17</property>
+                <property name="width">3</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="copyright_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="margin_left">12</property>
+                <property name="hexpand">False</property>
+                <property name="property_name">copyright</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">18</property>
+                <property name="width">3</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyLabel" id="comments_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="property_name">comments</property>
+                <property name="custom_text" translatable="yes">Comments</property>
+              </object>
+              <packing>
+                <property name="left_attach">3</property>
+                <property name="top_attach">17</property>
+                <property name="width">4</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GladePropertyShell" id="comments_editor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="property_name">comments</property>
+              </object>
+              <packing>
+                <property name="left_attach">3</property>
+                <property name="top_attach">18</property>
+                <property name="width">4</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">start</property>
+                <property name="valign">center</property>
+                <property name="margin_left">12</property>
+                <property name="label" translatable="yes">Logo:</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">3</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="spacing">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">2</property>
+                <property name="width">7</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="spacing1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">5</property>
+                <property name="width">7</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="spacing2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">9</property>
+                <property name="width">7</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">False</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child-editors>
+      <editor id="program_name_label"/>
+      <editor id="program_name_editor"/>
+      <editor id="license_type_label"/>
+      <editor id="license_label"/>
+      <editor id="license_type_editor"/>
+      <editor id="program_version_label"/>
+      <editor id="program_version_editor"/>
+      <editor id="wrap_license_editor"/>
+      <editor id="license_editor"/>
+      <editor id="logo_icon_label"/>
+      <editor id="logo_file_label"/>
+      <editor id="logo_icon_editor"/>
+      <editor id="logo_file_editor"/>
+      <editor id="website_label"/>
+      <editor id="website_editor"/>
+      <editor id="website_label_label"/>
+      <editor id="website_label_editor"/>
+      <editor id="authors_label"/>
+      <editor id="authors_editor"/>
+      <editor id="translators_label"/>
+      <editor id="translators_editor"/>
+      <editor id="artists_label"/>
+      <editor id="artists_editor"/>
+      <editor id="documenters_label"/>
+      <editor id="documenters_editor"/>
+      <editor id="copyright_label"/>
+      <editor id="copyright_editor"/>
+      <editor id="comments_label"/>
+      <editor id="comments_editor"/>
+    </child-editors>
+  </template>
+</interface>
diff --git a/plugins/gtk+/glade-gtk-resources.gresource.xml b/plugins/gtk+/glade-gtk-resources.gresource.xml
index 3044561..3527b62 100644
--- a/plugins/gtk+/glade-gtk-resources.gresource.xml
+++ b/plugins/gtk+/glade-gtk-resources.gresource.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
   <gresource prefix="/org/gnome/gladegtk">
+    <file compressed="true" preprocess="xml-stripblanks">glade-about-dialog-editor.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">glade-activatable-editor.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">glade-button-editor.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">glade-entry-editor.ui</file>
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index 7ac9dec..845e2df 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -25,28 +25,29 @@
 #include <config.h>
 
 #include "glade-gtk.h"
+#include "glade-about-dialog-editor.h"
 #include "glade-accels.h"
+#include "glade-activatable-editor.h"
 #include "glade-attributes.h"
+#include "glade-button-editor.h"
+#include "glade-cell-renderer-editor.h"
 #include "glade-column-types.h"
-#include "glade-model-data.h"
+#include "glade-entry-editor.h"
+#include "glade-fixed.h"
+#include "glade-gtk-action-widgets.h"
+#include "glade-icon-factory-editor.h"
 #include "glade-icon-sources.h"
-#include "glade-button-editor.h"
-#include "glade-widget-editor.h"
-#include "glade-window-editor.h"
-#include "glade-tool-button-editor.h"
 #include "glade-image-editor.h"
 #include "glade-image-item-editor.h"
-#include "glade-icon-factory-editor.h"
-#include "glade-store-editor.h"
 #include "glade-label-editor.h"
-#include "glade-cell-renderer-editor.h"
-#include "glade-treeview-editor.h"
-#include "glade-entry-editor.h"
-#include "glade-activatable-editor.h"
-#include "glade-tool-item-group-editor.h"
+#include "glade-model-data.h"
+#include "glade-store-editor.h"
 #include "glade-string-list.h"
-#include "glade-fixed.h"
-#include "glade-gtk-action-widgets.h"
+#include "glade-tool-button-editor.h"
+#include "glade-tool-item-group-editor.h"
+#include "glade-treeview-editor.h"
+#include "glade-widget-editor.h"
+#include "glade-window-editor.h"
 
 #include <gladeui/glade-editor-property.h>
 #include <gladeui/glade-base-editor.h>
@@ -3287,7 +3288,14 @@ glade_gtk_window_create_editable (GladeWidgetAdaptor * adaptor,
        * so don't check it by GType but use strcmp() instead.
        */
       strcmp (glade_widget_adaptor_get_name (adaptor), "GtkOffscreenWindow") != 0)
-    editable = (GladeEditable *) glade_window_editor_new ();
+    {
+      GType window_type = glade_widget_adaptor_get_object_type (adaptor);
+
+      if (g_type_is_a (window_type, GTK_TYPE_ABOUT_DIALOG))
+       editable = (GladeEditable *) glade_about_dialog_editor_new ();
+      else
+       editable = (GladeEditable *) glade_window_editor_new ();
+    }
   else
     editable = GWA_GET_CLASS (GTK_TYPE_WIDGET)->create_editable (adaptor, type);
 
@@ -3315,6 +3323,47 @@ glade_gtk_window_set_property (GladeWidgetAdaptor * adaptor,
     GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor, object, id, value);
 }
 
+/* ----------------------------- GtkAboutDialog ------------------------------ */
+void
+glade_gtk_about_dialog_read_widget (GladeWidgetAdaptor * adaptor,
+                                   GladeWidget * widget, GladeXmlNode * node)
+{
+  if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET) ||
+       glade_xml_node_verify_silent (node, GLADE_XML_TAG_TEMPLATE)))
+    return;
+
+  /* First chain up and read in all the normal properties.. */
+  GWA_GET_CLASS (GTK_TYPE_WIDGET)->read_widget (adaptor, widget, node);
+
+  /* Sync the logo icon mode */
+  if (glade_widget_property_original_default (widget, "logo") == FALSE)
+    glade_widget_property_set (widget, "glade-logo-as-file", TRUE);
+  else
+    glade_widget_property_set (widget, "glade-logo-as-file", FALSE);
+}
+
+void
+glade_gtk_about_dialog_set_property (GladeWidgetAdaptor * adaptor,
+                                    GObject * object,
+                                    const gchar * id, const GValue * value)
+{
+  if (!strcmp (id, "glade-logo-as-file"))
+    {
+      GladeWidget *gwidget = glade_widget_get_from_gobject (object);
+
+      glade_widget_property_set_sensitive (gwidget, "logo", FALSE, NOT_SELECTED_MSG);
+      glade_widget_property_set_sensitive (gwidget, "logo-icon-name", FALSE, NOT_SELECTED_MSG);
+
+      if (g_value_get_boolean (value))
+       glade_widget_property_set_sensitive (gwidget, "logo", TRUE, NULL);
+      else
+       glade_widget_property_set_sensitive (gwidget, "logo-icon-name", TRUE, NULL);
+    }
+  else
+    GWA_GET_CLASS (GTK_TYPE_DIALOG)->set_property (adaptor, object, id, value);
+}
+
+
 /* ----------------------------- GtkDialog(s) ------------------------------ */
 static void
 glade_gtk_dialog_stop_offending_signals (GtkWidget * widget)
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index b52c5c7..06563d3 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -2094,14 +2094,26 @@ embedded in another object</_tooltip>
     -->
     
    <glade-widget-class name="GtkAboutDialog" generic-name="aboutdialog" _title="About Dialog">
-      <properties>
-       <property id="program-name" since="2.12"/>
-       <property id="copyright" translatable="True" multiline="True"/>
-       <property id="comments" translatable="True" multiline="True"/>
-       <property id="license" translatable="True" multiline="True"/>
-       <property id="website-label" translatable="True" multiline="True"/>
 
-               <property id="license-type" since="3.0">
+      <read-widget-function>glade_gtk_about_dialog_read_widget</read-widget-function>
+      <set-property-function>glade_gtk_about_dialog_set_property</set-property-function>
+
+      <properties>
+       <property id="program-name" since="2.12" custom-layout="True"/>
+       <property id="version" custom-layout="True"/>
+       <property id="license" translatable="True" multiline="True" custom-layout="True"/>
+       <property id="wrap-license" custom-layout="True"/>
+       <property id="logo-icon-name" themed-icon="True" custom-layout="True"/>
+       <property id="logo" custom-layout="True"/>
+       <property id="website" custom-layout="True"/>
+       <property id="website-label" translatable="True" multiline="True" custom-layout="True"/>
+       <property id="authors" custom-layout="True"/>
+       <property id="artists" custom-layout="True"/>
+       <property id="documenters" custom-layout="True"/>
+       <property id="copyright" translatable="True" multiline="True" custom-layout="True"/>
+       <property id="comments" translatable="True" multiline="True" custom-layout="True"/>
+
+               <property id="license-type" since="3.0" custom-layout="True">
          <displayable-values>
            <value id="GTK_LICENSE_UNKNOWN" _name="Unknown"/>
            <value id="GTK_LICENSE_CUSTOM" _name="Custom"/>
@@ -2114,9 +2126,16 @@ embedded in another object</_tooltip>
            <value id="GTK_LICENSE_ARTISTIC" _name="Artistic"/>
          </displayable-values>
        </property>
+
+       <!-- A virtual property to drive the radio button between setting the Logo as a file or icon name -->
+        <property id="glade-logo-as-file" visible="False" save="False">
+         <parameter-spec>
+           <type>GParamBoolean</type>
+         </parameter-spec>
+        </property>
        
        <!-- It is disputable whether this should really be translatable -->
-       <property id="translator-credits" translatable="True" multiline="True">
+       <property id="translator-credits" translatable="True" multiline="True" custom-layout="True">
          <_tooltip>You can mark this as translatable and set one name/address if you want to show a 
translation specific translator, otherwise you should list all translators and unmark this string for 
translation</_tooltip>
        </property>
       </properties>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c42b5b7..f72ba44 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -79,6 +79,7 @@ plugins/gtk+/glade-widget-editor.c
 plugins/gtk+/glade-window-editor.c
 plugins/gtk+/gtkunixprint.xml.in
 plugins/gtk+/gtk+.xml.in
+[type: gettext/glade]plugins/gtk+/glade-about-dialog-editor.ui
 [type: gettext/glade]plugins/gtk+/glade-activatable-editor.ui
 [type: gettext/glade]plugins/gtk+/glade-button-editor.ui
 [type: gettext/glade]plugins/gtk+/glade-entry-editor.ui


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