From kstars-devel Mon Jun 09 05:17:32 2008 From: Jason Harris Date: Mon, 09 Jun 2008 05:17:32 +0000 To: kstars-devel Subject: [Kstars-devel] KDE/kdeedu/kstars/kstars Message-Id: <1212988652.188770.27108.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kstars-devel&m=121298920223045 SVN commit 818659 by harris: Fixing crash when closing the toolbar config dialog. I had been invoking KEditToolbar directly, but the API docs clued me in to the fact that this is not necessary. As long as I have an action named "options_configure_toolbars" in my XMLGUI file, then I don't need to do anything else. Apparently doing it manually is a bit worse than unnecessary, because the mysterious crash I had doing it manually is gone now. Actually, there's one more detail I needed to make the auto-code work. By looking at the code of other apps, I learned that I need to have setXMLFile("kstarsui.rc") and setupGUI(). It sure would be nice if we had some up to date documentation on how this XMLGUI stuff is supposed to work... CCMAIL: kstars-devel@kde.org M +0 -5 kstars.h M +0 -12 kstarsactions.cpp M +3 -3 kstarsinit.cpp M +3 -6 kstarsui.rc --- trunk/KDE/kdeedu/kstars/kstars/kstars.h #818658:818659 @@ -409,11 +409,6 @@ void slotApplyConfigChanges(); /** - *action slot: Configure toolbars - */ - void slotConfigureToolbars(); - - /** *action slot: Generate toolbars with new user-specified configuration */ void slotApplyToolbarConfig(); --- trunk/KDE/kdeedu/kstars/kstars/kstarsactions.cpp #818658:818659 @@ -344,18 +344,6 @@ } } -void KStars::slotConfigureToolbars() { - saveMainWindowSettings( KGlobal::config()->group( "MainWindow" ) ); - KEditToolBar ket(actionCollection()); - connect( &ket, SIGNAL(newToolBarConfig()), this, SLOT(slotApplyToolbarConfig()) ); - - //ket.exec(); - //DEBUG - if ( ket.exec() == QDialog::Accepted ) { - kDebug() << "KEditToolbar dialog returned Accepted"; - } -} - void KStars::slotApplyToolbarConfig() { //DEBUG kDebug() << "Recreating GUI..."; --- trunk/KDE/kdeedu/kstars/kstars/kstarsinit.cpp #818658:818659 @@ -268,9 +268,6 @@ ta->setText( i18n( "Show View Toolbar" ) ); QObject::connect(ta, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool))); - actionCollection()->addAction( KStandardAction::ConfigureToolbars, "configure_toolbars", - this, SLOT( slotConfigureToolbars() ) ); - //Statusbar view options ta = actionCollection()->add( "show_statusBar"); ta->setText( i18n( "Show Statusbar" ) ); @@ -484,6 +481,9 @@ ta->setToolTip( i18n("Toggle opaque ground") ); connect( ta, SIGNAL( triggered() ), this, SLOT( slotViewToolBar() ) ); + setXMLFile( "kstarsui.rc" ); + setupGUI(); + if (Options::fitsSaveDirectory().isEmpty()) Options::setFitsSaveDirectory(QDir:: homePath()); } --- trunk/KDE/kdeedu/kstars/kstars/kstarsui.rc #818658:818659 @@ -89,12 +89,7 @@ - &Toolbars - - - - - + &Statusbar @@ -106,6 +101,8 @@ + + _______________________________________________ Kstars-devel mailing list Kstars-devel@kde.org https://mail.kde.org/mailman/listinfo/kstars-devel