|
| 1 | +/* |
| 2 | + For more information, please see: http://software.sci.utah.edu |
| 3 | +
|
| 4 | + The MIT License |
| 5 | +
|
| 6 | + Copyright (c) 2012 Scientific Computing and Imaging Institute, |
| 7 | + University of Utah. |
| 8 | +
|
| 9 | + License for the specific language governing rights and limitations under |
| 10 | + Permission is hereby granted, free of charge, to any person obtaining a |
| 11 | + copy of this software and associated documentation files (the "Software"), |
| 12 | + to deal in the Software without restriction, including without limitation |
| 13 | + the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 14 | + and/or sell copies of the Software, and to permit persons to whom the |
| 15 | + Software is furnished to do so, subject to the following conditions: |
| 16 | +
|
| 17 | + The above copyright notice and this permission notice shall be included |
| 18 | + in all copies or substantial portions of the Software. |
| 19 | +
|
| 20 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 21 | + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 22 | + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 23 | + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 24 | + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 25 | + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 26 | + DEALINGS IN THE SOFTWARE. |
| 27 | +*/ |
| 28 | + |
| 29 | +#include <Interface/Modules/Matlab/ImportDatatypesFromMatlabDialog.h> |
| 30 | +// #include <Modules/DataIO/ReadField.h> |
| 31 | +// #include <Core/Algorithms/Base/AlgorithmVariableNames.h> |
| 32 | +// #include <Dataflow/Network/ModuleStateInterface.h> //TODO: extract into intermediate |
| 33 | +// #include <Core/ImportExport/GenericIEPlugin.h> |
| 34 | +// #include <iostream> |
| 35 | +// #include <boost/filesystem.hpp> |
| 36 | +// #include <QFileDialog> |
| 37 | + |
| 38 | +using namespace SCIRun::Gui; |
| 39 | +using namespace SCIRun::Dataflow::Networks; |
| 40 | +using namespace SCIRun::Core::Algorithms; |
| 41 | + |
| 42 | +ImportDatatypesFromMatlabDialog::ImportDatatypesFromMatlabDialog(const std::string& name, ModuleStateHandle state, |
| 43 | + QWidget* parent /* = 0 */) |
| 44 | + : ModuleDialogGeneric(state, parent) |
| 45 | +{ |
| 46 | + setupUi(this); |
| 47 | + setWindowTitle(QString::fromStdString(name)); |
| 48 | + fixSize(); |
| 49 | + |
| 50 | + //connect(openFileButton_, SIGNAL(clicked()), this, SLOT(openFile())); |
| 51 | + //connect(fileNameLineEdit_, SIGNAL(editingFinished()), this, SLOT(pushFileNameToState())); |
| 52 | + //connect(fileNameLineEdit_, SIGNAL(returnPressed()), this, SLOT(pushFileNameToState())); |
| 53 | + //buttonBox->setVisible(false); |
| 54 | +} |
| 55 | + |
| 56 | +void ImportDatatypesFromMatlabDialog::pull() |
| 57 | +{ |
| 58 | + //fileNameLineEdit_->setText(QString::fromStdString(state_->getValue(Variables::Filename).toString())); |
| 59 | +} |
| 60 | + |
| 61 | +//void ReadFieldDialog::pushFileNameToState() |
| 62 | +//{ |
| 63 | +// auto file = fileNameLineEdit_->text().trimmed().toStdString(); |
| 64 | +// state_->setValue(Variables::Filename, file); |
| 65 | +//} |
| 66 | +// |
| 67 | +//void ReadFieldDialog::openFile() |
| 68 | +//{ |
| 69 | +// auto types = Modules::DataIO::ReadFieldModule::fileTypeList(); |
| 70 | +// QString selectedFilter; |
| 71 | +// auto file = QFileDialog::getOpenFileName(this, "Open Field File", dialogDirectory(), QString::fromStdString(types), &selectedFilter); |
| 72 | +// if (file.length() > 0) |
| 73 | +// { |
| 74 | +// auto typeName = SCIRun::fileTypeDescriptionFromDialogBoxFilter(selectedFilter.toStdString()); |
| 75 | +// state_->setValue(Variables::FileTypeName, typeName); |
| 76 | +// fileNameLineEdit_->setText(file); |
| 77 | +// updateRecentFile(file); |
| 78 | +// pushFileNameToState(); |
| 79 | +// } |
| 80 | +//} |
0 commit comments