From: Joel Holdsworth Date: Sun, 24 Mar 2013 20:24:16 +0000 (+0000) Subject: Allow labels to be set to empty values X-Git-Tag: pulseview-0.1.0~56 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=2c982fc3905ef4d4fa1d87761d3ac14841f01de1;p=pulseview.git Allow labels to be set to empty values --- diff --git a/pv/view/header.cpp b/pv/view/header.cpp index e0e280b2..6d016fe0 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -218,14 +218,16 @@ void Header::contextMenuEvent(QContextMenuEvent *event) void Header::on_action_set_name_triggered() { + bool ok = false; + shared_ptr context_signal = _context_signal; if (!context_signal) return; const QString new_label = QInputDialog::getText(this, tr("Set Name"), - tr("Name"), QLineEdit::Normal, context_signal->get_name()); + tr("Name"), QLineEdit::Normal, context_signal->get_name(), &ok); - if (!new_label.isEmpty()) + if (ok) context_signal->set_name(new_label); }