connect(ui.continueUnsecured, &QAbstractButton::clicked, this, &IdentityEditWidget::requestEditSsl);
// we would need this if we enabled drag and drop in the nicklist...
connect(ui.continueUnsecured, &QAbstractButton::clicked, this, &IdentityEditWidget::requestEditSsl);
// we would need this if we enabled drag and drop in the nicklist...
- //connect(ui.nicknameList, &QListWidget::rowsInserted, this, &IdentityEditWidget::setWidgetStates);
- //connect(ui.nicknameList->model(), &NickListModel::rowsInserted, this, IdentityEditWidget::nicklistHasChanged);
+ // connect(ui.nicknameList, &QListWidget::rowsInserted, this, &IdentityEditWidget::setWidgetStates);
+ // connect(ui.nicknameList->model(), &NickListModel::rowsInserted, this, IdentityEditWidget::nicklistHasChanged);
if (Client::isCoreFeatureEnabled(Quassel::Feature::AwayFormatTimestamp)) {
// Core allows formatting %%timestamp%% messages in away strings. Update tooltips.
QString strFormatTooltip;
if (Client::isCoreFeatureEnabled(Quassel::Feature::AwayFormatTimestamp)) {
// Core allows formatting %%timestamp%% messages in away strings. Update tooltips.
QString strFormatTooltip;
formatTooltip << "<qt><style>.bold { font-weight: bold; } "
".italic { font-style: italic; }</style>";
// Function to add a row to the tooltip table
auto addRow = [&](const QString& key, const QString& value, bool condition) {
if (condition) {
formatTooltip << "<qt><style>.bold { font-weight: bold; } "
".italic { font-style: italic; }</style>";
// Function to add a row to the tooltip table
auto addRow = [&](const QString& key, const QString& value, bool condition) {
if (condition) {
}
};
// Original tooltip goes here
formatTooltip << "<p>%1</p>";
// New timestamp formatting guide here
}
};
// Original tooltip goes here
formatTooltip << "<p>%1</p>";
// New timestamp formatting guide here
- formatTooltip << "<p>" << tr("You can add date/time to this message "
- "using the syntax: "
- "<br/>%%<span class='italic'><format></span>%%, where "
- "<span class='italic'><format></span> is:") << "</p>";
+ formatTooltip << "<p>"
+ << tr("You can add date/time to this message "
+ "using the syntax: "
+ "<br/>%%<span class='italic'><format></span>%%, where "
+ "<span class='italic'><format></span> is:")
+ << "</p>";
formatTooltip << "<table cellspacing='5' cellpadding='0'>";
addRow("hh", tr("the hour"), true);
addRow("mm", tr("the minutes"), true);
formatTooltip << "<table cellspacing='5' cellpadding='0'>";
addRow("hh", tr("the hour"), true);
addRow("mm", tr("the minutes"), true);
addRow("t", tr("current timezone"), true);
formatTooltip << "</table>";
formatTooltip << "<p>" << tr("Example: Away since %%hh:mm%% on %%dd.MM%%.") << "</p>";
addRow("t", tr("current timezone"), true);
formatTooltip << "</table>";
formatTooltip << "<p>" << tr("Example: Away since %%hh:mm%% on %%dd.MM%%.") << "</p>";
- formatTooltip << "<p>" << tr("%%%% without anything inside represents %%. Other format "
- "codes are available.") << "</p>";
+ formatTooltip << "<p>"
+ << tr("%%%% without anything inside represents %%. Other format "
+ "codes are available.")
+ << "</p>";
formatTooltip << "</qt>";
// Split up the message to allow re-using translations:
// [Original tool-tip] [Timestamp format message]
ui.awayReason->setToolTip(strFormatTooltip.arg(ui.awayReason->toolTip()));
ui.detachAwayEnabled->setToolTip(strFormatTooltip.arg(ui.detachAwayEnabled->toolTip()));
formatTooltip << "</qt>";
// Split up the message to allow re-using translations:
// [Original tool-tip] [Timestamp format message]
ui.awayReason->setToolTip(strFormatTooltip.arg(ui.awayReason->toolTip()));
ui.detachAwayEnabled->setToolTip(strFormatTooltip.arg(ui.detachAwayEnabled->toolTip()));
void IdentityEditWidget::setWidgetStates()
{
if (ui.nicknameList->selectedItems().count()) {
ui.renameNick->setEnabled(true);
ui.nickUp->setEnabled(ui.nicknameList->row(ui.nicknameList->selectedItems()[0]) > 0);
void IdentityEditWidget::setWidgetStates()
{
if (ui.nicknameList->selectedItems().count()) {
ui.renameNick->setEnabled(true);
ui.nickUp->setEnabled(ui.nicknameList->row(ui.nicknameList->selectedItems()[0]) > 0);
ui.realName->setText(id->realName());
ui.nicknameList->clear();
ui.nicknameList->addItems(id->nicks());
ui.realName->setText(id->realName());
ui.nicknameList->clear();
ui.nicknameList->addItems(id->nicks());
ui.awayNick->setText(id->awayNick());
ui.awayReason->setText(id->awayReason());
ui.autoAwayEnabled->setChecked(id->autoAwayEnabled());
ui.awayNick->setText(id->awayNick());
ui.awayReason->setText(id->awayReason());
ui.autoAwayEnabled->setChecked(id->autoAwayEnabled());
id->setPartReason(ui.partReason->text().remove(linebreaks));
id->setQuitReason(ui.quitReason->text().remove(linebreaks));
#ifdef HAVE_SSL
id->setPartReason(ui.partReason->text().remove(linebreaks));
id->setQuitReason(ui.quitReason->text().remove(linebreaks));
#ifdef HAVE_SSL
NickEditDlg dlg(QString(), existing, this);
if (dlg.exec() == QDialog::Accepted) {
ui.nicknameList->addItem(dlg.nick());
NickEditDlg dlg(QString(), existing, this);
if (dlg.exec() == QDialog::Accepted) {
ui.nicknameList->addItem(dlg.nick());
void IdentityEditWidget::on_deleteNick_clicked()
{
// no confirmation, since a nickname is really nothing hard to recreate
if (ui.nicknameList->selectedItems().count()) {
delete ui.nicknameList->takeItem(ui.nicknameList->row(ui.nicknameList->selectedItems()[0]));
void IdentityEditWidget::on_deleteNick_clicked()
{
// no confirmation, since a nickname is really nothing hard to recreate
if (ui.nicknameList->selectedItems().count()) {
delete ui.nicknameList->takeItem(ui.nicknameList->row(ui.nicknameList->selectedItems()[0]));
NickEditDlg dlg(old, existing, this);
if (dlg.exec() == QDialog::Accepted) {
ui.nicknameList->selectedItems()[0]->setText(dlg.nick());
}
}
NickEditDlg dlg(old, existing, this);
if (dlg.exec() == QDialog::Accepted) {
ui.nicknameList->selectedItems()[0]->setText(dlg.nick());
}
}
- ui.nicknameList->insertItem(row-1, ui.nicknameList->takeItem(row));
- ui.nicknameList->setCurrentRow(row-1);
+ ui.nicknameList->insertItem(row - 1, ui.nicknameList->takeItem(row));
+ ui.nicknameList->setCurrentRow(row - 1);
- if (row < ui.nicknameList->count()-1) {
- ui.nicknameList->insertItem(row+1, ui.nicknameList->takeItem(row));
- ui.nicknameList->setCurrentRow(row+1);
+ if (row < ui.nicknameList->count() - 1) {
+ ui.nicknameList->insertItem(row + 1, ui.nicknameList->takeItem(row));
+ ui.nicknameList->setCurrentRow(row + 1);
void IdentityEditWidget::showAdvanced(bool advanced)
{
int idx = ui.tabWidget->indexOf(ui.advancedTab);
void IdentityEditWidget::showAdvanced(bool advanced)
{
int idx = ui.tabWidget->indexOf(ui.advancedTab);
{
if (event->mimeData()->hasFormat("text/uri-list") || event->mimeData()->hasFormat("text/uri")) {
event->setDropAction(Qt::CopyAction);
{
if (event->mimeData()->hasFormat("text/uri-list") || event->mimeData()->hasFormat("text/uri")) {
event->setDropAction(Qt::CopyAction);
void IdentityEditWidget::on_clearOrLoadKeyButton_clicked()
{
QSslKey key;
if (ui.keyTypeLabel->property("sslKey").toByteArray().isEmpty())
void IdentityEditWidget::on_clearOrLoadKeyButton_clicked()
{
QSslKey key;
if (ui.keyTypeLabel->property("sslKey").toByteArray().isEmpty())
- key = keyByFilename(QFileDialog::getOpenFileName(this, tr("Load a Key"), QStandardPaths::writableLocation(QStandardPaths::HomeLocation)));
+ key = keyByFilename(
+ QFileDialog::getOpenFileName(this, tr("Load a Key"), QStandardPaths::writableLocation(QStandardPaths::HomeLocation)));
- QMessageBox::information(this, tr("Failed to read key"), tr("Failed to read the key file. It is either incompatible or invalid. Note that the key file must not have a passphrase."));
+ QMessageBox::information(
+ this,
+ tr("Failed to read key"),
+ tr("Failed to read the key file. It is either incompatible or invalid. Note that the key file must not have a passphrase."));
- if(!key.isNull() && key.algorithm() == QSsl::KeyAlgorithm::Ec && !Client::isCoreFeatureEnabled(Quassel::Feature::EcdsaCertfpKeys)) {
- QMessageBox::information(this, tr("Core does not support ECDSA keys"), tr("You loaded an ECDSA key, but the core does not support ECDSA keys. Please contact the core administrator."));
+ if (!key.isNull() && key.algorithm() == QSsl::KeyAlgorithm::Ec && !Client::isCoreFeatureEnabled(Quassel::Feature::EcdsaCertfpKeys)) {
+ QMessageBox::
+ information(this,
+ tr("Core does not support ECDSA keys"),
+ tr("You loaded an ECDSA key, but the core does not support ECDSA keys. Please contact the core administrator."));
void IdentityEditWidget::on_clearOrLoadCertButton_clicked()
{
QSslCertificate cert;
if (ui.certOrgLabel->property("sslCert").toByteArray().isEmpty())
void IdentityEditWidget::on_clearOrLoadCertButton_clicked()
{
QSslCertificate cert;
if (ui.certOrgLabel->property("sslCert").toByteArray().isEmpty())
- cert = certByFilename(QFileDialog::getOpenFileName(this, tr("Load a Certificate"), QStandardPaths::writableLocation(QStandardPaths::HomeLocation)));
+ cert = certByFilename(
+ QFileDialog::getOpenFileName(this, tr("Load a Certificate"), QStandardPaths::writableLocation(QStandardPaths::HomeLocation)));