[Kstars-devel] KDE/kdeedu/kstars/kstars
Jason Harris
kstars at 30doradus.org
Mon Jun 9 07:17:32 CEST 2008
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 at 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<KToggleAction>( "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 @@
<Action name="show_focus_box" />
<Action name="show_location_box" />
</Menu>
- <Menu name="toolbars"><text>&Toolbars</text>
- <Action name="show_mainToolBar" />
- <Action name="show_viewToolBar" />
- <Separator />
- <Action name="configure_toolbars" />
- </Menu>
+ <Merge name="StandardToolBarMenuHandler" />
<Menu name="statusbar"><text>&Statusbar</text>
<Action name="show_statusBar" />
<Separator />
@@ -106,6 +101,8 @@
<Separator />
<Action name="geolocation" />
<Separator />
+ <Action name="options_configure_keybinding"/>
+ <Action name="options_configure_toolbars"/>
<Action name="configure" />
<Action name="startwizard" />
</Menu>
More information about the Kstars-devel
mailing list