]> sigrok.org Git - pulseview.git/commitdiff
Allow labels to be set to empty values
authorJoel Holdsworth <redacted>
Sun, 24 Mar 2013 20:24:16 +0000 (20:24 +0000)
committerJoel Holdsworth <redacted>
Sat, 6 Apr 2013 08:30:59 +0000 (09:30 +0100)
pv/view/header.cpp

index e0e280b2826dc3c988c362d1c2eaecaf0a508f29..6d016fe0b441aa832a504e64704fd564ac67d59c 100644 (file)
@@ -218,14 +218,16 @@ void Header::contextMenuEvent(QContextMenuEvent *event)
 
 void Header::on_action_set_name_triggered()
 {
+       bool ok = false;
+
        shared_ptr<view::Signal> 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);
 }