-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8f9ac8
commit 3f78e5f
Showing
8 changed files
with
58 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* Copyright (C) 2023 KeePassXC Team <[email protected]> | ||
* Copyright (C) 2010 Felix Geyer <[email protected]> | ||
* Copyright (C) 2017 KeePassXC Team <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -205,6 +205,11 @@ bool Entry::autoTypeEnabled() const | |
return m_data.autoTypeEnabled; | ||
} | ||
|
||
bool Entry::groupAutoTypeEnabled() const | ||
{ | ||
return group() && group()->resolveAutoTypeEnabled(); | ||
} | ||
|
||
int Entry::autoTypeObfuscation() const | ||
{ | ||
return m_data.autoTypeObfuscation; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* Copyright (C) 2023 KeePassXC Team <[email protected]> | ||
* Copyright (C) 2010 Felix Geyer <[email protected]> | ||
* Copyright (C) 2017 KeePassXC Team <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -91,6 +91,7 @@ class Entry : public ModifiableObject | |
QStringList tagList() const; | ||
const TimeInfo& timeInfo() const; | ||
bool autoTypeEnabled() const; | ||
bool groupAutoTypeEnabled() const; | ||
int autoTypeObfuscation() const; | ||
QString defaultAutoTypeSequence() const; | ||
QString effectiveAutoTypeSequence() const; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* Copyright (C) 2023 KeePassXC Team <[email protected]> | ||
* Copyright (C) 2010 Felix Geyer <[email protected]> | ||
* Copyright (C) 2021 KeePassXC Team <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -1977,6 +1977,16 @@ bool DatabaseWidget::currentEntryHasNotes() | |
return !currentEntry->resolveMultiplePlaceholders(currentEntry->notes()).isEmpty(); | ||
} | ||
|
||
bool DatabaseWidget::currentEntryHasAutoTypeEnabled() | ||
{ | ||
auto currentEntry = currentSelectedEntry(); | ||
if (!currentEntry) { | ||
return false; | ||
} | ||
|
||
return currentEntry->autoTypeEnabled() && currentEntry->groupAutoTypeEnabled(); | ||
} | ||
|
||
GroupView* DatabaseWidget::groupView() | ||
{ | ||
return m_groupView; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* Copyright (C) 2023 KeePassXC Team <[email protected]> | ||
* Copyright (C) 2010 Felix Geyer <[email protected]> | ||
* Copyright (C) 2021 KeePassXC Team <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -116,6 +116,7 @@ class DatabaseWidget : public QStackedWidget | |
#ifdef WITH_XC_SSHAGENT | ||
bool currentEntryHasSshKey(); | ||
#endif | ||
bool currentEntryHasAutoTypeEnabled(); | ||
|
||
QByteArray entryViewState() const; | ||
bool setEntryViewState(const QByteArray& state) const; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* Copyright (C) 2023 KeePassXC Team <[email protected]> | ||
* Copyright (C) 2012 Felix Geyer <[email protected]> | ||
* Copyright (C) 2017 KeePassXC Team <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -468,7 +468,9 @@ void EntryPreviewWidget::updateEntryAutotypeTab() | |
} | ||
|
||
m_ui->entryAutotypeTree->addTopLevelItems(items); | ||
setTabEnabled(m_ui->entryTabWidget, m_ui->entryAutotypeTab, m_currentEntry->autoTypeEnabled()); | ||
setTabEnabled(m_ui->entryTabWidget, | ||
m_ui->entryAutotypeTab, | ||
m_currentEntry->autoTypeEnabled() && m_currentEntry->groupAutoTypeEnabled()); | ||
} | ||
|
||
void EntryPreviewWidget::updateGroupHeaderLine() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* Copyright (C) 2023 KeePassXC Team <[email protected]> | ||
* Copyright (C) 2010 Felix Geyer <[email protected]> | ||
* Copyright (C) 2020 KeePassXC Team <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -929,8 +929,9 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode) | |
m_ui->menuEntryCopyAttribute->setEnabled(singleEntrySelected); | ||
m_ui->menuEntryTotp->setEnabled(singleEntrySelected); | ||
m_ui->menuTags->setEnabled(entriesSelected); | ||
m_ui->actionEntryAutoType->setEnabled(singleEntrySelected); | ||
m_ui->actionEntryAutoType->menu()->setEnabled(singleEntrySelected); | ||
m_ui->actionEntryAutoType->setEnabled(singleEntrySelected && dbWidget->currentEntryHasAutoTypeEnabled()); | ||
m_ui->actionEntryAutoType->menu()->setEnabled(singleEntrySelected | ||
&& dbWidget->currentEntryHasAutoTypeEnabled()); | ||
m_ui->actionEntryAutoTypeSequence->setText( | ||
singleEntrySelected ? dbWidget->currentSelectedEntry()->effectiveAutoTypeSequence() | ||
: Group::RootAutoTypeSequence); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* Copyright (C) 2023 KeePassXC Team <[email protected]> | ||
* Copyright (C) 2010 Felix Geyer <[email protected]> | ||
* Copyright (C) 2017 KeePassXC Team <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -1293,3 +1293,29 @@ void TestGroup::testPreviousParentGroup() | |
QVERIFY(group1->previousParentGroupUuid() == group2->uuid()); | ||
QVERIFY(group1->previousParentGroup() == group2); | ||
} | ||
|
||
void TestGroup::testAutoTypeState() | ||
{ | ||
Database db; | ||
auto* root = db.rootGroup(); | ||
|
||
auto* entry1 = new Entry(); | ||
entry1->setGroup(root); | ||
|
||
auto subGroup = new Group(); | ||
subGroup->setParent(root); | ||
auto* entry2 = new Entry(); | ||
entry2->setGroup(subGroup); | ||
|
||
// Disable Auto-Type from root group | ||
root->setAutoTypeEnabled(Group::TriState::Disable); | ||
QVERIFY(!entry1->groupAutoTypeEnabled()); | ||
QVERIFY(!entry2->groupAutoTypeEnabled()); | ||
|
||
// Enable Auto-Type for sub group | ||
subGroup->setAutoTypeEnabled(Group::TriState::Enable); | ||
QVERIFY(root->autoTypeEnabled() == Group::TriState::Disable); | ||
QVERIFY(subGroup->autoTypeEnabled() == Group::TriState::Enable); | ||
QVERIFY(!entry1->groupAutoTypeEnabled()); | ||
QVERIFY(entry2->groupAutoTypeEnabled()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* Copyright (C) 2023 KeePassXC Team <[email protected]> | ||
* Copyright (C) 2010 Felix Geyer <[email protected]> | ||
* Copyright (C) 2017 KeePassXC Team <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -49,6 +49,7 @@ private slots: | |
void testUsernamesRecursive(); | ||
void testMoveUpDown(); | ||
void testPreviousParentGroup(); | ||
void testAutoTypeState(); | ||
}; | ||
|
||
#endif // KEEPASSX_TESTGROUP_H |