[PATCH] new CloseWindow and CloseDocument KStandardGuiItems

David Faure faure at kde.org
Fri Jan 16 17:46:01 GMT 2009


On Thursday 15 January 2009, you wrote:
> hi dave.
> > Patch looks good. Add @since 4.3 in the documentation for the two methods please.
> ok thx i will update the patch in the next days..

OK.

> > Do you also plan on patching the applications to use those guiitems?
> Well i only created the patch to change the button in konqueror which 
> annoyed me and am not sure if i should do that or if i should take 
> that discussion to the usability lsit?

I have now read bug 80981 to understand the context better.
I agree that renaming Quit to "Close Window" is a good idea, since it's much
more descriptive of what the action is about. But then all applications which
currently connect the Quit action to close() should be ported to CloseWindow.

[the alternative would be to change the text for "Quit", but this assumes that
100% of the kde applications were following the styleguide and calling close()
rather than quit(), and I think we can't make that assumption. Ah and in fact
Quit is used by system tray icons, where it really quits.].

OK so IMHO the next step is clear: adding CloseWindow to, hmm, you were talking
about KStandardGuiItem, which is useful for buttons in dialogs (like that konq patch
in 80981 for the confirmation dialog, ok) ... but more importantly we need this in 
KStandardAction too, I think. The action (menu item) needs to be fixed as well,
to say File / Close Window rather than File / Quit in those applications where
the action indeed closes the window (like in konqueror). Let's see which other
apps need porting to a KStandardAction::CloseWindow:

kdebase/workspace/systemsettings/mainwindow.cpp: 208:             KStandardAction::Quit, [connected to close]
kdebase/workspace/kmenuedit/kmenuedit.cpp: 83:     actionCollection()->addAction(KStandardAction::Quit, this, SLOT( close() ));
kdebase/workspace/kcontrol/kfontinst/apps/Viewer.cpp: 52:         actionCollection()->addAction(KStandardAction::Quit, this, SLOT(close()));
kdebase/runtime/khelpcenter/mainwindow.cpp: 230:     actionCollection()->addAction( KStandardAction::Quit, this, SLOT( close() ) );
kdebase/apps/kwrite/kwritemain.cpp: 171:   actionCollection()->addAction( KStandardAction::Quit, this, SLOT(close()) )
kdebase/apps/konqueror/src/konqmainwindow.cpp: 3558:   actionCollection()->addAction( KStandardAction::Quit, "quit", this, SLOT( close() ) );
(but not the one in kdebase/workspace/kcontrol/randr/krandrtray.cpp for instance, since that's a system tray icon)

kdepim/kitchensync/src/mainwindow.cpp:55: actionCollection()->addAction( KStandardAction::Quit, this, SLOT( close() ) );
kdepim/kontact/src/mainwindow.cpp:415:  actionCollection()->addAction( KStandardAction::Quit, this, SLOT(slotQuit()) ); // which calls close
(but not kdepim/kalarm/traywindow.cpp nor kdepim/korganizer/korgac/alarmdockwindow.cpp nor kmobiletools,
where Quit really quits the process).

And that's just for kdebase and kdepim, there are more in other modules. Sounds like a nice
"junior job", to keep going through the other modules and sorting out which Quit quit and which Quit close :-)

> Also, i don't have an SVN account yet.. but i do want to do more work 
> on kde apps

Sounds good :)

Unless someone here (I'm cc'ing kde-core-devel again) objects to File / Close Window,
can you come up with an additional patch for KStandardAction? I'll then commit
the changes to kdelibs (trunk) and we'll wait a bit until porting the apps in order to 
make sure that all developers using trunk get an updated kdelibs first.

-- 
David Faure, faure at kde.org, sponsored by Qt Software @ Nokia to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list