diff --git a/src/gui/ApplicationSettingsWidgetSecurity.ui b/src/gui/ApplicationSettingsWidgetSecurity.ui
index 4052e5d6..344c2b81 100644
--- a/src/gui/ApplicationSettingsWidgetSecurity.ui
+++ b/src/gui/ApplicationSettingsWidgetSecurity.ui
@@ -175,7 +175,7 @@
-
- Show passwords in cleartext by default
+ Don't hide passwords when editing them
diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp
index 38891995..3faf43a6 100644
--- a/src/gui/DatabaseWidget.cpp
+++ b/src/gui/DatabaseWidget.cpp
@@ -114,7 +114,6 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent)
m_previewView = new EntryPreviewWidget(this);
m_previewView->hide();
- connect(this, SIGNAL(pressedEntry(Entry*)), m_previewView, SLOT(setEntry(Entry*)));
connect(this, SIGNAL(pressedGroup(Group*)), m_previewView, SLOT(setGroup(Group*)));
connect(this, SIGNAL(currentModeChanged(DatabaseWidget::Mode)),
m_previewView, SLOT(setDatabaseMode(DatabaseWidget::Mode)));
@@ -183,7 +182,7 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent)
connect(m_entryView,
SIGNAL(entryActivated(Entry*,EntryModel::ModelColumn)),
SLOT(entryActivationSignalReceived(Entry*,EntryModel::ModelColumn)));
- connect(m_entryView, SIGNAL(entrySelectionChanged()), SIGNAL(entrySelectionChanged()));
+ connect(m_entryView, SIGNAL(entrySelectionChanged()), SLOT(emitEntrySelectionChanged()));
connect(m_editEntryWidget, SIGNAL(editFinished(bool)), SLOT(switchToView(bool)));
connect(m_editEntryWidget, SIGNAL(historyEntryActivated(Entry*)), SLOT(switchToHistoryView(Entry*)));
connect(m_historyEditEntryWidget, SIGNAL(editFinished(bool)), SLOT(switchBackToEntryEdit()));
@@ -202,9 +201,7 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent)
connect(m_groupView, SIGNAL(groupPressed(Group*)), SLOT(emitPressedGroup(Group*)));
connect(m_groupView, SIGNAL(groupChanged(Group*)), SLOT(emitPressedGroup(Group*)));
- connect(m_entryView, SIGNAL(entryPressed(Entry*)), SLOT(emitPressedEntry(Entry*)));
- connect(m_entryView, SIGNAL(entrySelectionChanged()), SLOT(emitPressedEntry()));
- connect(m_editEntryWidget, SIGNAL(editFinished(bool)), SLOT(emitPressedEntry()));
+ connect(m_editEntryWidget, SIGNAL(editFinished(bool)), SLOT(emitEntrySelectionChanged()));
m_databaseModified = false;
@@ -506,80 +503,60 @@ void DatabaseWidget::setFocus()
void DatabaseWidget::copyTitle()
{
Entry* currentEntry = m_entryView->currentEntry();
- Q_ASSERT(currentEntry);
- if (!currentEntry) {
- return;
+ if (currentEntry) {
+ setClipboardTextAndMinimize(currentEntry->resolveMultiplePlaceholders(currentEntry->title()));
}
-
- setClipboardTextAndMinimize(currentEntry->resolveMultiplePlaceholders(currentEntry->title()));
}
void DatabaseWidget::copyUsername()
{
Entry* currentEntry = m_entryView->currentEntry();
- Q_ASSERT(currentEntry);
- if (!currentEntry) {
- return;
+ if (currentEntry) {
+ setClipboardTextAndMinimize(currentEntry->resolveMultiplePlaceholders(currentEntry->username()));
}
-
- setClipboardTextAndMinimize(currentEntry->resolveMultiplePlaceholders(currentEntry->username()));
}
void DatabaseWidget::copyPassword()
{
Entry* currentEntry = m_entryView->currentEntry();
- Q_ASSERT(currentEntry);
- if (!currentEntry) {
- return;
+ if (currentEntry) {
+ setClipboardTextAndMinimize(currentEntry->resolveMultiplePlaceholders(currentEntry->password()));
}
-
- setClipboardTextAndMinimize(currentEntry->resolveMultiplePlaceholders(currentEntry->password()));
}
void DatabaseWidget::copyURL()
{
Entry* currentEntry = m_entryView->currentEntry();
- Q_ASSERT(currentEntry);
- if (!currentEntry) {
- return;
+ if (currentEntry) {
+ setClipboardTextAndMinimize(currentEntry->resolveMultiplePlaceholders(currentEntry->url()));
}
-
- setClipboardTextAndMinimize(currentEntry->resolveMultiplePlaceholders(currentEntry->url()));
}
void DatabaseWidget::copyNotes()
{
Entry* currentEntry = m_entryView->currentEntry();
- Q_ASSERT(currentEntry);
- if (!currentEntry) {
- return;
+ if (currentEntry) {
+ setClipboardTextAndMinimize(currentEntry->resolveMultiplePlaceholders(currentEntry->notes()));
}
-
- setClipboardTextAndMinimize(currentEntry->resolveMultiplePlaceholders(currentEntry->notes()));
}
void DatabaseWidget::copyAttribute(QAction* action)
{
Entry* currentEntry = m_entryView->currentEntry();
- Q_ASSERT(currentEntry);
- if (!currentEntry) {
- return;
+ if (currentEntry) {
+ setClipboardTextAndMinimize(
+ currentEntry->resolveMultiplePlaceholders(
+ currentEntry->attributes()->value(action->data().toString())));
}
-
- setClipboardTextAndMinimize(
- currentEntry->resolveMultiplePlaceholders(currentEntry->attributes()->value(action->data().toString())));
}
void DatabaseWidget::showTotpKeyQrCode()
{
Entry* currentEntry = m_entryView->currentEntry();
- Q_ASSERT(currentEntry);
- if (!currentEntry) {
- return;
+ if (currentEntry) {
+ auto totpDisplayDialog = new TotpExportSettingsDialog(this, currentEntry);
+ totpDisplayDialog->open();
}
-
- auto totpDisplayDialog = new TotpExportSettingsDialog(this, currentEntry);
- totpDisplayDialog->open();
}
void DatabaseWidget::setClipboardTextAndMinimize(const QString& text)
@@ -593,27 +570,22 @@ void DatabaseWidget::setClipboardTextAndMinimize(const QString& text)
void DatabaseWidget::performAutoType()
{
Entry* currentEntry = m_entryView->currentEntry();
- Q_ASSERT(currentEntry);
- if (!currentEntry) {
- return;
+ if (currentEntry) {
+ autoType()->performAutoType(currentEntry, window());
}
-
- autoType()->performAutoType(currentEntry, window());
}
void DatabaseWidget::openUrl()
{
Entry* currentEntry = m_entryView->currentEntry();
- Q_ASSERT(currentEntry);
- if (!currentEntry) {
- return;
+ if (currentEntry) {
+ openUrlForEntry(currentEntry);
}
-
- openUrlForEntry(currentEntry);
}
void DatabaseWidget::openUrlForEntry(Entry* entry)
{
+ Q_ASSERT(entry);
QString cmdString = entry->resolveMultiplePlaceholders(entry->url());
if (cmdString.startsWith("cmd://")) {
// check if decision to execute command was stored
@@ -1076,10 +1048,11 @@ void DatabaseWidget::setSearchLimitGroup(bool state)
void DatabaseWidget::onGroupChanged(Group* group)
{
// Intercept group changes if in search mode
- if (isInSearchMode())
+ if (isInSearchMode()) {
search(m_lastSearchText);
- else
+ } else {
m_entryView->setGroup(group);
+ }
}
QString DatabaseWidget::getCurrentSearch()
@@ -1114,20 +1087,14 @@ void DatabaseWidget::emitEntryContextMenuRequested(const QPoint& pos)
emit entryContextMenuRequested(m_entryView->viewport()->mapToGlobal(pos));
}
-void DatabaseWidget::emitPressedEntry()
+void DatabaseWidget::emitEntrySelectionChanged()
{
Entry* currentEntry = m_entryView->currentEntry();
- emitPressedEntry(currentEntry);
-}
-
-void DatabaseWidget::emitPressedEntry(Entry* currentEntry)
-{
- if (!currentEntry) {
- // if no entry is pressed, leave in details the last entry
- return;
+ if (currentEntry) {
+ m_previewView->setEntry(currentEntry);
}
- emit pressedEntry(currentEntry);
+ emit entrySelectionChanged();
}
void DatabaseWidget::emitPressedGroup(Group* currentGroup)
@@ -1354,7 +1321,12 @@ void DatabaseWidget::restoreGroupEntryFocus(const QUuid& groupUuid, const QUuid&
bool DatabaseWidget::isGroupSelected() const
{
- return m_groupView->currentGroup() != nullptr;
+ return m_groupView->currentGroup();
+}
+
+bool DatabaseWidget::currentEntryHasFocus()
+{
+ return m_entryView->numberOfSelectedEntries() > 0 && m_entryView->hasFocus();
}
bool DatabaseWidget::currentEntryHasTitle()
diff --git a/src/gui/DatabaseWidget.h b/src/gui/DatabaseWidget.h
index 828aace5..a5cf538d 100644
--- a/src/gui/DatabaseWidget.h
+++ b/src/gui/DatabaseWidget.h
@@ -99,6 +99,7 @@ public:
QByteArray entryViewState() const;
bool setEntryViewState(const QByteArray& state) const;
void clearAllWidgets();
+ bool currentEntryHasFocus();
bool currentEntryHasTitle();
bool currentEntryHasUsername();
bool currentEntryHasPassword();
@@ -198,9 +199,8 @@ private slots:
void switchToGroupEdit(Group* entry, bool create);
void emitGroupContextMenuRequested(const QPoint& pos);
void emitEntryContextMenuRequested(const QPoint& pos);
- void emitPressedEntry();
- void emitPressedEntry(Entry* currentEntry);
void emitPressedGroup(Group* currentGroup);
+ void emitEntrySelectionChanged();
void openDatabase(bool accepted);
void mergeDatabase(bool accepted);
void unlockDatabase(bool accepted);
diff --git a/src/gui/EntryPreviewWidget.cpp b/src/gui/EntryPreviewWidget.cpp
index af6ffac3..b9fa2638 100644
--- a/src/gui/EntryPreviewWidget.cpp
+++ b/src/gui/EntryPreviewWidget.cpp
@@ -47,12 +47,14 @@ EntryPreviewWidget::EntryPreviewWidget(QWidget* parent)
// Entry
m_ui->entryTotpButton->setIcon(filePath()->icon("actions", "chronometer"));
m_ui->entryCloseButton->setIcon(filePath()->icon("actions", "dialog-close"));
+ m_ui->togglePasswordButton->setIcon(filePath()->onOffIcon("actions", "password-show"));
m_ui->entryAttachmentsWidget->setReadOnly(true);
m_ui->entryAttachmentsWidget->setButtonsVisible(false);
connect(m_ui->entryTotpButton, SIGNAL(toggled(bool)), m_ui->entryTotpWidget, SLOT(setVisible(bool)));
connect(m_ui->entryCloseButton, SIGNAL(clicked()), SLOT(hide()));
+ connect(m_ui->togglePasswordButton, SIGNAL(clicked(bool)), SLOT(setPasswordVisible(bool)));
connect(m_ui->entryTabWidget, SIGNAL(tabBarClicked(int)), SLOT(updateTabIndexes()), Qt::QueuedConnection);
connect(&m_totpTimer, SIGNAL(timeout()), this, SLOT(updateTotpLabel()));
@@ -152,18 +154,40 @@ void EntryPreviewWidget::updateEntryTotp()
}
}
+void EntryPreviewWidget::setPasswordVisible(bool state)
+{
+ const QString password = m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->password());
+ auto flags = m_ui->entryPasswordLabel->textInteractionFlags();
+ if (state) {
+ m_ui->entryPasswordLabel->setRawText(password);
+ m_ui->entryPasswordLabel->setToolTip(password);
+ m_ui->entryPasswordLabel->setTextInteractionFlags(flags | Qt::TextSelectableByMouse);
+ } else {
+ m_ui->entryPasswordLabel->setTextInteractionFlags(flags & ~Qt::TextSelectableByMouse);
+ m_ui->entryPasswordLabel->setToolTip({});
+ if (password.isEmpty() && config()->get("security/passwordemptynodots").toBool()) {
+ m_ui->entryPasswordLabel->setRawText("");
+ } else {
+ m_ui->entryPasswordLabel->setRawText(QString("\u25cf").repeated(6));
+ }
+ }
+}
+
void EntryPreviewWidget::updateEntryGeneralTab()
{
Q_ASSERT(m_currentEntry);
m_ui->entryUsernameLabel->setText(m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->username()));
- if (!config()->get("security/HidePasswordPreviewPanel").toBool()) {
- const QString password = m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->password());
- m_ui->entryPasswordLabel->setRawText(password);
- m_ui->entryPasswordLabel->setToolTip(password);
+ if (config()->get("security/HidePasswordPreviewPanel").toBool()) {
+ // Hide password
+ setPasswordVisible(false);
+ // Show the password toggle button if there are dots in the label
+ m_ui->togglePasswordButton->setVisible(!m_ui->entryPasswordLabel->rawText().isEmpty());
+ m_ui->togglePasswordButton->setChecked(false);
} else {
- m_ui->entryPasswordLabel->setRawText(QString("\u25cf").repeated(6));
- m_ui->entryPasswordLabel->setToolTip({});
+ // Show password
+ setPasswordVisible(true);
+ m_ui->togglePasswordButton->setVisible(false);
}
m_ui->entryUrlLabel->setRawText(m_currentEntry->displayUrl());
diff --git a/src/gui/EntryPreviewWidget.h b/src/gui/EntryPreviewWidget.h
index 88c72962..9e687c6d 100644
--- a/src/gui/EntryPreviewWidget.h
+++ b/src/gui/EntryPreviewWidget.h
@@ -51,6 +51,7 @@ private slots:
void updateEntryAttributesTab();
void updateEntryAttachmentsTab();
void updateEntryAutotypeTab();
+ void setPasswordVisible(bool state);
void updateGroupHeaderLine();
void updateGroupGeneralTab();
diff --git a/src/gui/EntryPreviewWidget.ui b/src/gui/EntryPreviewWidget.ui
index 1fde8aa3..7e84d412 100644
--- a/src/gui/EntryPreviewWidget.ui
+++ b/src/gui/EntryPreviewWidget.ui
@@ -6,8 +6,8 @@
0
0
- 280
- 267
+ 573
+ 330
@@ -168,7 +168,7 @@
-
-
+
0
@@ -181,65 +181,21 @@
0
-
-
-
-
-
- 0
- 0
-
+
-
+
+
+ Qt::Horizontal
-
+
+ QSizePolicy::Fixed
+
+
- 100
- 0
+ 20
+ 20
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 100
- 0
-
-
-
- PointingHandCursor
-
-
-
-
-
- Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 100
- 0
-
-
-
- Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse
-
-
+
-
@@ -266,6 +222,50 @@
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 100
+ 0
+
+
+
+ username
+
+
+ Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 75
+ true
+
+
+
+ Password
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
-
@@ -288,7 +288,45 @@
- -
+
-
+
+
+ Qt::Vertical
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 100
+ 0
+
+
+
+ PointingHandCursor
+
+
+ https://example.com
+
+
+ Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse
+
+
+
+ -
@@ -296,6 +334,9 @@
0
+
+ expired
+
-
@@ -320,8 +361,47 @@
- -
-
+
-
+
+
+ 6
+
+
+ 4
+
+
-
+
+
+
+
+
+ true
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 100
+ 0
+
+
+
+ password
+
+
+
+
+
+ -
+
Qt::Horizontal
@@ -336,37 +416,34 @@
- -
-
-
-
- 0
- 0
-
-
-
-
- 75
- true
-
-
-
- Password
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
+
-
+
- Qt::Vertical
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
- 0
- 0
+ 20
+ 20
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 20
@@ -688,6 +765,12 @@
Qt::Vertical
+
+
+ 0
+ 0
+
+
diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp
index ac26dd87..d9f9a055 100644
--- a/src/gui/MainWindow.cpp
+++ b/src/gui/MainWindow.cpp
@@ -183,7 +183,7 @@ MainWindow::MainWindow()
m_ui->actionDatabaseNew->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_N);
setShortcut(m_ui->actionDatabaseOpen, QKeySequence::Open, Qt::CTRL + Qt::Key_O);
setShortcut(m_ui->actionDatabaseSave, QKeySequence::Save, Qt::CTRL + Qt::Key_S);
- setShortcut(m_ui->actionDatabaseSaveAs, QKeySequence::SaveAs);
+ setShortcut(m_ui->actionDatabaseSaveAs, QKeySequence::SaveAs, Qt::CTRL + Qt::SHIFT + Qt::Key_S);
setShortcut(m_ui->actionDatabaseClose, QKeySequence::Close, Qt::CTRL + Qt::Key_W);
m_ui->actionLockDatabases->setShortcut(Qt::CTRL + Qt::Key_L);
setShortcut(m_ui->actionQuit, QKeySequence::Quit, Qt::CTRL + Qt::Key_Q);
@@ -196,16 +196,37 @@ MainWindow::MainWindow()
m_ui->actionEntryCopyTotp->setShortcut(Qt::CTRL + Qt::Key_T);
m_ui->actionEntryCopyUsername->setShortcut(Qt::CTRL + Qt::Key_B);
m_ui->actionEntryCopyPassword->setShortcut(Qt::CTRL + Qt::Key_C);
- setShortcut(m_ui->actionEntryAutoType, QKeySequence::Paste, Qt::CTRL + Qt::Key_V);
- m_ui->actionEntryOpenUrl->setShortcut(Qt::CTRL + Qt::Key_U);
- m_ui->actionEntryCopyURL->setShortcut(Qt::CTRL + Qt::ALT + Qt::Key_U);
+ m_ui->actionEntryAutoType->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_V);
+ m_ui->actionEntryOpenUrl->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_U);
+ m_ui->actionEntryCopyURL->setShortcut(Qt::CTRL + Qt::Key_U);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
+ // Qt 5.10 introduced a new "feature" to hide shortcuts in context menus
+ // Unfortunately, Qt::AA_DontShowShortcutsInContextMenus is broken, have to manually enable them
+ m_ui->actionEntryNew->setShortcutVisibleInContextMenu(true);
+ m_ui->actionEntryEdit->setShortcutVisibleInContextMenu(true);
+ m_ui->actionEntryDelete->setShortcutVisibleInContextMenu(true);
+ m_ui->actionEntryClone->setShortcutVisibleInContextMenu(true);
+ m_ui->actionEntryTotp->setShortcutVisibleInContextMenu(true);
+ m_ui->actionEntryCopyTotp->setShortcutVisibleInContextMenu(true);
+ m_ui->actionEntryCopyUsername->setShortcutVisibleInContextMenu(true);
+ m_ui->actionEntryCopyPassword->setShortcutVisibleInContextMenu(true);
+ m_ui->actionEntryAutoType->setShortcutVisibleInContextMenu(true);
+ m_ui->actionEntryOpenUrl->setShortcutVisibleInContextMenu(true);
+ m_ui->actionEntryCopyURL->setShortcutVisibleInContextMenu(true);
+#endif
+
+ // Control window state
new QShortcut(Qt::CTRL + Qt::Key_M, this, SLOT(showMinimized()));
new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_M, this, SLOT(hideWindow()));
+ // Control database tabs
new QShortcut(Qt::CTRL + Qt::Key_Tab, this, SLOT(selectNextDatabaseTab()));
new QShortcut(Qt::CTRL + Qt::Key_PageUp, this, SLOT(selectNextDatabaseTab()));
new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Tab, this, SLOT(selectPreviousDatabaseTab()));
new QShortcut(Qt::CTRL + Qt::Key_PageDown, this, SLOT(selectPreviousDatabaseTab()));
+ // Toggle password and username visibility in entry view
+ new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_C, this, SLOT(togglePasswordsHidden()));
+ new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_B, this, SLOT(toggleUsernamesHidden()));
m_ui->actionDatabaseNew->setIcon(filePath()->icon("actions", "document-new"));
m_ui->actionDatabaseOpen->setIcon(filePath()->icon("actions", "document-open"));
@@ -457,8 +478,8 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)
switch (mode) {
case DatabaseWidget::ViewMode: {
// bool inSearch = dbWidget->isInSearchMode();
- bool singleEntrySelected = dbWidget->numberOfSelectedEntries() == 1;
- bool entriesSelected = dbWidget->numberOfSelectedEntries() > 0;
+ bool singleEntrySelected = dbWidget->numberOfSelectedEntries() == 1 && dbWidget->currentEntryHasFocus();
+ bool entriesSelected = dbWidget->numberOfSelectedEntries() > 0 && dbWidget->currentEntryHasFocus();
bool groupSelected = dbWidget->isGroupSelected();
bool recycleBinSelected = dbWidget->isRecycleBinSelected();
@@ -472,7 +493,7 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)
m_ui->actionEntryCopyURL->setEnabled(singleEntrySelected && dbWidget->currentEntryHasUrl());
m_ui->actionEntryCopyNotes->setEnabled(singleEntrySelected && dbWidget->currentEntryHasNotes());
m_ui->menuEntryCopyAttribute->setEnabled(singleEntrySelected);
- m_ui->menuEntryTotp->setEnabled(true);
+ m_ui->menuEntryTotp->setEnabled(singleEntrySelected);
m_ui->actionEntryAutoType->setEnabled(singleEntrySelected);
m_ui->actionEntryOpenUrl->setEnabled(singleEntrySelected && dbWidget->currentEntryHasUrl());
m_ui->actionEntryTotp->setEnabled(singleEntrySelected && dbWidget->currentEntryHasTotp());
@@ -507,13 +528,6 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)
for (QAction* action : groupActions) {
action->setEnabled(false);
}
- m_ui->actionEntryCopyTitle->setEnabled(false);
- m_ui->actionEntryCopyUsername->setEnabled(false);
- m_ui->actionEntryCopyPassword->setEnabled(false);
- m_ui->actionEntryCopyURL->setEnabled(false);
- m_ui->actionEntryCopyNotes->setEnabled(false);
- m_ui->menuEntryCopyAttribute->setEnabled(false);
- m_ui->menuEntryTotp->setEnabled(false);
m_ui->actionChangeMasterKey->setEnabled(false);
m_ui->actionChangeDatabaseSettings->setEnabled(false);
@@ -539,13 +553,6 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)
for (QAction* action : groupActions) {
action->setEnabled(false);
}
- m_ui->actionEntryCopyTitle->setEnabled(false);
- m_ui->actionEntryCopyUsername->setEnabled(false);
- m_ui->actionEntryCopyPassword->setEnabled(false);
- m_ui->actionEntryCopyURL->setEnabled(false);
- m_ui->actionEntryCopyNotes->setEnabled(false);
- m_ui->menuEntryCopyAttribute->setEnabled(false);
- m_ui->menuEntryTotp->setEnabled(false);
m_ui->actionChangeMasterKey->setEnabled(false);
m_ui->actionChangeDatabaseSettings->setEnabled(false);
@@ -731,6 +738,22 @@ void MainWindow::databaseTabChanged(int tabIndex)
m_actionMultiplexer.setCurrentObject(m_ui->tabWidget->currentDatabaseWidget());
}
+void MainWindow::togglePasswordsHidden()
+{
+ auto dbWidget = m_ui->tabWidget->currentDatabaseWidget();
+ if (dbWidget) {
+ dbWidget->setPasswordsHidden(!dbWidget->isPasswordsHidden());
+ }
+}
+
+void MainWindow::toggleUsernamesHidden()
+{
+ auto dbWidget = m_ui->tabWidget->currentDatabaseWidget();
+ if (dbWidget) {
+ dbWidget->setUsernamesHidden(!dbWidget->isUsernamesHidden());
+ }
+}
+
void MainWindow::closeEvent(QCloseEvent* event)
{
// ignore double close events (happens on macOS when closing from the dock)
diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h
index 174e4756..caf2a0c5 100644
--- a/src/gui/MainWindow.h
+++ b/src/gui/MainWindow.h
@@ -112,6 +112,8 @@ private slots:
void showErrorMessage(const QString& message);
void selectNextDatabaseTab();
void selectPreviousDatabaseTab();
+ void togglePasswordsHidden();
+ void toggleUsernamesHidden();
private:
static void setShortcut(QAction* action, QKeySequence::StandardKey standard, int fallback = 0);
diff --git a/src/gui/MainWindow.ui b/src/gui/MainWindow.ui
index 2c74c706..c719cb67 100644
--- a/src/gui/MainWindow.ui
+++ b/src/gui/MainWindow.ui
@@ -180,7 +180,7 @@
0
0
800
- 30
+ 21
@@ -197,7 +197,7 @@
- Time-based one-time password
+ TOTP...
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+