Commit 0be6cdae authored by Robert Lancaster's avatar Robert Lancaster Committed by Jasem Mutlaq

Fix toggle of WI Tool from context menu

parent d04024af
......@@ -637,6 +637,7 @@ void KSPopupMenu::addFancyLabel(QString name, int deltaFontSize)
void KSPopupMenu::slotViewInWI(){
if(!KStars::Instance()->map()->clickedObject())
return;
KStars::Instance()->slotShowWIView();
if(!KStars::Instance()->isWIVisible())
KStars::Instance()->slotToggleWIView();
KStars::Instance()->wiView()->inspectSkyObject(KStars::Instance()->map()->clickedObject());
}
......@@ -518,8 +518,8 @@ class KStars : public KXmlGuiWindow
/** action slot: open What's Interesting settings window */
void slotWISettings();
/** action slot: open What's Interesting window */
void slotShowWIView();
/** action slot: toggle What's Interesting window */
void slotToggleWIView();
//#endif
private slots:
......
......@@ -507,9 +507,9 @@ void KStars::slotWUT()
void KStars::slotWISettings()
{
if (!m_WIView)
slotShowWIView();
slotToggleWIView();
if (m_WIView && !m_wiDock->isVisible())
slotShowWIView();
slotToggleWIView();
if (KConfigDialog::showDialog("wisettings"))
{
......@@ -530,7 +530,7 @@ void KStars::slotWISettings()
m_WIEquipmentSettings->setAperture(); //Something isn't working with this!
}
void KStars::slotShowWIView()
void KStars::slotToggleWIView()
{
if (!m_WIView)
{
......
......@@ -438,7 +438,7 @@ void KStars::initActions()
//FIXME Port to QML2
//#if 0
actionCollection()->addAction("whats_interesting", this, SLOT( slotShowWIView() ) )
actionCollection()->addAction("whats_interesting", this, SLOT( slotToggleWIView() ) )
<< i18n("What's Interesting...")
<< QKeySequence(Qt::CTRL+Qt::Key_W );
//#endif
......@@ -583,7 +583,7 @@ void KStars::initActions()
<< i18nc("Toggle supernovae in the display", "Supernovae" )
<< QIcon::fromTheme("kstars_supernovae" , QIcon(":/icons/breeze/default/kstars_supernovae.svg"))
<< ToolTip( i18n("Toggle supernovae") );
actionCollection()->add<KToggleAction>("show_whatsinteresting", this, SLOT( slotShowWIView() ) )
actionCollection()->add<KToggleAction>("show_whatsinteresting", this, SLOT( slotToggleWIView() ) )
<< i18nc("Toggle What's Interesting", "What's Interesting" )
<< QIcon::fromTheme("view-list-details" , QIcon(":/icons/breeze/default/view-list-details.svg"))
<< ToolTip( i18n("Toggle What's Interesting") );
......
......@@ -88,7 +88,7 @@ Rectangle {
x: 0
y: 31
width: parent.width
height: 500
height: 600
Rectangle {
id: background
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment