Thursday, March 06, 2008

click, drag ... eject! (oh, and logout)

These days you can run KDE apps natively on MacOS .. but that's not what I'm thinking about here. No, I'm thinking about a less recent Mac-related curio, circa 198x: my hand gently grasping the Mac-tethered mouse (cue the chuck-a-wa music here ;) and dragging the disc icon to the trash to eject it. Ooh yeah. Or when things went wrong, the slightly less romantic jabbing at the drive with a straightened paperclip to operate the manual eject mechanism.

While I many not get to relive the paper clip experience, we can do something for my drag-eject nostalgia! A few days back Marco Martin committed a change to the trash plasmoid he's written so that you can drag drives and discs from the Places view in Dolphin, the file open/save dialog, the Computer tab in kickoff, etc to the trash/recyle bin. Once dropped, the volume will be unmounted and, if applicable, the media is ejected.

It uses Solid, of course, to accomplish this: 7 lines of code plus 9 #include'd headers. (More headers than lines of code ... interesting.)

But I swear it's like stepping back to a time of fond childhood memories for me. Click .. drag .. eject! Yay! I may yet wear out the DVD drive on my laptop. ;)

Anyways, it tickled me so much that I just had to blog about it...

Also, since it's apparently all the rage to discuss how one can log out of KDE4, I figured I'd add to the mystery (?) and beauty (?!) of it all. KRunner (or, more accurately, the Sessions runner) understands the following commands: switch user, new session, logout, log out, restart, shutdown and lock. I'm sure you can guess what each one does.

43 comments:

GerbilSoft said...

I think it's a rather funny thing that you mention this feature, because a few years ago I submitted a bug report regarding this exact same thing:

https://bugs.kde.org/show_bug.cgi?id=101840


Although the bug was that dragging a CD to the trash resulted in KDE attempting to delete all the contents of the CD (which doesn't work, obviously), the bug was closed because ejecting a CD when dragged to the trash can is "completely brain damaged". (As opposed to trying to delete everything from the CD, of course.)

Anonymous said...

What about "suspend" and "hibernate"?

Richard Dale said...

I agree that dragging a disc onto the trash to eject is 'completely brain damaged', and I think it is a shame we are carrying on with design errors from 25 years ago. With Plasma we are finally getting rid of the crap 'Desktop metaphor' - hurrah! - but now this..

DanaKil said...

well, I always had fear to drag any removable device to the trash icon, and this could be the same for non-geek...

so it's not for me but some people may like it...

cheers

GaryGreene said...

Personally, I'm geeked that we've gained the option to unmount drives like Mac OS X :D

rufusD said...

I myself would think that dumping a drive would lead to it being entirely deleted, so I don't think using it as unmount is a good idea.
What about creating a "Me" plasmoid and using it to logout? Just dump Me (alternatively "My session") in the trash can?

Fabrice said...

Does KRunner understand the localised/translated versions of theses commands ? For example to shutdown my computer in french, can I say "éteindre" ? You seems to believe that most people speak english ... that's wrong.

Vide said...

Aaron, can you please then resolve as fixed this bug?

http://bugs.kde.org/show_bug.cgi?id=152110

Thanks for your great work on Plasma and KDE :)

Anonymous said...

On OS X the trash icon changes into an eject icon if you drag a drive over it. Might be worth considering for the plasmoid too?

Anonymous said...

I once requested this feature as well and was given a similar reply. Cheers to plasma!

I'm getting a Macbook soon anyway :)

p.s. I'm still keeping a KDE laptop as well!

Anonymous said...

drag a drive to the trash can to umount? that is not making any usability sense! oh does OSX have that feature? must be right a good thing then!

Anonymous said...

I don't use KDE 4.0 so I don't know whether it's already possible, but if it isn't you should definitely implement this:
Make it possible to delete/remove a plasmoid from any containment by dragging it to the trash.

Anonymous said...

Drag to Unmount & Eject ??, WTF !!!!!
This was Stupid 20 years ago,
and it's Damn Stupid Now !!!

Is this KDE ?? or friggin Mac-n-Slop

I can just see hordes of pissed off and confused users bitching at me, because all there data was deleted
"I just wanted to Unmount/Eject the Shared data folder...."

F%$#ing STUPID

