mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
* Have CardDatabase::getPreferredPrintingInfo respect card provider ID overrides (pinned printings)
Took 13 minutes
Took 37 seconds
Took 10 seconds
Took 10 seconds
# Commit time for manual adjustment:
# Took 30 seconds
Took 15 seconds
Took 8 minutes
Took 21 seconds
* Move settings cache and settings card preference provider out of libcockatrice_settings and into cockatrice
Took 52 minutes
Took 9 minutes
Took 1 minute
* Temp cache.
Took 16 minutes
* Dependency Injection for SettingsCache
* Turn SettingsCache into a QSharedPointer.
* Implement interfaces for settings that need it
Took 2 hours 38 minutes
* Adjust oracle.
Took 5 minutes
* Move abstract/noop interfaces to libcockatrice_interfaces so they can be linked against independently.
Took 52 minutes
* Clean up some links.
Took 3 minutes
* Cleanup two includes.
Took 3 minutes
* More fixes.
Took 7 minutes
* More includes that slipped past.
Took 3 minutes
* Stop mocking and start injecting for tests.
Took 15 minutes
* I don't know why remote_client was including main.
Took 4 minutes
* Include.
Took 3 minutes
* Lint.
Took 2 minutes
* Don't use Qt pointers.
Took 1 hour 7 minutes
* Make parser use CardSettingsInterface
Took 13 minutes
* Also adjust constructor lol.
Took 8 minutes
* Lint.
Took 32 minutes
* Revert "Lint."
This reverts commit ecb596c39e.
Took 3 minutes
* Test.
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
72 lines
2.5 KiB
C++
72 lines
2.5 KiB
C++
#include "dlg_edit_password.h"
|
|
|
|
#include "../../../client/settings/cache_settings.h"
|
|
|
|
#include <QDialogButtonBox>
|
|
#include <QGridLayout>
|
|
#include <QHBoxLayout>
|
|
#include <QLabel>
|
|
#include <QMessageBox>
|
|
#include <libcockatrice/utility/trice_limits.h>
|
|
|
|
DlgEditPassword::DlgEditPassword(QWidget *parent) : QDialog(parent)
|
|
{
|
|
oldPasswordLabel = new QLabel(tr("Old password:"));
|
|
oldPasswordEdit = new QLineEdit();
|
|
oldPasswordEdit->setMaxLength(MAX_NAME_LENGTH);
|
|
|
|
auto &servers = SettingsCache::instance().servers();
|
|
if (servers.getSavePassword()) {
|
|
oldPasswordEdit->setText(servers.getPassword());
|
|
}
|
|
|
|
oldPasswordLabel->setBuddy(oldPasswordEdit);
|
|
oldPasswordEdit->setEchoMode(QLineEdit::Password);
|
|
|
|
newPasswordLabel = new QLabel(tr("New password:"));
|
|
newPasswordEdit = new QLineEdit();
|
|
newPasswordEdit->setMaxLength(MAX_NAME_LENGTH);
|
|
newPasswordLabel->setBuddy(newPasswordLabel);
|
|
newPasswordEdit->setEchoMode(QLineEdit::Password);
|
|
|
|
newPasswordLabel2 = new QLabel(tr("Confirm new password:"));
|
|
newPasswordEdit2 = new QLineEdit();
|
|
newPasswordEdit2->setMaxLength(MAX_NAME_LENGTH);
|
|
newPasswordLabel2->setBuddy(newPasswordLabel2);
|
|
newPasswordEdit2->setEchoMode(QLineEdit::Password);
|
|
|
|
QGridLayout *grid = new QGridLayout;
|
|
grid->addWidget(oldPasswordLabel, 0, 0);
|
|
grid->addWidget(oldPasswordEdit, 0, 1);
|
|
grid->addWidget(newPasswordLabel, 1, 0);
|
|
grid->addWidget(newPasswordEdit, 1, 1);
|
|
grid->addWidget(newPasswordLabel2, 2, 0);
|
|
grid->addWidget(newPasswordEdit2, 2, 1);
|
|
|
|
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
|
connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgEditPassword::actOk);
|
|
connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgEditPassword::reject);
|
|
|
|
QVBoxLayout *mainLayout = new QVBoxLayout;
|
|
mainLayout->addLayout(grid);
|
|
mainLayout->addWidget(buttonBox);
|
|
setLayout(mainLayout);
|
|
|
|
setWindowTitle(tr("Change password"));
|
|
setFixedHeight(sizeHint().height());
|
|
setMinimumWidth(300);
|
|
}
|
|
|
|
void DlgEditPassword::actOk()
|
|
{
|
|
// TODO this stuff should be using qvalidators
|
|
if (newPasswordEdit->text().length() < 8) {
|
|
QMessageBox::critical(this, tr("Error"), tr("Your password is too short."));
|
|
return;
|
|
} else if (newPasswordEdit->text() != newPasswordEdit2->text()) {
|
|
QMessageBox::warning(this, tr("Error"), tr("The new passwords don't match."));
|
|
return;
|
|
}
|
|
|
|
accept();
|
|
}
|