/** * Dialog: Change your Nickname in the ChatLobby */ void ChatLobbyDialog::changeNickname() { QInputDialog dialog; dialog.setWindowTitle(tr("Change nick name")); dialog.setLabelText(tr("Please enter your new nick name")); dialog.setWindowIcon(QIcon(":/images/rstray3.png")); std::string nickName; rsMsgs->getNickNameForChatLobby(lobbyId, nickName); dialog.setTextValue(QString::fromUtf8(nickName.c_str())); if (dialog.exec() == QDialog::Accepted && !dialog.textValue().isEmpty()) { setNickname(dialog.textValue()); } }
std::string NotifyQt::askForPassword(const std::string& key_details,bool prev_is_bad) { RsAutoUpdatePage::lockAllEvents() ; QInputDialog dialog; dialog.setWindowTitle(tr("GPG key passphrase")); dialog.setLabelText((prev_is_bad?tr("Wrong password !") + "\n\n" : QString()) + tr("Please enter the password to unlock the following GPG key:") + "\n" + QString::fromStdString(key_details)); dialog.setTextEchoMode(QLineEdit::Password); dialog.setWindowIcon(QIcon(":/images/rstray3.png")); int ret = dialog.exec(); RsAutoUpdatePage::unlockAllEvents() ; if (ret) { return dialog.textValue().toStdString(); } return ""; }