I suppose you will want to revert to 1 Button Pointer devices now, or the o' so Intelligent concept of dragging Running applications to the trash can to Close/Exit them, as well ??

If I wanted a Broken Backwards-Ass MAC, I'd just Buy a Damn Mac !

Thank You, Very Little !!!!!!!!

"Completely Brain Damaged", Indeed !!!

firephoto said...

Even if it is the behavior on other operating systems it is a good method of removing media in a graphical way.

When you put something in the trash you remove it from it's current location and it is in the trash until you empty it or put it back. For removable media putting it in the trash removes the media from it's current location in the same way except it doesn't store anything in the trash since the media is a physical object. It's a great way to graphically represent what is actually happening in a way that takes a little effort to accomplish to avoid accidental removal even if it's not always the quickest or easiest method on all systems.

hook said...

I've written already a comment on Marco's blog (whom I respect otherwise), so I'll just be short here.

If drag-n-drop-into-trash unmounting gets into KDE, I beg of you to make it as an option ...and preferably one that is disabled by default, like the "MacOS-like menu bar" in KDE3.

Aaron J. Seigo said...

> I beg of you to make it as an option

why, how does it affect you negatively? have you ever dragged a volume to the trash can, and if so what did you expect it to do?

Leo S said...

Wow. What a set of entirely unreasonable responses. This is an additional OPTION people. This doesn't impede your current workflow in any way. All it does is give you another option to unmount a device. If you think it's dumb, don't drag your device there!

If someone gets confused and drags their shared folder to the trash, then it will, by definitiion, be trashed, not deleted. No harm done. That's the whole point of the trash is to offer undo for the destructive action of delete.

Anonymous said...

Hm, am I the only one who smiled when I read about this feature? :-)

Anonymous said...

"Drag to Unmount & Eject ??, WTF !!!!!" : This was my comment..

When you put Something into a Trash can, the Logical, and Intelligent conclusion is that you do Not Ever want to see/use/access/etc.. that thing Ever again, Trash = Temporary Delete (Pending Decision to Permanently Delete).

If you want to Unmount, and/or Eject a Device node, (Graphicly) it would be more logical to access the Options/Actions List (ie.. Right-Click on Icon) for that Mounted Device, and Select (Explicitly, so there are No Doubts about the Expected Action to be executed) the appropriate Functional Option to either Unmount, or Eject the device node.

Thank You !

Zarantu at gmail

Anonymous said...

While i started to use that "feature" in OSX & became to like it, I still remember the first time I used it - which happened with a rewritable CD: I first asked a colleague if I seriously should do this because I thought this would erase / format my disk :D

So how about, as one already suggested, making the trash bin making its icon change into an "eject" button if someone moves a removable / unmountable device over it? (Just to make it absolutely clear what will happen)

kwilliam said...

Good lord, what's the hullaballoo? It's not like people are going to be pissed when dragging their devices to the trash can doesn't reformat the device. If anything, they'll be like "Whew! Omg, that was close, sure glad it didn't delete my hard drive."

It's not like people are going to drag devices into trash cans anyway. The only thing I was aware of that could be put in the trash can is files and folders, and that is all people will continue to drag there unless 1) They *accidentally* drag a device, or 2) They are former Mac users. Sure, the paradigm is a little odd, but consider it a safety net for Mac users, who might drag devices to the trash out of habit.

hook said...

Well, let's assume not all users come from the world of the Apple Mac.

Thinks that I can think of someone would expect if dragging a mountpoint icon into the bin:
* delete the shortcut to the mountpoint
* delete the mountpoint itself (not the partition behind it!)
* delete/format the mounted device (e.g. CD/DVD-RW, HDD partition)
* (no, sorry, I cannot associate unmounting with a trash bin ...I would love to, but no go)

What's so bad for making this optional? I don't complain about the existence of the MacOS-like menu bar, and won't ...since it's an option. I'm not intending to complain about this either if it will/would be optional.

Here's a thought though (still not my style, but what the hell): Instead of a trash bin, there could be a door or a tree outside a window, or a unplugged plug or whatever to symbolise unmounting. Throwing my dist into the trash just doesn't make sense to me, however I bend it...

Or even better: Since Plasma handles desktop icons so they have more then one or two actions, it shouldn't be much of a hassle to have a corner of each mountpoint or device icon reserved (e.g. the bottom left one) for unmounting.

