Commit 65cd4f8d authored by Federico Mena Quintero's avatar Federico Mena Quintero Committed by Federico Mena Quintero

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: default avatarFederico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=22178
parent 2dd7cf49
......@@ -26,7 +26,10 @@
We filter out incomplete hostnames here (typing
"sftp://incompl[tab]" will error out), as well as completely
unparsable input.
(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.
2009-01-22 Matthew Barnes <mbarnes@redhat.com>
Bug 568334 – Constructor properties for GtkAction
......
......@@ -1111,43 +1111,76 @@ explicitly_complete (GtkFileChooserEntry *chooser_entry)
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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment