You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, April 22nd 2004, 9:24am

mount & KDE

Hallo everybody,

I configured my KDE (3.2) to mount/umount devices by shortcuts (e.g. floppy is mounted by alt-f, umounted by alt-shift-f). I set it in the kcontrol centre; to do it, "raw" mount command is called. (like ctrl-f --> mount /mnt/floppy).

But KDE contains quiet nice dialog about mount process. Moreover, the dialog can show message if mount fails or device is impossible to umount.

Is there any way existing, how to call mount/umount by the same shorcuts but instead of "mount", call the dialog? It would be very good for me, as I can not notify mount success/fail by "mount" call, and I like these shortcuts very much.

Thank you very much.

Dan


BTW. Does anybody know, why the mount dialog contains mount progress but the progress never changes? :-)

seb

Professional

Posts: 622

Location: Sydney

Occupation: Student

  • Send private message

2

Thursday, April 22nd 2004, 10:45am

you could write a short shell script which does it all for you.

I tried to do it for you, but i didn't know how to make a "passive" kdialog box. Its seemed pretty difficult too, looking at the kopete source code.

[/code]

3

Friday, April 23rd 2004, 8:37am

That is true, I already thought about it. I can test value returned by "mount", but how can I show "... mount failed ..." dialog to notify it? It seem to be simillar problem as before :-)

A possible solution (mabye?) would be to write short KDE application, e.g. kmount which calls the same methods as are called from menu -> mount (the menu of device icons on the desktop -- if you know, what I think). But I do not know, if KDE contains such a class/methods, not "hardwired" deep into KDE sources (but it should contain such a class for the use in other KDE applications, or am I wrong?)

m4ktub

Intermediate

Posts: 257

Location: Lisbon, Portugal

Occupation: Software Engineer

  • Send private message

4

Friday, April 23rd 2004, 11:51am

The class as you describe exists:
KAutoMount
KAutoUnmount

If you just whant to show a dialog with the result of the operation you can use kjscmd. Have a file like:
[code:1]#!/usr/bin/env kjscmd

var mountDialog = Factory.loadui('mountdialog.ui');
var resultLabel = mountDialog.child('resultLabel');

if (application.args.length > 0) {
var message = application.args[0];
resultLabel.text = message;
}

mountDialog.show();
application.exec();
[/code:1]
and then call it like
[code:1]./dialog "My message"[/code:1]

The dialog is not passive. That would require KPassivePopup suport (wich i think that KJS does not have).