I'm just expressing my opinion on it and trying to be productive about it as well. I'm not trying to flame. I just try to point out at possible problems before they occur. I repeat myself: having it as an option is fine by me. Other then that I'm just trying to suggest ideas.

p.s. sorry, no, still can't imagine how throwing my disk or CD into the bin would make my brain think I'm unounting it. ...I really tried to imagine it.

Anonymous said...

I think dragging a volume to the trash to unmount/eject is a bad idea. From a usability standpoint, dragging an object to the trash is a single action, and so it should have a single function. Adding this context-sensitive switching is confusing and probably dangerous. How do I know whether it will delete or eject/unmount? What if I want to delete it instead of unmounting? I think it will confuse many users and cause people to accidentally delete things.

One possibility is to provide some sort of visual feedback when a user drags an object and hovers over the trash to indicate which action will occur when the object is dropped. However, most people probably do not hover long enough before dropping to even notice.

Jakob Petsovits said...

> Also, since it's apparently
> all the rage to discuss how
> one can log out of KDE4, I
> figured I'd add to the
> mystery (?) and beauty (?!)
> of it all. KRunner (or, more
> accurately, the Sessions
> runner) understands the
> following commands: switch
> user, new session, logout,
> log out, restart, shutdown
> and lock. I'm sure you can
> guess what each one does.

Hm... at first, I would have guessed that each of them opens the logout dialog, but, er... no. Probably not.

Vide said...

OMG!!!11! PONIES!111

ROTFL, people screaming "don't want to be a Mac" are just so hilarious...
I mean, this is an option that will NEVER occour to a KDE/Windows user, and it's nothing intrusive in the normal workflow, so why are you crying for vengeance? Calm it down and take it easy!

hook said...

I don't mind as much as it's optional. Just as much as the Windowsesque dialogue that pops up in KDE3 when a new block device is added, annoys me to death, I don't mind since I can turn it off (for certain devices).

Anyhoo ...too tired to argue or anything.

John Varouhakis said...

Lol , if you hadn't mentioned that, none
would have noticed but now it's another
"must be configurable, or KDE is
Gnome/Windows/MacOs/PonyOS" :)

OMG!!!PONIES!!!, indeed.

Anonymous said...

I rather like the idea of the trash can changing into an "Unmount" icon or something.

madfire said...

Would be nice to be able to drag current user's icon to the trash bin and he's .. ejected! I mean, logged out.

hawk said...

I like you are experimenting with new (well in KDE) ideas.

This is nice progress.

In my opinion the idea of dragging things could be used extensively all over the desktop.

For instance we could have a "visual representation" of the user session and we could allow the user dragging it to the trash bin.

We could have a "bomb applet" we draggable over not responding apps to kill them (like xkill does)...

We could drag a network connection...

Maybe the idea of having an "exit" drop pad along with the bin could make sense: if we extend drag to many new things, it could happen that we end up with an item that could be meaningful to drag on a trash bin or the exit pad. For instance we could delete an user (from the passwd file) dragging it to the trash. But we could "log out" (kill his session) dragging his icon to the exit pad.

Another example could be the dragging "this session" to the trash or to an exit pad. When you drag to the exit pad you "save the session" for new logins. When using the trash you "delete" the session...
and so on.

Does all the above make sense?

firephoto said...

This gets even more entertaining...

For those that want the option that allows you to not click and drag your mounts to your trash can... Well I hope you figured out where the option is by now. ;)

Aaron J. Seigo said...

"Windowsesque dialogue that pops up in KDE3"

yeah, no doubt. we disliked it so much that we got rid of it in kde4 ;)

Jared Kells said...

I hate how in windows how you can't wipe a cdrom. Some crap about being read only.

You USED to be able to do it in KDE by dragging the CD to the trash. Now the stupid thing just ejects.

Why get rid of such a great feature :(

MichaelG said...

Hi, this is OT but interesting nontheless: I would like to hear your thoughts on the fact that you can find C# bindings in kdebindings.

LXj said...

If I type "lock" in KRunner, it launches KWorldClock (KDE 4.0.61)

Anonymous said...

If I dragged a volume onto the trashcan I'd expect it to be deleted. After all the trashcan is for trash right?

DanaKil said...

I like drag n' drop too, but just keep in mind that do it with a touchpad is not very easy so there must be anothers easy alternatives

cheers :)

