Commit 187e93a2 authored by Jasem Mutlaq's avatar Jasem Mutlaq

Add option to make Ekos and FITSViewer windows as separate Windows from KStars

parent 701a5058
......@@ -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);
......
......@@ -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;
......
......@@ -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">
......@@ -65,6 +65,16 @@
</item>
</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">
......
......@@ -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()));
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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>
......
......@@ -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);
......
......@@ -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)
{
......
......@@ -222,6 +222,16 @@
</property>
</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">
......@@ -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>
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