This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to add Secure-delet to right click actions menu

Tags: None
(comma "," separated)
lcharles
Registered Member
Posts
2
Karma
0
In the add services menu in Dolphin I can have it install secure-delete. But it doesn't show up in the right click actions. I've installed secure-delete from the repositories and srm works from the command line. I've put the secure-delete.desktop and secure-delete_folder.destop script files in the ~ ./kde/share/kde4/services/ServiceMenus. But when I right click on a document file, for example, I don't get the 'Action" for secure-deletion. I do get Actions like "Preview this file". The code in one of the .desktop files is:

[Desktop Entry]
Encoding=UTF-8
Actions=Secure_remove;
Icon=clanbomber
ServiceTypes=all/allfiles
ExcludeServiceTypes=kdedevice/*

[Desktop Action Secure_remove]
Exec=`kdialog --caption "Secure Delete" --menu "Choose how:" "rm" "Delete only" "srm -l" "Fast and unsecure" "srm -f" "Slow and more secure" srm "Very slow and very secure"` %U
Icon=clanbomber
Name=Delete file(s) DEFINITELY!
Name[it]=Distruggi il file DEFINITIVAMENTE!

Thanks, lcharles
germanzorba
Registered Member
Posts
9
Karma
0
Just have mixed ServiceType with MimeType, the first is where the element should be (i.e. as a Konquereror plugin), and the second is the files it is intended for, with some minor changes i got it to work.

This one works Ok (as far as I can test, because I don't have srm instaled), I changed the icon because I don't have the one you are trying to use:

[Desktop Entry]
Type=Service
Encoding=UTF-8
# Add as a plugin for Konqueror and Dolphin
ServiceTypes=KonqPopupMenu/Plugin
# Name of the action or actions you are adding
Actions=Secure_remove;
# This icon here goes for the file this is written in
Icon=emblem-important
# Files the menu is intended for
MimeType=all/allfiles
# I don't know if there is a way to exclude file types


[Desktop Action Secure_remove]
# Action to be taken
Exec=`kdialog --caption "Secure Delete" --menu "Choose how:" "rm" "Delete only" "srm -l" "Fast and unsecure" "srm -f" "Slow and more secure" srm "Very slow and very secure"` %U
# This icon here goes for the menu entry
Icon=emblem-important
Name=Delete file(s) DEFINITELY!
Name[it]=Distruggi il file DEFINITIVAMENTE!
germanzorba
Registered Member
Posts
9
Karma
0
An alternative to the dialog box you created, is to create a submenu in the context menu: try this (as before, I haven't tested the srm code, I guess you can correct it if needed).

The X-KDE-Priority line is for the submenu appearing in the top-level context menu. If you remove that line, then the Secure Remove submenu will appear as a submenu of the Actions submenu. I think the rest is self-explanatory.

[Desktop Entry]
Type=Service
Encoding=UTF-8
ServiceTypes=KonqPopupMenu/Plugin
Actions=Delete_only;Fast_and_unsecure;Slow_and_more_secure;Very_slow_and_very_secure;
Icon=emblem-important
MimeType=all/allfiles
X-KDE-Priority=TopLevel
X-KDE-Submenu=Secure Remove
X-KDE-Submenu[it]=Distrugi Definitivamente
X-KDE-Submenu[es]=Borrado Definitivo

[Desktop Action Delete_only]
Icon=emblem-important
Exec=rm %U
Name=classic remove (rm)
Name[it]=rimozione classica (rm)
Name[es]=eliminación clásica (rm)

[Desktop Action Fast_and_unsecure]
Icon=emblem-important
Exec=srm -l %U
Name=light delete
Name[it]=distruzione leggera
Name[es]=borrado suave

[Desktop Action Slow_and_more_secure]
Icon=emblem-important
Exec=srm -f %U
Name=secure delete
Name[it]=distruzione assicuratta
Name[es]=borrado seguro

[Desktop Action Very_slow_and_very_secure]
Icon=emblem-important
Exec=srm %U
Name=definitive delete
Name[it]=distruggi definitivamente
Name[es]=borrado definitivo
lcharles
Registered Member
Posts
2
Karma
0
Thanks for the help. It turns out there was an additional problem which was addressed in the following link if anyone is interested.

http://kde-apps.org/content/show.php/Se ... tent=75734


Bookmarks



Who is online

Registered users: Bing [Bot], gfielding, Google [Bot], markhm, sethaaaa, Sogou [Bot], Yahoo [Bot]