Commit b4d6a195 authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist
Browse files

Add more calls to g_filename_{to,from}_utf8() to convert back and forth

2000-08-11  Tor Lillqvist  <tml@iki.fi>

	* gtk/gtkfilesel.c: Add more calls to g_filename_{to,from}_utf8()
	to convert back and forth from UTF-8 and the "system" (or "current
	locale") charset when necessary. Indentation/spacing cleanup.
parent fcc95150
2000-08-11 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfilesel.c: Add more calls to g_filename_{to,from}_utf8()
to convert back and forth from UTF-8 and the "system" (or "current
locale") charset when necessary. Indentation/spacing cleanup.
2000-08-10 Havoc Pennington <hp@redhat.com>
* Makefile.am (snapshot): Change the format of the snapshot
......
2000-08-11 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfilesel.c: Add more calls to g_filename_{to,from}_utf8()
to convert back and forth from UTF-8 and the "system" (or "current
locale") charset when necessary. Indentation/spacing cleanup.
2000-08-10 Havoc Pennington <hp@redhat.com>
* Makefile.am (snapshot): Change the format of the snapshot
......
2000-08-11 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfilesel.c: Add more calls to g_filename_{to,from}_utf8()
to convert back and forth from UTF-8 and the "system" (or "current
locale") charset when necessary. Indentation/spacing cleanup.
2000-08-10 Havoc Pennington <hp@redhat.com>
* Makefile.am (snapshot): Change the format of the snapshot
......
2000-08-11 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfilesel.c: Add more calls to g_filename_{to,from}_utf8()
to convert back and forth from UTF-8 and the "system" (or "current
locale") charset when necessary. Indentation/spacing cleanup.
2000-08-10 Havoc Pennington <hp@redhat.com>
* Makefile.am (snapshot): Change the format of the snapshot
......
2000-08-11 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfilesel.c: Add more calls to g_filename_{to,from}_utf8()
to convert back and forth from UTF-8 and the "system" (or "current
locale") charset when necessary. Indentation/spacing cleanup.
2000-08-10 Havoc Pennington <hp@redhat.com>
* Makefile.am (snapshot): Change the format of the snapshot
......
2000-08-11 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfilesel.c: Add more calls to g_filename_{to,from}_utf8()
to convert back and forth from UTF-8 and the "system" (or "current
locale") charset when necessary. Indentation/spacing cleanup.
2000-08-10 Havoc Pennington <hp@redhat.com>
* Makefile.am (snapshot): Change the format of the snapshot
......
2000-08-11 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfilesel.c: Add more calls to g_filename_{to,from}_utf8()
to convert back and forth from UTF-8 and the "system" (or "current
locale") charset when necessary. Indentation/spacing cleanup.
2000-08-10 Havoc Pennington <hp@redhat.com>
* Makefile.am (snapshot): Change the format of the snapshot
......
......@@ -376,7 +376,7 @@ static gint cmpl_errno;
* translation had to be made.
*/
int
translate_win32_path(GtkFileSelection *filesel)
translate_win32_path (GtkFileSelection *filesel)
{
int updated = 0;
gchar *path;
......@@ -390,7 +390,7 @@ translate_win32_path(GtkFileSelection *filesel)
* Translate only if this looks like a DOS-ish
* path... First handle any drive letters.
*/
if (isalpha(path[0]) && (path[1] == ':')) {
if (isalpha (path[0]) && (path[1] == ':')) {
/*
* This part kind of stinks... It isn't possible
* to know if there is enough space in the current
......@@ -399,10 +399,7 @@ translate_win32_path(GtkFileSelection *filesel)
* and use the set function on the text field to
* set the newly created string.
*/
gchar *newPath;
newPath = g_malloc(strlen(path) + 2);
sprintf(newPath, "//%c/%s", path[0], (path + 3));
gchar *newPath = g_strdup_printf ("//%c/%s", path[0], (path + 3));
gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), newPath);
path = newPath;
......@@ -413,14 +410,15 @@ translate_win32_path(GtkFileSelection *filesel)
* Now, replace backslashes with forward slashes
* if necessary.
*/
if (strchr(path, '\\')) {
int index;
for (index = 0; path[index] != '\0'; index++)
if (path[index] == '\\')
path[index] = '/';
updated = 1;
}
if (strchr (path, '\\'))
{
int index;
for (index = 0; path[index] != '\0'; index++)
if (path[index] == '\\')
path[index] = '/';
updated = 1;
}
return updated;
}
......@@ -486,13 +484,13 @@ gtk_file_selection_init (GtkFileSelection *filesel)
/* The horizontal box containing create, rename etc. buttons */
filesel->button_area = gtk_hbutton_box_new ();
gtk_button_box_set_layout(GTK_BUTTON_BOX(filesel->button_area), GTK_BUTTONBOX_START);
gtk_button_box_set_spacing(GTK_BUTTON_BOX(filesel->button_area), 0);
gtk_button_box_set_layout (GTK_BUTTON_BOX (filesel->button_area), GTK_BUTTONBOX_START);
gtk_button_box_set_spacing (GTK_BUTTON_BOX (filesel->button_area), 0);
gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->button_area,
FALSE, FALSE, 0);
gtk_widget_show (filesel->button_area);
gtk_file_selection_show_fileop_buttons(filesel);
gtk_file_selection_show_fileop_buttons (filesel);
/* hbox for pulldown menu */
pulldown_hbox = gtk_hbox_new (TRUE, 5);
......@@ -558,8 +556,8 @@ gtk_file_selection_init (GtkFileSelection *filesel)
/* The OK/Cancel button area */
confirm_area = gtk_hbutton_box_new ();
gtk_button_box_set_layout(GTK_BUTTON_BOX(confirm_area), GTK_BUTTONBOX_END);
gtk_button_box_set_spacing(GTK_BUTTON_BOX(confirm_area), 5);
gtk_button_box_set_layout (GTK_BUTTON_BOX (confirm_area), GTK_BUTTONBOX_END);
gtk_button_box_set_spacing (GTK_BUTTON_BOX (confirm_area), 5);
gtk_box_pack_end (GTK_BOX (filesel->main_vbox), confirm_area, FALSE, FALSE, 0);
gtk_widget_show (confirm_area);
......@@ -665,7 +663,7 @@ gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel)
gtk_widget_show (filesel->fileop_ren_file);
}
gtk_widget_queue_resize(GTK_WIDGET(filesel));
gtk_widget_queue_resize (GTK_WIDGET (filesel));
}
void
......@@ -739,7 +737,7 @@ gtk_file_selection_get_filename (GtkFileSelection *filesel)
g_return_val_if_fail (GTK_IS_FILE_SELECTION (filesel), nothing);
#ifdef G_WITH_CYGWIN
translate_win32_path(filesel);
translate_win32_path (filesel);
#endif
text = gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry));
if (text)
......@@ -809,7 +807,8 @@ gtk_file_selection_destroy (GtkObject *object)
/* Begin file operations callbacks */
static void
gtk_file_selection_fileop_error (GtkFileSelection *fs, gchar *error_message)
gtk_file_selection_fileop_error (GtkFileSelection *fs,
gchar *error_message)
{
GtkWidget *label;
GtkWidget *vbox;
......@@ -830,19 +829,19 @@ gtk_file_selection_fileop_error (GtkFileSelection *fs, gchar *error_message)
/* If file dialog is grabbed, make this dialog modal too */
/* When error dialog is closed, file dialog will be grabbed again */
if (GTK_WINDOW(fs)->modal)
gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
if (GTK_WINDOW (fs)->modal)
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
vbox = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox,
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox,
FALSE, FALSE, 0);
gtk_widget_show(vbox);
gtk_widget_show (vbox);
label = gtk_label_new(error_message);
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
gtk_widget_show(label);
label = gtk_label_new (error_message);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5);
gtk_widget_show (label);
/* yes, we free it */
g_free (error_message);
......@@ -852,17 +851,18 @@ gtk_file_selection_fileop_error (GtkFileSelection *fs, gchar *error_message)
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) gtk_widget_destroy,
(gpointer) dialog);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area),
button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
gtk_widget_grab_default(button);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show (button);
gtk_widget_show (dialog);
}
static void
gtk_file_selection_fileop_destroy (GtkWidget *widget, gpointer data)
gtk_file_selection_fileop_destroy (GtkWidget *widget,
gpointer data)
{
GtkFileSelection *fs = data;
......@@ -874,12 +874,14 @@ gtk_file_selection_fileop_destroy (GtkWidget *widget, gpointer data)
static void
gtk_file_selection_create_dir_confirmed (GtkWidget *widget, gpointer data)
gtk_file_selection_create_dir_confirmed (GtkWidget *widget,
gpointer data)
{
GtkFileSelection *fs = data;
gchar *dirname;
gchar *path;
gchar *full_path;
gchar *xpath;
gchar *buf;
CompletionState *cmpl_state;
......@@ -891,20 +893,23 @@ gtk_file_selection_create_dir_confirmed (GtkWidget *widget, gpointer data)
path = cmpl_reference_position (cmpl_state);
full_path = g_strconcat (path, G_DIR_SEPARATOR_S, dirname, NULL);
if ( (mkdir (full_path, 0755) < 0) )
xpath = g_filename_from_utf8 (full_path);
if (mkdir (xpath, 0755) < 0)
{
buf = g_strconcat ("Error creating directory \"", dirname, "\": ",
g_strerror(errno), NULL);
g_strerror (errno), NULL);
gtk_file_selection_fileop_error (fs, buf);
}
g_free (full_path);
g_free (xpath);
gtk_widget_destroy (fs->fileop_dialog);
gtk_file_selection_populate (fs, "", FALSE);
}
static void
gtk_file_selection_create_dir (GtkWidget *widget, gpointer data)
gtk_file_selection_create_dir (GtkWidget *widget,
gpointer data)
{
GtkFileSelection *fs = data;
GtkWidget *label;
......@@ -929,25 +934,25 @@ gtk_file_selection_create_dir (GtkWidget *widget, gpointer data)
/* If file dialog is grabbed, grab option dialog */
/* When option dialog is closed, file dialog will be grabbed again */
if (GTK_WINDOW(fs)->modal)
gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
if (GTK_WINDOW (fs)->modal)
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
vbox = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox,
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox,
FALSE, FALSE, 0);
gtk_widget_show(vbox);
gtk_widget_show( vbox);
label = gtk_label_new(_("Directory name:"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
gtk_widget_show(label);
label = gtk_label_new (_("Directory name:"));
gtk_misc_set_alignment(GTK_MISC (label), 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5);
gtk_widget_show (label);
/* The directory entry widget */
fs->fileop_entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry,
TRUE, TRUE, 5);
GTK_WIDGET_SET_FLAGS(fs->fileop_entry, GTK_CAN_DEFAULT);
GTK_WIDGET_SET_FLAGS (fs->fileop_entry, GTK_CAN_DEFAULT);
gtk_widget_show (fs->fileop_entry);
/* buttons */
......@@ -955,31 +960,33 @@ gtk_file_selection_create_dir (GtkWidget *widget, gpointer data)
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) gtk_file_selection_create_dir_confirmed,
(gpointer) fs);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area),
button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
gtk_widget_show(button);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_show (button);
button = gtk_button_new_with_label (_("Cancel"));
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) gtk_widget_destroy,
(gpointer) dialog);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area),
button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
gtk_widget_grab_default(button);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show (button);
gtk_widget_show (dialog);
}
static void
gtk_file_selection_delete_file_confirmed (GtkWidget *widget, gpointer data)
gtk_file_selection_delete_file_confirmed (GtkWidget *widget,
gpointer data)
{
GtkFileSelection *fs = data;
CompletionState *cmpl_state;
gchar *path;
gchar *full_path;
gchar *xpath;
gchar *buf;
g_return_if_fail (fs != NULL);
......@@ -989,20 +996,23 @@ gtk_file_selection_delete_file_confirmed (GtkWidget *widget, gpointer data)
path = cmpl_reference_position (cmpl_state);
full_path = g_strconcat (path, G_DIR_SEPARATOR_S, fs->fileop_file, NULL);
if ( (unlink (full_path) < 0) )
xpath = g_filename_from_utf8 (full_path);
if (unlink (xpath) < 0)
{
buf = g_strconcat ("Error deleting file \"", fs->fileop_file, "\": ",
g_strerror(errno), NULL);
g_strerror (errno), NULL);
gtk_file_selection_fileop_error (fs, buf);
}
g_free (full_path);
g_free (xpath);
gtk_widget_destroy (fs->fileop_dialog);
gtk_file_selection_populate (fs, "", FALSE);
}
static void
gtk_file_selection_delete_file (GtkWidget *widget, gpointer data)
gtk_file_selection_delete_file (GtkWidget *widget,
gpointer data)
{
GtkFileSelection *fs = data;
GtkWidget *label;
......@@ -1019,12 +1029,12 @@ gtk_file_selection_delete_file (GtkWidget *widget, gpointer data)
return;
#ifdef G_WITH_CYGWIN
translate_win32_path(fs);
translate_win32_path (fs);
#endif
filename = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
if (strlen(filename) < 1)
return;
if (strlen (filename) < 1)
return;
fs->fileop_file = filename;
......@@ -1038,40 +1048,40 @@ gtk_file_selection_delete_file (GtkWidget *widget, gpointer data)
/* If file dialog is grabbed, grab option dialog */
/* When option dialog is closed, file dialog will be grabbed again */
if (GTK_WINDOW(fs)->modal)
gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
if (GTK_WINDOW (fs)->modal)
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
vbox = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox,
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox,
FALSE, FALSE, 0);
gtk_widget_show(vbox);
gtk_widget_show (vbox);
buf = g_strconcat ("Really delete file \"", filename, "\" ?", NULL);
label = gtk_label_new(buf);
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
gtk_widget_show(label);
g_free(buf);
label = gtk_label_new (buf);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5);
gtk_widget_show (label);
g_free (buf);
/* buttons */
button = gtk_button_new_with_label (_("Delete"));
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) gtk_file_selection_delete_file_confirmed,
(gpointer) fs);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
gtk_widget_show(button);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area),
button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_show (button);
button = gtk_button_new_with_label (_("Cancel"));
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) gtk_widget_destroy,
(gpointer) dialog);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
gtk_widget_grab_default(button);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area),
button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show (button);
gtk_widget_show (dialog);
......@@ -1079,7 +1089,8 @@ gtk_file_selection_delete_file (GtkWidget *widget, gpointer data)
}
static void
gtk_file_selection_rename_file_confirmed (GtkWidget *widget, gpointer data)
gtk_file_selection_rename_file_confirmed (GtkWidget *widget,
gpointer data)
{
GtkFileSelection *fs = data;
gchar *buf;
......@@ -1099,10 +1110,10 @@ gtk_file_selection_rename_file_confirmed (GtkWidget *widget, gpointer data)
new_filename = g_strconcat (path, G_DIR_SEPARATOR_S, file, NULL);
old_filename = g_strconcat (path, G_DIR_SEPARATOR_S, fs->fileop_file, NULL);
if ( (rename (old_filename, new_filename)) < 0)
if (rename (old_filename, new_filename) < 0)
{
buf = g_strconcat ("Error renaming file \"", file, "\": ",
g_strerror(errno), NULL);
g_strerror (errno), NULL);
gtk_file_selection_fileop_error (fs, buf);
}
g_free (new_filename);
......@@ -1113,7 +1124,8 @@ gtk_file_selection_rename_file_confirmed (GtkWidget *widget, gpointer data)
}
static void
gtk_file_selection_rename_file (GtkWidget *widget, gpointer data)
gtk_file_selection_rename_file (GtkWidget *widget,
gpointer data)
{
GtkFileSelection *fs = data;
GtkWidget *label;
......@@ -1129,8 +1141,8 @@ gtk_file_selection_rename_file (GtkWidget *widget, gpointer data)
return;
fs->fileop_file = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
if (strlen(fs->fileop_file) < 1)
return;
if (strlen (fs->fileop_file) < 1)
return;
/* main dialog */
fs->fileop_dialog = dialog = gtk_dialog_new ();
......@@ -1142,27 +1154,27 @@ gtk_file_selection_rename_file (GtkWidget *widget, gpointer data)
/* If file dialog is grabbed, grab option dialog */
/* When option dialog closed, file dialog will be grabbed again */
if (GTK_WINDOW(fs)->modal)
gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
if (GTK_WINDOW (fs)->modal)
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
vbox = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER(vbox), 8);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox,
FALSE, FALSE, 0);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox,
FALSE, FALSE, 0);
gtk_widget_show(vbox);
buf = g_strconcat ("Rename file \"", fs->fileop_file, "\" to:", NULL);
label = gtk_label_new(buf);
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
gtk_widget_show(label);
g_free(buf);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5);
gtk_widget_show (label);
g_free (buf);
/* New filename entry */
fs->fileop_entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry,
TRUE, TRUE, 5);
GTK_WIDGET_SET_FLAGS(fs->fileop_entry, GTK_CAN_DEFAULT);
GTK_WIDGET_SET_FLAGS (fs->fileop_entry, GTK_CAN_DEFAULT);
gtk_widget_show (fs->fileop_entry);
gtk_entry_set_text (GTK_ENTRY (fs->fileop_entry), fs->fileop_file);
......@@ -1174,19 +1186,19 @@ gtk_file_selection_rename_file (GtkWidget *widget, gpointer data)
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) gtk_file_selection_rename_file_confirmed,
(gpointer) fs);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
gtk_widget_show(button);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area),
button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_show (button);
button = gtk_button_new_with_label (_("Cancel"));
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) gtk_widget_destroy,
(gpointer) dialog);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
gtk_widget_grab_default(button);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area),
button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show (button);
gtk_widget_show (dialog);
......@@ -1208,7 +1220,7 @@ gtk_file_selection_key_press (GtkWidget *widget,
{
fs = GTK_FILE_SELECTION (user_data);
#ifdef G_WITH_CYGWIN
translate_win32_path(fs);
translate_win32_path (fs);
#endif
text = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
......@@ -1228,7 +1240,8 @@ gtk_file_selection_key_press (GtkWidget *widget,
static void
gtk_file_selection_history_callback (GtkWidget *widget, gpointer data)
gtk_file_selection_history_callback (GtkWidget *widget,
gpointer data)
{
GtkFileSelection *fs = data;
HistoryCallbackArg *callback_arg;
......@@ -1254,7 +1267,7 @@ gtk_file_selection_history_callback (GtkWidget *widget, gpointer data)
static void
gtk_file_selection_update_history_menu (GtkFileSelection *fs,
gchar *current_directory)
gchar *current_directory)
{
HistoryCallbackArg *callback_arg;
GtkWidget *menu_item;
......@@ -1283,7 +1296,7 @@ gtk_file_selection_update_history_menu (GtkFileSelection *fs,
gtk_widget_destroy (fs->history_menu);
}
fs->history_menu = gtk_menu_new();
fs->history_menu = gtk_menu_new ();
current_dir = g_strdup (current_directory);
......@@ -1299,7 +1312,7 @@ gtk_file_selection_update_history_menu (GtkFileSelection *fs,
if (i != dir_len)
current_dir[i + 1] = '\0';
#ifdef G_WITH_CYGWIN
if (!strcmp(current_dir, "//"))
if (!strcmp (current_dir, "//"))
continue;
#endif
menu_item = gtk_menu_item_new_with_label (current_dir);
......@@ -1335,11 +1348,11 @@ gtk_file_selection_update_history_menu (GtkFileSelection *fs,
}
static void
gtk_file_selection_file_button (GtkWidget *widget,
gint row,
gint column,
GdkEventButton *bevent,
gpointer user_data)
gtk_file_selection_file_button (GtkWidget *widget,
gint row,
gint column,
GdkEventButton *bevent,
gpointer user_data)
{
GtkFileSelection *fs = NULL;
gchar *filename, *temp = NULL;
......@@ -1355,13 +1368,11 @@ gtk_file_selection_file_button (GtkWidget *widget,
#ifdef G_WITH_CYGWIN