Commit 80a24fc8 authored by Samikshan Bairagya's avatar Samikshan Bairagya

Added documentation for class WIView.

parent f8d66182
......@@ -68,14 +68,14 @@ void WIView::onCategorySelected(int type)
switch(type)
{
case 0:
case 1:
case 2:
case 0: ///Planet type
case 1: ///Star type
case 2: ///Constellation type
ctxt->setContextProperty("soListModel", m->returnModel( type ));
break;
case 3:
case 4:
case 5:
case 3: ///Galaxy type
case 4: ///Cluster type
case 5: ///Nebula type
ctxt->setContextProperty("soListModel", m->returnModel( type ));
oMagTextObj->setProperty("text", oMagText);
break;
......@@ -105,7 +105,7 @@ void WIView::loadDetailsView(SkyObjItem* soitem, int index)
descTextObj->setProperty("text", soitem->getDesc());
magTextObj->setProperty("text", soitem->getMagnitude());
//Slew map to selected sky object
///Slew map to selected sky-object
SkyObject* so = soitem->getSkyObject();
KStars* data = KStars::Instance();
if (so != 0) {
......
......@@ -15,6 +15,9 @@
* *
***************************************************************************/
#ifndef WIVIEW_H
#define WIVIEW_H
#include "QtDeclarative/QDeclarativeView"
#include "QtDeclarative/QDeclarativeContext"
#include "QModelIndex"
......@@ -23,23 +26,66 @@
#include "skyobjlistmodel.h"
#include "obsconditions.h"
/**
* \class WIView
* \brief Manages the QML user interface for What's Interesting.
* WIView is used to display the QML UI using a QDeclarativeView.
* It acts on all signals emitted by the UI and manages the data
* sent to the UI for display.
* \author Samikshan Bairagya
*/
class WIView : public QObject
{
Q_OBJECT
public:
/**
* \brief Constructor - Store QML components as QObject pointers.
* Connect signals from various QML components into public slots.
* Displays the user interface for What's Interesting
*/
WIView(QObject *parent = 0, ObsConditions *obs = 0);
/**
* \brief Destructor
*/
~WIView();
/**
* \brief Load details-view for selected sky-object
*/
void loadDetailsView(SkyObjItem* soitem, int index);
public slots:
void onCategorySelected(int);
/**
* \brief public slot - Act upon signal emitted when category of sky-object is selected
* from category selection view of the QML UI.
* \param type Category selected
*/
void onCategorySelected(int type);
/**
* \brief public slot - Act upon signal emitted when an item is selected from list of sky-objects.
* Display details-view for the skyobject selected.
* \param type Category selected
* \param typename Name of category selected
* \param index Index of item in the list of skyobjects.
*/
void onSoListItemClicked(int type, QString typeName, int index);
/**
* \brief public slot - Show details-view for next sky-object from list of current sky-objects's category.
*/
void onNextObjTextClicked();
private:
QObject *m_BaseObj, *m_ViewsRowObj, *m_SoListObj, *m_DetailsViewObj, *m_NextObj;
QDeclarativeContext *ctxt;
ModelManager *m;
SkyObjItem *m_CurSoItem;
int m_CurIndex;
double m_OptMag;
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