Commit 25ff36e9 authored by Jasem Mutlaq's avatar Jasem Mutlaq

Enable clear button on FITS file. Check if URL is valid before saving

parent eed6f16b
...@@ -186,6 +186,7 @@ Scheduler::Scheduler() ...@@ -186,6 +186,7 @@ Scheduler::Scheduler()
connect(startupScript, SIGNAL(textChanged(QString)), this, SLOT(setDirty())); connect(startupScript, SIGNAL(textChanged(QString)), this, SLOT(setDirty()));
connect(shutdownScript, SIGNAL(textChanged(QString)), this, SLOT(setDirty())); connect(shutdownScript, SIGNAL(textChanged(QString)), this, SLOT(setDirty()));
connect(fitsEdit, SIGNAL(textChanged(QString)), this, SLOT(setDirty()));
} }
Scheduler::~Scheduler() Scheduler::~Scheduler()
...@@ -372,8 +373,9 @@ void Scheduler::addJob() ...@@ -372,8 +373,9 @@ void Scheduler::addJob()
job->setDateTimeDisplayFormat(startupTimeEdit->displayFormat()); job->setDateTimeDisplayFormat(startupTimeEdit->displayFormat());
job->setSequenceFile(sequenceURL); job->setSequenceFile(sequenceURL);
if (fitsURL.isEmpty() == false)
job->setFITSFile(fitsURL); fitsURL = QUrl::fromLocalFile(fitsEdit->text());
job->setFITSFile(fitsURL);
// #1 Startup conditions // #1 Startup conditions
...@@ -3017,7 +3019,7 @@ bool Scheduler::saveScheduler(const QUrl &fileURL) ...@@ -3017,7 +3019,7 @@ bool Scheduler::saveScheduler(const QUrl &fileURL)
outstream << "<J2000DE>"<< job->getTargetCoords().dec0().Degrees() << "</J2000DE>" << endl; outstream << "<J2000DE>"<< job->getTargetCoords().dec0().Degrees() << "</J2000DE>" << endl;
outstream << "</Coordinates>" << endl; outstream << "</Coordinates>" << endl;
if (job->getFITSFile().isEmpty() == false) if (job->getFITSFile().isValid() && job->getFITSFile().isEmpty() == false)
outstream << "<FITS>" << job->getFITSFile().path() << "</FITS>" << endl; outstream << "<FITS>" << job->getFITSFile().path() << "</FITS>" << endl;
outstream << "<Sequence>" << job->getSequenceFile().path() << "</Sequence>" << endl; outstream << "<Sequence>" << job->getSequenceFile().path() << "</Sequence>" << endl;
......
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
<item> <item>
<widget class="QLineEdit" name="fitsEdit"> <widget class="QLineEdit" name="fitsEdit">
<property name="readOnly"> <property name="readOnly">
<bool>false</bool>
</property>
<property name="clearButtonEnabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
...@@ -1071,7 +1074,7 @@ ...@@ -1071,7 +1074,7 @@
<resources/> <resources/>
<connections/> <connections/>
<buttongroups> <buttongroups>
<buttongroup name="completionButtonGroup"/>
<buttongroup name="startupButtonGroup"/> <buttongroup name="startupButtonGroup"/>
<buttongroup name="completionButtonGroup"/>
</buttongroups> </buttongroups>
</ui> </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