From kde-core-devel Thu Dec 02 10:50:27 1999 From: Matthias Ettrich Date: Thu, 02 Dec 1999 10:50:27 +0000 To: kde-core-devel Subject: Re: About the KHelpMenu change (What's this) X-MARC-Message: https://marc.info/?l=kde-core-devel&m=94414543925089 On Thu, 02 Dec 1999, Espen Sand wrote: > This was added by ME last evening. > > QToolButton* wtb = QWhatsThis::whatsThisButton(0); > id = mMenu->insertItem( wtb->iconSet(),i18n( "What's &This" ) ); > mMenu->connectItem( id, this, SLOT( contextHelpActivated() ) ); > delete wtb; > mMenu->setAccel( SHIFT + Key_F1, id ); > > For me this is fine, but > > 1) Should this entry always be there? I think it would look pretty strange if > an app has this entry in the help menu but no "What's This" help anywhere. > I can add a flag in the KHelpMenu constructor that decides if this entry should > be used or not. Default on or off ?? Default on for now is a good idea. It reminds authors that they might want to add help. > > > 2) From the KHelpMenu docs: > > * Using your own "about application" dialog box: > * > * The standard "about application" dialog box is quite simple. If you > * need a dialog box with more functionality you must design that one > * yourself. When you want to display the dialog you can connect it to > * the help menu. Here are the steps you must follow: > * > * 1. Make a help menu object with no text argument. If the text is missing > * the default dialog box will not be displayed: > * mHelpMenu = new KHelpMenu( this ); > * > * 2. Make a slot method that launches your dialog: > * void slotShowAboutDialog( void ) > * > * 3. Connect the slot to the help menu: > * QPopupMenu *help = mHelpMenu->menu(); > * help->connectItem( 2, this, SLOT(slotShowAboutDialog()) ); > * > > We need to make sure the "About application" entry always gets an Id == 2. > This is not the case after the change last evening. I will fix this > later today (evening). > > I had planned to add, after crash, a signal in khelpmenu and a virtual slot > in ktmainwindow (showAboutApplication()) that will make this simpler. > Perhaps I should do this before crash? Yes, an API that requires an arbitrary number '2' is not how KDE should be designed like. Matthias