summaryrefslogtreecommitdiff
path: root/src/nautilus-mime-actions.c
Commit message (Collapse)AuthorAgeFilesLines
* general: Remove tab position settingChristopher Davis2022-07-301-3/+1
| | | | | | | | | | | | | | | | | This hidden setting was added back when tabs were introduced in commit 07cf7db47fd5fae64201f1cff73e39fd8aed2f54 That commit provides no motivation for this setting, and neither does the bug it references: https://bugzilla.gnome.org/show_bug.cgi?id=48034 The same commit added a "tabs_enable" setting too, so it's fair assume this setting doesn't solve any problem, it was just a trend of older times to make everything configurable. Let's remove the setting and assume the default behavior. Also remove the related NAUTILUS_OPEN_FLAG_SLOT_APPEND flag. (Diff and message amended by António Fernandes<antoniof@gnome.org>)
* application: Move is_sandboxed() to allow re-useCorey Berla2022-07-141-17/+2
| | | | | Move function is_sandboxed() from mime-actions to nautilus-application to allow reuse.
* mime-actions: Close broken link message dialogAntónio Fernandes2022-05-211-6/+6
| | | | | | | | | | | | | | We used to rely on gtk_dialog_run(), which would allow us to block the execution of the current function. But it's gone in GTK 4, so we've ported to the ::response signal. 8af45e55fcc347b05c4376128df5f248732d07d8 However, a 'goto` which relied on the blocking behavior was kept by oversight, such that the ::response signal wasn't connected and, as a result, the dialog didn't close on response. Close https://gitlab.gnome.org/GNOME/nautilus/-/issues/2265
* general: Switch to GTK4António Fernandes2022-01-091-9/+9
| | | | | | | | | | | | | | | | The new major version of the toolkit is a requirement to fix old issues and enable future enhancements. Update symbols and adapt logic to API changes. Update and simplify UI definitions. Update local copy of places sidebar and places view. Replace dependencies with their GTK4-compatible successors. Make a minimum changes required to build and run, with known regressions to be fixed in future commits. For a detailed breakup of the changes, see the 36 commits-deep log leading to d5763facb1e5045251171ed1273dca0859f3542f. This is the main part of https://gitlab.gnome.org/GNOME/nautilus/-/issues/276
* program-choosing: Replace GdkScreen with GdkDisplayAntónio Fernandes2022-01-051-4/+4
| | | | They are assumed to have a 1-to-1 correspondence these days.
* mime-actions: Stop using gtk_dialog_run() on files activationAntónio Fernandes2021-12-281-60/+84
| | | | | | Use the GtkDialog::response signal instead, in preparation for GTK 4. Part of #1992
* mime-actions: Unify multiple window confirmationAntónio Fernandes2021-12-281-73/+64
| | | | | | | | | | | | | | | When the files view doesn't do it beforehand, we may prompt the user about opening multiple tabs/windows at once: - for each diretory to open in this app; - for each app to open other files. This has two problems: 1. we may show the prompt twice: first for directories, then for files; 2. we don't ever confirm about launching multiple executable files. Let's unify this prompt for all activation cases and do it before activating anything to address these issues.
* mime-actions: Remove blocking dialog for broken symbolic linksMatthew Jakeman2021-12-281-14/+38
| | | | | | | | | | | Stop using the blocking dialog function `gtk_dialog_run` when the user is prompted for action on a broken symbolic link. Switch to using `eel_show_simple_dialog` as this does not use the old blocking api. Part of #1992
* enums: Make OpenFlags more genericAntónio Fernandes2021-12-281-19/+19
| | | | | | GtkPlacesOpenFlags as public API are gone in GTK 4. In preparation, rename our NautilusWindowOpenFlags enumeration type and make it value-compatible with GtkPlacesOpenFlags.
* mime-actions: Revert unintended string freeze breakAntónio Fernandes2021-03-121-2/+3
| | | Reuse existing strings with approximate meaning.
* mime-action: Fix reinstated regressionAntónio Fernandes2021-03-121-1/+1
| | | | | | | Commit [1] has reinstated a regression from the earlier commit [2]. [1] 080f83385ff79a8be54ee31e7a45422138226f1f [2] 02ba130f3d61fae414459cb308adf270edb01e6e
* mime-actions: Don't leak errorwip/hadess/reinstate-multi-file-launchingAntónio Fernandes2021-03-121-1/+1
|
* mime-actions: Add all portal-opened files to recentsAntónio Fernandes2021-03-121-1/+4
| | | | | | | | | | | While sandboxed, we add the first file in the queue to recents. This has two problems: * The file is added to recents even if we fail to launch. * If opening multiple files, we forget to add the others to recents Instead, add each file to recents for each successful launch.
* mime-actions: Drop dead code pathAntónio Fernandes2021-03-121-11/+0
| | | | | Now that the async files opening path is only used while sandboxed, the conditions for these if blocks (not being sanboxed) is never met.
* mime-actions: Check flatpak-info only onceAntónio Fernandes2021-03-121-5/+16
|
* mime-actions: Open files as groups if not sandboxedAntónio Fernandes2021-03-121-23/+215
| | | | | | | | | | | | | | | | | | While sandboxed, we open files using the OpenURI portal, and we don't know which app is the default handler app for each file. As such, we have given up group-launching files with the same default handler when adapting nautilus to being sandboxed.[0] But this resulted in a feature regression in the non-sandboxed case, which is still the common case in production. Reinstate the code for the old behaviour[1], but keep the current behaviour when running in inside a flatpak sandbox. Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/117 [0] f5206a6daf0991d91e885a28bb66795a8ae12a41 [1] based on revert patch with revert conflicts resolved by hadess
* preferences: Drop executable-text-activation settingAntónio Fernandes2021-02-061-20/+1
| | | | | | | | | | | | | | | | Whe the ASK option gone, the only alternative to the default is RUN. This option is not safe: it's too easy to accidentally run programs. Now we have a "Run as a Program" action in the context menu, which is available by default (no configuration required) and safe (clearly labeled, intentionally chosen). So, remove the RUN option is no longer necessary, and with it we can remove the preference from both the UI and GSettings schemas. Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1700 Discussed in https://gitlab.gnome.org/GNOME/nautilus/-/issues/443
* mime-actions: Drop ACTIVATION_ACTION_ASKAntónio Fernandes2021-02-061-105/+1
| | | | | | | | | | | | | | | | | | There is an option in Preferences which enables a dialog asking users what they intend to do when they double-click an executable text file: open as a text file or run as a program? The dialog asking that question has known design problems, but they remain unaddressed, which is not surprising because it's non-default. Now, with the new menu item added in the last commit, the two options ("Open" and "Run as a Program") are both available by default in the context menu, so there is no need to ask the question in a dialog. Remove the option, the dialog, and the related code. Closes https://bugzilla.gnome.org/show_bug.cgi?id=598671 Part of https://gitlab.gnome.org/GNOME/nautilus/-/issues/1700
* file: Rename and document has_local_path() methodAntónio Fernandes2021-01-251-1/+1
| | | | The new name better reflects the usage and meaning of this method.
* nautilus-mime-actions.c: New PackageKit DBus APIRomeo Calota2020-04-261-25/+9
| | | | | | | | | | | | | | | When a user opens a file of a type that no installed application can open a dialog pops up with the option to search for a suitable application in GNOME Software. When the user clicks the "Search in Software" button an extra notification pops up asking to confirm searching for the app which is unnecessary and potentialy confusing. The fix consists of migrating to the new org.freedesktop.PackageKit.Modify2 D-Bus API that handles this use-case without a second user prompt. Closes #1299
* dbus-manager: add and implement FileOperations2 interfaceAlberts Muktupāvels2020-04-061-0/+1
| | | | | | | | | | Add new version of FileOperations interface. This versions adds PlatformData argument to all methods. Currently supported arguments are parent-handle and timestamp. This change is necessary for proper focus handling. https://gitlab.gnome.org/GNOME/nautilus/merge_requests/504
* general: Run uncrustify scriptOndrej Holy2020-04-051-2/+3
| | | | | There are some style issue since the last run. Let's run it again before enabling style-check CI job.
* general: Allow to compile on Wayland-only systemJavier Jardón2019-12-011-4/+11
| | | | Remove unneeded includes and add some guards to X11-only code.
* mime-actions: Make "search in Software" Dialog modalAmandeep Singh2019-08-111-1/+2
| | | | | | | | when a file type, for which no handler application is installed, is opened, a dialog box pops up, which is not modal. This commit makes the dialog box modal. Closes #646
* nautilus-mime-actions.c: No Application Installed dialog not closed on ↵Timothy OBrien2019-01-291-8/+0
| | | | | | | | | GTK_RESPONSE_YES The "There is no application installed for “foo” files. Do you want to search for an application to open this file?" dialog that appears when there is no application installed to open the specific file type is not closed after clicking Yes. Instead, it reopens again. This patch removes code that was causing the file to be activated after the user clicked Yes; relaunching the dialog. Resolves #842
* query: Port MIME type filter to GPtrArrayAntónio Fernandes2018-12-121-6/+7
| | | | | | | | | | We have been using doubly-linked lists to store MIME type names strings. But this is not a great container for strings, and we are copying the lists multiple times. So, use GPtrArray instead. This avoids copies thanks to reference counting, and enables autocleanup thanks to built-in data freeing.
* general: Kill off NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHINDErnestas Kulik2018-10-301-68/+3
| | | | | | | | | | | bb884cb6151a10523276c2888011692877c686a3 changed the accelerator for open-file-and-close-window from alt-shift-down to ctrl-shift-down, which now conflicts with keyboard rubberbanding in the canvas view. Additionally, it’s nothing more than a relict from a more spatial time. https://bugzilla.gnome.org/show_bug.cgi?id=765526 Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/701
* general: Fix the error dialog not showingGeorge Mocanu2018-10-271-1/+1
| | | | | | | | | | | | | Since commit c1bb594d, a dialog error wouldn't be shown if there was an error when renaming a file or setting permissions to a file. The user should be informed through a error dialog if something went wrong in the above-mentioned use-cases. This patch solves the issue by using the parent, instead of NULL. Closes #705
* mime-actions: Use more obvious nameCarlos Soriano2018-09-261-4/+4
| | | | | I'm not gonna say how much of the day I spent on this code because I read it the other way around because of the misleading function name.
* mime-actions: fix unhandled type dialog contentChristopher Hargarten2018-09-211-2/+7
| | | | | | | | | | | The 'Could not display' dialog, is, admittedly pretty ugly. The line break in the secondary text is tough to read through, and, YES/NO button actions aren't apparent to the user. This commit removes the linebreak in the secondary text and gives the buttons relevant names for the user. https://gitlab.gnome.org/GNOME/nautilus/issues/583
* mime-actions: fix unhandled type dialog headerChristopher Hargarten2018-09-201-1/+1
| | | | | | | | | | | The 'Could not display' dialog is, admittedly, pretty ugly. It's not properly capitalized, and, full stops do come across as rude to the user. This properly cases & removes the full stop from the unhandled type dialog header. https://gitlab.gnome.org/GNOME/nautilus/issues/583
* test: Add trash-or-delete testAlexandru Fazakas2018-07-201-3/+3
| | | | | This patch adds trash_or_delete synchronous alternative and a test including both of these functionalities.
* mime-actions: Add activated files to recentCarlos Soriano2018-06-141-0/+1
| | | | | | | | | | | | | Until now we left applications to add the files to recent if they did modify them. This usually works, specially for gtk applications, but it doesn't work for applications using other toolkits. Recently, as we move towards a more containerized Nautilus with Flatpak the recent files set by other apps are not accessible, so we need to add them ourselves when opening in Nautilus. This work adds every file activated by other app from Nautilus be added as recent.
* mime-actions: Stop handling delete-eventErnestas Kulik2018-05-281-9/+0
| | | | | Docs say that a response signal is emitted automagically when such an event is received.
* general: Revert to allow running binaries and scriptsCarlos Soriano2018-05-211-7/+248
| | | | | | | | | | | | | | | | | | Recently we removed the ability to launch binaries and scripts in commit 3a22ed5b8e3bb. A few cases appeared that we need to support, specially for enterprise and content creators. Specifically, cases similar to https://gitlab.gnome.org/GNOME/nautilus/issues/434 This also shows that is hard to predict cases like these, as some complex setups might be needed for specific workflows. This commits allow to run binaries and scripts as before, and further investigation in these cases need to be done if we ever want to tweak the workflow of running binaries. More discussion about improving binaries/script handling is being proposed and discussed in https://gitlab.gnome.org/GNOME/nautilus/issues/443
* general: Clean up headers and their inclusionsErnestas Kulik2018-05-181-14/+9
| | | | | | | This commit removes redundant header inclusions and tries to optimize headers by using forward declarations of types in headers. Such optimization should generally make builds speedier in that changes in certain headers will not cause unrelated sources to be rebuilt.
* file: Remove link info attributeAntónio Fernandes2018-05-141-2/+1
| | | | Leftovers from NautilusLink removal.
* general: Don't allow launching binaries or programs in generalCarlos Soriano2018-05-091-404/+7
| | | | | | | | | | | | | | | | | | | | | | For long we used to support that since the desktop was part of Nautilus. Also, back then we didn't have a Software app where you are expected to installs apps. Back then it was common for apps to be delivered in a tarball, nowadays that's out of question. Now that the desktop is long gone, launching binaries and desktop files from within Nautilus is not as useful. Not only that, but we are moving towards a more sandboxed system, and we should use the standard and system wide support for launching apps based on users choices. We also are not able to be secure enough to handle this, as we saw in the past we allowed untrusted binaries to be launched, and therefore we had a CVE (CVE-2017-14604) for Nautilus. We are not being audited (afaik) and we are not in a position that we can let this issues slip. With that altogether, this prevents launching binaries or programs from Nautilus. Closes: https://gitlab.gnome.org/GNOME/nautilus/issues/184
* files-view: Remove obsolete constantsCarlos Soriano2018-05-091-4/+0
|
* Change show_error_dialog() to show_dialog()George Mocanu2018-04-231-7/+16
| | | | | Changed show_error_dialog() to show_dialog() so that multiple dialog types can be used.
* Revert "Merge remote-tracking branch 'upstream/master'"Carlos Soriano2018-04-231-16/+7
| | | This reverts commit 1f4bd55d1b9d5f701f2df8d1be7466df85a8669a
* Change show_error_dialog() to show_dialog()George Mocanu2018-04-231-7/+16
| | | | | Changed show_error_dialog() to show_dialog() so that multiple dialog types can be used.
* properties-window: Don't use eel_show_error_dialogGeorge Mocanu2018-03-311-7/+9
| | | | | | | Instead of using eel_show_error_dialog, use the show_error_dialog function from nautilus-ui-utilities.h header. https://gitlab.gnome.org/GNOME/nautilus/issues/331
* general: don’t shadow variablesErnestas Kulik2018-03-011-1/+2
| | | | | | | Shadowing variables is error-prone, since one might mean to refer to a variable that was declared earlier, but has the same name. Additionally, being more strict about variable scoping can help make the code more readable.
* general: Run uncrustifyCarlos Soriano2018-02-131-1/+1
|
* mime-actions: Add DjVu mime type as PDFCarlos Soriano2017-11-211-0/+1
| | | | | Seems there is a new mime type for DjVu, more information at https://bugzilla.gnome.org/show_bug.cgi?id=754467
* mime-actions: Add Microsoft mime typesCarlos Soriano2017-11-211-0/+4
| | | | | | | | | Seems they are using some custom mime types for Microsoft Office. They can be found at https://blogs.msdn.microsoft.com/vsofficedeveloper/2008/05/08/office-2007-file-format-mime-types-for-http-content-streaming-2/ This commits adds them. Fixes #128
* mime-actions: null-check app infoErnestas Kulik2017-08-111-3/+6
| | | | | | | | When deciding on the activation action, the code checks if Nautilus is the default handler for archives. There are cases when the returned application info is invalid, e.g. for application/octet-stream. https://bugzilla.gnome.org/show_bug.cgi?id=786168
* general: Add mime type support for archivesCarlos Soriano2017-08-091-5/+9
| | | | | | | | | | | | | | | Until now archives were managed only if activated from Nautilus itself and if a setting was set. There are two main problems with this. 1- Archives opened in other apps cannot be handled by Nautilus 2- Users cannot use the regular mime type handling for setting Nautilus as the app handling archives, or unsetting it. This patch add support for archives mime types handled by gnome-autoar and removes the UI and setting used in the previous version. https://bugzilla.gnome.org/show_bug.cgi?id=771424
* mime-actions: check for valid error before dereferencingErnestas Kulik2017-05-131-1/+1
| | | | | | | After launching a URI, the code checks if the operation has been canceled, but does not check if the error pointer is valid. https://bugzilla.gnome.org/show_bug.cgi?id=781132