[glade] Added GladeMessageDialogEditor
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] Added GladeMessageDialogEditor
- Date: Sun, 5 May 2013 12:36:04 +0000 (UTC)
commit a812540d607a2be2c33a0551a345652ae2d4b42d
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Sun May 5 16:51:44 2013 +0900
Added GladeMessageDialogEditor
A GladeWindowEditor with message dialog attributes.
plugins/gtk+/Makefile.am | 3 +
plugins/gtk+/glade-gtk-resources.gresource.xml | 1 +
plugins/gtk+/glade-gtk-window.c | 3 +
plugins/gtk+/glade-message-dialog-editor.c | 48 +++++
plugins/gtk+/glade-message-dialog-editor.h | 57 ++++++
plugins/gtk+/glade-message-dialog-editor.ui | 254 ++++++++++++++++++++++++
plugins/gtk+/gtk+.xml.in | 23 +--
po/POTFILES.in | 2 +
8 files changed, 375 insertions(+), 16 deletions(-)
---
diff --git a/plugins/gtk+/Makefile.am b/plugins/gtk+/Makefile.am
index 84eaa1a..6b3e391 100644
--- a/plugins/gtk+/Makefile.am
+++ b/plugins/gtk+/Makefile.am
@@ -100,6 +100,7 @@ libgladegtk_la_SOURCES = \
glade-image-editor.c \
glade-image-item-editor.c \
glade-label-editor.c \
+ glade-message-dialog-editor.c \
glade-model-data.c \
glade-store-editor.c \
glade-string-list.c \
@@ -146,6 +147,7 @@ noinst_HEADERS = \
glade-image-editor.h \
glade-image-item-editor.h \
glade-label-editor.h \
+ glade-message-dialog-editor.h \
glade-model-data.h \
glade-store-editor.h \
glade-string-list.h \
@@ -191,6 +193,7 @@ UI_FILES = \
glade-font-chooser-widget-editor.ui \
glade-image-editor.ui \
glade-label-editor.ui \
+ glade-message-dialog-editor.ui \
glade-tool-button-editor.ui \
glade-widget-editor.ui \
glade-window-editor.ui
diff --git a/plugins/gtk+/glade-gtk-resources.gresource.xml b/plugins/gtk+/glade-gtk-resources.gresource.xml
index fb11e28..b228ee1 100644
--- a/plugins/gtk+/glade-gtk-resources.gresource.xml
+++ b/plugins/gtk+/glade-gtk-resources.gresource.xml
@@ -15,6 +15,7 @@
<file compressed="true" preprocess="xml-stripblanks">glade-font-chooser-widget-editor.ui</file>
<file compressed="true" preprocess="xml-stripblanks">glade-image-editor.ui</file>
<file compressed="true" preprocess="xml-stripblanks">glade-label-editor.ui</file>
+ <file compressed="true" preprocess="xml-stripblanks">glade-message-dialog-editor.ui</file>
<file compressed="true" preprocess="xml-stripblanks">glade-tool-button-editor.ui</file>
<file compressed="true" preprocess="xml-stripblanks">glade-widget-editor.ui</file>
<file compressed="true" preprocess="xml-stripblanks">glade-window-editor.ui</file>
diff --git a/plugins/gtk+/glade-gtk-window.c b/plugins/gtk+/glade-gtk-window.c
index d94d3d8..f27955b 100644
--- a/plugins/gtk+/glade-gtk-window.c
+++ b/plugins/gtk+/glade-gtk-window.c
@@ -29,6 +29,7 @@
#include "glade-about-dialog-editor.h"
#include "glade-file-chooser-dialog-editor.h"
#include "glade-font-chooser-dialog-editor.h"
+#include "glade-message-dialog-editor.h"
#include "glade-gtk.h"
#define GLADE_TAG_ACCEL_GROUPS "accel-groups"
@@ -173,6 +174,8 @@ glade_gtk_window_create_editable (GladeWidgetAdaptor * adaptor,
editable = (GladeEditable *) glade_file_chooser_dialog_editor_new ();
else if (g_type_is_a (window_type, GTK_TYPE_FONT_CHOOSER_DIALOG))
editable = (GladeEditable *) glade_font_chooser_dialog_editor_new ();
+ else if (g_type_is_a (window_type, GTK_TYPE_MESSAGE_DIALOG))
+ editable = (GladeEditable *) glade_message_dialog_editor_new ();
else
editable = (GladeEditable *) glade_window_editor_new ();
}
diff --git a/plugins/gtk+/glade-message-dialog-editor.c b/plugins/gtk+/glade-message-dialog-editor.c
new file mode 100644
index 0000000..c6a0bb1
--- /dev/null
+++ b/plugins/gtk+/glade-message-dialog-editor.c
@@ -0,0 +1,48 @@
+/*
+ * 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-message-dialog-editor.h"
+
+G_DEFINE_TYPE (GladeMessageDialogEditor, glade_message_dialog_editor, GLADE_TYPE_WINDOW_EDITOR)
+
+static void
+glade_message_dialog_editor_class_init (GladeMessageDialogEditorClass * klass)
+{
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/gladegtk/glade-message-dialog-editor.ui");
+}
+
+static void
+glade_message_dialog_editor_init (GladeMessageDialogEditor * self)
+{
+ gtk_widget_init_template (GTK_WIDGET (self));
+}
+
+GtkWidget *
+glade_message_dialog_editor_new (void)
+{
+ return g_object_new (GLADE_TYPE_MESSAGE_DIALOG_EDITOR, NULL);
+}
diff --git a/plugins/gtk+/glade-message-dialog-editor.h b/plugins/gtk+/glade-message-dialog-editor.h
new file mode 100644
index 0000000..77694a3
--- /dev/null
+++ b/plugins/gtk+/glade-message-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_MESSAGE_DIALOG_EDITOR_H_
+#define _GLADE_MESSAGE_DIALOG_EDITOR_H_
+
+#include <gtk/gtk.h>
+#include "glade-window-editor.h"
+
+G_BEGIN_DECLS
+
+#define GLADE_TYPE_MESSAGE_DIALOG_EDITOR (glade_message_dialog_editor_get_type ())
+#define GLADE_MESSAGE_DIALOG_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),
GLADE_TYPE_MESSAGE_DIALOG_EDITOR, GladeMessageDialogEditor))
+#define GLADE_MESSAGE_DIALOG_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),
GLADE_TYPE_MESSAGE_DIALOG_EDITOR, GladeMessageDialogEditorClass))
+#define GLADE_IS_MESSAGE_DIALOG_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
GLADE_TYPE_MESSAGE_DIALOG_EDITOR))
+#define GLADE_IS_MESSAGE_DIALOG_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
GLADE_TYPE_MESSAGE_DIALOG_EDITOR))
+#define GLADE_MESSAGE_DIALOG_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
GLADE_TYPE_MESSAGE_DIALOG_EDITOR, GladeMessageDialogEditorClass))
+
+typedef struct _GladeMessageDialogEditor GladeMessageDialogEditor;
+typedef struct _GladeMessageDialogEditorClass GladeMessageDialogEditorClass;
+typedef struct _GladeMessageDialogEditorPrivate GladeMessageDialogEditorPrivate;
+
+struct _GladeMessageDialogEditor
+{
+ GladeWindowEditor parent;
+
+ GladeMessageDialogEditorPrivate *priv;
+};
+
+struct _GladeMessageDialogEditorClass
+{
+ GladeWindowEditorClass parent;
+};
+
+GType glade_message_dialog_editor_get_type (void) G_GNUC_CONST;
+GtkWidget *glade_message_dialog_editor_new (void);
+
+G_END_DECLS
+
+#endif /* _GLADE_MESSAGE_DIALOG_EDITOR_H_ */
diff --git a/plugins/gtk+/glade-message-dialog-editor.ui b/plugins/gtk+/glade-message-dialog-editor.ui
new file mode 100644
index 0000000..3d721ac
--- /dev/null
+++ b/plugins/gtk+/glade-message-dialog-editor.ui
@@ -0,0 +1,254 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface domain="glade">
+ <!-- interface-requires gladeui 0.0 -->
+ <!-- interface-requires gtk+ 3.10 -->
+ <!-- interface-requires glade-gtk-plugin 0.0 -->
+ <template class="GladeMessageDialogEditor" 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="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">Message Dialog 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">6</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GladePropertyLabel" id="message_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">message-type</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GladePropertyShell" id="message_type_editor">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">False</property>
+ <property name="property_name">message-type</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GladePropertyLabel" id="buttons_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">buttons</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GladePropertyShell" id="buttons_editor">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">False</property>
+ <property name="property_name">buttons</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GladePropertyLabel" id="image_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">image</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GladePropertyShell" id="image_editor">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="property_name">image</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="width">3</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GladePropertyLabel" id="primary_text_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">text</property>
+ <property name="custom_text" translatable="yes">Primary Text:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GladePropertyLabel" id="secondary_text_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">secondary-text</property>
+ <property name="custom_text" translatable="yes">Secondary Text:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">5</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GladePropertyShell" id="primary_text_editor">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="property_name">text</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="width">3</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GladePropertyShell" id="primary_text_markup_editor">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">False</property>
+ <property name="property_name">use-markup</property>
+ <property name="editor_type">GladeEpropCheck</property>
+ <property name="custom_text">Markup</property>
+ </object>
+ <packing>
+ <property name="left_attach">5</property>
+ <property name="top_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GladePropertyShell" id="secondary_text_editor">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="property_name">secondary-text</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="width">3</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GladePropertyShell" id="secondary_text_markup_editor">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">False</property>
+ <property name="property_name">secondary-use-markup</property>
+ <property name="editor_type">GladeEpropCheck</property>
+ <property name="custom_text">Markup</property>
+ </object>
+ <packing>
+ <property name="left_attach">5</property>
+ <property name="top_attach">5</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </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>
+ </child>
+ <child-editors>
+ <editor id="message_type_label"/>
+ <editor id="message_type_editor"/>
+ <editor id="buttons_label"/>
+ <editor id="buttons_editor"/>
+ <editor id="image_label"/>
+ <editor id="image_editor"/>
+ <editor id="primary_text_label"/>
+ <editor id="secondary_text_label"/>
+ <editor id="primary_text_editor"/>
+ <editor id="primary_text_markup_editor"/>
+ <editor id="secondary_text_editor"/>
+ <editor id="secondary_text_markup_editor"/>
+ </child-editors>
+ </template>
+</interface>
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index 1ddf25b..6d0fd0e 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -1670,7 +1670,6 @@ embedded in another object</_tooltip>
<properties>
<property id="default-width" default="320" optional="True" optional-default="False"/>
<property id="default-height" default="260" optional="True" optional-default="False"/>
- <property id="has-separator" default="False"/>
<property id="type-hint" default="GDK_WINDOW_TYPE_HINT_DIALOG" save-always="True"/>
</properties>
@@ -2209,9 +2208,6 @@ embedded in another object</_tooltip>
<object name="help_button"/>
</object>
</internal-children>
- <properties>
- <property id="has-separator" disabled="True"/>
- </properties>
</glade-widget-class>
<glade-widget-class name="GtkFileChooserDialog" generic-name="filechooserdialog" _title="File Chooser
Dialog">
@@ -2247,9 +2243,6 @@ embedded in another object</_tooltip>
<object name="apply_button"/>
</object>
</internal-children>
- <properties>
- <property id="has-separator" disabled="True"/>
- </properties>
</glade-widget-class>
<glade-widget-class name="GtkAppChooserDialog" generic-name="appchooserdialog"
@@ -2262,18 +2255,16 @@ embedded in another object</_tooltip>
<verify-function>glade_gtk_message_dialog_verify_property</verify-function>
<properties>
- <property id="has-separator" disabled="True"/>
-
<property id="default-width" default="400" optional="True" optional-default="False"/>
<property id="default-height" default="115" optional="True" optional-default="False"/>
- <property id="image" since="2.10" parentless-widget="True"/>
- <property id="secondary-text" translatable="True" since="2.10"/>
- <property id="secondary-use-markup" since="2.10"/>
- <property id="text" translatable="True" since="2.10"/>
- <property id="use-markup" since="2.10"/>
-
- <property id="buttons">
+ <property id="image" since="2.10" parentless-widget="True" create-type="GtkImage"
custom-layout="True"/>
+ <property id="secondary-text" translatable="True" since="2.10" custom-layout="True"/>
+ <property id="secondary-use-markup" since="2.10" custom-layout="True"/>
+ <property id="text" translatable="True" since="2.10" custom-layout="True"/>
+ <property id="use-markup" since="2.10" custom-layout="True"/>
+ <property id="message-type" custom-layout="True"/>
+ <property id="buttons" custom-layout="True">
<displayable-values>
<value id="GTK_BUTTONS_NONE" _name="None"/>
<value id="GTK_BUTTONS_OK" _name="Ok"/>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 8ef7412..9622939 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -129,6 +129,7 @@ plugins/gtk+/glade-icon-sources.c
plugins/gtk+/glade-image-editor.c
plugins/gtk+/glade-image-item-editor.c
plugins/gtk+/glade-label-editor.c
+plugins/gtk+/glade-message-dialog-editor.c
plugins/gtk+/glade-model-data.c
plugins/gtk+/glade-store-editor.c
plugins/gtk+/glade-string-list.c
@@ -152,6 +153,7 @@ plugins/gtk+/gtk+.xml.in
[type: gettext/glade]plugins/gtk+/glade-font-chooser-editor.ui
[type: gettext/glade]plugins/gtk+/glade-image-editor.ui
[type: gettext/glade]plugins/gtk+/glade-label-editor.ui
+[type: gettext/glade]plugins/gtk+/glade-message-dialog-editor.ui
[type: gettext/glade]plugins/gtk+/glade-tool-button-editor.ui
[type: gettext/glade]plugins/gtk+/glade-widget-editor.ui
[type: gettext/glade]plugins/gtk+/glade-window-editor.ui
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]