diff options
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtNameWidget.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Swift/QtUI/QtNameWidget.cpp b/Swift/QtUI/QtNameWidget.cpp index c85b2e9..412665d 100644 --- a/Swift/QtUI/QtNameWidget.cpp +++ b/Swift/QtUI/QtNameWidget.cpp @@ -42,17 +42,19 @@ void QtNameWidget::setJID(const QString& jid) { void QtNameWidget::mousePressEvent(QMouseEvent* event) { QMenu menu; + bool hasNick = !nick.isEmpty(); - QAction* showAsNick = new QAction("Show nickname", this); + QAction* showAsNick = new QAction(hasNick ? "Show nickname" : "(No Nickname Set)", this); showAsNick->setCheckable(true); - if (mode == ShowNick) { + showAsNick->setEnabled(hasNick); + if (mode == ShowNick && hasNick) { showAsNick->setChecked(true); } menu.addAction(showAsNick); QAction* showAsJID = new QAction("Show ID", this); showAsJID->setCheckable(true); - if (mode == ShowJID) { + if (mode == ShowJID || !hasNick) { showAsJID->setChecked(true); } menu.addAction(showAsJID); |