Commit cdb0d7b3 authored by Tristan Van Berkom's avatar Tristan Van Berkom

Abolished "View->Context Help" and added a context menu to editor


	* src/glade-window.c, gladeui/glade-editor.c, gladeui/glade-editor-property.[ch],
	gladeui/glade-popup.[ch]: Abolished "View->Context Help" and added a context menu
	to editor properties.


svn path=/trunk/; revision=1983
parent 5baf9db1
2008-10-21 Tristan Van Berkom <tvb@gnome.org>
* src/glade-window.c, gladeui/glade-editor.c, gladeui/glade-editor-property.[ch],
gladeui/glade-popup.[ch]: Abolished "View->Context Help" and added a context menu
to editor properties.
2008-10-20 Tristan Van Berkom <tvb@gnome.org>
* plugins/gtk+/glade-cell-renderer-button.[ch], plugins/gtk+/glade-text-button.[ch]:
......
......@@ -45,6 +45,7 @@
#include "glade-property.h"
#include "glade-command.h"
#include "glade-project.h"
#include "glade-popup.h"
#include "glade-builtins.h"
#include "glade-marshallers.h"
#include "glade-named-icon-chooser-dialog.h"
......@@ -52,8 +53,7 @@
enum {
PROP_0,
PROP_PROPERTY_CLASS,
PROP_USE_COMMAND,
PROP_SHOW_INFO
PROP_USE_COMMAND
};
enum {
......@@ -234,44 +234,19 @@ glade_editor_property_enabled_toggled_cb (GtkWidget *check,
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)));
}
static void
glade_editor_property_info_clicked_cb (GtkWidget *info,
GladeEditorProperty *eprop)
static gboolean
glade_editor_property_button_pressed (GtkWidget *widget,
GdkEventButton *event,
GladeEditorProperty *eprop)
{
GladeWidgetAdaptor *adaptor;
gchar *search, *book;
adaptor = glade_widget_adaptor_from_pspec (eprop->klass->pspec);
search = g_strdup_printf ("The %s property", eprop->klass->id);
g_object_get (adaptor, "book", &book, NULL);
g_signal_emit (G_OBJECT (eprop),
glade_editor_property_signals[GTK_DOC_SEARCH],
0, book,
g_type_name (eprop->klass->pspec->owner_type), search);
g_free (book);
g_free (search);
if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
{
glade_popup_property_pop (eprop->property, event);
return TRUE;
}
return FALSE;
}
static GtkWidget *
glade_editor_property_create_info_button (GladeEditorProperty *eprop)
{
GtkWidget *image;
GtkWidget *button;
button = gtk_button_new ();
image = glade_util_get_devhelp_icon (GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_set_tooltip_text (button, _("View documentation for this property"));
return button;
}
static GObject *
glade_editor_property_constructor (GType type,
......@@ -281,7 +256,7 @@ glade_editor_property_constructor (GType type,
GtkRequisition req = { -1, -1 };
GObject *obj;
GladeEditorProperty *eprop;
GtkWidget *hbox;
GtkWidget *hbox, *alignment;
/* Invoke parent constructor (eprop->klass should be resolved by this point) . */
obj = G_OBJECT_CLASS (table_class)->constructor
......@@ -304,25 +279,20 @@ glade_editor_property_constructor (GType type,
eprop->input = GLADE_EDITOR_PROPERTY_GET_CLASS (eprop)->create_input (eprop);
gtk_widget_show (eprop->input);
/* Create the informational button and add it */
eprop->info = glade_editor_property_create_info_button (eprop);
g_signal_connect (G_OBJECT (eprop->info), "clicked",
G_CALLBACK (glade_editor_property_info_clicked_cb), eprop);
/* Create the warning icon */
eprop->warning = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
GTK_ICON_SIZE_MENU);
gtk_widget_set_no_show_all (eprop->warning, TRUE);
/* Create & setup label */
eprop->item_label = gtk_alignment_new (1.0, 0.5, 0.0, 0.0);
eprop->item_label = gtk_event_box_new ();
alignment = gtk_alignment_new (1.0, 0.5, 0.0, 0.0);
hbox = gtk_hbox_new (FALSE, 4);
eprop->label = gtk_label_new (NULL);
gtk_label_set_line_wrap (GTK_LABEL(eprop->label), TRUE);
gtk_label_set_line_wrap_mode (GTK_LABEL(eprop->label), PANGO_WRAP_WORD_CHAR);
/* gtk_label_set_width_chars() was not working well :( */
gtk_label_set_text (GTK_LABEL (eprop->label), "xxxxxxxxxxxxxxx");
gtk_widget_size_request (eprop->label, &req);
......@@ -333,13 +303,18 @@ glade_editor_property_constructor (GType type,
gtk_box_pack_start (GTK_BOX (hbox), eprop->warning, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), eprop->label, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (eprop->item_label), hbox);
gtk_container_add (GTK_CONTAINER (alignment), hbox);
gtk_container_add (GTK_CONTAINER (eprop->item_label), alignment);
gtk_widget_show_all (eprop->item_label);
glade_editor_property_fix_label (eprop);
gtk_box_pack_start (GTK_BOX (eprop), eprop->input, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (eprop), eprop->info, FALSE, FALSE, 2);
g_signal_connect (G_OBJECT (eprop->item_label), "button-press-event",
G_CALLBACK (glade_editor_property_button_pressed), eprop);
g_signal_connect (G_OBJECT (eprop->input), "button-press-event",
G_CALLBACK (glade_editor_property_button_pressed), eprop);
return obj;
}
......@@ -371,12 +346,6 @@ glade_editor_property_set_property (GObject *object,
case PROP_USE_COMMAND:
eprop->use_command = g_value_get_boolean (value);
break;
case PROP_SHOW_INFO:
if (g_value_get_boolean (value))
glade_editor_property_show_info (eprop);
else
glade_editor_property_hide_info (eprop);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -399,8 +368,6 @@ glade_editor_property_get_property (GObject *object,
case PROP_USE_COMMAND:
g_value_set_boolean (value, eprop->use_command);
break;
case PROP_SHOW_INFO:
g_value_set_boolean (value, eprop->show_info);
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -542,7 +509,6 @@ glade_editor_property_load_common (GladeEditorProperty *eprop,
static void
glade_editor_property_init (GladeEditorProperty *eprop)
{
}
static void
......@@ -601,13 +567,6 @@ glade_editor_property_class_init (GladeEditorPropertyClass *eprop_class)
("use-command", _("Use Command"),
_("Whether we should use the command API for the undo/redo stack"),
FALSE, G_PARAM_READWRITE));
g_object_class_install_property
(object_class, PROP_SHOW_INFO,
g_param_spec_boolean
("show-info", _("Show Info"),
_("Whether we should show an informational button"),
FALSE, G_PARAM_READWRITE));
}
......@@ -3402,56 +3361,3 @@ glade_editor_property_load_by_widget (GladeEditorProperty *eprop,
}
}
/**
* 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)
{
GladeWidgetAdaptor *adaptor;
gchar *book;
g_return_if_fail (GLADE_IS_EDITOR_PROPERTY (eprop));
adaptor = glade_widget_adaptor_from_pspec (eprop->klass->pspec);
g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
g_object_get (adaptor, "book", &book, NULL);
if (eprop->klass->virt == FALSE &&
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);
}
g_free (book);
eprop->show_info = TRUE;
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)
{
g_return_if_fail (GLADE_IS_EDITOR_PROPERTY (eprop));
gtk_widget_hide (eprop->info);
eprop->show_info = FALSE;
g_object_notify (G_OBJECT (eprop), "show-info");
}
......@@ -100,9 +100,6 @@ struct _GladeEditorProperty
GtkWidget *check; /* Check button for optional properties.
*/
GtkWidget *info; /* Informational button
*/
gulong tooltip_id; /* signal connection id for tooltip changes */
gulong sensitive_id; /* signal connection id for sensitivity changes */
gulong changed_id; /* signal connection id for value changes */
......@@ -117,10 +114,6 @@ struct _GladeEditorProperty
* or skip directly to GladeProperty interface.
* (used for query dialogs).
*/
gboolean show_info; /* Whether we should show an informational button
* for this property
*/
};
struct _GladeEditorPropertyClass {
......@@ -147,10 +140,6 @@ void glade_editor_property_load (GladeEditorProperty *
void glade_editor_property_load_by_widget (GladeEditorProperty *eprop,
GladeWidget *widget);
void glade_editor_property_show_info (GladeEditorProperty *eprop);
void glade_editor_property_hide_info (GladeEditorProperty *eprop);
void glade_editor_property_commit (GladeEditorProperty *eprop,
GValue *value);
......
......@@ -57,8 +57,7 @@
enum
{
PROP_0,
PROP_SHOW_INFO,
PROP_SHOW_CONTEXT_INFO
PROP_SHOW_INFO
};
enum {
......@@ -114,12 +113,6 @@ glade_editor_set_property (GObject *object,
else
glade_editor_hide_info (editor);
break;
case PROP_SHOW_CONTEXT_INFO:
if (g_value_get_boolean (value))
glade_editor_show_context_info (editor);
else
glade_editor_hide_context_info (editor);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -139,9 +132,6 @@ glade_editor_get_property (GObject *object,
case PROP_SHOW_INFO:
g_value_set_boolean (value, editor->show_info);
break;
case PROP_SHOW_CONTEXT_INFO:
g_value_set_boolean (value, editor->show_context_info);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -171,14 +161,6 @@ glade_editor_class_init (GladeEditorClass *klass)
"button for the loaded widget"),
FALSE, G_PARAM_READABLE));
g_object_class_install_property
(object_class, PROP_SHOW_CONTEXT_INFO,
g_param_spec_boolean ("show-context-info",
_("Show context info"),
_("Whether to show an informational button for "
"each property and signal in the editor"),
FALSE, G_PARAM_READABLE));
/**
* GladeEditor::gtk-doc-search:
......@@ -539,11 +521,6 @@ glade_editor_table_append_item (GladeEditorTable *table,
gtk_widget_show (GTK_WIDGET (property));
gtk_widget_show_all (property->item_label);
if (table->editor->show_context_info && from_query_dialog == FALSE)
glade_editor_property_show_info (property);
else
glade_editor_property_hide_info (property);
g_signal_connect (G_OBJECT (property), "gtk-doc-search",
G_CALLBACK (glade_editor_gtk_doc_search_cb),
table->editor);
......@@ -1587,67 +1564,3 @@ glade_editor_hide_info (GladeEditor *editor)
g_object_notify (G_OBJECT (editor), "show-info");
}
}
void
glade_editor_show_context_info (GladeEditor *editor)
{
GList *list, *props;
GladeEditorTable *etable;
g_return_if_fail (GLADE_IS_EDITOR (editor));
if (editor->show_context_info != TRUE)
{
editor->show_context_info = TRUE;
for (list = editor->widget_tables; list; list = list->next)
{
etable = list->data;
for (props = etable->properties; props; props = props->next)
glade_editor_property_show_info
(GLADE_EDITOR_PROPERTY (props->data));
}
if (editor->packing_etable)
{
etable = editor->packing_etable;
for (props = etable->properties; props; props = props->next)
glade_editor_property_show_info
(GLADE_EDITOR_PROPERTY (props->data));
}
g_object_notify (G_OBJECT (editor), "show-context-info");
}
}
void
glade_editor_hide_context_info (GladeEditor *editor)
{
GList *list, *props;
GladeEditorTable *etable;
g_return_if_fail (GLADE_IS_EDITOR (editor));
if (editor->show_context_info != FALSE)
{
editor->show_context_info = FALSE;
for (list = editor->widget_tables; list; list = list->next)
{
etable = list->data;
for (props = etable->properties; props; props = props->next)
glade_editor_property_hide_info
(GLADE_EDITOR_PROPERTY (props->data));
}
if (editor->packing_etable)
{
etable = editor->packing_etable;
for (props = etable->properties; props; props = props->next)
glade_editor_property_hide_info
(GLADE_EDITOR_PROPERTY (props->data));
}
g_object_notify (G_OBJECT (editor), "show-context-info");
}
}
......@@ -670,7 +670,7 @@ glade_popup_palette_pop (GladeWidgetAdaptor *adaptor,
glade_popup_root_add_cb, adaptor);
g_object_get (adaptor, "book", &book, NULL);
if (book)
if (book && glade_util_have_devhelp ())
{
GtkWidget *icon = glade_util_get_devhelp_icon (GTK_ICON_SIZE_MENU);
glade_popup_append_item (popup_menu, NULL, _("Read _documentation"), icon, TRUE,
......@@ -694,6 +694,83 @@ glade_popup_palette_pop (GladeWidgetAdaptor *adaptor,
NULL, NULL, button, event_time);
}
static void
glade_popup_clear_property_cb (GtkMenuItem *item,
GladeProperty *property)
{
GValue value = { 0, };
glade_property_get_default (property, &value);
glade_command_set_property_value (property, &value);
g_value_unset (&value);
}
static void
glade_popup_property_docs_cb (GtkMenuItem *item,
GladeProperty *property)
{
GladeWidgetAdaptor *adaptor, *prop_adaptor;
gchar *search, *book;
prop_adaptor = glade_widget_adaptor_from_pclass (property->klass);
adaptor = glade_widget_adaptor_from_pspec (prop_adaptor, property->klass->pspec);
search = g_strdup_printf ("The %s property", property->klass->id);
g_object_get (adaptor, "book", &book, NULL);
glade_editor_search_doc_search (glade_app_get_editor (),
book, g_type_name (property->klass->pspec->owner_type), search);
g_free (book);
g_free (search);
}
void
glade_popup_property_pop (GladeProperty *property,
GdkEventButton *event)
{
GladeWidgetAdaptor *adaptor, *prop_adaptor;
GtkWidget *popup_menu;
gchar *book = NULL;
gint button;
gint event_time;
prop_adaptor = glade_widget_adaptor_from_pclass (property->klass);
adaptor = glade_widget_adaptor_from_pspec (prop_adaptor, property->klass->pspec);
g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
popup_menu = gtk_menu_new ();
glade_popup_append_item (popup_menu, GTK_STOCK_CLEAR, _("Set default value"), NULL,
TRUE, glade_popup_clear_property_cb, property);
g_object_get (adaptor, "book", &book, NULL);
if (book && glade_util_have_devhelp ())
{
GtkWidget *icon = glade_util_get_devhelp_icon (GTK_ICON_SIZE_MENU);
glade_popup_append_item (popup_menu, NULL, _("Read _documentation"), icon, TRUE,
glade_popup_property_docs_cb, property);
}
g_free (book);
if (event)
{
button = event->button;
event_time = event->time;
}
else
{
button = 0;
event_time = gtk_get_current_event_time ();
}
gtk_menu_popup (GTK_MENU (popup_menu), NULL, NULL,
NULL, NULL, button, event_time);
}
void
glade_popup_simple_pop (GdkEventButton *event)
......
......@@ -24,6 +24,9 @@ gint glade_popup_action_populate_menu (GtkWidget *menu,
void glade_popup_simple_pop (GdkEventButton *event);
void glade_popup_property_pop (GladeProperty *property,
GdkEventButton *event);
G_END_DECLS
#endif /* __GLADE_POPUP_H__ */
......@@ -1644,14 +1644,15 @@ glade_project_verify_property (GladeProject *project,
GString *string,
gboolean forwidget)
{
GladeWidgetAdaptor *adaptor;
GladeWidgetAdaptor *adaptor, *prop_adaptor;
gint target_major, target_minor;
gchar *catalog, *tooltip;
if (glade_property_original_default (property) && !forwidget)
return;
adaptor = GLADE_WIDGET_ADAPTOR (property->klass->origin_handle);
prop_adaptor = glade_widget_adaptor_from_pclass (property->klass);
adaptor = glade_widget_adaptor_from_pspec (prop_adaptor, property->klass->pspec);
g_object_get (adaptor, "catalog", &catalog, NULL);
glade_project_target_version_for_adaptor (property->widget->project, adaptor,
......
......@@ -65,7 +65,6 @@ glade_property_class_new (gpointer handle)
GladePropertyClass *property_class;
property_class = g_new0 (GladePropertyClass, 1);
property_class->origin_handle = handle;
property_class->handle = handle;
property_class->pspec = NULL;
property_class->id = NULL;
......
......@@ -28,9 +28,6 @@ struct _GladePropertyClass
gpointer handle; /* The GladeWidgetAdaptor that this property class
* was created for.
*/
gpointer origin_handle; /* The GladeWidgetAdaptor that this property class
* was introduced in.
*/
gint version_since_major; /* Version in which this property was
* introduced
......
......@@ -2401,6 +2401,39 @@ glade_widget_adaptor_get_by_type (GType type)
return NULL;
}
/**
* glade_widget_adaptor_from_pspec:
* @adaptor: a #GladeWidgetAdaptor
* @pspec: a #GParamSpec
*
* Assumes @pspec is a property in an object class wrapped by @adaptor,
* this function will search for the specific parent adaptor class which
* originally introduced @pspec.
*
* Returns: the closest #GladeWidgetAdaptor in the ancestry to @adaptor
* which is responsable for introducing @pspec.
**/
GladeWidgetAdaptor *
glade_widget_adaptor_from_pspec (GladeWidgetAdaptor *adaptor,
GParamSpec *spec)
{
GladeWidgetAdaptor *spec_adaptor = glade_widget_adaptor_get_by_type (spec->owner_type);
GType spec_type = spec->owner_type;
g_return_val_if_fail (g_type_is_a (adaptor->type, spec->owner_type), NULL);
while (!spec_adaptor && spec_type != adaptor->type)
{
spec_type = g_type_parent (spec_type);
spec_adaptor = glade_widget_adaptor_get_by_type (spec_type);
}
if (spec_adaptor)
return spec_adaptor;
return adaptor;
}
/**
* glade_widget_adaptor_get_property_class:
* @adaptor: a #GladeWidgetAdaptor
......
......@@ -671,8 +671,6 @@ struct _GladeWidgetAdaptorClass
#define glade_widget_adaptor_from_pclass(pclass) \
((pclass) ? (GladeWidgetAdaptor *)((GladePropertyClass *)(pclass))->handle : NULL)
#define glade_widget_adaptor_from_pspec(pspec) \
((pspec) ? glade_widget_adaptor_get_by_type (((GParamSpec *)(pspec))->owner_type) : NULL)
GType glade_widget_adaptor_get_type (void) G_GNUC_CONST;
......@@ -703,6 +701,9 @@ GladeWidgetAdaptor *glade_widget_adaptor_get_by_name (const gchar
GladeWidgetAdaptor *glade_widget_adaptor_get_by_type (GType type);
GladeWidgetAdaptor *glade_widget_adaptor_from_pspec (GladeWidgetAdaptor *adaptor,
GParamSpec *spec);
GladePropertyClass *glade_widget_adaptor_get_property_class (GladeWidgetAdaptor *adaptor,
const gchar *name);
......
......@@ -99,8 +99,6 @@ column_types_store_populate_enums_flags (GtkTreeStore *store,
g_list_free (types);
}
/* TODO: Add submenus with a generated list of all known flag and enum types
*/
static void
column_types_store_populate (GtkTreeStore *store)
{
......@@ -122,9 +120,6 @@ column_types_store_populate (GtkTreeStore *store)
G_TYPE_POINTER,
G_TYPE_OBJECT,
GDK_TYPE_PIXBUF};
column_types_store_populate_enums_flags (store, TRUE);
column_types_store_populate_enums_flags (store, FALSE);
for (i = 0; i < sizeof (types) / sizeof (GType); i++)
{
......@@ -134,6 +129,9 @@ column_types_store_populate (GtkTreeStore *store)
COLUMN_GTYPE, types[i],
-1);
}
column_types_store_populate_enums_flags (store, TRUE);
column_types_store_populate_enums_flags (store, FALSE);
}
GList *
......
......@@ -1577,13 +1577,6 @@ redo_cb (GtkAction *action, GladeWindow *window)
glade_app_command_redo ();
}
static gboolean
hide_window_on_delete (GtkWidget *window, gpointer not_used, GtkUIManager *ui)
{
glade_util_hide_window (GTK_WINDOW (window));
return TRUE;
}
static void
doc_search_cb (GladeEditor *editor,
const gchar *book,
......@@ -1781,39 +1774,6 @@ palette_toggle_small_icons_cb (GtkAction *action, GladeWindow *window)
gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
}
static void
show_clipboard_cb (GtkAction *action, GladeWindow *window)
{
static GtkWidget *view = NULL;
g_return_if_fail (window != NULL);
if (view == NULL)
{
view = glade_app_get_clipboard_view ();
g_signal_connect (view, "delete_event",
G_CALLBACK (hide_window_on_delete),
window->priv->ui);
gtk_widget_show_all (view);
}
gtk_window_present (GTK_WINDOW (view));
}
static void
toggle_editor_help_cb (GtkAction *action, GladeWindow *window)
{
if (glade_util_have_devhelp() == FALSE)
return;
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
glade_editor_show_context_info (glade_app_get_editor ());
else
glade_editor_hide_context_info (glade_app_get_editor ());
}
/* This function is meant to be attached to key-press-event of a toplevel,
* it simply allows the window contents to treat key events /before/
* accelerator keys come into play (this way widgets dont get deleted
......@@ -2100,8 +2060,6 @@ static const gchar ui_info[] =
" <menuitem action='Preferences'/>"
" </menu>"
" <menu action='ViewMenu'>"
" <menuitem action='Clipboard'/>"
" <separator/>"
" <menu action='PaletteAppearance'>"
" <menuitem action='IconsAndLabels'/>"
" <menuitem action='IconsOnly'/>"
......@@ -2109,7 +2067,6 @@ static const gchar ui_info[] =
" <separator/>"
" <menuitem action='UseSmallIcons'/>"
" </menu>"
" <menuitem action='PropertyEditorHelp'/>"
" <separator/>"
" <menuitem action='DockPalette'/>"
" <menuitem action='DockInspector'/>"
......@@ -2209,12 +2166,6 @@ static GtkActionEntry project_entries[] = {
{ "Preferences", GTK_STOCK_PREFERENCES, NULL, "<control>P",
N_("Modify project preferences"), G_CALLBACK (preferences_cb) },
/* ViewMenu */
{ "Clipboard", NULL, N_("_Clipboard"), NULL,
N_("Show the clipboard"),
G_CALLBACK (show_clipboard_cb) },
/* ProjectsMenu */
{ "PreviousProject", NULL, N_("_Previous Project"), "<control>Page_Up",
......@@ -2233,10 +2184,6 @@ static GtkToggleActionEntry view_entries[] = {
N_("Show items using small icons"),
G_CALLBACK (palette_toggle_small_icons_cb), FALSE },
{ "PropertyEditorHelp", NULL, N_("Context _Help"), NULL,
N_("Show or hide contextual help buttons in the editor"),
G_CALLBACK (toggle_editor_help_cb), FALSE },
{ "DockPalette", NULL, N_("Dock _Palette"), NULL,
N_("Dock the palette into the main window"),
G_CALLBACK (toggle_dock_cb), TRUE },
......@@ -3263,29 +3210,18 @@ glade_window_new (void)
void
glade_window_check_devhelp (GladeWindow *window)
{
GtkWidget *editor_item;
g_return_if_fail (GLADE_IS_WINDOW (window));
editor_item = gtk_ui_manager_get_widget (window->priv->ui,
"/MenuBar/ViewMenu/PropertyEditorHelp");
if (glade_util_have_devhelp ())
{
GladeEditor *editor = glade_app_get_editor ();
glade_editor_show_info (editor);
glade_editor_hide_context_info (editor);
g_signal_handlers_disconnect_by_func (editor, doc_search_cb, window);
g_signal_connect (editor, "gtk-doc-search",
G_CALLBACK (doc_search_cb), window);
gtk_widget_set_sensitive (editor_item, TRUE);
}
else
{
gtk_widget_set_sensitive (editor_item, FALSE);