o Now bookless classes' info buttons are show insensitive. o No info

* src/glade-editor-property.c, src/glade-editor.c:
	  o Now bookless classes' info buttons are show insensitive.
	  o No info buttons on query dialogs.

	* Many files: changed "== TRUE" to be "!= FALSE"
This commit is contained in:
Tristan Van Berkom 2006-06-03 17:57:50 +00:00
parent fd104da64a
commit cce24e22b9
10 changed files with 62 additions and 32 deletions

View File

@ -1,3 +1,11 @@
2006-06-03 Tristan Van Berkom <tvb@gnome.org>
* src/glade-editor-property.c, src/glade-editor.c:
o Now bookless classes' info buttons are show insensitive.
o No info buttons on query dialogs.
* Many files: changed "== TRUE" to be "!= FALSE"
2006-06-02 Tristan Van Berkom <tvb@gnome.org>
* src/glade-widget.c: Fixed segfault on widget copying.

View File

@ -953,7 +953,7 @@ glade_command_delete_execute (GladeCommandCreateDelete *me)
cdata->widget->object);
}
if (me->from_clipboard == TRUE)
if (me->from_clipboard != FALSE)
wlist = g_list_prepend (wlist, cdata->widget);
else
glade_project_remove_object

View File

@ -175,7 +175,7 @@ glade_editor_property_sensitivity_cb (GladeProperty *property,
if (sensitive == FALSE)
gtk_widget_set_sensitive (eprop->input, FALSE);
else if (glade_property_get_enabled (property) == TRUE)
else if (glade_property_get_enabled (property) != FALSE)
gtk_widget_set_sensitive (eprop->input, TRUE);
if (eprop->check)
@ -235,20 +235,13 @@ static void
glade_editor_property_info_clicked_cb (GtkWidget *info,
GladeEditorProperty *eprop)
{
GladeWidgetClass *widget_class;
gchar *search;
/* XXX Would be nice if we didnt have to beat around the bush here...
* something like eporp->class->widget_class.
*/
widget_class = glade_widget_class_get_by_type (eprop->class->pspec->owner_type);
search = g_strdup_printf ("The %s property", eprop->property->class->id);
g_signal_emit (G_OBJECT (eprop),
glade_editor_property_signals[GTK_DOC_SEARCH],
0,
widget_class ? widget_class->book : NULL,
0, eprop->class->book,
g_type_name (eprop->class->pspec->owner_type), search);
g_free (search);
@ -3082,17 +3075,26 @@ glade_editor_property_load_by_widget (GladeEditorProperty *eprop,
glade_editor_property_load (eprop, property);
}
/**
* glade_editor_property_show_info:
* @eprop: A #GladeEditorProperty
*
* Show the control widget to access help for @eprop
*/
void
glade_editor_property_show_info (GladeEditorProperty *eprop)
{
g_return_if_fail (GLADE_IS_EDITOR_PROPERTY (eprop));
/* Just pretend to show these properties.
*/
if (eprop->class->virtual == FALSE)
if (eprop->class->virtual == FALSE &&
eprop->class->book != NULL)
gtk_widget_show (eprop->info);
else
{
/* Put insensitive controls to balance the UI with
* other eprops.
*/
gtk_widget_show (eprop->info);
gtk_widget_set_sensitive (eprop->info, FALSE);
}
@ -3101,6 +3103,12 @@ glade_editor_property_show_info (GladeEditorProperty *eprop)
g_object_notify (G_OBJECT (eprop), "show-info");
}
/**
* glade_editor_property_hide_info:
* @eprop: A #GladeEditorProperty
*
* Hide the control widget to access help for @eprop
*/
void
glade_editor_property_hide_info (GladeEditorProperty *eprop)
{

View File

@ -454,7 +454,7 @@ glade_editor_table_append_item (GladeEditorTable *table,
gtk_widget_show (GTK_WIDGET (property));
gtk_widget_show_all (property->eventbox);
if (table->editor->show_context_info)
if (table->editor->show_context_info && from_query_dialog == FALSE)
glade_editor_property_show_info (property);
else
glade_editor_property_hide_info (property);
@ -839,7 +839,9 @@ glade_editor_load_widget_real (GladeEditor *editor, GladeWidget *widget)
return;
}
gtk_widget_set_sensitive (editor->reset_button, TRUE);
gtk_widget_set_sensitive (editor->info_button, TRUE);
gtk_widget_set_sensitive (editor->info_button,
editor->loaded_class->book != NULL);
editor->loading = TRUE;
@ -1393,7 +1395,7 @@ glade_editor_hide_info (GladeEditor *editor)
{
g_return_if_fail (GLADE_IS_EDITOR (editor));
if (editor->show_info == TRUE)
if (editor->show_info != FALSE)
{
editor->show_info = FALSE;
gtk_widget_hide (editor->info_button);
@ -1442,7 +1444,7 @@ glade_editor_hide_context_info (GladeEditor *editor)
g_return_if_fail (GLADE_IS_EDITOR (editor));
if (editor->show_context_info == TRUE)
if (editor->show_context_info != FALSE)
{
editor->show_context_info = FALSE;

View File

@ -140,7 +140,7 @@ glade_property_class_atk_realname (const gchar *atk_name)
* Returns: a new #GladePropertyClass
*/
GladePropertyClass *
glade_property_class_new (void)
glade_property_class_new (const gchar *book)
{
GladePropertyClass *property_class;
@ -149,6 +149,7 @@ glade_property_class_new (void)
property_class->id = NULL;
property_class->name = NULL;
property_class->tooltip = NULL;
property_class->book = book; /* <-- dont free */
property_class->def = NULL;
property_class->orig_def = NULL;
property_class->parameters = NULL;
@ -1050,7 +1051,7 @@ glade_property_class_list_atk_relations (GType owner_type)
{
relation_tab = &relation_names_table[i];
property_class = glade_property_class_new ();
property_class = glade_property_class_new (NULL);
property_class->pspec =
glade_param_spec_objects (relation_tab->id,
_(relation_tab->name),
@ -1089,7 +1090,8 @@ glade_property_class_list_atk_relations (GType owner_type)
* or %NULL if its unsupported.
*/
GladePropertyClass *
glade_property_class_new_from_spec (GParamSpec *spec)
glade_property_class_new_from_spec (GParamSpec *spec,
const gchar *book)
{
GObjectClass *gtk_widget_class;
GladePropertyClass *property_class;
@ -1100,7 +1102,7 @@ glade_property_class_new_from_spec (GParamSpec *spec)
/* Only properties that are _new_from_spec() are
* not virtual properties
*/
property_class = glade_property_class_new ();
property_class = glade_property_class_new (book);
property_class->virtual = FALSE;
property_class->pspec = spec;

View File

@ -77,12 +77,18 @@ struct _GladePropertyClass
gchar *id; /* The id of the property. Like "label" or "xpad"
* this is a non-translatable string
*/
gchar *name; /* The name of the property. Like "Label" or "X Pad"
* this is a translatable string
*/
gchar *tooltip; /* The default tooltip for the property editor rows.
*/
const gchar *book; /* A property class level pointer to the GladeWidgetClass
* book member.
*/
gboolean virtual; /* Whether this is a virtual property with its pspec supplied
* via the catalog (or hard code-paths); or FALSE if its a real
* GObject introspected property
@ -195,9 +201,10 @@ struct _GladePropertyClass
};
LIBGLADEUI_API
GladePropertyClass *glade_property_class_new (void);
GladePropertyClass *glade_property_class_new (const gchar *book);
LIBGLADEUI_API
GladePropertyClass *glade_property_class_new_from_spec (GParamSpec *spec);
GladePropertyClass *glade_property_class_new_from_spec (GParamSpec *spec,
const gchar *book);
LIBGLADEUI_API
GList *glade_property_class_list_atk_relations (GType owner_type);
LIBGLADEUI_API

View File

@ -1413,7 +1413,7 @@ glade_util_copy_file (const gchar *src_path,
if (glade_util_canonical_match (src_path, dest_path))
return FALSE;
if (g_file_test (dest_path, G_FILE_TEST_IS_REGULAR) == TRUE)
if (g_file_test (dest_path, G_FILE_TEST_IS_REGULAR) != FALSE)
if (glade_util_ui_message
(glade_app_get_window(), GLADE_UI_YES_OR_NO,
_("%s exists.\nDo you want to replace it?"), dest_path) == FALSE)

View File

@ -118,7 +118,9 @@ glade_widget_class_free (GladeWidgetClass *widget_class)
}
static GList *
gwc_props_from_pspecs (GParamSpec **specs, gint n_specs)
gwc_props_from_pspecs (GladeWidgetClass *class,
GParamSpec **specs,
gint n_specs)
{
GladePropertyClass *property_class;
gint i;
@ -127,7 +129,8 @@ gwc_props_from_pspecs (GParamSpec **specs, gint n_specs)
for (i = 0; i < n_specs; i++)
{
if ((property_class =
glade_property_class_new_from_spec (specs[i])) != NULL)
glade_property_class_new_from_spec (specs[i],
class->book)) != NULL)
list = g_list_prepend (list, property_class);
}
return g_list_reverse (list);
@ -153,7 +156,7 @@ glade_widget_class_list_properties (GladeWidgetClass *class)
/* list class properties */
specs = g_object_class_list_properties (object_class, &n_specs);
list = gwc_props_from_pspecs (specs, n_specs);
list = gwc_props_from_pspecs (class, specs, n_specs);
g_free (specs);
/* list the (hard-coded) atk relation properties if applicable */
@ -188,7 +191,7 @@ glade_widget_class_list_child_properties (GladeWidgetClass *class)
}
specs = gtk_container_class_list_child_properties (object_class, &n_specs);
list = gwc_props_from_pspecs (specs, n_specs);
list = gwc_props_from_pspecs (class, specs, n_specs);
g_free (specs);
/* We have to mark packing properties from GladeWidgetClass
@ -355,7 +358,7 @@ glade_widget_class_update_properties_from_node (GladeXmlNode *node,
}
else
{
property_class = glade_property_class_new ();
property_class = glade_property_class_new (widget_class->book);
property_class->id = g_strdup (id);
*properties = g_list_append (*properties, property_class);
list = g_list_last (*properties);

View File

@ -2795,7 +2795,7 @@ glade_widget_write_child (GArray *children,
GladeProperty *property;
property = list->data;
g_assert (property->class->packing == TRUE);
g_assert (property->class->packing != FALSE);
glade_property_write (property, interface, props);
}
}

View File

@ -108,7 +108,7 @@ main (int argc, char *argv[])
}
if (version == TRUE)
if (version != FALSE)
{
/* Print version information and exit */
g_print ("%s\n", PACKAGE_STRING);
@ -147,7 +147,7 @@ main (int argc, char *argv[])
for (i=0; files[i] ; ++i)
{
if (g_file_test (files[i], G_FILE_TEST_EXISTS) == TRUE)
if (g_file_test (files[i], G_FILE_TEST_EXISTS) != FALSE)
glade_project_window_open_project (project_window, files[i]);
else
g_warning (_("Unable to open '%s', the file does not exist.\n"), files[i]);