glade3 r1991 - in trunk: . gladeui src
- From: tvb svn gnome org
- To: svn-commits-list gnome org
- Subject: glade3 r1991 - in trunk: . gladeui src
- Date: Thu, 23 Oct 2008 19:03:25 +0000 (UTC)
Author: tvb
Date: Thu Oct 23 19:03:25 2008
New Revision: 1991
URL: http://svn.gnome.org/viewvc/glade3?rev=1991&view=rev
Log:
* src/glade-window.c: Fixed a warning.
also fixed some errors in previous commit.
Modified:
trunk/ChangeLog
trunk/gladeui/glade-editor-table.c
trunk/gladeui/glade-editor.c
trunk/gladeui/glade-property-class.c
trunk/gladeui/glade-property-class.h
trunk/gladeui/glade-xml-utils.h
trunk/src/glade-window.c
Modified: trunk/gladeui/glade-editor-table.c
==============================================================================
--- trunk/gladeui/glade-editor-table.c (original)
+++ trunk/gladeui/glade-editor-table.c Thu Oct 23 19:03:25 2008
@@ -31,8 +31,6 @@
static void glade_editor_table_finalize (GObject *object);
static void glade_editor_table_editable_init (GladeEditableIface *iface);
static void glade_editor_table_grab_focus (GtkWidget *widget);
-static void append_packing_items (GladeEditorTable *table,
- GladeWidget *widget);
G_DEFINE_TYPE_WITH_CODE (GladeEditorTable, glade_editor_table, GTK_TYPE_TABLE,
G_IMPLEMENT_INTERFACE (GLADE_TYPE_EDITABLE,
@@ -147,10 +145,6 @@
else if (table->name_entry)
gtk_entry_set_text (GTK_ENTRY (table->name_entry), "");
- /* If this is a packing page, we need to generate the properties here... */
- if (table->loaded_widget && table->type == GLADE_PAGE_PACKING)
- append_packing_items (table, table->loaded_widget);
-
/* Sync up properties, even if widget is NULL */
for (list = table->properties; list; list = list->next)
{
@@ -205,14 +199,19 @@
get_sorted_properties (GladeWidgetAdaptor *adaptor,
GladeEditorPageType type)
{
- GList *l, *list = NULL;
-
- for (l = adaptor->properties; l && l->data; l = g_list_next (l))
+ GList *l, *list = NULL, *properties;
+
+ properties = (type == GLADE_PAGE_PACKING) ? adaptor->packing_props : adaptor->properties;
+
+ for (l = properties; l && l->data; l = g_list_next (l))
{
GladePropertyClass *klass = l->data;
- /* Collect properties in our domain, query dialogs are allowed editor invisible properties */
- if (GLADE_PROPERTY_CLASS_IS_TYPE (klass, type) &&
+ /* Collect properties in our domain, query dialogs are allowed editor
+ * invisible properties, allow adaptors to filter out properties from
+ * the GladeEditorTable using the "custom-layout" attribute.
+ */
+ if (!klass->custom_layout && GLADE_PROPERTY_CLASS_IS_TYPE (klass, type) &&
(glade_property_class_is_visible (klass) || type != GLADE_PAGE_QUERY))
list = g_list_prepend (list, klass);
@@ -271,26 +270,6 @@
}
static void
-append_packing_items (GladeEditorTable *table,
- GladeWidget *widget)
-{
- GladeEditorProperty *eprop;
- GladeProperty *property;
- GList *list;
-
- for (list = widget->packing_properties; list != NULL; list = list->next)
- {
- property = list->data;
-
- eprop = append_item (table, property->klass, FALSE);
- table->properties = g_list_prepend (table->properties, eprop);
- }
-
- table->properties = g_list_reverse (table->properties);
-}
-
-
-static void
widget_name_edited (GtkWidget *editable, GladeEditorTable *table)
{
GladeWidget *widget;
Modified: trunk/gladeui/glade-editor.c
==============================================================================
--- trunk/gladeui/glade-editor.c (original)
+++ trunk/gladeui/glade-editor.c Thu Oct 23 19:03:25 2008
@@ -387,7 +387,6 @@
editor->page_signals = glade_editor_notebook_page (editor, _("_Signals"));
editor->page_atk = glade_editor_notebook_page (editor, _("Accessibility"));
editor->editables = NULL;
- editor->packing_page = NULL;
editor->loading = FALSE;
editor->class_field = glade_editor_setup_class_field (editor);
@@ -474,7 +473,6 @@
GList *list;
g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
- g_return_val_if_fail (type != GLADE_PAGE_PACKING, NULL);
for (list = editor->editables; list; list = list->next)
{
@@ -488,16 +486,19 @@
editable = (GtkWidget *)glade_widget_adaptor_create_editable (adaptor, type);
g_return_val_if_fail (editable != NULL, NULL);
- g_object_ref_sink (editable);
g_object_set_data (G_OBJECT (editable), "glade-editor-page-type", GINT_TO_POINTER (type));
g_object_set_data (G_OBJECT (editable), "glade-widget-adaptor", adaptor);
- editor->editables = g_list_prepend (editor->editables, editable);
+ if (type != GLADE_PAGE_PACKING)
+ {
+ editor->editables = g_list_prepend (editor->editables, editable);
+ g_object_ref_sink (editable);
+ }
return editable;
}
-static void
+static GtkWidget *
glade_editor_load_editable_in_page (GladeEditor *editor,
GladeWidgetAdaptor *adaptor,
GladeEditorPageType type)
@@ -529,24 +530,20 @@
/* Remove the editable (this will destroy on packing pages) */
if (GTK_BIN (container)->child)
+ {
+ gtk_widget_hide (GTK_BIN (container)->child);
gtk_container_remove (container, GTK_BIN (container)->child);
+ }
if (!adaptor)
- return;
-
- if (type != GLADE_PAGE_PACKING)
- editable = glade_editor_get_editable_by_adaptor (editor, adaptor, type);
- else
- {
- /* Dont take a ref for packing pages, they are owned by thier container
- * until we update it.
- */
- editable = (GtkWidget *)glade_widget_adaptor_create_editable (adaptor, type);
- editor->packing_page = editable;
- }
+ return NULL;
+ if ((editable = glade_editor_get_editable_by_adaptor (editor, adaptor, type)) == NULL)
+ return NULL;
+
/* Attach the new page */
gtk_container_add (GTK_CONTAINER (container), editable);
+ gtk_widget_show (editable);
/* Enable tabbed keynav in the editor */
scrolled_window = gtk_widget_get_parent (GTK_WIDGET (container));
@@ -563,8 +560,10 @@
adj = gtk_scrolled_window_get_hadjustment
(GTK_SCROLLED_WINDOW (scrolled_window));
- gtk_container_set_focus_hadjustment
- (GTK_CONTAINER (editable), adj);
+ gtk_container_set_focus_hadjustment
+ (GTK_CONTAINER (editable), adj);
+
+ return editable;
}
static void
@@ -583,7 +582,6 @@
glade_editor_load_editable_in_page (editor, adaptor, GLADE_PAGE_GENERAL);
glade_editor_load_editable_in_page (editor, adaptor, GLADE_PAGE_COMMON);
- glade_editor_load_editable_in_page (editor, adaptor, GLADE_PAGE_PACKING);
glade_editor_load_editable_in_page (editor, adaptor, GLADE_PAGE_ATK);
glade_editor_load_signal_page (editor);
@@ -608,8 +606,14 @@
{
GtkWidget *editable;
- if (type == GLADE_PAGE_PACKING)
- editable = editor->packing_page;
+ /* Use the parenting adaptor for packing pages... so deffer creating the widgets
+ * until load time.
+ */
+ if (type == GLADE_PAGE_PACKING && widget->parent)
+ {
+ GladeWidgetAdaptor *adaptor = widget->parent->adaptor;
+ editable = glade_editor_load_editable_in_page (editor, adaptor, GLADE_PAGE_PACKING);
+ }
else
editable = glade_editor_get_editable_by_adaptor
(editor, widget->adaptor, type);
Modified: trunk/gladeui/glade-property-class.c
==============================================================================
--- trunk/gladeui/glade-property-class.c (original)
+++ trunk/gladeui/glade-property-class.c Thu Oct 23 19:03:25 2008
@@ -77,17 +77,18 @@
property_class->query = FALSE;
property_class->optional = FALSE;
property_class->optional_default = FALSE;
+ property_class->is_modified = FALSE;
property_class->common = FALSE;
property_class->packing = FALSE;
- property_class->is_modified = FALSE;
+ property_class->atk = FALSE;
property_class->visible = TRUE;
+ property_class->custom_layout = FALSE;
property_class->save = TRUE;
property_class->save_always = FALSE;
property_class->ignore = FALSE;
property_class->needs_sync = FALSE;
property_class->themed_icon = FALSE;
property_class->translatable = FALSE;
- property_class->atk = FALSE;
property_class->virt = TRUE;
property_class->transfer_on_paste = FALSE;
property_class->weight = -1.0;
@@ -1411,16 +1412,17 @@
klass->parameters = glade_parameter_list_new_from_node (klass->parameters, child);
klass->construct_only = glade_xml_get_property_boolean (node, GLADE_TAG_CONSTRUCT_ONLY, klass->construct_only);
- klass->translatable = glade_xml_get_property_boolean (node, GLADE_TAG_TRANSLATABLE, klass->translatable);
- klass->common = glade_xml_get_property_boolean (node, GLADE_TAG_COMMON, klass->common);
- klass->optional = glade_xml_get_property_boolean (node, GLADE_TAG_OPTIONAL, klass->optional);
- klass->query = glade_xml_get_property_boolean (node, GLADE_TAG_QUERY, klass->query);
- klass->save = glade_xml_get_property_boolean (node, GLADE_TAG_SAVE, klass->save);
- klass->visible = glade_xml_get_property_boolean (node, GLADE_TAG_VISIBLE, klass->visible);
- klass->ignore = glade_xml_get_property_boolean (node, GLADE_TAG_IGNORE, klass->ignore);
- klass->needs_sync = glade_xml_get_property_boolean (node, GLADE_TAG_NEEDS_SYNC, klass->needs_sync);
- klass->themed_icon = glade_xml_get_property_boolean (node, GLADE_TAG_THEMED_ICON, klass->themed_icon);
- klass->weight = glade_xml_get_property_double (node, GLADE_TAG_WEIGHT, klass->weight);
+ klass->translatable = glade_xml_get_property_boolean (node, GLADE_TAG_TRANSLATABLE, klass->translatable);
+ klass->common = glade_xml_get_property_boolean (node, GLADE_TAG_COMMON, klass->common);
+ klass->optional = glade_xml_get_property_boolean (node, GLADE_TAG_OPTIONAL, klass->optional);
+ klass->query = glade_xml_get_property_boolean (node, GLADE_TAG_QUERY, klass->query);
+ klass->save = glade_xml_get_property_boolean (node, GLADE_TAG_SAVE, klass->save);
+ klass->visible = glade_xml_get_property_boolean (node, GLADE_TAG_VISIBLE, klass->visible);
+ klass->custom_layout = glade_xml_get_property_boolean (node, GLADE_TAG_CUSTOM_LAYOUT, klass->custom_layout);
+ klass->ignore = glade_xml_get_property_boolean (node, GLADE_TAG_IGNORE, klass->ignore);
+ klass->needs_sync = glade_xml_get_property_boolean (node, GLADE_TAG_NEEDS_SYNC, klass->needs_sync);
+ klass->themed_icon = glade_xml_get_property_boolean (node, GLADE_TAG_THEMED_ICON, klass->themed_icon);
+ klass->weight = glade_xml_get_property_double (node, GLADE_TAG_WEIGHT, klass->weight);
klass->transfer_on_paste = glade_xml_get_property_boolean (node, GLADE_TAG_TRANSFER_ON_PASTE, klass->transfer_on_paste);
klass->save_always = glade_xml_get_property_boolean (node, GLADE_TAG_SAVE_ALWAYS, klass->save_always);
klass->parentless_widget = glade_xml_get_property_boolean (node, GLADE_TAG_PARENTLESS_WIDGET, klass->parentless_widget);
Modified: trunk/gladeui/glade-property-class.h
==============================================================================
--- trunk/gladeui/glade-property-class.h (original)
+++ trunk/gladeui/glade-property-class.h Thu Oct 23 19:03:25 2008
@@ -135,8 +135,16 @@
* that are assigned initial values in composite widgets
* or derived widget code).
*/
- gboolean visible; /* Whether or not to show this property in the editor
+ gboolean visible; /* Whether or not to show this property in the editor &
+ * reset dialog.
*/
+
+ gboolean custom_layout; /* Properties marked as custom_layout will not be included
+ * in a base #GladeEditorTable implementation (use this
+ * for properties you want to layout in custom ways in
+ * a #GladeEditable widget
+ */
+
gboolean ignore; /* When true, we will not sync the object when the property
* changes, or load values from the object.
*/
Modified: trunk/gladeui/glade-xml-utils.h
==============================================================================
--- trunk/gladeui/glade-xml-utils.h (original)
+++ trunk/gladeui/glade-xml-utils.h Thu Oct 23 19:03:25 2008
@@ -158,6 +158,7 @@
#define GLADE_TAG_OPTIONAL "optional"
#define GLADE_TAG_OPTIONAL_DEFAULT "optional-default"
#define GLADE_TAG_VISIBLE "visible"
+#define GLADE_TAG_CUSTOM_LAYOUT "custom-layout"
#define GLADE_TAG_EXPANDED "expanded"
#define GLADE_TAG_GENERIC_NAME "generic-name"
#define GLADE_TAG_NAME "name"
Modified: trunk/src/glade-window.c
==============================================================================
--- trunk/src/glade-window.c (original)
+++ trunk/src/glade-window.c Thu Oct 23 19:03:25 2008
@@ -544,8 +544,8 @@
static void
action_notify_sensitive (GObject *gobject,
- GParamSpec *arg1,
- GtkWidget *item)
+ GParamSpec *arg1,
+ GtkWidget *item)
{
GladeWidgetAction *action = GLADE_WIDGET_ACTION (gobject);
gtk_widget_set_sensitive (item, action->sensitive);
@@ -2957,7 +2957,6 @@
GtkWidget *hpaned2;
GtkWidget *vpaned;
GtkWidget *menubar;
- GtkWidget *editor_item;
GtkWidget *palette;
GtkWidget *dockitem;
GtkWidget *widget;
@@ -3074,12 +3073,6 @@
gtk_widget_show (vbox);
-
-
- /* devhelp */
- editor_item = gtk_ui_manager_get_widget (priv->ui,
- "/MenuBar/ViewMenu/PropertyEditorHelp");
- gtk_widget_set_sensitive (editor_item, FALSE);
/* recent files */
priv->recent_manager = gtk_recent_manager_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (window)));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]