nautilus/test/test-nautilus-preferences-display.c
Darin Adler 074ed7a01a Remove nautilus-launch-icon.png.
* Makefile.am: Remove nautilus-launch-icon.png.

	* components/hardware/nautilus-hardware-view.c: (setup_form_title),
	(setup_overview_form): Port from EelImage to GtkImage.

	* components/music/nautilus-music-view.c: Remove unused include.
	* src/nautilus-theme-selector.c: Remove unused includes.

	* libnautilus-private/nautilus-bonobo-extensions.c:
	(bonobo_activation_activation_callback): Add warning message so we
	get to see the error from bonobo-activation.

	* libnautilus-private/nautilus-directory-metafile.c: (get_factory):
	* libnautilus-private/nautilus-icon-factory.c: (get_icon_factory),
	(load_icon_for_scaling), (embed_text):
	* libnautilus-private/nautilus-metafile-factory.c:
	(nautilus_metafile_factory_get_instance):
	* libnautilus-private/nautilus-theme.c:
	(nautilus_theme_get_theme_data_from_theme):
	* libnautilus-private/nautilus-trash-monitor.c:
	(nautilus_trash_monitor_get):
	* libnautilus-private/nautilus-volume-monitor.c:
	(nautilus_volume_monitor_get):
	* src/file-manager/nautilus-indexing-info.c:
	(show_indexing_info_dialog):
	* src/nautilus-preferences-dialog.c:
	(global_preferences_get_dialog):
	* src/nautilus-window.c: (nautilus_window_class_init),
	(add_to_history_list):
	Use eel_debug_call_at_shutdown instead of g_atexit.

	* libnautilus-private/nautilus-file.c:
	(nautilus_file_get_display_name): Add G_BROKEN_FILENAMES support.

	* libnautilus-private/nautilus-global-preferences.c:
	(nautilus_global_preferences_init): Remove eel_smooth_widget code.

	* libnautilus/Makefile.am: Add missing ORBIT_IDL dependency.

	* libnautilus/nautilus-view-standard-main.c:
	(nautilus_view_standard_main_multi): Remove
	bonobo_ui_debug_shutdown for now. It does us no good unless we
	also do eel_debug_shut_down, but libnautilus can't depend on eel.

	* nautilus-launch-icon.png: Remove.

	* src/file-manager/fm-properties-window.c:
	(update_properties_window_icon),
	(fm_properties_window_drag_data_received),
	(create_image_widget_for_file): Port from EelImage to GtkImage.

	* src/nautilus-component-adapter-factory.c:
	(nautilus_component_adapter_factory_get): Use
	eel_debug_call_at_shutdown instead of g_atexit.
	(nautilus_component_adapter_factory_create_adapter): Look at
	exceptions before looking at return values from CORBA calls.

	* src/nautilus-main.c: (main): Add a call to eel_debug_shut_down.

	* src/nautilus-property-browser.c:
	(nautilus_property_browser_init), (element_clicked_callback),
	(nautilus_property_browser_update_contents): Port from EelViewport
	to GtkViewport.

	* src/nautilus-search-bar-criterion.c:
	(nautilus_search_bar_criterion_destroy),
	(nautilus_search_bar_criterion_new_from_values): Fix for change
	that made NautilusSignaller no longer a GtkObject.

	* src/nautilus-sidebar-title.c: (nautilus_sidebar_title_init),
	(update_icon), (add_emblem): Port from EelImage to GtkImage.

	* src/nautilus-signaller.h:
	* src/nautilus-signaller.c: (nautilus_signaller_get_current): Use
	eel_debug_call_at_shutdown instead of g_atexit.
	(nautilus_signaller_instance_init),
	(nautilus_signaller_class_init): Change to GObject, not GtkObject.

	* src/nautilus-window-menus.c: (get_bookmark_list): Use
	eel_debug_call_at_shutdown instead of g_atexit.
	(nautilus_window_initialize_go_menu): Fix for change that made
	NautilusSignaller no longer a GtkObject.

	* test/test-nautilus-preferences-change.c: Remove unused include.
	* test/test-nautilus-preferences-display.c: Remove unused includes.
	* test/test-nautilus-wrap-table.c: Remove unused includes.
	* test/test.c: Remove unused function.
	* test/test.h: Remove unused function.
