summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Lancaster <rlancaste@gmail.com>2016-10-23 18:00:47 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-23 18:00:47 (GMT)
commit043e2e6d247786c3a5005a480c76144c1c29a2d6 (patch)
treedb90b43f1b5039549d16aad96c8ee795a67e401f
parent3ec82ddde7089b6c8df8849b5a216a8d6dab4a1a (diff)
Fix context menu location in FITSViewer
-rw-r--r--kstars/fitsviewer/fitstab.cpp1
-rw-r--r--kstars/fitsviewer/fitsview.cpp3
-rw-r--r--kstars/skyobjects/deepskyobject.h3
-rw-r--r--kstars/skyobjects/ksmoon.h4
-rw-r--r--kstars/skyobjects/satellite.h4
-rw-r--r--kstars/skyobjects/skyobject.h12
-rw-r--r--kstars/skyobjects/starobject.h3
-rw-r--r--kstars/skyobjects/supernova.h3
-rw-r--r--kstars/skyobjects/trailobject.h5
9 files changed, 25 insertions, 13 deletions
diff --git a/kstars/fitsviewer/fitstab.cpp b/kstars/fitsviewer/fitstab.cpp
index 037b1e5..d41bdb6 100644
--- a/kstars/fitsviewer/fitstab.cpp
+++ b/kstars/fitsviewer/fitstab.cpp
@@ -131,7 +131,6 @@ bool FITSTab::loadFITS(const QUrl *imageURL, FITSMode mode, FITSScale filter, bo
view->updateFrame();
}
-
return imageLoad;
}
diff --git a/kstars/fitsviewer/fitsview.cpp b/kstars/fitsviewer/fitsview.cpp
index 875d344..bd7ba58 100644
--- a/kstars/fitsviewer/fitsview.cpp
+++ b/kstars/fitsviewer/fitsview.cpp
@@ -286,7 +286,7 @@ void FITSLabel::mousePressEvent(QMouseEvent *e)
SkyObject *object=listObject->skyObject();
KSPopupMenu *pmenu;
pmenu=new KSPopupMenu();
- object->showPopupMenu(pmenu,e->globalPos());
+ object->initPopupMenu(pmenu);
QList<QAction *> actions= pmenu->actions();
foreach(QAction *action,actions){
if(action->text().left(7)=="Starhop")
@@ -298,6 +298,7 @@ void FITSLabel::mousePressEvent(QMouseEvent *e)
if(action->text().left(12)=="Attach Label")
pmenu->removeAction(action);
}
+ pmenu->popup(e->globalPos());
KStars::Instance()->map()->setClickedObject(object);
break;
}
diff --git a/kstars/skyobjects/deepskyobject.h b/kstars/skyobjects/deepskyobject.h
index 6f15090..48393a3 100644
--- a/kstars/skyobjects/deepskyobject.h
+++ b/kstars/skyobjects/deepskyobject.h
@@ -194,8 +194,9 @@ public:
quint64 updateID;
quint64 updateNumID;
+ virtual void initPopupMenu( KSPopupMenu *pmenu );
private:
- virtual void initPopupMenu( KSPopupMenu *pmenu );
+
double PositionAngle;
QImage m_image;
diff --git a/kstars/skyobjects/ksmoon.h b/kstars/skyobjects/ksmoon.h
index f7f4e73..ea44cf8 100644
--- a/kstars/skyobjects/ksmoon.h
+++ b/kstars/skyobjects/ksmoon.h
@@ -88,8 +88,10 @@ public:
*/
void updateMag() { findMagnitude(NULL); }
-private:
virtual void initPopupMenu( KSPopupMenu* pmenu );
+
+private:
+
virtual void findMagnitude(const KSNumbers*);
static bool data_loaded;
diff --git a/kstars/skyobjects/satellite.h b/kstars/skyobjects/satellite.h
index e215182..b95b141 100644
--- a/kstars/skyobjects/satellite.h
+++ b/kstars/skyobjects/satellite.h
@@ -98,6 +98,8 @@ public:
*/
QString sgp4ErrorString(int code);
+ virtual void initPopupMenu( KSPopupMenu *pmenu );
+
private:
/**
*@short Compute non time dependant parameters
@@ -128,7 +130,7 @@ private:
double Modulus(double arg1, double arg2);
- virtual void initPopupMenu( KSPopupMenu *pmenu );
+
// TLE
int m_number; // Satellite Number
diff --git a/kstars/skyobjects/skyobject.h b/kstars/skyobjects/skyobject.h
index 663b4db..935d6d9 100644
--- a/kstars/skyobjects/skyobject.h
+++ b/kstars/skyobjects/skyobject.h
@@ -196,6 +196,12 @@ public:
/** *@return true if the object is a solar system body. */
inline bool isSolarSystem() const { return ( type() == 2 || type() == 9 || type() == 10 || type() == 12 ); }
+ /** Initialize the popup menut. This function should call correct
+ * initialization function in KSPopupMenu. By overloading the
+ * function, we don't have to check the object type when we need
+ * the menu. */
+ virtual void initPopupMenu(KSPopupMenu* pmenu);
+
/** Show Type-specific popup menu. Oveloading is done in the function initPopupMenu */
void showPopupMenu( KSPopupMenu *pmenu, const QPoint &pos );
@@ -336,11 +342,7 @@ public:
virtual UID getUID() const;
private:
- /** Initialize the popup menut. This function should call correct
- * initialization function in KSPopupMenu. By overloading the
- * function, we don't have to check the object type when we need
- * the menu. */
- virtual void initPopupMenu(KSPopupMenu* pmenu);
+
/**
*Compute the UT time when the object will rise or set. It is an auxiliary
diff --git a/kstars/skyobjects/starobject.h b/kstars/skyobjects/starobject.h
index aea004d..ee708e5 100644
--- a/kstars/skyobjects/starobject.h
+++ b/kstars/skyobjects/starobject.h
@@ -273,6 +273,7 @@ public:
static unsigned int starsUpdated;
#endif
+ virtual void initPopupMenu( KSPopupMenu *pmenu);
protected:
// DEBUG EDIT. For testing proper motion, uncomment this, and related blocks
@@ -282,7 +283,7 @@ protected:
// END DEBUG
private:
- virtual void initPopupMenu( KSPopupMenu *pmenu);
+
double PM_RA, PM_Dec, Parallax; //, VRange, VPeriod;
bool Multiplicity, Variability;
diff --git a/kstars/skyobjects/supernova.h b/kstars/skyobjects/supernova.h
index 6510522..d3e4b55 100644
--- a/kstars/skyobjects/supernova.h
+++ b/kstars/skyobjects/supernova.h
@@ -91,8 +91,9 @@ public:
*/
inline QString getDate() const { return date; }
-private:
void initPopupMenu(KSPopupMenu*);
+private:
+
QString serialNumber, type, hostGalaxy, offset, discoverers, date;
dms RA, Dec;
float Magnitude;
diff --git a/kstars/skyobjects/trailobject.h b/kstars/skyobjects/trailobject.h
index 6ef4900..0b636af 100644
--- a/kstars/skyobjects/trailobject.h
+++ b/kstars/skyobjects/trailobject.h
@@ -68,13 +68,16 @@ public:
/** Maximum trail size */
static const int MaxTrail = 400;
+
+ virtual void initPopupMenu( KSPopupMenu *pmenu );
+
protected:
QList<SkyPoint> Trail;
QList<QString> m_TrailLabels;
/// Store list of objects with trails.
static QSet<TrailObject*> trailObjects;
private:
- virtual void initPopupMenu( KSPopupMenu *pmenu );
+
};
#endif