21 #include "ui_metadatasetdialog.h" 29 dataset_list_model_ =
new DatasetListModel(
this, workspace_->dataset_names());
30 ui->datasetListView->setModel(dataset_list_model_);
31 ui->datasetListView->setSelectionMode(QAbstractItemView::MultiSelection);
39 void MetaDatasetDialog::on_buttonBox_rejected()
44 void MetaDatasetDialog::on_buttonBox_accepted()
46 QList<QSharedPointer<VespucciDataset> > parent_datasets;
47 QModelIndexList selected_indices = ui->datasetListView->selectionModel()->selectedRows();
48 if (selected_indices.size() <= 0){
51 for (
int i = 0; i < selected_indices.size(); ++i){
52 parent_datasets.append(workspace_->GetDataset(dataset_list_model_->
DatasetName(selected_indices[i].row())));
55 QString method_description = ui->methodComboBox->currentText();
57 switch(ui->methodComboBox->currentIndex()){
59 cout << method_description.toStdString() <<
"\n";
66 cout << method_description.toStdString() <<
"\n";
68 cout <<
"1 or default\n";
74 QString name = ui->nameLineEdit->text();
75 QSharedPointer<MetaDataset> new_dataset;
77 new_dataset = QSharedPointer<MetaDataset>(
new MetaDataset(name, workspace_->main_window(), workspace_->directory_ptr(), method_description, method, parent_datasets));
80 cerr <<
"Exception thrown\n";
82 cerr << e.what() <<
"\n";
84 QMessageBox::warning(
this,
"Exception Occured",
"An exception was thrown in the MetaDataset constructor");
87 workspace_->AddDataset(new_dataset);
QString DatasetName(int row)