Merged from HEAD:
2004-08-06 Federico Mena Quintero <federico@ximian.com> Merged from HEAD: Fix #144232: * gtk/gtkfilechooserdefault.c (save_widgets_create): Use a GtkFileChooserEntry for the file name, rather than a GtkEntry. (update_chooser_entry): Set the contents of the file chooser entry rather than the plain entry's. (gtk_file_chooser_default_set_current_folder): Set the new folder on the save entry. (gtk_file_chooser_default_set_current_name): Set the name on the file chooser entry. (check_save_entry): Use the file chooser entry rather than the plain entry. * gtk/gtkfilechooserentry.c (_gtk_file_chooser_entry_set_base_folder): Call gtk_file_chooser_entry_changed() so that we recompute the current folder based on the new base folder.
This commit is contained in:
committed by
Federico Mena Quintero
parent
8996a22718
commit
70076454c6
22
ChangeLog
22
ChangeLog
@@ -1,3 +1,25 @@
|
|||||||
|
2004-08-06 Federico Mena Quintero <federico@ximian.com>
|
||||||
|
|
||||||
|
Merged from HEAD:
|
||||||
|
|
||||||
|
Fix #144232:
|
||||||
|
|
||||||
|
* gtk/gtkfilechooserdefault.c (save_widgets_create): Use a
|
||||||
|
GtkFileChooserEntry for the file name, rather than a GtkEntry.
|
||||||
|
(update_chooser_entry): Set the contents of the file chooser entry
|
||||||
|
rather than the plain entry's.
|
||||||
|
(gtk_file_chooser_default_set_current_folder): Set the new folder
|
||||||
|
on the save entry.
|
||||||
|
(gtk_file_chooser_default_set_current_name): Set the name on the
|
||||||
|
file chooser entry.
|
||||||
|
(check_save_entry): Use the file chooser entry rather than the
|
||||||
|
plain entry.
|
||||||
|
|
||||||
|
* gtk/gtkfilechooserentry.c
|
||||||
|
(_gtk_file_chooser_entry_set_base_folder): Call
|
||||||
|
gtk_file_chooser_entry_changed() so that we recompute the current
|
||||||
|
folder based on the new base folder.
|
||||||
|
|
||||||
2004-08-06 Matthias Clasen <mclasen@redhat.com>
|
2004-08-06 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): Fix
|
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): Fix
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
2004-08-06 Federico Mena Quintero <federico@ximian.com>
|
||||||
|
|
||||||
|
Merged from HEAD:
|
||||||
|
|
||||||
|
Fix #144232:
|
||||||
|
|
||||||
|
* gtk/gtkfilechooserdefault.c (save_widgets_create): Use a
|
||||||
|
GtkFileChooserEntry for the file name, rather than a GtkEntry.
|
||||||
|
(update_chooser_entry): Set the contents of the file chooser entry
|
||||||
|
rather than the plain entry's.
|
||||||
|
(gtk_file_chooser_default_set_current_folder): Set the new folder
|
||||||
|
on the save entry.
|
||||||
|
(gtk_file_chooser_default_set_current_name): Set the name on the
|
||||||
|
file chooser entry.
|
||||||
|
(check_save_entry): Use the file chooser entry rather than the
|
||||||
|
plain entry.
|
||||||
|
|
||||||
|
* gtk/gtkfilechooserentry.c
|
||||||
|
(_gtk_file_chooser_entry_set_base_folder): Call
|
||||||
|
gtk_file_chooser_entry_changed() so that we recompute the current
|
||||||
|
folder based on the new base folder.
|
||||||
|
|
||||||
2004-08-06 Matthias Clasen <mclasen@redhat.com>
|
2004-08-06 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): Fix
|
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): Fix
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
2004-08-06 Federico Mena Quintero <federico@ximian.com>
|
||||||
|
|
||||||
|
Merged from HEAD:
|
||||||
|
|
||||||
|
Fix #144232:
|
||||||
|
|
||||||
|
* gtk/gtkfilechooserdefault.c (save_widgets_create): Use a
|
||||||
|
GtkFileChooserEntry for the file name, rather than a GtkEntry.
|
||||||
|
(update_chooser_entry): Set the contents of the file chooser entry
|
||||||
|
rather than the plain entry's.
|
||||||
|
(gtk_file_chooser_default_set_current_folder): Set the new folder
|
||||||
|
on the save entry.
|
||||||
|
(gtk_file_chooser_default_set_current_name): Set the name on the
|
||||||
|
file chooser entry.
|
||||||
|
(check_save_entry): Use the file chooser entry rather than the
|
||||||
|
plain entry.
|
||||||
|
|
||||||
|
* gtk/gtkfilechooserentry.c
|
||||||
|
(_gtk_file_chooser_entry_set_base_folder): Call
|
||||||
|
gtk_file_chooser_entry_changed() so that we recompute the current
|
||||||
|
folder based on the new base folder.
|
||||||
|
|
||||||
2004-08-06 Matthias Clasen <mclasen@redhat.com>
|
2004-08-06 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): Fix
|
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): Fix
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
2004-08-06 Federico Mena Quintero <federico@ximian.com>
|
||||||
|
|
||||||
|
Merged from HEAD:
|
||||||
|
|
||||||
|
Fix #144232:
|
||||||
|
|
||||||
|
* gtk/gtkfilechooserdefault.c (save_widgets_create): Use a
|
||||||
|
GtkFileChooserEntry for the file name, rather than a GtkEntry.
|
||||||
|
(update_chooser_entry): Set the contents of the file chooser entry
|
||||||
|
rather than the plain entry's.
|
||||||
|
(gtk_file_chooser_default_set_current_folder): Set the new folder
|
||||||
|
on the save entry.
|
||||||
|
(gtk_file_chooser_default_set_current_name): Set the name on the
|
||||||
|
file chooser entry.
|
||||||
|
(check_save_entry): Use the file chooser entry rather than the
|
||||||
|
plain entry.
|
||||||
|
|
||||||
|
* gtk/gtkfilechooserentry.c
|
||||||
|
(_gtk_file_chooser_entry_set_base_folder): Call
|
||||||
|
gtk_file_chooser_entry_changed() so that we recompute the current
|
||||||
|
folder based on the new base folder.
|
||||||
|
|
||||||
2004-08-06 Matthias Clasen <mclasen@redhat.com>
|
2004-08-06 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): Fix
|
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): Fix
|
||||||
|
|||||||
@@ -3057,7 +3057,9 @@ save_widgets_create (GtkFileChooserDefault *impl)
|
|||||||
0, 0);
|
0, 0);
|
||||||
gtk_widget_show (widget);
|
gtk_widget_show (widget);
|
||||||
|
|
||||||
impl->save_file_name_entry = gtk_entry_new ();
|
impl->save_file_name_entry = _gtk_file_chooser_entry_new ();
|
||||||
|
_gtk_file_chooser_entry_set_file_system (GTK_FILE_CHOOSER_ENTRY (impl->save_file_name_entry),
|
||||||
|
impl->file_system);
|
||||||
gtk_entry_set_width_chars (GTK_ENTRY (impl->save_file_name_entry), 45);
|
gtk_entry_set_width_chars (GTK_ENTRY (impl->save_file_name_entry), 45);
|
||||||
gtk_entry_set_activates_default (GTK_ENTRY (impl->save_file_name_entry), TRUE);
|
gtk_entry_set_activates_default (GTK_ENTRY (impl->save_file_name_entry), TRUE);
|
||||||
gtk_table_attach (GTK_TABLE (table), impl->save_file_name_entry,
|
gtk_table_attach (GTK_TABLE (table), impl->save_file_name_entry,
|
||||||
@@ -3998,8 +4000,8 @@ update_chooser_entry (GtkFileChooserDefault *impl)
|
|||||||
info = _gtk_file_system_model_get_info (impl->browse_files_model, &child_iter);
|
info = _gtk_file_system_model_get_info (impl->browse_files_model, &child_iter);
|
||||||
|
|
||||||
if (!gtk_file_info_get_is_folder (info))
|
if (!gtk_file_info_get_is_folder (info))
|
||||||
gtk_entry_set_text (GTK_ENTRY (impl->save_file_name_entry),
|
_gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->save_file_name_entry),
|
||||||
gtk_file_info_get_display_name (info));
|
gtk_file_info_get_display_name (info));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -4047,6 +4049,11 @@ gtk_file_chooser_default_set_current_folder (GtkFileChooser *chooser,
|
|||||||
impl->changing_folder = FALSE;
|
impl->changing_folder = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set the folder on the save entry */
|
||||||
|
|
||||||
|
_gtk_file_chooser_entry_set_base_folder (GTK_FILE_CHOOSER_ENTRY (impl->save_file_name_entry),
|
||||||
|
impl->current_folder);
|
||||||
|
|
||||||
/* Create a new list model. This is slightly evil; we store the result value
|
/* Create a new list model. This is slightly evil; we store the result value
|
||||||
* but perform more actions rather than returning immediately even if it
|
* but perform more actions rather than returning immediately even if it
|
||||||
* generates an error.
|
* generates an error.
|
||||||
@@ -4084,7 +4091,7 @@ gtk_file_chooser_default_set_current_name (GtkFileChooser *chooser,
|
|||||||
g_return_if_fail (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
|
g_return_if_fail (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
|
||||||
|| impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER);
|
|| impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER);
|
||||||
|
|
||||||
gtk_entry_set_text (GTK_ENTRY (impl->save_file_name_entry), name);
|
_gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->save_file_name_entry), name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -4218,16 +4225,21 @@ check_save_entry (GtkFileChooserDefault *impl,
|
|||||||
gboolean *is_valid,
|
gboolean *is_valid,
|
||||||
gboolean *is_empty)
|
gboolean *is_empty)
|
||||||
{
|
{
|
||||||
const char *filename;
|
GtkFileChooserEntry *chooser_entry;
|
||||||
|
const GtkFilePath *current_folder;
|
||||||
|
const char *file_part;
|
||||||
GtkFilePath *path;
|
GtkFilePath *path;
|
||||||
GError *error;
|
GError *error;
|
||||||
|
|
||||||
g_assert (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
|
g_assert (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
|
||||||
|| impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER);
|
|| impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER);
|
||||||
|
|
||||||
filename = gtk_entry_get_text (GTK_ENTRY (impl->save_file_name_entry));
|
chooser_entry = GTK_FILE_CHOOSER_ENTRY (impl->save_file_name_entry);
|
||||||
|
|
||||||
if (!filename || filename[0] == '\0')
|
current_folder = _gtk_file_chooser_entry_get_current_folder (chooser_entry);
|
||||||
|
file_part = _gtk_file_chooser_entry_get_file_part (chooser_entry);
|
||||||
|
|
||||||
|
if (!file_part || file_part[0] == '\0')
|
||||||
{
|
{
|
||||||
*is_valid = FALSE;
|
*is_valid = FALSE;
|
||||||
*is_empty = TRUE;
|
*is_empty = TRUE;
|
||||||
@@ -4237,11 +4249,11 @@ check_save_entry (GtkFileChooserDefault *impl,
|
|||||||
*is_empty = FALSE;
|
*is_empty = FALSE;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
path = gtk_file_system_make_path (impl->file_system, impl->current_folder, filename, &error);
|
path = gtk_file_system_make_path (impl->file_system, current_folder, file_part, &error);
|
||||||
|
|
||||||
if (!path)
|
if (!path)
|
||||||
{
|
{
|
||||||
error_building_filename_dialog (impl, impl->current_folder, filename, error);
|
error_building_filename_dialog (impl, current_folder, file_part, error);
|
||||||
*is_valid = FALSE;
|
*is_valid = FALSE;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -841,6 +841,7 @@ _gtk_file_chooser_entry_set_base_folder (GtkFileChooserEntry *chooser_entry,
|
|||||||
|
|
||||||
chooser_entry->base_folder = gtk_file_path_copy (path);
|
chooser_entry->base_folder = gtk_file_path_copy (path);
|
||||||
|
|
||||||
|
gtk_file_chooser_entry_changed (GTK_EDITABLE (chooser_entry));
|
||||||
gtk_editable_select_region (GTK_EDITABLE (chooser_entry), 0, -1);
|
gtk_editable_select_region (GTK_EDITABLE (chooser_entry), 0, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user