segedunum said...

I can remember that this totally brain dead and 'holier than though' feature was what turned by sister off Macs several years ago. Whenever she described the procedure for ejecting a CD by dragging the icon to the trash she would start touching her hair and the pitch of her voice would rise considerably. I still tease her by telling her my next laptop will be a Mac.

This is one of those Mac quirks that Apple thought was cool, but made ludicrous logical sense. The bug that gerbilsoft described above is the correct logical behaviour - you're trying to delete the contents of a CD or a drive if you drag it to the trash.

Surely, it's easier to have context menus on an icon where you can unmount/eject? I'm not saying this feature shouldn't be in, but that it just makes very, very, very little logical sense - if any at all.

cjc15153 said...

Further to Hawk's suggestion maybe a "drastic action" icon that changes with the item you choose. A volume is unmounted, a file is deleted, an application/plasmoid is killed. I think this still creates mental confusion because because linux treats volumes as directories, but if someone deletes all the subdirectories of their thumb drive at least the contents are still in the trash.

hook said...

Don't get me wrong ...I love the fact that KDE is developing itself, but I prefere it to go its own way that has a logic behind it.

Now here's a though:
what happens when I throw the "system" icon into the trash bin? Suspend? Poweroff? Format? Deletion of the icon?
Or a plasmoid showing pictures and name (taken from KAdressBook/Akonadi and DigiKam) of my girlfriend? Does it remove that plasmoid from my desktop, throw her pictures and contacts entry from my disk or send her a e-mail saying we're through?
I know, I know ...I'm taking this too far, but I just wanted to illustrate what could be completely legitimate ideas of what dragging something into a trash bin could mean to someone.

But I agree that we (including me) might have taken this too far. Sleeping over it and looking back, what we have is a feature that although we might not agree on its brilliance or idiocy, we can be proud of KDE4 — especially Solid and Marco — for being able to write something like that in under 20 lines of code! The simplest solution is to make this new trash behaviour optional; and the best one probably to make a usability research on how to handle such and similar events in a new and more userfriendly way (e.g. docks or corners to represent different behaviours).

This is just my 0.13 €

@aaron: I don't mind it being optional, but IMHO good riddance for that pop up horror! ;)

p.s. I love KDE, have so from the 90s on and don't see any reason to stop loving it ...that's also why I'm sometimes a bit vocal about possible (mis)features ;)

Marcel said...

Why has the black icon background not gotten fixed yet? Sorry to say, but...it looks so ugly! :\

I have stopped using desktop icons with KDE4 just because I can't stand the black background they draw.

Please, someone fix this bug asap.

Anonymous said...

Nice to see that people are discussing the issue constructively (for the most part).

I think the drag & eject is a bad idea.

The defenders say that if it's optional then you just ignore it. The problem is that this creates user support issues for folks who don't "get it". I have my mom on kubuntu, and if she finds out she can perform an unmount by dragging to the trash, I promise you that she'll get confused, and drag a folder on the USB to the trash, expecting the same behavior.

In this case, a poor legacy design choice should be allowed to die a quiet death. If folks have to have its functionality, perhaps a command-line option could be changed to enable it.

Nice work, btw, on KDE4. Bloody beautiful.

Dave Taylor said...

"why, how does it affect you negatively? have you ever dragged a volume to the trash can, and if so what did you expect it to do?"

I'll answer this on behalf of 'Hook' who seems to have taken your seemingly innocuous questions as an insult as I think that Hook's request is valid.

"why, how does it affect you negatively?"

Well it won't be Hook who is affected as he already knows that by doing this to a media icon he would get an inconsistent result to what any other icon would but he is thinking on behalf of other users who want to delete the contents of a drive and it just unmounts instead. Or even worse users who only know half of what happens and have contents trashed that they didn't want to happen.

"have you ever dragged a volume to the trash can"

This is irrelevant as he was thinking on behalf of others.

"what did you expect it to do?"

As expressed by so many others here to delete the contents of the drive as it seems consistent and logical.

I am most definitely with the crowd on this one in that illogical and inconsistent GUI nuances should not be allowed in even to mimic legacy designs from relatively unpopular desktops (by unopopular I mean that strictly in relative terms).