Commit c821dce6 authored by John Sullivan's avatar John Sullivan

Moved a couple of utility functions into the right libnautilus homes.

parent 908efb2d
2000-03-16 John Sullivan <sullivan@eazel.com>
Moved a couple of utility functions I wrote recently
into the right places in libnautilus.
* libnautilus/nautilus-bonobo-extensions.h,
* libnautilus/nautilus-bonobo-extensions.c: New files,
initially containing only the euphoniously-named
(nautilus_bonobo_ui_handler_menu_set_toggle_appearance),
which toggles a bonobo menu item's checkbox state without
invoking its callback.
* libnautilus/Makefile.am: Put these two new files into build.
* libnautilus/nautilus-glib-extensions.h,
* libnautilus/nautilus-glib-extensions.c:
(nautilus_g_strfindv): New function, finds a string in a
NULL-terminated string array. Hideous name to match glib conventions.
(nautilus_self_check_glib_extensions): Added tests for
nautilus_g_strfindv.
* src/nautilus-window-menus.c:
(nautilus_bonobo_ui_handler_menu_toggle_appearance): Moved out
of here, now called in its new home in libnautilus.
* src/file-manager/fm-icon-text-window.c:
(find_string_in_array): Moved out of here and renamed on its
way into libnautilus.
(synch_menus_with_preference): Updated for function name change.
2000-03-16 Darin Adler <darin@eazel.com>
* src/file-manager/fm-directory-view.c:
......
......@@ -35,6 +35,7 @@ libnautilusinclude_HEADERS= \
libnautilus.h \
nautilus-alloc.h \
nautilus-background.h \
nautilus-bonobo-extensions.h \
nautilus-bookmark.h \
nautilus-debug.h \
nautilus-directory.h \
......@@ -69,6 +70,7 @@ libnautilus_la_SOURCES=$(nautilus_idl_sources) \
gtkscrollframe.c \
nautilus-background-canvas-group.c \
nautilus-background.c \
nautilus-bonobo-extensions.c \
nautilus-bookmark.c \
nautilus-debug.c \
nautilus-default-file-icon.c \
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-bonobo-extensions.c - implementation of new functions that conceptually
belong in bonobo. Perhaps some of these will be
actually rolled into bonobo someday.
Copyright (C) 2000 Eazel, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: John Sullivan <sullivan@eazel.com>
*/
#include "nautilus-bonobo-extensions.h"
/**
* nautilus_bonobo_ui_handler_menu_toggle_appearance
*
* Changes a toggleable bonobo menu item's apparent state
* without invoking its callback.
*
* @uih: The BonoboUIHandler for this menu item.
* @path: The standard bonobo-style path specifier for this menu item.
* @new_value: TRUE if item should appear checked (on), FALSE otherwise.
*/
void
nautilus_bonobo_ui_handler_menu_set_toggle_appearance (BonoboUIHandler *uih,
const char *path,
gboolean new_value)
{
BonoboUIHandlerCallbackFunc saved_callback;
gpointer saved_callback_data;
/* Temporarily clear out callback and data so when we
* set the toggle state the callback isn't called.
*/
bonobo_ui_handler_menu_get_callback (uih, path, &saved_callback, &saved_callback_data);
bonobo_ui_handler_menu_set_callback (uih, path, NULL, NULL);
bonobo_ui_handler_menu_set_toggle_state (uih, path, new_value);
bonobo_ui_handler_menu_set_callback (uih, path, saved_callback, saved_callback_data);
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-bonobo-extensions.h - interface for new functions that conceptually
belong in bonobo. Perhaps some of these will be
actually rolled into bonobo someday.
Copyright (C) 2000 Eazel, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: John Sullivan <sullivan@eazel.com>
*/
#ifndef NAUTILUS_BONOBO_EXTENSIONS_H
#define NAUTILUS_BONOBO_EXTENSIONS_H
#include <bonobo/bonobo-ui-handler.h>
void nautilus_bonobo_ui_handler_menu_set_toggle_appearance (BonoboUIHandler *uih,
const char *path,
gboolean new_value);
#endif /* NAUTILUS_BONOBO_EXTENSIONS_H */
......@@ -110,6 +110,33 @@ nautilus_g_list_free_deep (GList *list)
g_list_free (list);
}
/**
* nautilus_g_strfindv
*
* Get index of string in array of strings.
*
* @str_array: NULL-terminated array of strings.
* @find_me: string to search for.
*
* Return value: index of array entry in @str_array that
* matches @find_me, or -1 if no matching entry.
*/
int
nautilus_g_strfindv (char **str_array, const char *find_me)
{
int index;
g_return_val_if_fail (find_me != NULL, -1);
for (index = 0; str_array[index] != NULL; ++index) {
if (strcmp (str_array[index], find_me) == 0) {
return index;
}
}
return -1;
}
#if !defined (NAUTILUS_OMIT_SELF_CHECK)
static void
......@@ -137,9 +164,20 @@ check_tm_to_g_date (time_t time)
void
nautilus_self_check_glib_extensions (void)
{
char **str_array;
check_tm_to_g_date (0); /* lower limit */
check_tm_to_g_date ((time_t) -1); /* upper limit */
check_tm_to_g_date (time (NULL)); /* current time */
str_array = g_strsplit ("zero|one|two|three|four", "|", 0);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "zero"), 0);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "one"), 1);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "four"), 4);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "five"), -1);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, ""), -1);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "o"), -1);
g_strfreev (str_array);
}
#endif /* !NAUTILUS_OMIT_SELF_CHECK */
......@@ -43,4 +43,8 @@ gboolean nautilus_g_list_equal (GList *list_a,
GList *list_b);
void nautilus_g_list_free_deep (GList *list);
/* NULL terminated string arrays. */
int nautilus_g_strfindv (char **str_array,
const char *find_me);
#endif /* NAUTILUS_GLIB_EXTENSIONS_H */
......@@ -35,6 +35,7 @@ libnautilusinclude_HEADERS= \
libnautilus.h \
nautilus-alloc.h \
nautilus-background.h \
nautilus-bonobo-extensions.h \
nautilus-bookmark.h \
nautilus-debug.h \
nautilus-directory.h \
......@@ -69,6 +70,7 @@ libnautilus_la_SOURCES=$(nautilus_idl_sources) \
gtkscrollframe.c \
nautilus-background-canvas-group.c \
nautilus-background.c \
nautilus-bonobo-extensions.c \
nautilus-bookmark.c \
nautilus-debug.c \
nautilus-default-file-icon.c \
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-bonobo-extensions.c - implementation of new functions that conceptually
belong in bonobo. Perhaps some of these will be
actually rolled into bonobo someday.
Copyright (C) 2000 Eazel, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: John Sullivan <sullivan@eazel.com>
*/
#include "nautilus-bonobo-extensions.h"
/**
* nautilus_bonobo_ui_handler_menu_toggle_appearance
*
* Changes a toggleable bonobo menu item's apparent state
* without invoking its callback.
*
* @uih: The BonoboUIHandler for this menu item.
* @path: The standard bonobo-style path specifier for this menu item.
* @new_value: TRUE if item should appear checked (on), FALSE otherwise.
*/
void
nautilus_bonobo_ui_handler_menu_set_toggle_appearance (BonoboUIHandler *uih,
const char *path,
gboolean new_value)
{
BonoboUIHandlerCallbackFunc saved_callback;
gpointer saved_callback_data;
/* Temporarily clear out callback and data so when we
* set the toggle state the callback isn't called.
*/
bonobo_ui_handler_menu_get_callback (uih, path, &saved_callback, &saved_callback_data);
bonobo_ui_handler_menu_set_callback (uih, path, NULL, NULL);
bonobo_ui_handler_menu_set_toggle_state (uih, path, new_value);
bonobo_ui_handler_menu_set_callback (uih, path, saved_callback, saved_callback_data);
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-bonobo-extensions.h - interface for new functions that conceptually
belong in bonobo. Perhaps some of these will be
actually rolled into bonobo someday.
Copyright (C) 2000 Eazel, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: John Sullivan <sullivan@eazel.com>
*/
#ifndef NAUTILUS_BONOBO_EXTENSIONS_H
#define NAUTILUS_BONOBO_EXTENSIONS_H
#include <bonobo/bonobo-ui-handler.h>
void nautilus_bonobo_ui_handler_menu_set_toggle_appearance (BonoboUIHandler *uih,
const char *path,
gboolean new_value);
#endif /* NAUTILUS_BONOBO_EXTENSIONS_H */
......@@ -110,6 +110,33 @@ nautilus_g_list_free_deep (GList *list)
g_list_free (list);
}
/**
* nautilus_g_strfindv
*
* Get index of string in array of strings.
*
* @str_array: NULL-terminated array of strings.
* @find_me: string to search for.
*
* Return value: index of array entry in @str_array that
* matches @find_me, or -1 if no matching entry.
*/
int
nautilus_g_strfindv (char **str_array, const char *find_me)
{
int index;
g_return_val_if_fail (find_me != NULL, -1);
for (index = 0; str_array[index] != NULL; ++index) {
if (strcmp (str_array[index], find_me) == 0) {
return index;
}
}
return -1;
}
#if !defined (NAUTILUS_OMIT_SELF_CHECK)
static void
......@@ -137,9 +164,20 @@ check_tm_to_g_date (time_t time)
void
nautilus_self_check_glib_extensions (void)
{
char **str_array;
check_tm_to_g_date (0); /* lower limit */
check_tm_to_g_date ((time_t) -1); /* upper limit */
check_tm_to_g_date (time (NULL)); /* current time */
str_array = g_strsplit ("zero|one|two|three|four", "|", 0);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "zero"), 0);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "one"), 1);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "four"), 4);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "five"), -1);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, ""), -1);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "o"), -1);
g_strfreev (str_array);
}
#endif /* !NAUTILUS_OMIT_SELF_CHECK */
......@@ -43,4 +43,8 @@ gboolean nautilus_g_list_equal (GList *list_a,
GList *list_b);
void nautilus_g_list_free_deep (GList *list);
/* NULL terminated string arrays. */
int nautilus_g_strfindv (char **str_array,
const char *find_me);
#endif /* NAUTILUS_GLIB_EXTENSIONS_H */
......@@ -35,6 +35,7 @@ libnautilusinclude_HEADERS= \
libnautilus.h \
nautilus-alloc.h \
nautilus-background.h \
nautilus-bonobo-extensions.h \
nautilus-bookmark.h \
nautilus-debug.h \
nautilus-directory.h \
......@@ -69,6 +70,7 @@ libnautilus_la_SOURCES=$(nautilus_idl_sources) \
gtkscrollframe.c \
nautilus-background-canvas-group.c \
nautilus-background.c \
nautilus-bonobo-extensions.c \
nautilus-bookmark.c \
nautilus-debug.c \
nautilus-default-file-icon.c \
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-bonobo-extensions.c - implementation of new functions that conceptually
belong in bonobo. Perhaps some of these will be
actually rolled into bonobo someday.
Copyright (C) 2000 Eazel, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: John Sullivan <sullivan@eazel.com>
*/
#include "nautilus-bonobo-extensions.h"
/**
* nautilus_bonobo_ui_handler_menu_toggle_appearance
*
* Changes a toggleable bonobo menu item's apparent state
* without invoking its callback.
*
* @uih: The BonoboUIHandler for this menu item.
* @path: The standard bonobo-style path specifier for this menu item.
* @new_value: TRUE if item should appear checked (on), FALSE otherwise.
*/
void
nautilus_bonobo_ui_handler_menu_set_toggle_appearance (BonoboUIHandler *uih,
const char *path,
gboolean new_value)
{
BonoboUIHandlerCallbackFunc saved_callback;
gpointer saved_callback_data;
/* Temporarily clear out callback and data so when we
* set the toggle state the callback isn't called.
*/
bonobo_ui_handler_menu_get_callback (uih, path, &saved_callback, &saved_callback_data);
bonobo_ui_handler_menu_set_callback (uih, path, NULL, NULL);
bonobo_ui_handler_menu_set_toggle_state (uih, path, new_value);
bonobo_ui_handler_menu_set_callback (uih, path, saved_callback, saved_callback_data);
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-bonobo-extensions.h - interface for new functions that conceptually
belong in bonobo. Perhaps some of these will be
actually rolled into bonobo someday.
Copyright (C) 2000 Eazel, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: John Sullivan <sullivan@eazel.com>
*/
#ifndef NAUTILUS_BONOBO_EXTENSIONS_H
#define NAUTILUS_BONOBO_EXTENSIONS_H
#include <bonobo/bonobo-ui-handler.h>
void nautilus_bonobo_ui_handler_menu_set_toggle_appearance (BonoboUIHandler *uih,
const char *path,
gboolean new_value);
#endif /* NAUTILUS_BONOBO_EXTENSIONS_H */
......@@ -110,6 +110,33 @@ nautilus_g_list_free_deep (GList *list)
g_list_free (list);
}
/**
* nautilus_g_strfindv
*
* Get index of string in array of strings.
*
* @str_array: NULL-terminated array of strings.
* @find_me: string to search for.
*
* Return value: index of array entry in @str_array that
* matches @find_me, or -1 if no matching entry.
*/
int
nautilus_g_strfindv (char **str_array, const char *find_me)
{
int index;
g_return_val_if_fail (find_me != NULL, -1);
for (index = 0; str_array[index] != NULL; ++index) {
if (strcmp (str_array[index], find_me) == 0) {
return index;
}
}
return -1;
}
#if !defined (NAUTILUS_OMIT_SELF_CHECK)
static void
......@@ -137,9 +164,20 @@ check_tm_to_g_date (time_t time)
void
nautilus_self_check_glib_extensions (void)
{
char **str_array;
check_tm_to_g_date (0); /* lower limit */
check_tm_to_g_date ((time_t) -1); /* upper limit */
check_tm_to_g_date (time (NULL)); /* current time */
str_array = g_strsplit ("zero|one|two|three|four", "|", 0);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "zero"), 0);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "one"), 1);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "four"), 4);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "five"), -1);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, ""), -1);
NAUTILUS_CHECK_INTEGER_RESULT (nautilus_g_strfindv (str_array, "o"), -1);
g_strfreev (str_array);
}
#endif /* !NAUTILUS_OMIT_SELF_CHECK */
......@@ -43,4 +43,8 @@ gboolean nautilus_g_list_equal (GList *list_a,
GList *list_b);
void nautilus_g_list_free_deep (GList *list);
/* NULL terminated string arrays. */
int nautilus_g_strfindv (char **str_array,
const char *find_me);
#endif /* NAUTILUS_GLIB_EXTENSIONS_H */
......@@ -39,6 +39,7 @@
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libnautilus/nautilus-glib-extensions.h>
#include <libnautilus/nautilus-global-preferences.h>
static void ensure_unique_attributes (int menu_index);
......@@ -86,20 +87,6 @@ get_attribute_index_from_option_menu (GtkOptionMenu *option_menu)
GTK_OBJECT (option_menu->menu_item)));
}
static int
find_string_in_array (char **strings, const char *find_me)
{
int index;
for (index = 0; strings[index] != NULL; ++index) {
if (strcmp (strings[index], find_me) == 0) {
return index;
}
}
return -1;
}
static char *attribute_names_preference = NULL;
static void
......@@ -129,7 +116,7 @@ synch_menus_with_preference ()
* text_array[i+1]
*/
g_assert (text_array[menu_index+1] != NULL);
string_index = find_string_in_array (attribute_names, text_array[menu_index+1]);
string_index = nautilus_g_strfindv (attribute_names, text_array[menu_index+1]);
g_assert (string_index >= 0);
gtk_option_menu_set_history (option_menus[menu_index], string_index);
}
......
......@@ -30,6 +30,7 @@
#include "ntl-window-private.h"
#include <libnautilus/nautilus-bonobo-extensions.h>
#include <libnautilus/nautilus-gtk-extensions.h>
#include <libnautilus/nautilus-icon-factory.h>
#include <libnautilus/nautilus-string.h>
......@@ -676,38 +677,6 @@ refresh_bookmarks_in_go_menu (NautilusWindow *window)
}
}
/**
* nautilus_bonobo_ui_handler_menu_item_toggle_appearance
*
* Changes a toggleable bonobo menu item's apparent state
* without invoking its callback.
*
* @uih: The BonoboUIHandler for this menu item.
* @path: The standard bonobo-style path specifier for this menu item.
* @new_value: TRUE if item should appear checked (on), FALSE otherwise.
*/
/* FIXME: This doesn't belong here long-term. Need to determine whether
* it belongs in bonobo (or whether bonobo_ui_handler_menu_set_toggle_state
* should change to behave like this). If not in bonobo, this should be
* moved somewhere in libnautilus.
*/
static void
nautilus_bonobo_ui_handler_menu_set_toggle_appearance (BonoboUIHandler *uih,
const char *path,
gboolean new_value)
{
BonoboUIHandlerCallbackFunc saved_callback;
gpointer saved_callback_data;
/* Temporarily clear out callback and data so when we
* set the toggle state the callback isn't called.
*/
bonobo_ui_handler_menu_get_callback (uih, path, &saved_callback, &saved_callback_data);
bonobo_ui_handler_menu_set_callback (uih, path, NULL, NULL);
bonobo_ui_handler_menu_set_toggle_state (uih, path, new_value);
bonobo_ui_handler_menu_set_callback (uih, path, saved_callback, saved_callback_data);
}
static void
update_eazel_theme_menu_item (NautilusWindow *window)
{
......
......@@ -30,6 +30,7 @@
#include "ntl-window-private.h"
#include <libnautilus/nautilus-bonobo-extensions.h>
#include <libnautilus/nautilus-gtk-extensions.h>
#include <libnautilus/nautilus-icon-factory.h>
#include <libnautilus/nautilus-string.h>
......@@ -676,38 +677,6 @@ refresh_bookmarks_in_go_menu (NautilusWindow *window)
}
}
/**
* nautilus_bonobo_ui_handler_menu_item_toggle_appearance
*
* Changes a toggleable bonobo menu item's apparent state
* without invoking its callback.
*
* @uih: The BonoboUIHandler for this menu item.
* @path: The standard bonobo-style path specifier for this menu item.
* @new_value: TRUE if item should appear checked (on), FALSE otherwise.
*/
/* FIXME: This doesn't belong here long-term. Need to determine whether
* it belongs in bonobo (or whether bonobo_ui_handler_menu_set_toggle_state
* should change to behave like this). If not in bonobo, this should be
* moved somewhere in libnautilus.
*/
static void
nautilus_bonobo_ui_handler_menu_set_toggle_appearance (BonoboUIHandler *uih,
const char *path,
gboolean new_value)
{
BonoboUIHandlerCallbackFunc saved_callback;
gpointer saved_callback_data;
/* Temporarily clear out callback and data so when we
* set the toggle state the callback isn't called.
*/
bonobo_ui_handler_menu_get_callback (uih, path, &saved_callback, &saved_callback_data);
bonobo_ui_handler_menu_set_callback (uih, path, NULL, NULL);
bonobo_ui_handler_menu_set_toggle_state (uih, path, new_value);
bonobo_ui_handler_menu_set_callback (uih, path, saved_callback, saved_callback_data);
}
static void
update_eazel_theme_menu_item (NautilusWindow *window)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment