21 #include "ui_historydialog.h" 40 QSharedPointer<VespucciDataset> dataset = workspace_->GetDataset(key);
41 QStringList actions = dataset->operations();
42 ui->actionsListWidget->clear();
43 ui->actionsListWidget->addItems(actions);
44 ui->datasetLabel->setText(
"History for " + key);
47 void HistoryDialog::on_savePushButton_clicked()
49 QString filename = QFileDialog::getSaveFileName(
this,
"Save macro",
50 workspace_->directory(),
51 "Text files (*.txt)");
52 if (filename.isEmpty())
return;
53 QFile outfile(filename);
54 outfile.open(QFile::WriteOnly);
55 QTextStream outstream(&outfile);
56 for (
int i = 0; i < ui->actionsListWidget->count(); ++i)
57 outstream << ui->actionsListWidget->item(i)->text() <<
"\n";
61 void HistoryDialog::on_sendPushButton_clicked()
64 for (
int i = 0; i < ui->actionsListWidget->count(); ++i)
65 macro << ui->actionsListWidget->item(i)->text();
69 void HistoryDialog::on_refreshPushButton_clicked()
71 ui->actionsListWidget->clear();
72 if (workspace_->dataset_names().contains(dataset_key_)){
73 QSharedPointer<VespucciDataset> dataset = workspace_->GetDataset(dataset_key_);
74 QStringList operations = dataset->operations();
75 ui->actionsListWidget->addItems(operations);
81 workspace_->main_window()->SetHistoryDialogActionChecked(
false);
87 workspace_->main_window()->SetHistoryDialogActionChecked(
true);
void DatasetSelectionChanged(QString key)
void closeEvent(QCloseEvent *event)
HistoryDialog(QWidget *parent, QSharedPointer< VespucciWorkspace > ws)
void MacroRequested(const QStringList ¯o)
void showEvent(QShowEvent *event)