gtk+ r22178 - in trunk: . gtk
- From: federico svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r22178 - in trunk: . gtk
- Date: Fri, 23 Jan 2009 00:53:38 +0000 (UTC)
Author: federico
Date: Fri Jan 23 00:53:38 2009
New Revision: 22178
URL: http://svn.gnome.org/viewvc/gtk+?rev=22178&view=rev
Log:
Process the result of refreshing the folder during explicit completion
(start_explicit_completion): Process the result from
refresh...(). Here we present the actual feedback about only
being able to display local folders for local_only=TRUE.
Signed-off-by: Federico Mena Quintero <federico novell com>
Modified:
trunk/ChangeLog
trunk/gtk/gtkfilechooserentry.c
Modified: trunk/gtk/gtkfilechooserentry.c
==============================================================================
--- trunk/gtk/gtkfilechooserentry.c (original)
+++ trunk/gtk/gtkfilechooserentry.c Fri Jan 23 00:53:38 2009
@@ -1111,43 +1111,76 @@
static void
start_explicit_completion (GtkFileChooserEntry *chooser_entry)
{
- /* FMQ: get result from the function below */
- refresh_current_folder_and_file_part (chooser_entry, REFRESH_UP_TO_CURSOR_POSITION);
+ RefreshStatus status;
+ gboolean is_error;
+ char *feedback_msg;
+
+ status = refresh_current_folder_and_file_part (chooser_entry, REFRESH_UP_TO_CURSOR_POSITION);
- if (!chooser_entry->current_folder_file)
+ is_error = FALSE;
+
+ switch (status)
{
- /* Here, no folder path means we couldn't parse what the user typed. */
+ case REFRESH_OK:
+ g_assert (chooser_entry->current_folder_file != NULL);
- beep (chooser_entry);
- pop_up_completion_feedback (chooser_entry, _("Invalid path"));
+ if (chooser_entry->current_folder
+ && _gtk_folder_is_finished_loading (chooser_entry->current_folder))
+ {
+ explicitly_complete (chooser_entry);
+ }
+ else
+ {
+ chooser_entry->load_complete_action = LOAD_COMPLETE_EXPLICIT_COMPLETION;
- chooser_entry->load_complete_action = LOAD_COMPLETE_NOTHING;
- return;
- }
+ /* translators: this text is shown while the system is searching
+ * for possible completions for text in a file chooser entry
+ */
+ pop_up_completion_feedback (chooser_entry, _("Completing..."));
+ }
- if (chooser_entry->local_only
- && !g_file_is_native (chooser_entry->current_folder_file))
- {
- beep (chooser_entry);
- pop_up_completion_feedback (chooser_entry, _("Only local files can be selected"));
+ break;
- chooser_entry->load_complete_action = LOAD_COMPLETE_NOTHING;
+ case REFRESH_INVALID_INPUT:
+ is_error = TRUE;
+ feedback_msg = _("Invalid path");
+ break;
+
+ case REFRESH_INCOMPLETE_HOSTNAME:
+ is_error = TRUE;
+
+ if (chooser_entry->local_only)
+ feedback_msg = _("Only local files may be selected"); /* hostnames in a local_only file chooser? user error */
+ else
+ {
+ /* Another option is to complete the hostname based on the remote volumes that are mounted */
+ feedback_msg = _("Incomplete hostname; end it with '/'");
+ }
+
+ break;
+
+ case REFRESH_NONEXISTENT:
+ is_error = TRUE;
+ feedback_msg = _("Path does not exist");
+ break;
+
+ case REFRESH_NOT_LOCAL:
+ is_error = TRUE;
+ feedback_msg = _("Only local files may be selected");
+ break;
+
+ default:
+ g_assert_not_reached ();
return;
}
- if (chooser_entry->current_folder
- && _gtk_folder_is_finished_loading (chooser_entry->current_folder))
- {
- explicitly_complete (chooser_entry);
- }
- else
+ if (is_error)
{
- chooser_entry->load_complete_action = LOAD_COMPLETE_EXPLICIT_COMPLETION;
+ g_assert (chooser_entry->current_folder_file == NULL);
- /* translators: this text is shown while the system is searching
- * for possible completions for text in a file chooser entry
- */
- pop_up_completion_feedback (chooser_entry, _("Completing..."));
+ beep (chooser_entry);
+ pop_up_completion_feedback (chooser_entry, feedback_msg);
+ chooser_entry->load_complete_action = LOAD_COMPLETE_NOTHING;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]