2009-04-01 Alexander Larsson <alexl@redhat.com>
Bug 518481 – URL shortcuts do not open query part
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.[ch]:
* libnautilus-private/nautilus-desktop-icon-file.c:
(update_info_from_link):
* libnautilus-private/nautilus-directory-async.c:
(lacks_mount):
(link_info_done):
* libnautilus-private/nautilus-search-directory-file.c:
(nautilus_search_directory_file_init):
Store NautilusFile activation uri as char *uri, not
GFile, as we sometimes handle links that are not true
GFile locations such as mailto: links in desktop files.
* libnautilus-private/nautilus-desktop-link.[ch]:
Add nautilus_desktop_link_get_activation_uri
* libnautilus-private/nautilus-directory.c:
(nautilus_directory_notify_files_added_by_uri):
(nautilus_directory_notify_files_changed_by_uri):
(nautilus_directory_notify_files_removed_by_uri):
(nautilus_directory_schedule_metadata_remove_by_uri):
Use public nautilus_file_list_from_uris instead of local
copy of it.
* libnautilus-private/nautilus-mime-actions.c:
Store both NautilusFile and char *uri in ApplicationLaunchParameters.
This allows us to correctly handle uris that don't work well as
GFiles and pass them unmodified to the launched applications.
* libnautilus-private/nautilus-program-choosing.[ch]:
Add nautilus_launch_application_by_uri() that launches an application
by specifying the file as a uri, so that we can handle uris that
don't work well as GFile/NautilusFiles.
svn path=/trunk/; revision=15157
2008-08-20 Christian Neumair <cneumair@gnome.org>
* libnautilus-private/nautilus-program-choosing.c
(nautilus_launch_application_from_command),
(nautilus_launch_application_from_command_array):
* libnautilus-private/nautilus-program-choosing.h:
Use vararg list for nautilus_launch_application_from_command().
Add nautilus_launch_application_from_command_array() which takes a
parameter string array. Quote each parameter separately.
* libnautilus-private/nautilus-mime-actions.c (activate_files):
* src/file-manager/fm-desktop-icon-view.c
(action_new_launcher_callback),
(action_change_background_callback):
* src/file-manager/fm-directory-view.c
(action_new_launcher_callback),
(get_file_names_as_parameter_array), (run_script_callback):
* src/file-manager/fm-tree-view.c (got_activation_uri_callback):
Pass each parameter separately to
nautilus_launch_application_from_command(_array)().
The _array() variant is used for running scripts, where the file names
of the selection are passed separately.
Fixes#341657. Thanks to Cosimo Cecchi.
svn path=/trunk/; revision=14502
2008-05-21 A. Walton <awalton@gnome.org>
* */*.[ch]:
Move all of Nautilus to single Gtk+ includes, because Mitch says so.
Closes Bug #530315.
svn path=/trunk/; revision=14182
2008-02-13 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file.[ch]:
* libnautilus-private/nautilus-file-private.h:
Add nautilus_file_is_launcher()
* libnautilus-private/nautilus-directory-async.c:
* libnautilus-private/nautilus-dnd.c:
* libnautilus-private/nautilus-link.[ch]
* libnautilus-private/nautilus-mime-actions.c:
* libnautilus-private/nautilus-program-choosing.[ch]:
* src/file-manager/fm-directory-view.c:
* src/file-manager/fm-tree-view.c:
Remove weird desktop-file: and command: hacks, and
replace with usage and implementation of
nautilus_file_is_launcher().
This fixes some problems where the old desktop-file uri
was interpreted as an actual file.
svn path=/trunk/; revision=13734
2006-01-11 Christian Neumair <chris@gnome-de.org>
* libnautilus-private/nautilus-mime-actions.c:
(nautilus_mime_get_default_application_for_files),
(intersect_application_lists),
(nautilus_mime_get_open_with_applications_for_files),
(nautilus_mime_has_any_applications_for_files):
* libnautilus-private/nautilus-mime-actions.h:
Add file list helpers for getting associated applications.
* libnautilus-private/nautilus-program-choosing.c:
* libnautilus-private/nautilus-program-choosing.h:
(nautilus_launch_application):
Allow to pass multiple files per application launch.
* src/nautilus-information-panel.c:
(command_button_callback):
Port to new API.
* src/file-manager/fm-directory-view.c:
(application_launch_parameters_new),
(application_launch_parameters_free),
(fm_directory_view_launch_application),
(fm_directory_view_chose_application_callback),
(application_selected_cb),
(open_with_launch_application_callback),
(add_application_to_open_with_menu), (reset_open_with_menu),
(real_update_menus), (list_to_parameters_foreach),
(mime_application_hash),
(fm_directory_view_make_activation_parameters),
(activate_callback):
Support activation of multiple files at once, correctly figure out
their associated applications. Fixes#105653.
* src/file-manager/fm-directory-view.c:
(activate_callback):
ref/unref the view before/after operating on it. Fixes#326231.
2003-04-28 Alexander Larsson <alexl@redhat.com>
Based on a patch by Frank Worsley <fworsley@shaw.ca>
* libnautilus-private/nautilus-program-chooser.[ch]:
(nautilus_program_chooser_show_no_choices_message),
(nautilus_program_chooser_show_invalid_message):
Added the term 'action' to the dialogs when there is
no default application or component.
* libnautilus-private/nautilus-program-choosing.[ch]:
(application_cannot_open_location), (nautilus_launch_show_file),
(nautilus_launch_action), (nautilus_launch_application):
Updated to use the new gnome-vfs functions and error codes.
* src/file-manager/fm-directory-view.c:
(fm_directory_view_launch_application), (activate_callback),
(activate_activation_uri_ready_callback),
(cancel_activate_callback), (fm_directory_view_activate_file):
Cleaned up to properly support the new gnome-vfs functionality
and an external component viewer. Also fixed to get activation uri
for a file and then retrieve properties for the activation uri
not the file that was clicked (fixes#42391).
2002-10-02 Mark McLoughlin <mark@skynet.ie>
* acconfig.h: define HAVE_GTK_MULTIHEAD for
egg-screen-exec methods.
* configure.in: require gtk 2.1.0 and don't
define HAVE_GTK_MULTIHEAD.
* libnautilus-private/nautilus-multihead-hacks.h: kill.
* libnautilus-private/nautilus-directory-background:
(make_root_pixmap), (set_root_pixmap): use
gdk_screen_get_display instead of assuming the default
display.
* src/nautilus-shell.c: (restore_one_window_callback):
add backwards compat support for sessions without
a screen number.
2002-06-25 Frank Worsley <fworsley@shaw.ca>
* components/tree/nautilus-tree-view.c:
(got_activation_uri_callback):
implement viewing/opening and executing of files
for the tree view
* libnautilus-private/nautilus-dnd.c:
* libnautilus-private/nautilus-link-desktop-file.c:
* libnautilus-private/nautilus-link-historical.c:
updated for new desktop-file: command specifier to allow
proper launching of desktop files
* libnautilus-private/nautilus-program-choosing.c:
(nautilus_launch_desktop_file):
new function to launch desktop files with proper exec
parameter support
* libnautilus-private/nautilus-program-choosing.h:
define command specifiers in one place
* src/file-manager/fm-directory-view.c:
(get_executable_text_file_action):
add "run in terminal" button, partial fix for #41773
(activate_callback), (fm_directory_view_move_copy_items):
support proper launching of and dnd to desktop files
* libnautilus-private/Makefile.am: Remove nautilus-desktop-file-loader.[ch].
* libnautilus-private/nautilus-desktop-file-loader.c: Remove.
* libnautilus-private/nautilus-desktop-file-loader.h: Remove.
* libnautilus-private/nautilus-directory-async.c:
(link_info_nautilus_link_read_callback): Pass in NULL for the new
optional URI parameter for parsing existing link files.
* libnautilus-private/nautilus-link-desktop-file.h:
* libnautilus-private/nautilus-link-desktop-file.c:
Change to use GnomeDesktopItem instead of NautilusDesktopFile.
* libnautilus-private/nautilus-link.h:
* libnautilus-private/nautilus-link.c:
(nautilus_link_get_link_uri_given_file_contents),
(nautilus_link_get_link_name_given_file_contents),
(nautilus_link_get_link_icon_given_file_contents):
Add optional URI parameter for parsing existing link files. This
is passed down to the GnomeDesktopItem level, which can sometimes
do a better job if it knows the URI.
* src/file-manager/fm-directory-view.c: (activate_callback):
Change to use GnomeDesktopItem instead of NautilusDesktopFile. Also,
simplify error handling.
* Many files:
Fix includes to use <> style in headers more consistently, and remove
unnecessarily includes.
uses the launch_application_from_command function.
* libnautilus-extensions/nautilus-program-chooser.c:
(launch_mime_capplet): Pass the file name of the files and
programs capplet when starting it up. (Is there a better name to
use for this case?)
* src/file-manager/fm-desktop-icon-view.c:
(change_background_callback): Pass "Background" as the name when
starting the Background capplet.
* src/file-manager/fm-directory-view.c: (run_script_callback):
Pass the file name of the script as the name when starting a
script.
(activate_callback): Pass the file name of an executable file when
starting an executable file by opening it.
* libnautilus-extensions/nautilus-program-choosing.h:
* libnautilus-extensions/nautilus-program-choosing.c:
(nautilus_launch_application): Pass the application name from the
gnome-vfs MIME database when starting an application.
(get_xalf_prefix): Placeholder for code to figure out the right
set of parameters to pass to xalf.
(nautilus_launch_application_from_command): Change to take a name
for the application. It's ignored when xalf is not used, but used
as the title when xalf is used.
2001-02-22 Rebecca Schulman <rebecka@eazel.com>
Fix bug 6058, that opening a file with a default
application that cannot access a location (in the specific
case of the bug, eazel-services) should explain the problem,
and offer another application, rather than simply failing.
reviewed by: John Sullivan <sullivan@eazel.com>
* libnautilus-extensions/nautilus-program-choosing.h:
* libnautilus-extensions/nautilus-program-choosing.c:
(nautilus_choose_application_for_file),
(application_can_handle_uri), (application_cannot_open_location),
(nautilus_launch_application),
(launch_application_callback),
(launch_parameters_new),
(launch_parameters_free), (launch_application_callback):
Change nautilus_launch_application to take a NautilusFile rather
than a uri, so that we can find out whether other applications
are available for the location, using the mime type as well
as uri scheme. Change the dialogs that come up when an application
is not available for a particular location to explain more of what
we know. If another application is available to open the uri,
open the program chooser dialog.
* src/file-manager/fm-directory-view.c:
(application_launch_parameters_new),
(application_launch_parameters_free),
(fm_directory_view_launch_application),
(fm_directory_view_chose_application_callback), (choose_program),
(bonobo_launch_application_callback),
(add_application_to_bonobo_menu), (reset_bonobo_open_with_menu),
(activate_callback):
Change the parameters sent to nautilus_launch_application, and
so change data sent to callbacks used to later call
nautilus_launch_application
* src/nautilus-sidebar.c: (command_button_callback),
(nautilus_sidebar_chose_application_callback):
Call nautilus_launch_application with the new arguments
terminals don't get them) and 4072 (mime types: command= string
can't take args?).
* libnautilus-extensions/nautilus-gnome-extensions.c
(nautilus_gnome_terminal_shell_execute): Don't take the shell as
an argument, just use "/bin/sh", there's no reason to use any
other shell for the purpose of launching a terminal like this.
(nautilus_gnome_open_terminal): Don't pass user shell to
`nautilus_gnome_terminal_shell_execute'; handle `gnome-terminal'
properly by passing it "-x" instead of incorrectly trying to quote
the command.
* libnautilus-extensions/nautilus-gnome-extensions.h: Fix minor
typo.
* libnautilus-extensions/nautilus-program-choosing.h,
libnautilus-extensions/nautilus-program-choosing.c:
(nautilus_launch_application_from_command): Add a use_termial
argument and if passed, launch the program in a terminal; minor
fixes to the way non-terminal-requiring programs are launched as
well, including not quoting the command, so that it can include
command line arguments (if the command name includes a space, it
had better be quoted already).
(nautilus_launch_application): Use the new `use_terminal' argument
when calling `nautilus_launch_application_from_command'.
* libnautilus-extensions/nautilus-program-chooser.c:
(launch_mime_capplet): Use the new `use_terminal' argument
when calling `nautilus_launch_application_from_command'.
* src/file-manager/fm-desktop-icon-view.c
(change_desktop_background_menu_item_callback): Use the new
`use_terminal' argument when calling
`nautilus_launch_application_from_command'.
* src/file-manager/fm-directory-view.c (activate_callback): Use
the new `use_terminal' argument when calling
`nautilus_launch_application_from_command'. Also, shell-quote the
command, since nautilus_application_launch_from_command won't do
that for you any more.
dialog be parented on the NautilusWindow from whence
it came.
* libnautilus-extensions/nautilus-program-choosing.h:
* libnautilus-extensions/nautilus-program-choosing.c:
(nautilus_launch_application_parented): Removed this function
(nautilus_launch_application): Made this function take a
parent (can be NULL, but better not to be).
* src/file-manager/fm-directory-view.c:
(fm_directory_view_launch_application): Remove "_parented"
* src/nautilus-sidebar.c:
(nautilus_sidebar_get_window): New helper function to get
enclosing window.
(command_button_callback),
(nautilus_sidebar_chose_application_callback): Pass parent
window to nautilus_launch_application.
and bug 2404 (Help uri needs to be escaped properly) by adding a
function to quote for strings for shell. I chose a name an an
implementation that matches the function that will be added to
glib 2.0 for this purpose.
* libnautilus-extensions/nautilus-glib-extensions.h:
* libnautilus-extensions/nautilus-glib-extensions.c:
(nautilus_shell_quote), (nautilus_self_check_glib_extensions):
Add a shell_quote function and tests for it.
* components/help/help-method.c: (help_uri_to_string): Call the
new nautilus_shell_quote function.
* libnautilus-extensions/nautilus-program-choosing.h:
* libnautilus-extensions/nautilus-program-choosing.c:
(nautilus_launch_application_parented): Use a URI by default, and
a path only for applications that can't use URIs.
(nautilus_launch_application_from_command): Quote the parameter
for the shell with the new nautilus_shell_quote function.
can only handle local paths). After talking to Darin,
decided not to do some automagic local-copying in this
case. Instead, Nautilus detects the case and puts up an
alert explaining the situation instead of launching the app.
* libnautilus-extensions/nautilus-program-choosing.h,
* libnautilus-extensions/nautilus-program-choosing.c:
(nautilus_launch_application_parented): New function, just
like nautilus_launch_application but takes a parent window
for error dialogs. Checks whether the application can
handle uris and if not puts up an alert.
(nautilus_launch_application): Guts moved to _parented call,
which this now calls.
(nautilus_launch_application_from_command): No longer converts
the uri to a local path here; callers have to handle this
themselves if they want to.
* src/file-manager/fm-directory-view.c:
(get_containing_window): New utility function, returns the
GtkWindow that the directory view is in.
(fm_directory_view_launch_application): Now calls new
nautilus_launch_application_parented.
(choose_program): Now calls get_containing_window.
* libnautilus-extensions/nautilus-program-choosing.h,
libnautilus-extensions/nautilus-program-choosing.c:
(nautilus_launch_application): Take a GnomeVFSMimeApplication *
instead of a command string; add gnome-terminal -x
(nautilus_launch_application_from_command): Old version that takes
a command string renamed. Also, uses `system' instead of `execlp',
so command-line arguments in the command string work.
* libnautilus-extensions/nautilus-program-chooser.c
(launch_mime_capplet): Adjusted to conform.
* src/file-manager/fm-directory-view.c
(fm_directory_view_launch_application): Likewise.
* src/nautilus-sidebar.c: (command_button_callback,
nautilus_sidebar_chose_application_callback, add_command_buttons):
Likewise.
* test/test-nautilus-mime-actions.c (print_application): Show the
requires_terminal field for applications.
the new API, whose implementation awaits. This causes
us to temporarily lose the command-buttons-in-sidebar
feature until the new API's implementation happens.
Some of these changes are only partially done; I've
got a list of things to finish still. But feel free
to bug me about anything in particular that seems bad.
* libnautilus-extensions/nautilus-program-chooser.h:
* libnautilus-extensions/nautilus-program-chooser.c:
(populate_program_list): Use real API to add programs
to list in dialog.
(nautilus_program_chooser_new): Remember whether this
is an application-choosing or component-choosing dialog.
(nautilus_program_chooser_get_application),
(nautilus_program_chooser_get_component): New functions,
get the item in the list that the user selected.
* libnautilus-extensions/nautilus-program-choosing.h:
Change parameter in NautilusApplicationChoiceCallback
from char * to GnomeVFSMimeApplication.
* libnautilus-extensions/nautilus-program-choosing.c:
(nautilus_choose_application_for_file),
(nautilus_choose_component_for_file): Get the chosen
item from the dialog instead of returning a hardwired
value.
* src/file-manager/fm-directory-view.c:
(fm_directory_view_chose_application_callback): Take
GnomeVFSMimeApplication instead of char *.
(add_open_with_gtk_menu_item): Enable menu items now
that they work.
(launch_application_from_menu_item): New function, callback
used when user picks an app from context menu.
(view_uri_from_menu_item): New function, callback used
when user picks a viewer from context menu.
(add_application_to_gtk_menu),
(add_component_to_gtk_menu): New functions, set up menu items.
(create_open_with_gtk_menu): Use real API to populate
open_with context menu items.
(bonobo_menu_select_all_callback), (select_all_callback),
(fm_directory_view_real_merge_menus):
Fixed bug where context menu "Select All" didn't work by
separating bonobo and gtk callbacks.
* src/nautilus-sidebar.c:
(nautilus_index_panel_chose_application_callback),
(add_command_buttons), (gnome_vfs_mime_application_list_free),
(nautilus_index_panel_update_buttons): Use real API instead
of hardwired set of buttons for different MIME types. This
currently means you always get only the "Open with ..." button,
but the real buttons will reappear once we have our new
application-choosing scheme in place.
with Darin.
* libnautilus-extensions/nautilus-program-choosing.h,
* libnautilus-extensions/nautilus-program-choosing.c:
(nautilus_choose_application_for_file): Make callback
take a const char * instead of a char *.
* src/file-manager/fm-directory-view.c:
(fm_directory_view_chose_application_callback): take
a const char * instead of a char *.
* src/ntl-index-panel.c:
(nautilus_index_panel_chose_application_callback):
take a const char * instead of a char *.
(open_with_callback): unref file
(add_command_buttons): Use gtk_signal_connect instead of
nautilus_gtk_signal_connect_free_data when passing NULL
as the data (Doh!).
They don't do anything useful yet.
* libnautilus-extensions/nautilus-program-chooser.h,
* libnautilus-extensions/nautilus-program-chooser.c:
New files with code for creating a program-choosing
dialog (which is really degenerate right now).
* libnautilus-extensions/nautilus-program-choosing.h,
* libnautilus-extensions/nautilus-program-choosing.c:
New files with functions for choosing a component or other
program to display or open a file with. This uses the
dialog in nautilus-program-chooser, but callers don't
need to know that.
* libnautilus-extensions/Makefile.am: add these new
files to the build.
* src/file-manager/fm-directory-view.c:
(fm_directory_view_chose_application_callback),
(fm_directory_view_chose_component_callback), (choose_application),
(choose_component), (bonobo_menu_other_program_callback),
(other_application_callback), (other_viewer_callback):
New functions that connect the program-choosing UI to the
menu items.
(compute_menu_item_info): Stop desensitizing the "Other ..." items.
(append_gtk_menu_item): Eliminated this function, made callers use
more elaborate append_gtk_menu_item_with_view instead.
(fm_directory_view_real_create_background_context_menu_items),
(create_open_with_gtk_menu):
Updated callers to append_gtk_menu_item.
(fm_directory_view_real_create_selection_context_menu_items):
Pass view to create_open_with_gtk_menu.
(reset_bonobo_open_with_menu): Now takes an FMDirectoryView and
uses it as callback data for "Other..." items.
(fm_directory_view_real_merge_menus),
(fm_directory_view_real_update_menus): Pass view to
reset_bonobo_open_with_menu.
* src/ntl-index-panel.c: (command_button_callback): Renamed from
command_button_cb, also broke out application-launching code and
moved it to libnautilus-extensions/nautilus-program-choosing.c.
(nautilus_index_panel_chose_application_callback),
(open_with_callback): New functions, used to wire up functionality
of "Open with ..." button.
(add_command_buttons): Stop desensitizing "Open with ..." button,
and wire it up to do something.
* src/ntl-window.h: Renamed field "option_cvtype" to "view_as_option_menu".
* src/ntl-window.c:
(nautilus_window_constructed): Updated to match field name change.
(nautilus_window_switch_views): New function, broken out of
view_menu_switch_views_callback; switches window to new content view.
(view_menu_switch_views_callback): Now calls nautilus_window_switch_views.
(synch_view_as_menu): New function, resets displayed name of "View as"
menu to match current content view.
(chose_component_callback), (view_menu_choose_view_callback): New
functions, used to implement "View as ..." menu item.
(nautilus_window_load_content_view_menu): Store iid in menu item;
call synch_view_as_menu; wire up "View as ..." menu item.
* src/ntl-window-msgs.c: (handle_unreadable_location):
Tweaked wording of an error message.
* src/file-manager/fm-error-reporting.c:
(fm_report_error_renaming_file): Tweaked wording of an error message.