Review Request 120171: Add option to allow execution as well as opening of scripts and desktop files

Arjun AK arjunak234 at gmail.com
Sat Oct 18 19:11:20 BST 2014



> On Sept. 18, 2014, 1:55 a.m., David Faure wrote:
> > Yep, this could go into KIO for sharing between file managers.
> > 
> > I'm not sure how/where though; probably KRun. But the real question is whether the config should be shared between apps or not.
> > It's easier to code, but it might be better to let each app handle the configuration part of it, otherwise we have more weird "shared settings which don't belong in any app's KCM because it's unexpected that they affect all apps", right?
> > 
> > 
> > Well, one solution is using KGlobal::config() (KSharedConfig::openConfig in KF5) in KRun and letting apps write to that.
> 
> Arjun AK wrote:
>     But if 'KRun::setRunExecutables()' is set to true, then the file should definitely be executed. If not, it should be opened in another app. In either of these cases, there is no point in prompting the user on what to do with the file, since we have already specified that.
> 
> David Faure wrote:
>     OK, so one layer above that. A new class, say KIO::ScriptLauncher class (deriving from QObject), which takes care of showing an internal dialog if necessary, in a NON-MODAL way (unlike the current code), and to call a slot in the script launcher class which takes care of doing what the user chose -- i.e. basically the equivalent of DolphinMainWindow::openExecutableFile, but split into a constructor and a slot, so that apps are not forced to use a modal dialog. Plasma developers will appreciate this very much. Then dolphin can be ported to "new KIO::ScriptLauncher". (auto-deletion after use, like jobs and like KRun, is probably the best way of doing it)
>     
>     Ah this functionality includes desktop files, it seems? Then maybe not "Script" but "ExecutableFileLauncher" to keep your current naming. But to the unaware reader it sounds like the way to launch any program, while it's specific to executable *text* files....
>     ExecutableTextFileLauncher ?
> 
> Arjun AK wrote:
>     How about having a `KRun::promptUser(bool)` function, which defaults to false, but if set shows the dialog box? But if you move it to KIO, how do you handle "Do not ask again" checkbox?
> 
> David Faure wrote:
>     I would much rather see something non modal (as I said, for plasma), and separated (KRun is getting a bit bloated).
>     
>     KIO and other frameworks have plenty of "do not ask again"; indeed the setting is just global across all apps in general, but that's easily fixed with a dontAskAgain name like "run_executables_" + QCoreApplication::name()

> and separated (KRun is getting a bit bloated).

Do we really need an entirely new class that does the exact same thing as KRun with the only difference being that it shows a dialog?


- Arjun


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120171/#review66782
-----------------------------------------------------------


On Sept. 16, 2014, 3:42 a.m., Arjun AK wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120171/
> -----------------------------------------------------------
> 
> (Updated Sept. 16, 2014, 3:42 a.m.)
> 
> 
> Review request for Dolphin, KDE Usability and David Faure.
> 
> 
> Bugs: 275405
>     http://bugs.kde.org/show_bug.cgi?id=275405
> 
> 
> Repository: kde-baseapps
> 
> 
> Description
> -------
> 
> This patch allows the user to execute (in background, within the embedded terminal, external terminal) or open an executable file (scripts, desktop files...). When the user clicks on an executable file, a [dialog](https://git.reviewboard.kde.org/media/uploaded/files/2014/09/12/0fa53887-666f-4121-9ec6-9f323d633d03__dialog.png) pops up which contains options to either open it or execute it. Clicking on execute runs the program in the background (dolphin's current behaviour).
> 
> The [settings dialog](https://git.reviewboard.kde.org/media/uploaded/files/2014/09/12/cd4d14d3-dd82-4c2c-8c0a-c2a428c78903__settings.png) has further options to fine-tune how the file is executed. The program can either be executed in the background or inside the embedded konsole or in an external terminal.
> 
> In case there is a process already running in the embedded terminal, with [user's permission](https://git.reviewboard.kde.org/media/uploaded/files/2014/09/12/c5d7843a-099a-43d4-a2e1-6ce429623866__replace.png) it will be terminated and the selected program will be started.
> 
> 
> See also:
> https://git.reviewboard.kde.org/r/118939/
> 
> 
> Diffs
> -----
> 
>   dolphin/src/views/executablefileopendialog.cpp PRE-CREATION 
>   dolphin/src/dolphinviewcontainer.cpp a11ba42 
>   dolphin/src/settings/dolphin_generalsettings.kcfg 849a9c7 
>   dolphin/src/settings/general/behaviorsettingspage.h 7a9c2f0 
>   dolphin/src/settings/general/behaviorsettingspage.cpp cbbde1d 
>   dolphin/src/views/executablefileopendialog.h PRE-CREATION 
>   dolphin/src/CMakeLists.txt 6f256a2 
>   dolphin/src/dolphinmainwindow.h 9d4c003 
>   dolphin/src/dolphinmainwindow.cpp 95b08af 
>   dolphin/src/dolphinviewcontainer.h 31612f1 
> 
> Diff: https://git.reviewboard.kde.org/r/120171/diff/
> 
> 
> Testing
> -------
> 
> 
> File Attachments
> ----------------
> 
> Dialog
>   https://git.reviewboard.kde.org/media/uploaded/files/2014/09/12/0fa53887-666f-4121-9ec6-9f323d633d03__dialog.png
> settings
>   https://git.reviewboard.kde.org/media/uploaded/files/2014/09/12/cd4d14d3-dd82-4c2c-8c0a-c2a428c78903__settings.png
> Replace current program
>   https://git.reviewboard.kde.org/media/uploaded/files/2014/09/12/c5d7843a-099a-43d4-a2e1-6ce429623866__replace.png
> 
> 
> Thanks,
> 
> Arjun AK
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20141018/c3199359/attachment.htm>


More information about the kfm-devel mailing list