[glade3] * plugins/gtk+/gtk+.xml.in, plugins/gnome/gnome.xml.in, plugins/gnome/canvas.xml.in, plugins/gnome
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3] * plugins/gtk+/gtk+.xml.in, plugins/gnome/gnome.xml.in, plugins/gnome/canvas.xml.in, plugins/gnome
- Date: Thu, 25 Mar 2010 22:55:49 +0000 (UTC)
commit 6afb3f18595bac47e788509208b52ca8348dd874
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Thu Mar 25 18:55:07 2010 -0400
* plugins/gtk+/gtk+.xml.in, plugins/gnome/gnome.xml.in, plugins/gnome/canvas.xml.in,
plugins/gnome/gtkunixprint.xml.in: Added missing displayable values and rooted out latest
resulting startup warnings for GTK+ 2.20.
* gladeui/glade-widget-adaptor.[ch]: Save the original missing icon name if the icon was
not found.
* gladeui/glade-catalog.c: Print a summery of all missing icon names for thier classes
(cleans up start up warnings).
ChangeLog | 10 ++++++++
gladeui/glade-catalog.c | 32 ++++++++++++++++++++++++++-
gladeui/glade-widget-adaptor.c | 43 +++++++++++++++++++++++--------------
gladeui/glade-widget-adaptor.h | 3 +-
plugins/gnome/canvas.xml.in | 10 ++++++++-
plugins/gnome/gnome.xml.in | 1 +
plugins/gtk+/gtk+.xml.in | 24 ++++++++++++++++++++-
plugins/gtk+/gtkunixprint.xml.in | 20 ++++++++++++++++-
8 files changed, 121 insertions(+), 22 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ce039de..2cb70dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,16 @@
* plugins/gtk+/glade-gtk.c: Fix some remaining crashes from the GSEAL() stuff (GtkBoxChild
invalid type dereferencing).
+ * plugins/gtk+/gtk+.xml.in, plugins/gnome/gnome.xml.in, plugins/gnome/canvas.xml.in,
+ plugins/gnome/gtkunixprint.xml.in: Added missing displayable values and rooted out latest
+ resulting startup warnings for GTK+ 2.20.
+
+ * gladeui/glade-widget-adaptor.[ch]: Save the original missing icon name if the icon was
+ not found.
+
+ * gladeui/glade-catalog.c: Print a summery of all missing icon names for thier classes
+ (cleans up start up warnings).
+
2010-03-25 Federico Mena Quintero <federico novell com>
* plugins/gtk+/gtk+.xml.in: bgo#594231 - Fix the orientation of
diff --git a/gladeui/glade-catalog.c b/gladeui/glade-catalog.c
index ead16fb..60417d7 100644
--- a/gladeui/glade-catalog.c
+++ b/gladeui/glade-catalog.c
@@ -527,10 +527,11 @@ catalogs_from_path (GList *catalogs, const gchar *path)
const GList *
glade_catalog_load_all (void)
{
- GList *catalogs = NULL, *l;
+ GList *catalogs = NULL, *l, *adaptors;
GladeCatalog *catalog;
const gchar *search_path;
gchar **split;
+ GString *icon_warning = NULL;
gint i;
/* First load catalogs from user specified directories ... */
@@ -567,7 +568,34 @@ glade_catalog_load_all (void)
catalog = l->data;
catalog_load (catalog);
}
-
+
+ /* Print a summery of widget adaptors missing icons.
+ */
+ adaptors = glade_widget_adaptor_list_adaptors ();
+ for (l = adaptors; l; l = l->next)
+ {
+ GladeWidgetAdaptor *adaptor = l->data;
+
+ if (adaptor->missing_icon)
+ {
+ if (!icon_warning)
+ icon_warning = g_string_new ("Glade needs artwork; "
+ "a default icon will be used for "
+ "the following classes:");
+
+ g_string_append_printf (icon_warning, "\n\t%s\tneeds an icon named '%s'",
+ adaptor->name, adaptor->missing_icon);
+ }
+
+ }
+ g_list_free (adaptors);
+
+ if (icon_warning)
+ {
+ g_message ("%s", icon_warning->str);
+ g_string_free (icon_warning, TRUE);
+ }
+
loaded_catalogs = catalogs;
return loaded_catalogs;
diff --git a/gladeui/glade-widget-adaptor.c b/gladeui/glade-widget-adaptor.c
index 9daa6bf..c11f5e7 100644
--- a/gladeui/glade-widget-adaptor.c
+++ b/gladeui/glade-widget-adaptor.c
@@ -701,6 +701,7 @@ glade_widget_adaptor_finalize (GObject *object)
if (adaptor->generic_name) g_free (adaptor->generic_name);
if (adaptor->title) g_free (adaptor->title);
if (adaptor->icon_name) g_free (adaptor->icon_name);
+ if (adaptor->missing_icon) g_free (adaptor->missing_icon);
if (adaptor->actions)
{
@@ -2014,17 +2015,6 @@ create_icon_name_for_object_class (const gchar *class_name,
name = g_strdup_printf ("widget-%s-%s", icon_prefix, generic_name);
else
name = g_strdup (icon_name);
-
- /* check if icon is available */
- if (!gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), name))
- {
- GladeWidgetAdaptor *parent = glade_widget_adaptor_get_parent_adaptor_by_type (class_type);
- g_warning ("No icon named '%s' was found for object class '%s'.", name, class_name);
- g_free (name);
-
- name = g_strdup ((parent && parent->icon_name) ?
- parent->icon_name : DEFAULT_ICON_NAME);
- }
return name;
}
@@ -2097,7 +2087,9 @@ glade_widget_adaptor_from_catalog (GladeCatalog *catalog,
gchar *name, *generic_name, *icon_name, *adaptor_icon_name, *adaptor_name, *func_name;
gchar *title, *translated_title, *parent_name;
GType object_type, adaptor_type, parent_type;
+ gchar *missing_icon = NULL;
GWADerivedClassData data;
+
if (!glade_xml_node_verify (class_node, GLADE_TAG_GLADE_WIDGET_CLASS))
{
@@ -2176,11 +2168,28 @@ glade_widget_adaptor_from_catalog (GladeCatalog *catalog,
icon_name = glade_xml_get_property_string (class_node, GLADE_TAG_ICON_NAME);
/* get a suitable icon name for adaptor */
- adaptor_icon_name = create_icon_name_for_object_class (name,
- object_type,
- icon_name,
- glade_catalog_get_icon_prefix (catalog),
- generic_name);
+ adaptor_icon_name =
+ create_icon_name_for_object_class (name,
+ object_type,
+ icon_name,
+ glade_catalog_get_icon_prefix (catalog),
+ generic_name);
+
+
+ /* check if icon is available (a null icon-name is an abstract class) */
+ if (adaptor_icon_name &&
+ !gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), adaptor_icon_name))
+ {
+ GladeWidgetAdaptor *parent =
+ glade_widget_adaptor_get_parent_adaptor_by_type (object_type);
+
+ /* Save the desired name */
+ missing_icon = adaptor_icon_name;
+
+ adaptor_icon_name = g_strdup ((parent && parent->icon_name) ?
+ parent->icon_name : DEFAULT_ICON_NAME);
+
+ }
adaptor = g_object_new (adaptor_type,
"type", object_type,
@@ -2189,6 +2198,8 @@ glade_widget_adaptor_from_catalog (GladeCatalog *catalog,
"generic-name", generic_name,
"icon-name", adaptor_icon_name,
NULL);
+
+ adaptor->missing_icon = missing_icon;
g_free (generic_name);
g_free (icon_name);
diff --git a/gladeui/glade-widget-adaptor.h b/gladeui/glade-widget-adaptor.h
index bfe5ba2..899545c 100644
--- a/gladeui/glade-widget-adaptor.h
+++ b/gladeui/glade-widget-adaptor.h
@@ -574,7 +574,8 @@ struct _GladeWidgetAdaptor
* button2, buttonX ..
*/
- gchar *icon_name; /* icon name for widget class */
+ gchar *icon_name; /* icon name to use for widget class */
+ gchar *missing_icon; /* the name of the missing icon if it was not found */
gchar *title; /* Translated class name used in the UI */
diff --git a/plugins/gnome/canvas.xml.in b/plugins/gnome/canvas.xml.in
index 8753198..a92a92f 100644
--- a/plugins/gnome/canvas.xml.in
+++ b/plugins/gnome/canvas.xml.in
@@ -42,8 +42,16 @@
<property id="scroll-y2" disabled="True"/>
<property id="pixels-per-unit" disabled="True"/>
<property id="selection-mode" _name="Selection Mode">
+ <parameter-spec>
+ <type>GParamEnum</type>
+ <value-type>GnomeIconListMode</value-type>
+ </parameter-spec>
<_tooltip>The selection mode</_tooltip>
- <spec>glade_gnome_icon_list_selection_mode_spec</spec>
+ <displayable-values>
+ <value id="GNOME_ICON_LIST_ICONS" _name="List Icons"/>
+ <value id="GNOME_ICON_LIST_TEXT_BELOW" _name="Text Below"/>
+ <value id="GNOME_ICON_LIST_TEXT_RIGHT" _name="Text Right"/>
+ </displayable-values>
</property>
<property id="icon-width" _name="Icon Width" default="78">
<_tooltip>The width of each icon</_tooltip>
diff --git a/plugins/gnome/gnome.xml.in b/plugins/gnome/gnome.xml.in
index adcc778..aca5586 100644
--- a/plugins/gnome/gnome.xml.in
+++ b/plugins/gnome/gnome.xml.in
@@ -155,6 +155,7 @@
<value id="GNOME_DATE_EDIT_SHOW_TIME" _name="Show Time"/>
<value id="GNOME_DATE_EDIT_24_HR" _name="24-Hour Format"/>
<value id="GNOME_DATE_EDIT_WEEK_STARTS_ON_MONDAY" _name="Monday First"/>
+ <value id="GNOME_DATE_EDIT_DISPLAY_SECONDS" _name="Display Seconds"/>
</displayable-values>
</property>
</properties>
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index d975b08..57673e0 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -1037,6 +1037,17 @@ embedded in another object</_tooltip>
<glade-widget-class name="GtkScaleButton" generic-name="scalebutton" _title="Scale Button" since="2.12">
<properties>
<property id="orientation" since="2.14"/>
+ <property id="size">
+ <displayable-values>
+ <value id="GTK_ICON_SIZE_INVALID" _name="Invalid"/>
+ <value id="GTK_ICON_SIZE_MENU" _name="Menu"/>
+ <value id="GTK_ICON_SIZE_SMALL_TOOLBAR" _name="Small Toolbar"/>
+ <value id="GTK_ICON_SIZE_LARGE_TOOLBAR" _name="Large Toolbar"/>
+ <value id="GTK_ICON_SIZE_BUTTON" _name="Button"/>
+ <value id="GTK_ICON_SIZE_DND" _name="Drag & Drop"/>
+ <value id="GTK_ICON_SIZE_DIALOG" _name="Dialog"/>
+ </displayable-values>
+ </property>
</properties>
</glade-widget-class>
@@ -3329,7 +3340,18 @@ embedded in another object</_tooltip>
<glade-widget-class name="GtkTextTag" generic-name="texttag" _title="Text Tag"
- libglade-unsupported="True" toplevel="True"/>
+ libglade-unsupported="True" toplevel="True">
+ <properties>
+ <property id="direction">
+ <displayable-values>
+ <value id="GTK_TEXT_DIR_NONE" _name="None"/>
+ <value id="GTK_TEXT_DIR_LTR" _name="Left to Right"/>
+ <value id="GTK_TEXT_DIR_RTL" _name="Right to Left"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
<glade-widget-class name="GtkTextTagTable" generic-name="texttagtable" _title="Text Tag Table"
libglade-unsupported="True" toplevel="True"/>
diff --git a/plugins/gtk+/gtkunixprint.xml.in b/plugins/gtk+/gtkunixprint.xml.in
index 4a9be39..63006a1 100644
--- a/plugins/gtk+/gtkunixprint.xml.in
+++ b/plugins/gtk+/gtkunixprint.xml.in
@@ -7,7 +7,25 @@
<glade-widget-classes>
<glade-widget-class name="GtkPageSetupUnixDialog" generic-name="pagesetupdialog" _title="Page Setup Dialog"/>
- <glade-widget-class name="GtkPrintUnixDialog" generic-name="printdialog" _title="Print Dialog"/>
+ <glade-widget-class name="GtkPrintUnixDialog" generic-name="printdialog" _title="Print Dialog">
+ <properties>
+ <property id="manual-capabilities">
+ <displayable-values>
+ <value id="GTK_PRINT_CAPABILITY_PAGE_SET" _name="Page Set"/>
+ <value id="GTK_PRINT_CAPABILITY_COPIES" _name="Copies"/>
+ <value id="GTK_PRINT_CAPABILITY_COLLATE" _name="Collate"/>
+ <value id="GTK_PRINT_CAPABILITY_REVERSE" _name="Reverse"/>
+ <value id="GTK_PRINT_CAPABILITY_SCALE" _name="Scale"/>
+ <value id="GTK_PRINT_CAPABILITY_GENERATE_PDF" _name="Generate PDF"/>
+ <value id="GTK_PRINT_CAPABILITY_GENERATE_PS" _name="Generate PS"/>
+ <value id="GTK_PRINT_CAPABILITY_PREVIEW" _name="Preview"/>
+ <value id="GTK_PRINT_CAPABILITY_NUMBER_UP" _name="Number Up"/>
+ <value id="GTK_PRINT_CAPABILITY_NUMBER_UP_LAYOUT" _name="Number Up Layout"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
</glade-widget-classes>
<glade-widget-group name="unixprint-toplevels" _title="GTK+ Unix Print Toplevels">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]