Source
spl2[i].remove(spl2[i].size() - 1, 1); // and ]'s
//# QtParamGUI.cc: GUI for collecting user input for task parameters.
//# Copyright (C) 2008
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
//# $Id: $
using namespace casacore;
namespace casa {
// QTPARAMGUI DEFINITIONS //
// Constructors/Destructors //
QtParamGUI::QtParamGUI(const Record& r, Mode m, PyObject* ipythonShell,
const Record* globals, QWidget* parent) : QDialog(parent), m_tasks(r),
m_resetMode(DEFAULT), m_mode(m), m_descDialog(NULL),
m_exampleDialog(NULL), m_python(ipythonShell) {
setupUi(this);
connect(resetGlobals, SIGNAL(toggled(bool)), this, SLOT(resetChanged()));
connect(resetDefaults, SIGNAL(toggled(bool)), this, SLOT(resetChanged()));
connect(resetLast, SIGNAL(toggled(bool)), this, SLOT(resetChanged()));
connect(lastLoadButton, SIGNAL(clicked()), this, SLOT(loadLast()));
if(globals != NULL) {
m_globals = *globals;
m_resetMode = GLOBAL;
}
showHideResets(globals != NULL, false);
if(r.nfields() < 2) {
taskLabel->close();
taskChooser->close();
taskLine->close();
} else {
QStringList tasks;
for(unsigned int i = 0; i < r.nfields(); i++)
tasks << r.name(i).c_str();
taskChooser->addItems(tasks);
}
setRecord(m_tasks, 0);
connect(taskChooser, SIGNAL(currentIndexChanged(QString)),
this, SLOT(taskChosen(QString)));
if(ipythonShell != NULL) loggerBox->setVisible(false);
if(m != PYTHON) closeOnRunBox->setVisible(false);
connect(runButton, SIGNAL(clicked()), this, SLOT(run()));
connect(resetButton, SIGNAL(clicked()), this, SLOT(reset()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancel()));
setVisible(true);
if(globals != NULL) resetGlobals->setChecked(true);
}
QtParamGUI::~QtParamGUI() {
if(m_descDialog) delete m_descDialog;
if(m_exampleDialog) delete m_exampleDialog;
}
String QtParamGUI::taskName() const { return m_taskName; }
Record QtParamGUI::taskParameters() const {