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

Wednesday, December 17th 2003, 4:31pm

Kontact Problem

This is a sort of nitpicky thing. I now have kontact up and running well, but I still want to be able to type kmail --composer at the command line so I can write an email even when I am not looking at kontact. When I type "kmail --composer" I get the following msg:

"Only one instance of KMail can be run at any one time. It is already running with PID 1777 on host linux according to the lock file located at /home/lawrencegoodman/.kde/share/apps/kmail/lock."

Is there any way to stop Kontact from creating the lock file or altering the lock file so it doesn't keep me from doing this. Maybe there is another way of running Kmail so Kontact won't care.

Thanks for the help/thoughts.
Lawrence

m4ktub

Intermediate

Posts: 257

Location: Lisbon, Portugal

Occupation: Software Engineer

  • Send private message

2

Thursday, December 18th 2003, 10:56am

That is strange because I think I have done that in 3.1.4 with kmail running and it didn't complain. Maybe you should post a bug or check if now we are supposed to do something like kontact --composer.

I can only check this later.

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

3

Thursday, December 18th 2003, 10:59am

If you have kmail running, you can open a composer window with DCOP.
You can even prefill some fields.

#> dcop kmail default openComposer "" "" "" "" "" 0 ""
opens an empty composer

#> dcop kmail default openComposer "toaddress@somewhere.com" "" "" "DCOP rules" "" 0 ""

opens composer with To address and subject already set

Cheers,
_
Qt/KDE Developer
Debian User

m4ktub

Intermediate

Posts: 257

Location: Lisbon, Portugal

Occupation: Software Engineer

  • Send private message

4

Thursday, December 18th 2003, 11:29am

dcop scripting can be really helpfull but there isn't much documentation around (I can be missing something).
Sometime ago there was a post about how to lock the screen from the shell. Again the solution was dcop.

Is there any standard way of knowing what can be used from an aplication? I have already used kdcop.
If an appliation provides dcop hooks why do they make them "secret"? (ATTENTION: kde API and development philosophy illiterate)

5

Thursday, December 18th 2003, 12:30pm

Thanks for the help, but I am still having trouble. I shoudl have mentioned this but I am using KDE 3.1 and the preliminary source version of Kontact (not the one that comes with KDE 3.2).

Here's what happens:
I type :
dcop kmail default openComposer "" "" "" "" "" 0 ""
I get the following msg:
object not accessible

I type:
dcop kmail default openComposer "toaddress@somewhere.com" "" "" "DCOP rules" "" 0 ""
I again get the msg "object no accessible."

I am a newbie so perhaps I am not typiing this in exactly correctly, but I was also unaware of an openComposer command after kmail. I thought it was just "--composer." Thanks!

6

Thursday, December 18th 2003, 1:19pm

So this is a rather inelegant, newbie kind of fix to this problem:

The problem is this file: ~/.kde/share/apps/kmail/lock
Kmail/Kontact evidently creates this file every time it boots up and inside assigns Kmail a prcoess number.

What I did is just change the permissions on the file so it belonged to root. Kontact can't write the file when it boots up so I'm free to run multpiple versions of Kmail.

Not sure why, but it's working for now. I know it's not the best solution, but what the heck.

Lawrence

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

7

Saturday, December 20th 2003, 8:33am

Quoted

Original von lawrencegoodman

Thanks for the help, but I am still having trouble. I shoudl have mentioned this but I am using KDE 3.1 and the preliminary source version of Kontact (not the one that comes with KDE 3.2).

Here's what happens:
I type :
dcop kmail default openComposer "" "" "" "" "" 0 ""
I get the following msg:
object not accessible


Hmm, maybe the name is different.
#> dcop
will list all DCOP enabled applications currently available, perhaps the name of KMail has changed.

#> dcop processname
lists all interfaces available from this application, one is usually calles default, so it can be accessed through "default" and through its name.

#> dcop processname interfacename
lists all functions available in the interface.
Each function has some parameters, QString means you can use any text within "", int is a number and, as in openComposer, KURL can be set like a QString.

There is a grafical tool called kdcop to browse applications DCOP interfaces.

Quoted


I am a newbie so perhaps I am not typiing this in exactly correctly, but I was also unaware of an openComposer command after kmail. I thought it was just "--composer." Thanks!


Both are ok. --composer is a commandline option to the kmail executable, passed to it on startup.
dcop can be used to communicate with an application that is already running.

Quoted


Not sure why, but it's working for now. I know it's not the best solution, but what the heck.


Could corrupt your mail files/folders if both kmail instances try to access them at the same time.

Cheers,
_
Qt/KDE Developer
Debian User

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

8

Saturday, December 20th 2003, 8:42am

Quoted

Original von m4ktub

Is there any standard way of knowing what can be used from an aplication? I have already used kdcop.

Currently only through looking by yourself, with kdcop for example.

Quoted


If an appliation provides dcop hooks why do they make them "secret"? (ATTENTION: kde API and development philosophy illiterate)


Unfortunatel there is currently no documentation of applications' DCOP interfaces other then the documentation in the header files.

I am sure any effort in this direction will be highly welcomed.
One would need the applications sources and look into any header file which contains the "k_dcop" keyword.
The functions are usually documented but in style for developers :(

Cheers,
_
Qt/KDE Developer
Debian User