Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Jonathan White 2017-02-06 20:29:21 -05:00
commit 7db7747cb0
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01
28 changed files with 4179 additions and 1648 deletions

View file

@ -246,7 +246,7 @@ bool DatabaseTabWidget::closeDatabase(Database* db)
QMessageBox::StandardButton result =
MessageBox::question(
this, tr("Close?"),
tr("\"%1\" is in edit mode.\nDiscard changes and close anyway?").arg(dbName),
tr("\"%1\" is in edit mode.\nDiscard changes and close anyway?").arg(dbName.toHtmlEscaped()),
QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Cancel);
if (result == QMessageBox::Cancel) {
return false;
@ -262,7 +262,7 @@ bool DatabaseTabWidget::closeDatabase(Database* db)
QMessageBox::StandardButton result =
MessageBox::question(
this, tr("Save changes?"),
tr("\"%1\" was modified.\nSave changes?").arg(dbName),
tr("\"%1\" was modified.\nSave changes?").arg(dbName.toHtmlEscaped()),
QMessageBox::Yes | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Yes);
if (result == QMessageBox::Yes) {
if (!saveDatabase(db)) {

View file

@ -344,7 +344,7 @@ void DatabaseWidget::deleteEntries()
result = MessageBox::question(
this, tr("Delete entry?"),
tr("Do you really want to delete the entry \"%1\" for good?")
.arg(selectedEntries.first()->title()),
.arg(selectedEntries.first()->title().toHtmlEscaped()),
QMessageBox::Yes | QMessageBox::No);
}
else {
@ -368,7 +368,7 @@ void DatabaseWidget::deleteEntries()
result = MessageBox::question(
this, tr("Move entry to recycle bin?"),
tr("Do you really want to move entry \"%1\" to the recycle bin?")
.arg(selectedEntries.first()->title()),
.arg(selectedEntries.first()->title().toHtmlEscaped()),
QMessageBox::Yes | QMessageBox::No);
}
else {
@ -573,7 +573,7 @@ void DatabaseWidget::deleteGroup()
QMessageBox::StandardButton result = MessageBox::question(
this, tr("Delete group?"),
tr("Do you really want to delete the group \"%1\" for good?")
.arg(currentGroup->name()),
.arg(currentGroup->name().toHtmlEscaped()),
QMessageBox::Yes | QMessageBox::No);
if (result == QMessageBox::Yes) {
delete currentGroup;

View file

@ -190,6 +190,10 @@ void EditWidgetIcons::abortFaviconDownload(bool clearRedirect)
void EditWidgetIcons::onRequestFinished(QNetworkReply *reply)
{
if (m_database == nullptr) {
return;
}
if (!reply->error()) {
QImage image;
image.loadFromData(reply->readAll());

View file

@ -45,11 +45,15 @@ PasswordGeneratorWidget::PasswordGeneratorWidget(QWidget* parent)
connect(m_ui->optionButtons, SIGNAL(buttonClicked(int)), SLOT(updateGenerator()));
// set font size of password quality and entropy labels dynamically to 80% of the default font size
// set font size of password quality and entropy labels dynamically to 80% of
// the default font size, but make it no smaller than 8pt
QFont defaultFont;
defaultFont.setPointSize(static_cast<int>(defaultFont.pointSize() * 0.8f));
m_ui->entropyLabel->setFont(defaultFont);
m_ui->strengthLabel->setFont(defaultFont);
int smallerSize = static_cast<int>(defaultFont.pointSize() * 0.8f);
if (smallerSize >= 8) {
defaultFont.setPointSize(smallerSize);
m_ui->entropyLabel->setFont(defaultFont);
m_ui->strengthLabel->setFont(defaultFont);
}
loadSettings();
reset();
@ -132,8 +136,10 @@ void PasswordGeneratorWidget::updatePasswordStrength(const QString& password)
void PasswordGeneratorWidget::generatePassword()
{
QString password = m_generator->generatePassword();
m_ui->editNewPassword->setText(password);
if (m_generator->isValid()) {
QString password = m_generator->generatePassword();
m_ui->editNewPassword->setText(password);
}
}
void PasswordGeneratorWidget::applyPassword()
@ -279,5 +285,11 @@ void PasswordGeneratorWidget::updateGenerator()
m_generator->setCharClasses(classes);
m_generator->setFlags(flags);
if (m_generator->isValid()) {
m_ui->buttonGenerate->setEnabled(true);
} else {
m_ui->buttonGenerate->setEnabled(false);
}
regeneratePassword();
}

View file

@ -104,11 +104,6 @@ QProgressBar::chunk {
<height>30</height>
</size>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>strength</string>
</property>
@ -144,11 +139,6 @@ QProgressBar::chunk {
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>entropy</string>
</property>
@ -295,6 +285,12 @@ QProgressBar::chunk {
</item>
<item>
<widget class="QToolButton" name="checkBoxNumbers">
<property name="minimumSize">
<size>
<width>0</width>
<height>26</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
@ -314,6 +310,12 @@ QProgressBar::chunk {
</item>
<item>
<widget class="QToolButton" name="checkBoxSpecialChars">
<property name="minimumSize">
<size>
<width>0</width>
<height>26</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>

View file

@ -272,14 +272,15 @@ void EditEntryWidget::loadEntry(Entry* entry, bool create, bool history, const Q
m_history = history;
if (history) {
setHeadline(QString("%1 > %2").arg(parentName, tr("Entry history")));
setHeadline(QString("%1 > %2").arg(parentName.toHtmlEscaped(), tr("Entry history")));
}
else {
if (create) {
setHeadline(QString("%1 > %2").arg(parentName, tr("Add entry")));
setHeadline(QString("%1 > %2").arg(parentName.toHtmlEscaped(), tr("Add entry")));
}
else {
setHeadline(QString("%1 > %2 > %3").arg(parentName, entry->title(), tr("Edit entry")));
setHeadline(QString("%1 > %2 > %3").arg(parentName.toHtmlEscaped(),
entry->title().toHtmlEscaped(), tr("Edit entry")));
}
}