Commit ed52d992 authored by Robert Lancaster's avatar Robert Lancaster Committed by Jasem Mutlaq

This patch will fix the crash you observed with one of the ways to access...

This patch will fix the crash you observed with one of the ways to access Whats Interesting, adds a toolbar action for whats interesting and makes it toggle appropriately, fixes the clock icon for the time button, and removes KF5WIT ifdefs for whats interesting since they are no longer needed.
parent 46fde5f9
......@@ -173,8 +173,9 @@
<Action name="show_cbounds" />
<Action name="show_mw" />
<Action name="show_equatorial_grid" />
<Action name="show_horizontal_grid" />
<Action name="show_horizontal_grid" />
<Action name="show_horizon" />
<Action name="show_whatsinteresting" />
</ToolBar>
<ToolBar noMerge="1" name="INDIToolBar" iconText="icononly">
......
......@@ -83,11 +83,9 @@
#include "tools/eyepiecefield.h"
#include "tools/adddeepskyobject.h"
#ifdef HAVE_KF5WIT
#include "tools/whatsinteresting/wiview.h"
#include "tools/whatsinteresting/wilpsettings.h"
#include "tools/whatsinteresting/wiequipsettings.h"
#endif
#include "tools/skycalendar.h"
#include "tools/scriptbuilder.h"
......@@ -508,7 +506,6 @@ void KStars::slotWUT()
//#if 0
void KStars::slotWISettings()
{
#ifdef HAVE_KF5WIT
if (!m_WIView)
slotShowWIView();
if (m_WIView && !m_wiDock->isVisible())
......@@ -531,14 +528,10 @@ void KStars::slotWISettings()
dialog->exec();
if(m_WIEquipmentSettings)
m_WIEquipmentSettings->setAperture(); //Something isn't working with this!
#endif
}
void KStars::slotShowWIView()
{
#ifdef HAVE_KF5WIT
if (!m_WIView)
{
m_WIView = new WIView(0);
......@@ -549,13 +542,14 @@ void KStars::slotShowWIView()
m_wiDock->setWidget(container);
m_wiDock->setMinimumWidth(400);
addDockWidget(Qt::RightDockWidgetArea, m_wiDock);
connect( m_wiDock, SIGNAL( visibilityChanged(bool) ),
actionCollection()->action( "show_whatsinteresting" ), SLOT( setChecked(bool) ) );
m_wiDock->setVisible(true);
}
else
{
m_wiDock->setVisible(true);
m_wiDock->setVisible(!m_wiDock->isVisible());
}
#endif
}
void KStars::slotCalendar()
......
......@@ -49,9 +49,7 @@
#include "observinglist.h"
#include "eyepiecefield.h"
#ifdef HAVE_KF5WIT
#include "tools/whatsinteresting/wiview.h"
#endif
#ifdef HAVE_CFITSIO
#include "fitsviewer/fitsviewer.h"
......@@ -505,10 +503,8 @@ void KStars::loadColorScheme( const QString &name )
{
//OriginalPalette = QApplication::palette();
QApplication::setPalette( DarkPalette );
#ifdef HAVE_KF5WIT
if(KStars::Instance()->wiView())
KStars::Instance()->wiView()->setNightVisionOn(true);
#endif
//Note: This uses style sheets to set the dark colors, this is cross platform. Palettes have a different behavior on OS X and Windows as opposed to Linux.
//It might be a good idea to use stylesheets in the future instead of palettes but this will work for now for OS X.
//This is also in KStars.cpp. If you change it, change it in BOTH places.
......@@ -540,10 +536,8 @@ void KStars::loadColorScheme( const QString &name )
}
else
{
#ifdef HAVE_KF5WIT
if(KStars::Instance()->wiView())
KStars::Instance()->wiView()->setNightVisionOn(false);
#endif
//if ( Options::darkAppColors() && filename != "night.colors" ) {
//Options::setDarkAppColors( false );
QApplication::setPalette( OriginalPalette );
......
......@@ -198,7 +198,7 @@ void KStars::initActions()
actionCollection()->addAction("time_dialog", this, SLOT( slotSetTime() ) )
<< i18nc("set Clock to New Time", "&Set Time..." )
<< QKeySequence( Qt::CTRL+Qt::Key_S )
<< QIcon::fromTheme("view-history", QIcon(":/icons/breeze/default/view-history.svg"));
<< QIcon::fromTheme("clock", QIcon(":/icons/breeze/default/clock.svg"));
ka = actionCollection()->add<KToggleAction>("clock_startstop")
<< i18n("Stop &Clock" )
......@@ -583,6 +583,10 @@ 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() ) )
<< 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") );
#ifdef HAVE_INDI
// ==== INDIToolBar actions ================
......
......@@ -149,7 +149,7 @@ WIView::WIView(QWidget * parent) : QWidget(parent), m_CurrentObjectListName(-1)
nightVision = m_BaseObj->findChild<QObject *>("nightVision");
if(Options::darkAppColors())
setNightVisionOn(true);
nightVision->setProperty("state","active");
}
......
......@@ -155,9 +155,9 @@ class WIView : public QWidget
QObject * infoBoxText, * descTextObj, * nightVision;
QQuickView * m_BaseView;
ObsConditions * m_Obs;
ObsConditions * m_Obs = nullptr;
ModelManager * m_ModManager;
SkyObjItem * m_CurSoItem; ///Current sky-object item.
SkyObjItem * m_CurSoItem = nullptr; ///Current sky-object item.
int m_CurIndex; ///Index of current sky-object item in details-view.
QString m_CurrentObjectListName; ///Currently selected category from WI QML view
QString getWikipediaName(SkyObjItem * soitem);
......
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