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