[glade] Added GladeRecentChooserWidgetEditor.
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] Added GladeRecentChooserWidgetEditor.
- Date: Sun, 5 May 2013 12:36:24 +0000 (UTC)
commit c7685964c1d5919decf4557e4b305bf44caf199c
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Sun May 5 19:04:38 2013 +0900
Added GladeRecentChooserWidgetEditor.
plugins/gtk+/Makefile.am | 4 ++
plugins/gtk+/glade-gtk-recent-chooser-widget.c | 40 ++++++++++++++
plugins/gtk+/glade-gtk-resources.gresource.xml | 1 +
plugins/gtk+/glade-recent-chooser-widget-editor.c | 48 ++++++++++++++++
plugins/gtk+/glade-recent-chooser-widget-editor.h | 57 ++++++++++++++++++++
plugins/gtk+/glade-recent-chooser-widget-editor.ui | 38 +++++++++++++
plugins/gtk+/gtk+.xml.in | 30 +++++++----
po/POTFILES.in | 3 +
8 files changed, 210 insertions(+), 11 deletions(-)
---
diff --git a/plugins/gtk+/Makefile.am b/plugins/gtk+/Makefile.am
index f292611..826a9aa 100644
--- a/plugins/gtk+/Makefile.am
+++ b/plugins/gtk+/Makefile.am
@@ -79,6 +79,7 @@ libgladegtk_la_SOURCES = \
glade-gtk-radio-button.c \
glade-gtk-radio-menu-item.c \
glade-gtk-recent-chooser-menu.c \
+ glade-gtk-recent-chooser-widget.c \
glade-gtk-recent-file-filter.c \
glade-gtk-size-group.c \
glade-gtk-spin-button.c \
@@ -104,6 +105,7 @@ libgladegtk_la_SOURCES = \
glade-model-data.c \
glade-recent-chooser-dialog-editor.c \
glade-recent-chooser-editor.c \
+ glade-recent-chooser-widget-editor.c \
glade-store-editor.c \
glade-string-list.c \
glade-tool-button-editor.c \
@@ -153,6 +155,7 @@ noinst_HEADERS = \
glade-model-data.h \
glade-recent-chooser-dialog-editor.h \
glade-recent-chooser-editor.h \
+ glade-recent-chooser-widget-editor.h \
glade-store-editor.h \
glade-string-list.h \
glade-tool-button-editor.h \
@@ -200,6 +203,7 @@ UI_FILES = \
glade-message-dialog-editor.ui \
glade-recent-chooser-dialog-editor.ui \
glade-recent-chooser-editor.ui \
+ glade-recent-chooser-widget-editor.ui \
glade-tool-button-editor.ui \
glade-widget-editor.ui \
glade-window-editor.ui
diff --git a/plugins/gtk+/glade-gtk-recent-chooser-widget.c b/plugins/gtk+/glade-gtk-recent-chooser-widget.c
new file mode 100644
index 0000000..1da09dd
--- /dev/null
+++ b/plugins/gtk+/glade-gtk-recent-chooser-widget.c
@@ -0,0 +1,40 @@
+/*
+ * glade-gtk-recent-chooser-widget.c - GladeWidgetAdaptor for GtkRecentChooserWidget
+ *
+ * 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"
+#include "glade-recent-chooser-widget-editor.h"
+
+GladeEditable *
+glade_gtk_recent_chooser_widget_create_editable (GladeWidgetAdaptor *adaptor,
+ GladeEditorPageType type)
+{
+ if (type == GLADE_PAGE_GENERAL)
+ return (GladeEditable *) glade_recent_chooser_widget_editor_new ();
+
+ return GWA_GET_CLASS (GTK_TYPE_WIDGET)->create_editable (adaptor, type);
+}
+
diff --git a/plugins/gtk+/glade-gtk-resources.gresource.xml b/plugins/gtk+/glade-gtk-resources.gresource.xml
index 722ddbb..10b496d 100644
--- a/plugins/gtk+/glade-gtk-resources.gresource.xml
+++ b/plugins/gtk+/glade-gtk-resources.gresource.xml
@@ -18,6 +18,7 @@
<file compressed="true" preprocess="xml-stripblanks">glade-message-dialog-editor.ui</file>
<file compressed="true" preprocess="xml-stripblanks">glade-recent-chooser-dialog-editor.ui</file>
<file compressed="true" preprocess="xml-stripblanks">glade-recent-chooser-editor.ui</file>
+ <file compressed="true" preprocess="xml-stripblanks">glade-recent-chooser-widget-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-recent-chooser-widget-editor.c
b/plugins/gtk+/glade-recent-chooser-widget-editor.c
new file mode 100644
index 0000000..09c55cf
--- /dev/null
+++ b/plugins/gtk+/glade-recent-chooser-widget-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-recent-chooser-widget-editor.h"
+
+G_DEFINE_TYPE (GladeRecentChooserWidgetEditor, glade_recent_chooser_widget_editor,
GLADE_TYPE_EDITOR_SKELETON)
+
+static void
+glade_recent_chooser_widget_editor_class_init (GladeRecentChooserWidgetEditorClass * klass)
+{
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/gladegtk/glade-recent-chooser-widget-editor.ui");
+}
+
+static void
+glade_recent_chooser_widget_editor_init (GladeRecentChooserWidgetEditor * self)
+{
+ gtk_widget_init_template (GTK_WIDGET (self));
+}
+
+GtkWidget *
+glade_recent_chooser_widget_editor_new (void)
+{
+ return g_object_new (GLADE_TYPE_RECENT_CHOOSER_WIDGET_EDITOR, NULL);
+}
diff --git a/plugins/gtk+/glade-recent-chooser-widget-editor.h
b/plugins/gtk+/glade-recent-chooser-widget-editor.h
new file mode 100644
index 0000000..2ea0379
--- /dev/null
+++ b/plugins/gtk+/glade-recent-chooser-widget-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_RECENT_CHOOSER_WIDGET_EDITOR_H_
+#define _GLADE_RECENT_CHOOSER_WIDGET_EDITOR_H_
+
+#include <gtk/gtk.h>
+#include "glade-window-editor.h"
+
+G_BEGIN_DECLS
+
+#define GLADE_TYPE_RECENT_CHOOSER_WIDGET_EDITOR
(glade_recent_chooser_widget_editor_get_type ())
+#define GLADE_RECENT_CHOOSER_WIDGET_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),
GLADE_TYPE_RECENT_CHOOSER_WIDGET_EDITOR, GladeRecentChooserWidgetEditor))
+#define GLADE_RECENT_CHOOSER_WIDGET_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),
GLADE_TYPE_RECENT_CHOOSER_WIDGET_EDITOR, GladeRecentChooserWidgetEditorClass))
+#define GLADE_IS_RECENT_CHOOSER_WIDGET_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
GLADE_TYPE_RECENT_CHOOSER_WIDGET_EDITOR))
+#define GLADE_IS_RECENT_CHOOSER_WIDGET_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
GLADE_TYPE_RECENT_CHOOSER_WIDGET_EDITOR))
+#define GLADE_RECENT_CHOOSER_WIDGET_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
GLADE_TYPE_RECENT_CHOOSER_WIDGET_EDITOR, GladeRecentChooserWidgetEditorClass))
+
+typedef struct _GladeRecentChooserWidgetEditor GladeRecentChooserWidgetEditor;
+typedef struct _GladeRecentChooserWidgetEditorClass GladeRecentChooserWidgetEditorClass;
+typedef struct _GladeRecentChooserWidgetEditorPrivate GladeRecentChooserWidgetEditorPrivate;
+
+struct _GladeRecentChooserWidgetEditor
+{
+ GladeEditorSkeleton parent;
+
+ GladeRecentChooserWidgetEditorPrivate *priv;
+};
+
+struct _GladeRecentChooserWidgetEditorClass
+{
+ GladeEditorSkeletonClass parent;
+};
+
+GType glade_recent_chooser_widget_editor_get_type (void) G_GNUC_CONST;
+GtkWidget *glade_recent_chooser_widget_editor_new (void);
+
+G_END_DECLS
+
+#endif /* _GLADE_RECENT_CHOOSER_WIDGET_EDITOR_H_ */
diff --git a/plugins/gtk+/glade-recent-chooser-widget-editor.ui
b/plugins/gtk+/glade-recent-chooser-widget-editor.ui
new file mode 100644
index 0000000..d807692
--- /dev/null
+++ b/plugins/gtk+/glade-recent-chooser-widget-editor.ui
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface domain="glade">
+ <!-- interface-requires glade-gtk-plugin 0.0 -->
+ <!-- interface-requires gladeui 0.0 -->
+ <template class="GladeRecentChooserWidgetEditor" parent="GladeEditorSkeleton">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GladeEditorTable" id="embed">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GladeRecentChooserEditor" id="recentchoosereditor">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child-editors>
+ <editor id="embed"/>
+ <editor id="recentchoosereditor"/>
+ </child-editors>
+ </template>
+</interface>
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index 1ee9a4b..d132d46 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -2378,7 +2378,8 @@ embedded in another object</_tooltip>
</properties>
</glade-widget-class>
- <glade-widget-class name="GtkRecentChooserWidget" generic-name="recentchooser" _title="Recent Chooser">
+ <glade-widget-class name="GtkRecentChooserWidget" generic-name="recentchooser" _title="Recent Chooser"
since="2.10">
+ <create-editable-function>glade_gtk_recent_chooser_widget_create_editable</create-editable-function>
<signals>
<signal id="item-activated" since="2.10"/>
@@ -2386,16 +2387,24 @@ embedded in another object</_tooltip>
</signals>
<properties>
+ <!-- Disable GtkBox stuff -->
<property id="size" disabled="True"/>
- <property id="filter" since="2.10"/>
- <property id="limit" since="2.10"/>
- <property id="local-only" since="2.10"/>
- <property id="recent-manager" since="2.10"/>
- <property id="select-multiple" since="2.10"/>
- <property id="show-icons" since="2.10"/>
- <property id="show-not-found" since="2.10"/>
- <property id="show-tips" since="2.10"/>
- <property id="sort-type" since="2.10">
+ <property id="homogeneous" disabled="True"/>
+ <property id="orientation" disabled="True"/>
+ <property id="spacing" disabled="True"/>
+ <property id="baseline-position" disabled="True"/>
+
+ <!-- Claim the GladeRecentChooserEditor properties -->
+ <property id="recent-manager" custom-layout="True"/>
+ <property id="filter" custom-layout="True"/>
+ <property id="limit" custom-layout="True"/>
+ <property id="show-private" custom-layout="True"/>
+ <property id="show-tips" custom-layout="True"/>
+ <property id="show-icons" custom-layout="True"/>
+ <property id="show-not-found" custom-layout="True"/>
+ <property id="select-multiple" custom-layout="True"/>
+ <property id="local-only" custom-layout="True"/>
+ <property id="sort-type" custom-layout="True">
<displayable-values>
<value id="GTK_RECENT_SORT_NONE" _name="None"/>
<value id="GTK_RECENT_SORT_MRU" _name="Most Recently Used first"/>
@@ -2420,7 +2429,6 @@ embedded in another object</_tooltip>
<property id="select-multiple" custom-layout="True"/>
<property id="local-only" custom-layout="True"/>
</properties>
-
</glade-widget-class>
<glade-widget-class name="GtkSizeGroup" generic-name="sizegroup" _title="Size Group" toplevel="True">
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 8d27c93..10bdc14 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -108,6 +108,7 @@ plugins/gtk+/glade-gtk-paned.c
plugins/gtk+/glade-gtk-radio-button.c
plugins/gtk+/glade-gtk-radio-menu-item.c
plugins/gtk+/glade-gtk-recent-chooser-menu.c
+plugins/gtk+/glade-gtk-recent-chooser-widget.c
plugins/gtk+/glade-gtk-recent-file-filter.c
plugins/gtk+/glade-gtk-size-group.c
plugins/gtk+/glade-gtk-spin-button.c
@@ -133,6 +134,7 @@ plugins/gtk+/glade-message-dialog-editor.c
plugins/gtk+/glade-model-data.c
plugins/gtk+/glade-recent-chooser-dialog-editor.c
plugins/gtk+/glade-recent-chooser-editor.c
+plugins/gtk+/glade-recent-chooser-widget-editor.c
plugins/gtk+/glade-store-editor.c
plugins/gtk+/glade-string-list.c
plugins/gtk+/glade-tool-button-editor.c
@@ -158,6 +160,7 @@ plugins/gtk+/gtk+.xml.in
[type: gettext/glade]plugins/gtk+/glade-message-dialog-editor.ui
[type: gettext/glade]plugins/gtk+/glade-recent-chooser-dialog-editor.ui
[type: gettext/glade]plugins/gtk+/glade-recent-chooser-editor.ui
+[type: gettext/glade]plugins/gtk+/glade-recent-chooser-widget-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]