Bug 371837 - Dolphin General option "Executing scripts or desktop files" doesn't let you choose between "execute" and "open".
Summary: Dolphin General option "Executing scripts or desktop files" doesn't let you c...
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.08.2
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
Depends on:
Reported: 2016-10-29 18:24 UTC by Russell
Modified: 2019-09-29 16:28 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.12.0
kde: Usability?

Suggested improvement for executable file select default behavior (5.77 KB, image/jpeg)
2016-11-11 12:04 UTC, Russell
suggestion for behavior page (50.38 KB, image/png)
2016-11-11 17:24 UTC, Don Nguyen

Note You need to log in before you can comment on or make changes to this bug.
Description Russell 2016-10-29 18:24:02 UTC
The option "Executing scripts or desktop files" can not be unchecked.  


1. Open Dolphin
2. Go to: Settings -> Configure Dolphin -> General -> Confirmations -> "Executing scripts or desktop files"
3. Uncheck option
4. Click Apply
5. Click Ok
6. Again go to: Settings -> Configure Dolphin -> General -> Confirmations -> "Executing scripts or desktop files" 
7. The option is checked. I expected it to be unchecked.

There are 4 checkboxes on the Confirmations tab, and this is the only one that has the problem.  I found this problem when I clicked a file to select it so I could use the down/up arrow key to maneuver in the directory. That is when I got a popup with the text, "What do you wish to do with this executable file". I didn't expect this popup and don't want it.  I am assuming the option "Executing scripts or desktop files" is controlling the popup.
Comment 1 Elvis Angelaccio 2016-10-30 18:41:53 UTC
I can reproduce, thanks for reporting.
Comment 2 Don Nguyen 2016-11-11 01:49:14 UTC
The problem is in  ConfirmationsSettingsPage::applySettings()
It is only saving the setting if the setting is checked, but not doing anything if it's unchecked.  Unlike it's neighboring settings, it's not being saved as a simple on/off so I don't know how to deal with it.  I need to look into how this setting is being used and find an appropriate value to set when the checkbox is off.
Comment 3 Don Nguyen 2016-11-11 03:12:57 UTC
The reason why you can't simply uncheck the box is because you need to specify the behavior you want if you don't want the confirmation.  When you click on a script, you will get the text, "What do you wish to do with this executable file?", and you have the option to "Open" or "Execute".  In that same dialog there is an option "Do not ask again".  If you check that box, and choose "Open" or "Execute", it will no longer ask for confirmation, and always perform the action that you choose - either "Open" or "Execute".  This will also turn off the "Executing scripts or desktop files" setting.  The problem is if that setting is on, and you turn it off, we don't know what you want to do with the script - "Open" or "Execute".  If you don't want to the confirmation, you'll somehow have to specify if you want to "Open" or "Execute".  I'm not sure what's the best way to fix this.  The setting really should be "Always Execute, Always Open, or Always Ask".
Comment 4 Russell 2016-11-11 12:04:26 UTC
Created attachment 102167 [details]
Suggested improvement for executable file select default behavior

The "Executing scripts or desktop files" option only turns the confirmation
dialog on --- resets it, but only the confirmation dialog can turn itself off. 
Unchecking the checkbox on the Confirmations tab does nothing. And this is done 
to capture the default behavior when someone clicks an executable file.

I see a couple of issues:
1. The remembered behavior is not visible, so the user doesn't know what it is.
2. If the user changes the option (was on, turns off or visa versa), but the 
   user hasn't clicked an executable to get the dialog, the behavior is in
   some sort of a limbo state until the user clicks an executable and selects a 
   default behavior.

A suggested improvement would be to make the default behavior visible on the
"Behavior" tab.  The "Executing scripts or desktop files" confirmation dialog 
would just be a dialog and the user could turn on/off via the checkbox.
Please see the attached image for a simple example.
Comment 5 Don Nguyen 2016-11-11 17:24:12 UTC
Created attachment 102172 [details]
suggestion for behavior page
Comment 6 Don Nguyen 2016-11-11 17:27:03 UTC
Comment on attachment 102172 [details]
suggestion for behavior page

My suggestion is to remove the setting from the confirmations page and instead add a new section to the behaviors page to set the behavior for executable scripts and desktop files from:  Always Ask, Open, Execute
Comment 7 Don Nguyen 2016-11-12 00:15:34 UTC
The reason why I suggest to do it this way is because dolphin activates the file via KRun(KIO) which uses a "behaviourOnLaunch" setting where the valid values are "alwaysAsk", "open", and "execute".  This implementation is a direct mapping to that.  Another reason to do it this way is so that that setting isn't split into two places - "Behavior", and "Confirmation".  If we go with the two separate places, we would then also have to make changes to how that setting is captured.  This would require a lot more changes.
Comment 8 Thomas Pfeiffer 2017-01-14 16:09:25 UTC
From the usability perspective, Don Nguyen's suggestion to implement a three-option radio group is the only sensible solution, so please go with that.
Comment 9 Wolfgang Bauer 2018-09-18 13:01:55 UTC
The original problem should be fixed meanwhile (in the upcoming 18.08.2), the setting should stick:

It's still not possible to choose between opening and executing though.
Comment 10 Nate Graham 2018-09-18 13:32:09 UTC
Before we add more options, I'd like to see this setting removed from Dolphin and put in System Settings, which is the correct place for a global setting for KIO. This is tracked by Bug 376992.

*** This bug has been marked as a duplicate of bug 398022 ***
Comment 11 Elvis Angelaccio 2019-09-24 20:31:49 UTC
Reopening and updating the title. It is still not possible to choose between "execute" and "open". See also https://phabricator.kde.org/T9932
Comment 12 Nate Graham 2019-09-29 16:28:05 UTC
Git commit 983273924d2887cdccdd7c3618d332b52dc0dad6 by Nate Graham.
Committed on 29/09/2019 at 16:27.
Pushed by ngraham into branch 'master'.

Expose full set of script execution options in settings window

Right now the script execution setting is a checkbox, capable only of handling boolean
input. This is not appropriate because there are actually three options available.

Accordingly, this patch replaces the checkbox with a combobox (to save space compared
to radio buttons) that clearly exposes all three options.
FIXED-IN: 19.12.0

Test Plan:

- All three options do what they say they'll do
- All options get saved properly
- The combobox displays the correct option when the window is loaded
- The {nav Defaults} button resets it to "always ask" as expected

Reviewers: elvisangelaccio, #dolphin, #vdg

Reviewed By: elvisangelaccio, #dolphin

Subscribers: kfm-devel

Tags: #dolphin

Maniphest Tasks: T9932

Differential Revision: https://phabricator.kde.org/D24247

M  +40   -9    src/settings/general/confirmationssettingspage.cpp
M  +2    -1    src/settings/general/confirmationssettingspage.h