From 3cc0ae605a10eb7f24bc6083e2388a7103a4aeb4 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 17 Aug 2004 16:52:04 +0000 Subject: Use g_message() throughout, add RTL envar for rtl testing. 2004-08-17 Matthias Clasen * tests/testfilechooserbutton.c: Use g_message() throughout, add RTL envar for rtl testing. * gtk/gtkfilechooserbutton.c: Get rid of HAVE_CONFIG_H. (gtk_file_chooser_button_init): Use gtk_drag_dest_add_text_targets(). (gtk_file_chooser_button_drag_data_received): Use gtk_selection_data_get_text(). (gtk_file_chooser_button_set_dialog): _gtk_file_chooser_entry_set_base_folder() seems to expect a path, not an uri. (update_dialog): Handle g_filename_from_uri() returning NULL, don't free info if it is NULL. * gtk/gtkfilechooserbutton.h: Minor stylistic changes. --- tests/testfilechooserbutton.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests/testfilechooserbutton.c') diff --git a/tests/testfilechooserbutton.c b/tests/testfilechooserbutton.c index 9635e04a1..21ae38dff 100644 --- a/tests/testfilechooserbutton.c +++ b/tests/testfilechooserbutton.c @@ -68,7 +68,7 @@ chooser_selection_changed_cb (GtkFileChooser *chooser, gpointer user_data) { GSList *selection; - g_warning ("%s:%s:\n`%s` Selection:", G_STRFUNC, G_STRLOC, G_OBJECT_TYPE_NAME (chooser)); + g_message ("%s:%s:\n`%s` Selection:", G_STRFUNC, G_STRLOC, G_OBJECT_TYPE_NAME (chooser)); for (selection = gtk_file_chooser_get_filenames (chooser); selection != NULL; selection = g_slist_remove_link (selection, selection)) { @@ -86,7 +86,7 @@ chooser_file_activated_cb (GtkFileChooser *chooser, gpointer user_data) folder = gtk_file_chooser_get_current_folder (chooser); filename = gtk_file_chooser_get_filename (chooser); - g_warning ("%s:%s:\n`%s`\nFolder: `%s'\nFilename: `%s'", G_STRFUNC, G_STRLOC, G_OBJECT_TYPE_NAME (chooser), folder, filename); + g_message ("%s:%s:\n`%s`\nFolder: `%s'\nFilename: `%s'", G_STRFUNC, G_STRLOC, G_OBJECT_TYPE_NAME (chooser), folder, filename); g_free (folder); g_free (filename); } @@ -98,7 +98,7 @@ chooser_update_preview_cb (GtkFileChooser *chooser, gpointer user_data) gchar *filename; filename = gtk_file_chooser_get_preview_filename (chooser); - g_warning ("%s:%s:\n`%s`\nPreview Filename: `%s'", G_STRFUNC, G_STRLOC, G_OBJECT_TYPE_NAME (chooser), filename); + g_message ("%s:%s:\n`%s`\nPreview Filename: `%s'", G_STRFUNC, G_STRLOC, G_OBJECT_TYPE_NAME (chooser), filename); g_free (filename); } @@ -111,6 +111,10 @@ main (int argc, char *argv[]) gtk_init (&argc, &argv); + /* to test rtl layout, set RTL=1 in the environment */ + if (g_getenv ("RTL")) + gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL); + win = gtk_dialog_new_with_buttons ("TestFileChooserButton", NULL, GTK_DIALOG_NO_SEPARATOR, GTK_STOCK_QUIT, GTK_RESPONSE_CLOSE, NULL); g_signal_connect (win, "style-set", G_CALLBACK (win_style_set_cb), NULL); -- cgit v1.2.1