StatusBar in KMainWindow

Benjamin Meyer ben at meyerhome.net
Wed Mar 12 09:30:43 GMT 2003


I have made a few small changes to KMainWindow so that it can completely 
maintain the statusBar.  Below is the small patch.  I have tested it on 
applications that currently maintain the statusbar and those that don't.  In 
both cases it performed fine and didn't mess up the applications that handled 
it on there own.

  The purpose of this patch is to do two things:

1) Remove the duplication of code which is in most applications
- KStdAction::showStatusbar() variable
- Reading the default value of said statusBar
- The function that hides/shows the statusbar.

2) Lets KMainWindow know when it is hidden/shown fixing an annoying bug.

For an application to take advantage of these changes an application simply 
has to call KMainWindow::statusBar() before calling either 
createGUI();
setAutoSaveSettings();

The same can be done for the toolbar, but that would be a bit more dynamic 
based and would need to be done as the xml files are read in (sense there 
could be any number of toolbars with different names)

Feedback?  Good to commit?

-Benjamin Meyer

===================================================================
RCS file: /home/kde/kdelibs/kdeui/kmainwindow.cpp,v
retrieving revision 1.97
diff -r1.97 kmainwindow.cpp
880a881,882
>     if(internalStatusBar())
>       internalStatusBar()->setShown(d->isStatusBarShown);
947a950,953
>
>       KToggleAction *showStatusbar = KStdAction::showStatusbar(0, 0, 
actionCollection());
>       connect(showStatusbar, SIGNAL(toggled(bool)), sb, 
SLOT(setShown(bool)));
>       connect(showStatusbar, SIGNAL(activated()), this, 
SLOT(setSettingsDirty()));





More information about the kde-core-devel mailing list