summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-29 07:31:41 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-29 07:31:41 (GMT)
commit187e93a259c5cc984c0ffc619b631290b5b9f5ae (patch)
treecdeac8c7fb006e257fd919f42b75692006ece8a8
parent701a50583f38d09d566be576807855fd714a4a99 (diff)
Add option to make Ekos and FITSViewer windows as separate Windows from KStars
-rw-r--r--kstars/ekos/ekosmanager.cpp3
-rw-r--r--kstars/ekos/ekosmanager.h4
-rw-r--r--kstars/ekos/opsekos.ui12
-rw-r--r--kstars/indi/indiccd.cpp4
-rw-r--r--kstars/kstars.cpp16
-rw-r--r--kstars/kstars.h4
-rw-r--r--kstars/kstars.kcfg8
-rw-r--r--kstars/kstarsactions.cpp2
-rw-r--r--kstars/kstarsdbus.cpp2
-rw-r--r--kstars/options/opsadvanced.ui14
10 files changed, 48 insertions, 21 deletions
diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp
index 7b3a899..a53b011 100644
--- a/kstars/ekos/ekosmanager.cpp
+++ b/kstars/ekos/ekosmanager.cpp
@@ -46,8 +46,7 @@
#define MAX_REMOTE_INDI_TIMEOUT 15000
#define MAX_LOCAL_INDI_TIMEOUT 5000
-EkosManager::EkosManager()
- : QDialog(KStars::Instance())
+EkosManager::EkosManager(QWidget *parent) : QDialog(parent)
{
setupUi(this);
diff --git a/kstars/ekos/ekosmanager.h b/kstars/ekos/ekosmanager.h
index dc205af..d5bdbcc 100644
--- a/kstars/ekos/ekosmanager.h
+++ b/kstars/ekos/ekosmanager.h
@@ -57,7 +57,7 @@ class QProgressIndicator;
* For low level access to INDI devices, the \ref INDIDBusInterface "INDI Dbus Interface" provides complete access to INDI devices and properties.
* Ekos Manager provides a summary of operations progress in the <i>Summary</i> section of the <i>Setup</i> tab.
*@author Jasem Mutlaq
- *@version 1.4
+ *@version 1.5
*/
class EkosManager : public QDialog, public Ui::EkosManager
{
@@ -65,7 +65,7 @@ class EkosManager : public QDialog, public Ui::EkosManager
Q_CLASSINFO("D-Bus Interface", "org.kde.kstars.Ekos")
public:
- EkosManager();
+ EkosManager(QWidget *parent);
~EkosManager();
typedef enum { EKOS_STATUS_IDLE, EKOS_STATUS_PENDING, EKOS_STATUS_SUCCESS, EKOS_STATUS_ERROR } CommunicationStatus;
diff --git a/kstars/ekos/opsekos.ui b/kstars/ekos/opsekos.ui
index 15a47e7..e27aeac 100644
--- a/kstars/ekos/opsekos.ui
+++ b/kstars/ekos/opsekos.ui
@@ -14,7 +14,7 @@
<string>TabWidget</string>
</property>
<property name="currentIndex">
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="generalTab">
<attribute name="title">
@@ -66,6 +66,16 @@
</layout>
</item>
<item>
+ <widget class="QCheckBox" name="kcfg_independentWindowEkos">
+ <property name="toolTip">
+ <string>Make Ekos window independent from KStars main window. Requires restart to take effect.</string>
+ </property>
+ <property name="text">
+ <string>Independent Window</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
diff --git a/kstars/indi/indiccd.cpp b/kstars/indi/indiccd.cpp
index 3163762..4f17254 100644
--- a/kstars/indi/indiccd.cpp
+++ b/kstars/indi/indiccd.cpp
@@ -1237,8 +1237,8 @@ void CCD::processBLOB(IBLOB* bp)
if (Options::singleWindowCapturedFITS())
fv = KStars::Instance()->genericFITSViewer();
- else
- fv = new FITSViewer(KStars::Instance());
+ else
+ fv = new FITSViewer(Options::independentWindowFITS() ? NULL : KStars::Instance());
//connect(fv, SIGNAL(destroyed()), this, SLOT(FITSViewerDestroyed()));
//connect(fv, SIGNAL(destroyed()), this, SIGNAL(FITSViewerClosed()));
diff --git a/kstars/kstars.cpp b/kstars/kstars.cpp
index 6c292c1..c468cf9 100644
--- a/kstars/kstars.cpp
+++ b/kstars/kstars.cpp
@@ -77,11 +77,11 @@ KStars::KStars( bool doSplash, bool clockrun, const QString &startdate )
QDBusConnection::sessionBus().registerService("org.kde.kstars");
#ifdef HAVE_CFITSIO
- genericViewer = NULL;
+ m_GenericFITSViewer.clear();
#endif
#ifdef HAVE_INDI
- m_EkosManager = NULL;
+ m_EkosManager.clear();
#endif
// Set pinstance to yourself
@@ -387,21 +387,21 @@ void KStars::updateTime( const bool automaticDSTchange ) {
#ifdef HAVE_CFITSIO
FITSViewer * KStars::genericFITSViewer()
{
- if (genericViewer == NULL)
+ if (m_GenericFITSViewer.isNull())
{
- genericViewer = new FITSViewer(this);
- genericViewer->setAttribute(Qt::WA_DeleteOnClose);
+ m_GenericFITSViewer = new FITSViewer(Options::independentWindowFITS() ? NULL : this);
+ m_GenericFITSViewer->setAttribute(Qt::WA_DeleteOnClose);
}
- return genericViewer;
+ return m_GenericFITSViewer;
}
#endif
#ifdef HAVE_INDI
EkosManager *KStars::ekosManager()
{
- if (!m_EkosManager)
- m_EkosManager = new EkosManager();
+ if (m_EkosManager.isNull())
+ m_EkosManager = new EkosManager(Options::independentWindowEkos() ? NULL : this);
return m_EkosManager;
}
diff --git a/kstars/kstars.h b/kstars/kstars.h
index 50cb7a0..3d7d209 100644
--- a/kstars/kstars.h
+++ b/kstars/kstars.h
@@ -680,11 +680,11 @@ private:
HorizonManager *m_HorizonManager;
EyepieceField *m_EyepieceView;
#ifdef HAVE_CFITSIO
- QPointer<FITSViewer> genericViewer;
+ QPointer<FITSViewer> m_GenericFITSViewer;
#endif
#ifdef HAVE_INDI
- EkosManager *m_EkosManager;
+ QPointer<EkosManager> m_EkosManager;
#endif
AddDeepSkyObject *m_addDSODialog;
diff --git a/kstars/kstars.kcfg b/kstars/kstars.kcfg
index 674bdd1..523e661 100644
--- a/kstars/kstars.kcfg
+++ b/kstars/kstars.kcfg
@@ -1261,6 +1261,10 @@
<whatsthis>Display all opened FITS images in a single FITS Viewer window.</whatsthis>
<default>true</default>
</entry>
+ <entry name="independentWindowFITS" type="Bool">
+ <label>Make FITS Viewer window independent of KStars main window</label>
+ <default>false</default>
+ </entry>
</group>
<group name="WISettings">
<entry name="BortleClass" type="UInt">
@@ -1285,6 +1289,10 @@
</entry>
</group>
<group name="Ekos">
+ <entry name="independentWindowEkos" type="Bool">
+ <label>Make Ekos window independent of KStars main window</label>
+ <default>false</default>
+ </entry>
<entry name="profile" type="String">
<label>Ekos drivers profile</label>
<default>Simulators</default>
diff --git a/kstars/kstarsactions.cpp b/kstars/kstarsactions.cpp
index c50afe2..6a666a9 100644
--- a/kstars/kstarsactions.cpp
+++ b/kstars/kstarsactions.cpp
@@ -797,7 +797,7 @@ void KStars::slotOpenFITS()
// Remember last directory
path.setUrl(fileURL.toLocalFile());
- FITSViewer * fv = new FITSViewer(this);
+ FITSViewer * fv = new FITSViewer((Options::independentWindowFITS()) ? NULL : this);
// Error opening file
if (fv->addFITS(&fileURL, FITS_NORMAL, FITS_NONE, QString(), false) == -2)
delete (fv);
diff --git a/kstars/kstarsdbus.cpp b/kstars/kstarsdbus.cpp
index 835eb7d..fd309cb 100644
--- a/kstars/kstarsdbus.cpp
+++ b/kstars/kstarsdbus.cpp
@@ -713,7 +713,7 @@ bool KStars::openFITS(const QUrl &imageURL)
if (Options::singleWindowOpenedFITS())
fv = genericFITSViewer();
else
- fv = new FITSViewer(this);
+ fv = new FITSViewer((Options::independentWindowFITS()) ? NULL : this);
// Error opening file
if (fv->addFITS(&imageURL) == -2)
{
diff --git a/kstars/options/opsadvanced.ui b/kstars/options/opsadvanced.ui
index ce6cb0e..3e6e81f 100644
--- a/kstars/options/opsadvanced.ui
+++ b/kstars/options/opsadvanced.ui
@@ -223,6 +223,16 @@
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="kcfg_independentWindowFITS">
+ <property name="toolTip">
+ <string>Make FITS Viewer window independent from KStars</string>
+ </property>
+ <property name="text">
+ <string>Independent Window</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -982,12 +992,12 @@
<resources/>
<connections/>
<buttongroups>
- <buttongroup name="logbuttonGroup"/>
- <buttongroup name="verbosityButtonGroup"/>
<buttongroup name="modulesGroup">
<property name="exclusive">
<bool>false</bool>
</property>
</buttongroup>
+ <buttongroup name="verbosityButtonGroup"/>
+ <buttongroup name="logbuttonGroup"/>
</buttongroups>
</ui>