- if (!t)
- return;
-
- QMenu menu(this);
- menu.addAction(_action_set_name);
- menu.addAction(_action_set_colour);
-
- _context_trace = t;
- menu.exec(event->globalPos());
- _context_trace.reset();
-}
-
-void Header::on_action_set_name_triggered()
-{
- bool ok = false;
-
- shared_ptr<view::Trace> context_trace = _context_trace;
- if (!context_trace)
- return;
-
- const QString new_label = QInputDialog::getText(this, tr("Set Name"),
- tr("Name"), QLineEdit::Normal, context_trace->get_name(), &ok);
-
- if (ok)
- context_trace->set_name(new_label);