Commit 466220f4 authored by Samikshan Bairagya's avatar Samikshan Bairagya

Implemented the user-settings button.

parent 481d535b
......@@ -40,6 +40,7 @@
#include "observinglist.h"
#include "oal/execute.h"
#include "whatsinteresting/wiview.h"
#include "whatsinteresting/wiusersettings.h"
#include "kstarsadaptor.h"
......@@ -305,6 +306,13 @@ void KStars::selectPreviousFov()
map()->update();
}
void KStars::showWIWizard()
{
wiDock->setVisible(false);
wiWiz->restart();
wiWiz->setVisible(true);
}
void KStars::showWI(ObsConditions *obs)
{
if ( ! wi )
......
......@@ -175,6 +175,8 @@ public:
void selectPreviousFov();
void showWIWizard();
void showWI(ObsConditions *obs);
public Q_SLOTS:
......
......@@ -840,6 +840,7 @@ Rectangle {
Image {
id: settingsIcon
objectName: "settingsIconObj"
x: 9
y: 528
width: 28
......@@ -851,12 +852,15 @@ Rectangle {
fillMode: Image.Stretch
source: "settingsIcon.png"
signal settingsIconClicked()
MouseArea {
id: settingsMouseArea
anchors.fill: parent
hoverEnabled: true
onEntered: settingsForeground.opacity = 0.2
onExited: settingsForeground.opacity = 0.0
onClicked: settingsIcon.settingsIconClicked()
}
Rectangle {
......
......@@ -23,9 +23,8 @@
#include "kstandarddirs.h"
WIView::WIView(QWidget *parent, ObsConditions *obs) : QWidget(parent)
WIView::WIView(QWidget *parent, ObsConditions *obs) : QWidget(parent), m_Obs(obs)
{
m = new ModelManager(obs);
m_BaseView = new QDeclarativeView();
......@@ -57,6 +56,9 @@ WIView::WIView(QWidget *parent, ObsConditions *obs) : QWidget(parent)
m_DetailsButtonObj = m_BaseObj->findChild<QObject *>("detailsButtonObj");
connect(m_DetailsButtonObj, SIGNAL(detailsButtonClicked()), this, SLOT(onDetailsButtonClicked()));
QObject *settingsIconObj = m_BaseObj->findChild<QObject *>("settingsIconObj");
connect(settingsIconObj, SIGNAL(settingsIconClicked()), this, SLOT(onSettingsIconClicked()));
m_BaseView->setResizeMode(QDeclarativeView::SizeRootObjectToView);
m_BaseView->show();
}
......@@ -172,3 +174,9 @@ void WIView::onDetailsButtonClicked()
detail->exec();
delete detail;
}
void WIView::onSettingsIconClicked()
{
KStars *kstars = KStars::Instance();
kstars->showWIWizard();
}
......@@ -99,15 +99,17 @@ public slots:
*/
void onDetailsButtonClicked();
void onSettingsIconClicked();
private:
QObject *m_BaseObj, *m_ViewsRowObj, *m_SoListObj, *m_DetailsViewObj,
*m_NextObj, *m_PrevObj, *m_SlewButtonObj, *m_DetailsButtonObj;
QDeclarativeContext *ctxt;
QDeclarativeView *m_BaseView;
ObsConditions *m_Obs;
ModelManager *m;
SkyObjItem *m_CurSoItem; ///Current sky-object item.
int m_CurIndex; ///Index of current sky-object item in details-view.
double m_OptMag; ///Optimum magnification
};
#endif
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