2002-01-19 00:06:14 +00:00

214 lines
6.4 KiB
C

#include "test.h"
#include <eel/eel-text-caption.h>
#include <libnautilus-private/nautilus-global-preferences.h>
static void
text_caption_update (EelTextCaption *text_caption,
const char *name)
{
g_return_if_fail (EEL_IS_TEXT_CAPTION (text_caption));
g_return_if_fail (name != NULL);
g_print ("'%s' changed from '%d' to '%d'\n",
name,
test_text_caption_get_text_as_int (text_caption),
eel_preferences_get_integer (name));
test_text_caption_set_text_for_int_preferences (text_caption, name);
}
static void
green_changed_callback (gpointer callback_data)
{
text_caption_update (EEL_TEXT_CAPTION (callback_data), "green");
}
static void
yellow_changed_callback (gpointer callback_data)
{
text_caption_update (EEL_TEXT_CAPTION (callback_data), "yellow");
}
static void
red_changed_callback (gpointer callback_data)
{
text_caption_update (EEL_TEXT_CAPTION (callback_data), "red");
}
static void
apple_changed_callback (gpointer callback_data)
{
text_caption_update (EEL_TEXT_CAPTION (callback_data), "fruits/apple");
}
static void
orange_changed_callback (gpointer callback_data)
{
text_caption_update (EEL_TEXT_CAPTION (callback_data), "fruits/orange");
}
static void
pear_changed_callback (gpointer callback_data)
{
text_caption_update (EEL_TEXT_CAPTION (callback_data), "fruits/pear");
}
static GtkWidget *
entry_new (const char *name,
GtkWidget **caption_out,
GtkWidget **default_caption_out)
{
GtkWidget *hbox;
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (caption_out != NULL, NULL);
g_return_val_if_fail (default_caption_out != NULL, NULL);
hbox = gtk_hbox_new (TRUE, 2);
*caption_out = eel_text_caption_new ();
eel_text_caption_set_editable (EEL_TEXT_CAPTION (*caption_out), FALSE);
eel_caption_set_title_label (EEL_CAPTION (*caption_out), name);
*default_caption_out = eel_text_caption_new ();
eel_text_caption_set_editable (EEL_TEXT_CAPTION (*default_caption_out), FALSE);
eel_caption_set_title_label (EEL_CAPTION (*default_caption_out), "default:");
gtk_box_pack_start (GTK_BOX (hbox), *caption_out, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), *default_caption_out, FALSE, FALSE, 0);
gtk_widget_show (*caption_out);
gtk_widget_show (*default_caption_out);
return hbox;
}
static GtkWidget *
colors_frame_new (void)
{
GtkWidget *green_caption;
GtkWidget *green_default_caption;
GtkWidget *green_hbox;
GtkWidget *yellow_caption;
GtkWidget *yellow_default_caption;
GtkWidget *yellow_hbox;
GtkWidget *red_caption;
GtkWidget *red_default_caption;
GtkWidget *red_hbox;
GtkWidget *frame;
GtkWidget *vbox;
vbox = gtk_vbox_new (FALSE, 2);
frame = gtk_frame_new ("colors");
gtk_container_add (GTK_CONTAINER (frame), vbox);
green_hbox = entry_new ("green", &green_caption, &green_default_caption);
yellow_hbox = entry_new ("yellow", &yellow_caption, &yellow_default_caption);
red_hbox = entry_new ("red", &red_caption, &red_default_caption);
test_text_caption_set_text_for_int_preferences (EEL_TEXT_CAPTION (green_caption), "green");
test_text_caption_set_text_for_int_preferences (EEL_TEXT_CAPTION (yellow_caption), "yellow");
test_text_caption_set_text_for_int_preferences (EEL_TEXT_CAPTION (red_caption), "red");
test_text_caption_set_text_for_default_int_preferences (EEL_TEXT_CAPTION (green_default_caption), "green");
test_text_caption_set_text_for_default_int_preferences (EEL_TEXT_CAPTION (yellow_default_caption), "yellow");
test_text_caption_set_text_for_default_int_preferences (EEL_TEXT_CAPTION (red_default_caption), "red");
eel_preferences_add_callback ("green", green_changed_callback, green_caption);
eel_preferences_add_callback ("yellow", yellow_changed_callback, yellow_caption);
eel_preferences_add_callback ("red", red_changed_callback, red_caption);
gtk_box_pack_start (GTK_BOX (vbox), green_hbox, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), yellow_hbox, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), red_hbox, TRUE, TRUE, 0);
gtk_widget_show_all (frame);
return frame;
}
static GtkWidget *
fruits_frame_new (void)
{
GtkWidget *apple_caption;
GtkWidget *apple_default_caption;
GtkWidget *apple_hbox;
GtkWidget *orange_caption;
GtkWidget *orange_default_caption;
GtkWidget *orange_hbox;
GtkWidget *pear_caption;
GtkWidget *pear_default_caption;
GtkWidget *pear_hbox;
GtkWidget *frame;
GtkWidget *vbox;
vbox = gtk_vbox_new (FALSE, 2);
frame = gtk_frame_new ("fruits");
gtk_container_add (GTK_CONTAINER (frame), vbox);
apple_hbox = entry_new ("fruits/apple", &apple_caption, &apple_default_caption);
orange_hbox = entry_new ("fruits/orange", &orange_caption, &orange_default_caption);
pear_hbox = entry_new ("fruits/pear", &pear_caption, &pear_default_caption);
test_text_caption_set_text_for_int_preferences (EEL_TEXT_CAPTION (apple_caption), "fruits/apple");
test_text_caption_set_text_for_int_preferences (EEL_TEXT_CAPTION (orange_caption), "fruits/orange");
test_text_caption_set_text_for_int_preferences (EEL_TEXT_CAPTION (pear_caption), "fruits/pear");
test_text_caption_set_text_for_default_int_preferences (EEL_TEXT_CAPTION (apple_default_caption), "fruits/apple");
test_text_caption_set_text_for_default_int_preferences (EEL_TEXT_CAPTION (orange_default_caption), "fruits/orange");
test_text_caption_set_text_for_default_int_preferences (EEL_TEXT_CAPTION (pear_default_caption), "fruits/pear");
eel_preferences_add_callback ("fruits/apple", apple_changed_callback, apple_caption);
eel_preferences_add_callback ("fruits/orange", orange_changed_callback, orange_caption);
eel_preferences_add_callback ("fruits/pear", pear_changed_callback, pear_caption);
gtk_box_pack_start (GTK_BOX (vbox), apple_hbox, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), orange_hbox, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), pear_hbox, TRUE, TRUE, 0);
gtk_widget_show_all (frame);
return frame;
}
int
main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *vbox;
GtkWidget *colors_frame;
GtkWidget *fruits_frame;
test_init (&argc, &argv);
nautilus_global_preferences_init ();
window = test_window_new (NULL, 4);
test_window_set_title_with_pid (GTK_WINDOW (window), "Preferences Display");
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (window), vbox);
colors_frame = colors_frame_new ();
fruits_frame = fruits_frame_new ();
gtk_box_pack_start (GTK_BOX (vbox), colors_frame, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), fruits_frame, TRUE, TRUE, 0);
gtk_widget_show_all (window);
gtk_main ();
return 0;
}