From kde-commits Tue Feb 08 00:44:41 2005 From: Jens Dagerbo Date: Tue, 08 Feb 2005 00:44:41 +0000 To: kde-commits Subject: kdevelop/src Message-Id: <20050208004441.F27B41CFB7 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=110782353930967 CVS commit by dagerbo: When the toolbars are updated, the GUI is recreated.. so we need to reapply our workarounds. BUG: 95758 M +2 -2 kdevelopui.rc 1.67 M +37 -18 newmainwindow.cpp 1.34 M +3 -1 newmainwindow.h 1.13 --- kdevelop/src/kdevelopui.rc #1.66:1.67 @@ -1,4 +1,4 @@ - + &File @@ -112,5 +112,5 @@ - + --- kdevelop/src/newmainwindow.cpp #1.33:1.34 @@ -47,4 +47,5 @@ #include #include +#include #include "kdevplugin.h" @@ -107,4 +108,5 @@ NewMainWindow::NewMainWindow(QWidget *pa m_raiseEditor->setWhatsThis(i18n("Raise editor

Focuses the editor.")); + KStdAction::configureToolbars( this, SLOT(configureToolbars()), actionCollection(), "set_configure_toolbars" ); //@fixme why is this part of KDevMainWindow? @@ -141,21 +143,5 @@ void NewMainWindow::init() { delete m_pWindowMenu; - // get the xmlgui created one instead - m_pWindowMenu = static_cast(main()->child( "window", "KPopupMenu" )); - - if( !m_pWindowMenu ) - { - kdDebug(9000) << "Couldn't find the XMLGUI window menu. Creating new." << endl; - - m_pWindowMenu = new QPopupMenu( main(), "window"); - menuBar()->insertItem(i18n("&Window"),m_pWindowMenu); - } - - actionCollection()->action( "file_close" )->plug( m_pWindowMenu ); - actionCollection()->action( "file_close_all" )->plug( m_pWindowMenu ); - actionCollection()->action( "file_closeother" )->plug( m_pWindowMenu ); - - QObject::connect( m_pWindowMenu, SIGNAL(activated(int)), this, SLOT(openURL(int )) ); - QObject::connect( m_pWindowMenu, SIGNAL(aboutToShow()), this, SLOT(fillWindowMenu()) ); + setupWindowMenu(); menuBar()->setEnabled( false ); @@ -212,4 +198,16 @@ void NewMainWindow::init() { } +void NewMainWindow::configureToolbars( ) +{ + kdDebug() << k_funcinfo << endl; + + KEditToolbar dlg( factory() ); + if ( dlg.exec() ) + { + setupWindowMenu(); + createGUI( PartController::getInstance()->activePart() ); + } +} + void NewMainWindow::tabContext(QWidget* widget,const QPoint & pos) { @@ -330,4 +328,25 @@ void NewMainWindow::openURL( int id ) } +void NewMainWindow::setupWindowMenu( ) +{ + // get the xmlgui created one instead + m_pWindowMenu = static_cast(main()->child( "window", "KPopupMenu" )); + + if( !m_pWindowMenu ) + { + kdDebug(9000) << "Couldn't find the XMLGUI window menu. Creating new." << endl; + + m_pWindowMenu = new QPopupMenu( main(), "window"); + menuBar()->insertItem(i18n("&Window"),m_pWindowMenu); + } + + actionCollection()->action( "file_close" )->plug( m_pWindowMenu ); + actionCollection()->action( "file_close_all" )->plug( m_pWindowMenu ); + actionCollection()->action( "file_closeother" )->plug( m_pWindowMenu ); + + QObject::connect( m_pWindowMenu, SIGNAL(activated(int)), this, SLOT(openURL(int )) ); + QObject::connect( m_pWindowMenu, SIGNAL(aboutToShow()), this, SLOT(fillWindowMenu()) ); +} + void NewMainWindow::fillWindowMenu() { --- kdevelop/src/newmainwindow.h #1.12:1.13 @@ -99,4 +99,6 @@ private slots: void tabContext(QWidget*,const QPoint &); void tabContextActivated(int); + void configureToolbars(); + void setupWindowMenu(); // void loadMDISettings();