/***************************************************************************
- * Copyright (C) 2005-2018 by the Quassel Project *
+ * Copyright (C) 2005-2022 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
connect(Client::instance(), &Client::identityRemoved, this, &IdentitiesSettingsPage::clientIdentityRemoved);
connect(ui.identityEditor, &IdentityEditWidget::widgetHasChanged, this, &IdentitiesSettingsPage::widgetHasChanged);
-#ifdef HAVE_SSL
connect(ui.identityEditor, &IdentityEditWidget::requestEditSsl, this, &IdentitiesSettingsPage::continueUnsecured);
-#endif
currentId = 0;
}
{
setEnabled(connected);
if (connected) {
-#ifdef HAVE_SSL
if (Client::signalProxy()->isSecure()) {
ui.identityEditor->setSslState(IdentityEditWidget::AllowSsl);
_editSsl = true;
ui.identityEditor->setSslState(IdentityEditWidget::UnsecureSsl);
_editSsl = false;
}
-#else
- ui.identityEditor->setSslState(IdentityEditWidget::NoSsl);
-#endif
load();
}
else {
}
}
-#ifdef HAVE_SSL
void IdentitiesSettingsPage::continueUnsecured()
{
_editSsl = true;
ui.identityEditor->setSslState(IdentityEditWidget::AllowSsl);
}
-#endif
-
void IdentitiesSettingsPage::save()
{
setEnabled(false);
if (currentId != 0) {
changedIdentities.removeAll(currentId);
CertIdentity temp(currentId, this);
-#ifdef HAVE_SSL
// we need to set the cert and key manually, as they aren't synced
CertIdentity* old = identities[currentId];
temp.setSslKey(old->sslKey());
temp.setSslCert(old->sslCert());
-#endif
ui.identityEditor->saveToIdentity(&temp);
temp.setIdentityName(identities[currentId]->identityName());
if (temp != *Client::identity(currentId) || temp.isDirty())
void IdentitiesSettingsPage::clientIdentityCreated(IdentityId id)
{
auto* identity = new CertIdentity(*Client::identity(id), this);
-#ifdef HAVE_SSL
identity->enableEditSsl(_editSsl);
-#endif
insertIdentity(identity);
-#ifdef HAVE_SSL
connect(identity, &CertIdentity::sslSettingsUpdated, this, &IdentitiesSettingsPage::clientIdentityUpdated);
-#endif
connect(Client::identity(id), &SyncableObject::updatedRemotely, this, &IdentitiesSettingsPage::clientIdentityUpdated);
}
}
id = -id.toInt();
auto* newId = new CertIdentity(id, this);
-#ifdef HAVE_SSL
newId->enableEditSsl(_editSsl);
-#endif
if (dlg.duplicateId() != 0) {
// duplicate
newId->copyFrom(*identities[dlg.duplicateId()]);
}
connect(cid, &SyncableObject::updatedRemotely, this, &SaveIdentitiesDlg::clientEvent);
Client::updateIdentity(id->id(), id->toVariantMap());
-#ifdef HAVE_SSL
id->requestUpdateSslSettings();
-#endif
}
foreach (IdentityId id, toRemove) {
Client::removeIdentity(id);