mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-03-06 13:15:57 -05:00
Merge pull request #5542 from keepassxreboot/hotfix/final-push
Final push for 2.6.2
This commit is contained in:
commit
a09acc86d0
@ -99,6 +99,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
|
||||
{Config::GUI_MinimizeOnStartup, {QS("GUI/MinimizeOnStartup"), Roaming, false}},
|
||||
{Config::GUI_MinimizeOnClose, {QS("GUI/MinimizeOnClose"), Roaming, false}},
|
||||
{Config::GUI_HideUsernames, {QS("GUI/HideUsernames"), Roaming, false}},
|
||||
{Config::GUI_HidePasswords, {QS("GUI/HidePasswords"), Roaming, true}},
|
||||
{Config::GUI_AdvancedSettings, {QS("GUI/AdvancedSettings"), Roaming, false}},
|
||||
{Config::GUI_MonospaceNotes, {QS("GUI/MonospaceNotes"), Roaming, false}},
|
||||
{Config::GUI_ApplicationTheme, {QS("GUI/ApplicationTheme"), Roaming, QS("auto")}},
|
||||
|
@ -81,6 +81,7 @@ public:
|
||||
GUI_MinimizeOnStartup,
|
||||
GUI_MinimizeOnClose,
|
||||
GUI_HideUsernames,
|
||||
GUI_HidePasswords,
|
||||
GUI_AdvancedSettings,
|
||||
GUI_MonospaceNotes,
|
||||
GUI_ApplicationTheme,
|
||||
|
@ -329,38 +329,6 @@ void DatabaseWidget::setPreviewSplitterSizes(const QList<int>& sizes)
|
||||
m_previewSplitter->setSizes(sizes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current state of entry view 'Hide Usernames' setting
|
||||
*/
|
||||
bool DatabaseWidget::isUsernamesHidden() const
|
||||
{
|
||||
return m_entryView->isUsernamesHidden();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set state of entry view 'Hide Usernames' setting
|
||||
*/
|
||||
void DatabaseWidget::setUsernamesHidden(bool hide)
|
||||
{
|
||||
m_entryView->setUsernamesHidden(hide);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current state of entry view 'Hide Passwords' setting
|
||||
*/
|
||||
bool DatabaseWidget::isPasswordsHidden() const
|
||||
{
|
||||
return m_entryView->isPasswordsHidden();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set state of entry view 'Hide Passwords' setting
|
||||
*/
|
||||
void DatabaseWidget::setPasswordsHidden(bool hide)
|
||||
{
|
||||
m_entryView->setPasswordsHidden(hide);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current view state of entry view
|
||||
*/
|
||||
@ -890,7 +858,8 @@ void DatabaseWidget::openUrlForEntry(Entry* entry)
|
||||
|
||||
// otherwise ask user
|
||||
if (!launch && cmdString.length() > 6) {
|
||||
QString cmdTruncated = cmdString.mid(6);
|
||||
QString cmdTruncated = entry->resolveMultiplePlaceholders(entry->maskPasswordPlaceholders(entry->url()));
|
||||
cmdTruncated = cmdTruncated.mid(6);
|
||||
if (cmdTruncated.length() > 400) {
|
||||
cmdTruncated = cmdTruncated.left(400) + " […]";
|
||||
}
|
||||
|
@ -104,10 +104,6 @@ public:
|
||||
|
||||
QStringList customEntryAttributes() const;
|
||||
bool isEditWidgetModified() const;
|
||||
bool isUsernamesHidden() const;
|
||||
void setUsernamesHidden(bool hide);
|
||||
bool isPasswordsHidden() const;
|
||||
void setPasswordsHidden(bool hide);
|
||||
void clearAllWidgets();
|
||||
bool currentEntryHasTitle();
|
||||
bool currentEntryHasUsername();
|
||||
|
@ -29,8 +29,6 @@ DatabaseWidgetStateSync::DatabaseWidgetStateSync(QObject* parent)
|
||||
{
|
||||
m_mainSplitterSizes = variantToIntList(config()->get(Config::GUI_SplitterState));
|
||||
m_previewSplitterSizes = variantToIntList(config()->get(Config::GUI_PreviewSplitterState));
|
||||
m_hideUsernames = config()->get(Config::GUI_HideUsernames).toBool();
|
||||
m_hidePasswords = true;
|
||||
m_listViewState = config()->get(Config::GUI_ListViewState).toByteArray();
|
||||
m_searchViewState = config()->get(Config::GUI_SearchViewState).toByteArray();
|
||||
|
||||
@ -48,7 +46,6 @@ void DatabaseWidgetStateSync::sync()
|
||||
{
|
||||
config()->set(Config::GUI_SplitterState, intListToVariant(m_mainSplitterSizes));
|
||||
config()->set(Config::GUI_PreviewSplitterState, intListToVariant(m_previewSplitterSizes));
|
||||
config()->set(Config::GUI_HideUsernames, m_hideUsernames);
|
||||
config()->set(Config::GUI_ListViewState, m_listViewState);
|
||||
config()->set(Config::GUI_SearchViewState, m_searchViewState);
|
||||
config()->sync();
|
||||
@ -104,9 +101,6 @@ void DatabaseWidgetStateSync::setActive(DatabaseWidget* dbWidget)
|
||||
*/
|
||||
void DatabaseWidgetStateSync::restoreListView()
|
||||
{
|
||||
m_activeDbWidget->setUsernamesHidden(m_hideUsernames);
|
||||
m_activeDbWidget->setPasswordsHidden(m_hidePasswords);
|
||||
|
||||
if (!m_listViewState.isEmpty()) {
|
||||
m_activeDbWidget->setEntryViewState(m_listViewState);
|
||||
}
|
||||
@ -129,9 +123,6 @@ void DatabaseWidgetStateSync::restoreListView()
|
||||
*/
|
||||
void DatabaseWidgetStateSync::restoreSearchView()
|
||||
{
|
||||
m_activeDbWidget->setUsernamesHidden(m_hideUsernames);
|
||||
m_activeDbWidget->setPasswordsHidden(m_hidePasswords);
|
||||
|
||||
if (!m_searchViewState.isEmpty()) {
|
||||
m_activeDbWidget->setEntryViewState(m_searchViewState);
|
||||
} else {
|
||||
@ -169,9 +160,6 @@ void DatabaseWidgetStateSync::updateViewState()
|
||||
return;
|
||||
}
|
||||
|
||||
m_hideUsernames = m_activeDbWidget->isUsernamesHidden();
|
||||
m_hidePasswords = m_activeDbWidget->isPasswordsHidden();
|
||||
|
||||
if (m_activeDbWidget->isSearchActive()) {
|
||||
m_searchViewState = m_activeDbWidget->entryViewState();
|
||||
} else {
|
||||
|
@ -51,9 +51,6 @@ private:
|
||||
QList<int> m_mainSplitterSizes;
|
||||
QList<int> m_previewSplitterSizes;
|
||||
|
||||
bool m_hideUsernames;
|
||||
bool m_hidePasswords;
|
||||
|
||||
QByteArray m_listViewState;
|
||||
QByteArray m_searchViewState;
|
||||
};
|
||||
|
@ -332,10 +332,6 @@ MainWindow::MainWindow()
|
||||
shortcut = new QShortcut(dbTabModifier + Qt::Key_9, this);
|
||||
connect(shortcut, &QShortcut::activated, [this]() { selectDatabaseTab(m_ui->tabWidget->count() - 1); });
|
||||
|
||||
// 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(resources()->icon("document-new"));
|
||||
m_ui->actionDatabaseOpen->setIcon(resources()->icon("document-open"));
|
||||
m_ui->menuRecentDatabases->setIcon(resources()->icon("document-open-recent"));
|
||||
@ -1126,22 +1122,6 @@ 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)
|
||||
{
|
||||
if (m_appExiting) {
|
||||
@ -1757,4 +1737,23 @@ void MainWindow::initViewMenu()
|
||||
connect(m_ui->actionShowPreviewPanel, &QAction::toggled, this, [](bool checked) {
|
||||
config()->set(Config::GUI_HidePreviewPanel, !checked);
|
||||
});
|
||||
|
||||
connect(m_ui->actionAlwaysOnTop, &QAction::toggled, this, [this](bool checked) {
|
||||
if (checked) {
|
||||
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
} else {
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
}
|
||||
show();
|
||||
});
|
||||
|
||||
m_ui->actionHideUsernames->setChecked(config()->get(Config::GUI_HideUsernames).toBool());
|
||||
connect(m_ui->actionHideUsernames, &QAction::toggled, this, [](bool checked) {
|
||||
config()->set(Config::GUI_HideUsernames, checked);
|
||||
});
|
||||
|
||||
m_ui->actionHidePasswords->setChecked(config()->get(Config::GUI_HidePasswords).toBool());
|
||||
connect(m_ui->actionHidePasswords, &QAction::toggled, this, [](bool checked) {
|
||||
config()->set(Config::GUI_HidePasswords, checked);
|
||||
});
|
||||
}
|
||||
|
@ -131,8 +131,6 @@ private slots:
|
||||
void selectNextDatabaseTab();
|
||||
void selectPreviousDatabaseTab();
|
||||
void selectDatabaseTab(int tabIndex, bool wrap = false);
|
||||
void togglePasswordsHidden();
|
||||
void toggleUsernamesHidden();
|
||||
void obtainContextFocusLock();
|
||||
void releaseContextFocusLock();
|
||||
void agentEnabled(bool enabled);
|
||||
|
@ -381,8 +381,11 @@
|
||||
</widget>
|
||||
<addaction name="menuTheme"/>
|
||||
<addaction name="actionCompactMode"/>
|
||||
<addaction name="actionAlwaysOnTop"/>
|
||||
<addaction name="actionShowPreviewPanel"/>
|
||||
<addaction name="actionShowToolbar"/>
|
||||
<addaction name="actionHideUsernames"/>
|
||||
<addaction name="actionHidePasswords"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuEntries"/>
|
||||
@ -972,6 +975,42 @@
|
||||
<string>Show Preview Panel</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAlwaysOnTop">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Always on Top</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string notr="true">Ctrl+Shift+A</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionHideUsernames">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hide Usernames</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string notr="true">Ctrl+Shift+B</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionHidePasswords">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hide Passwords</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string notr="true">Ctrl+Shift+C</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
@ -997,6 +997,11 @@ bool EditEntryWidget::commitEntry()
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check Auto-Type validity early
|
||||
if (!AutoType::verifyAutoTypeSyntax(m_autoTypeUi->sequenceEdit->text())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_advancedUi->attributesView->currentIndex().isValid() && m_advancedUi->attributesEdit->isEnabled()) {
|
||||
QString key = m_attributesModel->keyByIndex(m_advancedUi->attributesView->currentIndex());
|
||||
m_entryAttributes->set(key, m_advancedUi->attributesEdit->toPlainText(), m_entryAttributes->isProtected(key));
|
||||
@ -1095,7 +1100,7 @@ void EditEntryWidget::updateEntryData(Entry* entry) const
|
||||
entry->setAutoTypeEnabled(m_autoTypeUi->enableButton->isChecked());
|
||||
if (m_autoTypeUi->inheritSequenceButton->isChecked()) {
|
||||
entry->setDefaultAutoTypeSequence(QString());
|
||||
} else if (AutoType::verifyAutoTypeSyntax(m_autoTypeUi->sequenceEdit->text())) {
|
||||
} else {
|
||||
entry->setDefaultAutoTypeSequence(m_autoTypeUi->sequenceEdit->text());
|
||||
}
|
||||
|
||||
@ -1364,6 +1369,7 @@ void EditEntryWidget::removeAutoTypeAssoc()
|
||||
|
||||
void EditEntryWidget::loadCurrentAssoc(const QModelIndex& current)
|
||||
{
|
||||
bool modified = isModified();
|
||||
if (current.isValid() && current.row() < m_autoTypeAssoc->size()) {
|
||||
AutoTypeAssociations::Association assoc = m_autoTypeAssoc->get(current.row());
|
||||
m_autoTypeUi->windowTitleCombo->setEditText(assoc.window);
|
||||
@ -1379,6 +1385,7 @@ void EditEntryWidget::loadCurrentAssoc(const QModelIndex& current)
|
||||
} else {
|
||||
clearCurrentAssoc();
|
||||
}
|
||||
setModified(modified);
|
||||
}
|
||||
|
||||
void EditEntryWidget::clearCurrentAssoc()
|
||||
|
@ -37,11 +37,10 @@
|
||||
EntryModel::EntryModel(QObject* parent)
|
||||
: QAbstractTableModel(parent)
|
||||
, m_group(nullptr)
|
||||
, m_hideUsernames(false)
|
||||
, m_hidePasswords(true)
|
||||
, HiddenContentDisplay(QString("\u25cf").repeated(6))
|
||||
, DateFormat(Qt::DefaultLocaleShortDate)
|
||||
{
|
||||
connect(config(), &Config::changed, this, &EntryModel::onConfigChanged);
|
||||
}
|
||||
|
||||
Entry* EntryModel::entryFromIndex(const QModelIndex& index) const
|
||||
@ -156,7 +155,7 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const
|
||||
}
|
||||
return result;
|
||||
case Username:
|
||||
if (m_hideUsernames) {
|
||||
if (config()->get(Config::GUI_HideUsernames).toBool()) {
|
||||
result = EntryModel::HiddenContentDisplay;
|
||||
} else {
|
||||
result = entry->resolveMultiplePlaceholders(entry->username());
|
||||
@ -164,9 +163,12 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const
|
||||
if (attr->isReference(EntryAttributes::UserNameKey)) {
|
||||
result.prepend(tr("Ref: ", "Reference abbreviation"));
|
||||
}
|
||||
if (entry->username().isEmpty() && !config()->get(Config::Security_PasswordEmptyPlaceholder).toBool()) {
|
||||
result = "";
|
||||
}
|
||||
return result;
|
||||
case Password:
|
||||
if (m_hidePasswords) {
|
||||
if (config()->get(Config::GUI_HidePasswords).toBool()) {
|
||||
result = EntryModel::HiddenContentDisplay;
|
||||
} else {
|
||||
result = entry->resolveMultiplePlaceholders(entry->password());
|
||||
@ -537,6 +539,20 @@ void EntryModel::entryDataChanged(Entry* entry)
|
||||
emit dataChanged(index(row, 0), index(row, columnCount() - 1));
|
||||
}
|
||||
|
||||
void EntryModel::onConfigChanged(Config::ConfigKey key)
|
||||
{
|
||||
switch (key) {
|
||||
case Config::GUI_HideUsernames:
|
||||
emit dataChanged(index(0, Username), index(rowCount() - 1, Username), {Qt::DisplayRole});
|
||||
break;
|
||||
case Config::GUI_HidePasswords:
|
||||
emit dataChanged(index(0, Password), index(rowCount() - 1, Password), {Qt::DisplayRole});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void EntryModel::severConnections()
|
||||
{
|
||||
if (m_group) {
|
||||
@ -560,39 +576,3 @@ void EntryModel::makeConnections(const Group* group)
|
||||
connect(group, SIGNAL(entryMovedDown()), SLOT(entryMovedDown()));
|
||||
connect(group, SIGNAL(entryDataChanged(Entry*)), SLOT(entryDataChanged(Entry*)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current state of 'Hide Usernames' setting
|
||||
*/
|
||||
bool EntryModel::isUsernamesHidden() const
|
||||
{
|
||||
return m_hideUsernames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set state of 'Hide Usernames' setting and signal change
|
||||
*/
|
||||
void EntryModel::setUsernamesHidden(bool hide)
|
||||
{
|
||||
m_hideUsernames = hide;
|
||||
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
|
||||
emit usernamesHiddenChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current state of 'Hide Passwords' setting
|
||||
*/
|
||||
bool EntryModel::isPasswordsHidden() const
|
||||
{
|
||||
return m_hidePasswords;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set state of 'Hide Passwords' setting and signal change
|
||||
*/
|
||||
void EntryModel::setPasswordsHidden(bool hide)
|
||||
{
|
||||
m_hidePasswords = hide;
|
||||
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
|
||||
emit passwordsHiddenChanged();
|
||||
}
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include <QAbstractTableModel>
|
||||
#include <QPixmap>
|
||||
|
||||
#include "core/Config.h"
|
||||
|
||||
class Entry;
|
||||
class Group;
|
||||
|
||||
@ -64,15 +66,6 @@ public:
|
||||
void setGroup(Group* group);
|
||||
void setEntries(const QList<Entry*>& entries);
|
||||
|
||||
bool isUsernamesHidden() const;
|
||||
void setUsernamesHidden(bool hide);
|
||||
bool isPasswordsHidden() const;
|
||||
void setPasswordsHidden(bool hide);
|
||||
|
||||
signals:
|
||||
void usernamesHiddenChanged();
|
||||
void passwordsHiddenChanged();
|
||||
|
||||
private slots:
|
||||
void entryAboutToAdd(Entry* entry);
|
||||
void entryAdded(Entry* entry);
|
||||
@ -84,6 +77,8 @@ private slots:
|
||||
void entryMovedDown();
|
||||
void entryDataChanged(Entry* entry);
|
||||
|
||||
void onConfigChanged(Config::ConfigKey key);
|
||||
|
||||
private:
|
||||
void severConnections();
|
||||
void makeConnections(const Group* group);
|
||||
@ -93,9 +88,6 @@ private:
|
||||
QList<Entry*> m_orgEntries;
|
||||
QList<const Group*> m_allGroups;
|
||||
|
||||
bool m_hideUsernames;
|
||||
bool m_hidePasswords;
|
||||
|
||||
const QString HiddenContentDisplay;
|
||||
const Qt::DateFormat DateFormat;
|
||||
};
|
||||
|
@ -32,7 +32,7 @@ EntryView::EntryView(QWidget* parent)
|
||||
, m_sortModel(new SortFilterHideProxyModel(this))
|
||||
, m_lastIndex(-1)
|
||||
, m_lastOrder(Qt::AscendingOrder)
|
||||
, m_inSearchMode(false)
|
||||
, m_headerMenu(new QMenu(this))
|
||||
{
|
||||
m_sortModel->setSourceModel(m_model);
|
||||
m_sortModel->setDynamicSortFilter(true);
|
||||
@ -55,22 +55,10 @@ EntryView::EntryView(QWidget* parent)
|
||||
// clang-format off
|
||||
connect(this, SIGNAL(doubleClicked(QModelIndex)), SLOT(emitEntryActivated(QModelIndex)));
|
||||
connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(emitEntrySelectionChanged()));
|
||||
connect(m_model, SIGNAL(usernamesHiddenChanged()), SIGNAL(viewStateChanged()));
|
||||
connect(m_model, SIGNAL(passwordsHiddenChanged()), SIGNAL(viewStateChanged()));
|
||||
// clang-format on
|
||||
|
||||
new QShortcut(Qt::CTRL + Qt::Key_F10, this, SLOT(contextMenuShortcutPressed()), nullptr, Qt::WidgetShortcut);
|
||||
|
||||
m_headerMenu = new QMenu(this);
|
||||
m_headerMenu->setTitle(tr("Customize View"));
|
||||
m_headerMenu->addSection(tr("Customize View"));
|
||||
|
||||
m_hideUsernamesAction = m_headerMenu->addAction(tr("Hide Usernames"), this, SLOT(setUsernamesHidden(bool)));
|
||||
m_hideUsernamesAction->setCheckable(true);
|
||||
m_hidePasswordsAction = m_headerMenu->addAction(tr("Hide Passwords"), this, SLOT(setPasswordsHidden(bool)));
|
||||
m_hidePasswordsAction->setCheckable(true);
|
||||
m_headerMenu->addSeparator();
|
||||
|
||||
resetViewToDefaults();
|
||||
|
||||
// Actions to toggle column visibility, each carrying the corresponding
|
||||
@ -292,50 +280,6 @@ int EntryView::currentEntryIndex()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current state of 'Hide Usernames' setting (NOTE: just pass-through for
|
||||
* m_model)
|
||||
*/
|
||||
bool EntryView::isUsernamesHidden() const
|
||||
{
|
||||
return m_model->isUsernamesHidden();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set state of 'Hide Usernames' setting (NOTE: just pass-through for m_model)
|
||||
*/
|
||||
void EntryView::setUsernamesHidden(bool hide)
|
||||
{
|
||||
bool block = m_hideUsernamesAction->signalsBlocked();
|
||||
m_hideUsernamesAction->blockSignals(true);
|
||||
m_hideUsernamesAction->setChecked(hide);
|
||||
m_hideUsernamesAction->blockSignals(block);
|
||||
|
||||
m_model->setUsernamesHidden(hide);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current state of 'Hide Passwords' setting (NOTE: just pass-through for
|
||||
* m_model)
|
||||
*/
|
||||
bool EntryView::isPasswordsHidden() const
|
||||
{
|
||||
return m_model->isPasswordsHidden();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set state of 'Hide Passwords' setting (NOTE: just pass-through for m_model)
|
||||
*/
|
||||
void EntryView::setPasswordsHidden(bool hide)
|
||||
{
|
||||
bool block = m_hidePasswordsAction->signalsBlocked();
|
||||
m_hidePasswordsAction->blockSignals(true);
|
||||
m_hidePasswordsAction->setChecked(hide);
|
||||
m_hidePasswordsAction->blockSignals(block);
|
||||
|
||||
m_model->setPasswordsHidden(hide);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current view state
|
||||
*/
|
||||
@ -363,8 +307,6 @@ bool EntryView::setViewState(const QByteArray& state)
|
||||
*/
|
||||
void EntryView::showHeaderMenu(const QPoint& position)
|
||||
{
|
||||
m_hideUsernamesAction->setChecked(m_model->isUsernamesHidden());
|
||||
m_hidePasswordsAction->setChecked(m_model->isPasswordsHidden());
|
||||
const QList<QAction*> actions = m_columnActions->actions();
|
||||
for (auto& action : actions) {
|
||||
Q_ASSERT(static_cast<QMetaType::Type>(action->data().type()) == QMetaType::Int);
|
||||
@ -469,9 +411,6 @@ void EntryView::resetFixedColumns()
|
||||
*/
|
||||
void EntryView::resetViewToDefaults()
|
||||
{
|
||||
m_model->setUsernamesHidden(false);
|
||||
m_model->setPasswordsHidden(true);
|
||||
|
||||
// Reduce number of columns that are shown by default
|
||||
if (m_inSearchMode) {
|
||||
header()->showSection(EntryModel::ParentGroup);
|
||||
|
@ -44,8 +44,6 @@ public:
|
||||
bool isSorted();
|
||||
int numberOfSelectedEntries();
|
||||
void setFirstEntryActive();
|
||||
bool isUsernamesHidden() const;
|
||||
bool isPasswordsHidden() const;
|
||||
QByteArray viewState() const;
|
||||
bool setViewState(const QByteArray& state);
|
||||
|
||||
@ -57,10 +55,6 @@ signals:
|
||||
void entrySelectionChanged(Entry* entry);
|
||||
void viewStateChanged();
|
||||
|
||||
public slots:
|
||||
void setUsernamesHidden(bool hide);
|
||||
void setPasswordsHidden(bool hide);
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
void focusInEvent(QFocusEvent* event) override;
|
||||
@ -86,12 +80,10 @@ private:
|
||||
SortFilterHideProxyModel* const m_sortModel;
|
||||
int m_lastIndex;
|
||||
Qt::SortOrder m_lastOrder;
|
||||
bool m_inSearchMode;
|
||||
bool m_inSearchMode = false;
|
||||
bool m_columnsNeedRelayout = true;
|
||||
|
||||
QMenu* m_headerMenu;
|
||||
QAction* m_hideUsernamesAction;
|
||||
QAction* m_hidePasswordsAction;
|
||||
QActionGroup* m_columnActions;
|
||||
};
|
||||
|
||||
|
@ -66,7 +66,7 @@ void ShareObserver::deinitialize()
|
||||
|
||||
void ShareObserver::reinitialize()
|
||||
{
|
||||
QList<QPair<Group*, KeeShareSettings::Reference>> shares;
|
||||
QList<QPair<QPointer<Group>, KeeShareSettings::Reference>> shares;
|
||||
for (Group* group : m_db->rootGroup()->groupsRecursive(true)) {
|
||||
auto oldReference = m_groupToReference.value(group);
|
||||
auto newReference = KeeShare::referenceOf(group);
|
||||
@ -97,6 +97,10 @@ void ShareObserver::reinitialize()
|
||||
for (const auto& share : shares) {
|
||||
auto group = share.first;
|
||||
auto& reference = share.second;
|
||||
// Check group validity, it may have been deleted by a merge action
|
||||
if (!group) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!reference.path.isEmpty() && reference.type != KeeShareSettings::Inactive) {
|
||||
const auto newResolvedPath = resolvePath(reference.path, m_db);
|
||||
|
@ -18,13 +18,24 @@
|
||||
|
||||
set -e
|
||||
|
||||
DEBUG=false
|
||||
JSON_OUT=""
|
||||
BASE_DIR="."
|
||||
INSTALL_DIR=""
|
||||
INSTALL_FILE="org.keepassxc.keepassxc_browser.json"
|
||||
|
||||
# Early out if the keepassxc.proxy executable cannot be found
|
||||
if ! command -v keepassxc.proxy; then
|
||||
echo "Could not find keepassxc.proxy! Ensure the keepassxc snap is installed properly."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
PROXY_PATH=$(command -v keepassxc.proxy)
|
||||
|
||||
JSON_FIREFOX=$(cat << EOF
|
||||
{
|
||||
"name": "org.keepassxc.keepassxc_browser",
|
||||
"description": "KeePassXC integration with native messaging support",
|
||||
"path": "/snap/bin/keepassxc.proxy",
|
||||
"path": "${PROXY_PATH}",
|
||||
"type": "stdio",
|
||||
"allowed_extensions": [
|
||||
"keepassxc-browser@keepassxc.org"
|
||||
@ -37,7 +48,7 @@ JSON_CHROME=$(cat << EOF
|
||||
{
|
||||
"name": "org.keepassxc.keepassxc_browser",
|
||||
"description": "KeePassXC integration with native messaging support",
|
||||
"path": "/snap/bin/keepassxc.proxy",
|
||||
"path": "${PROXY_PATH}",
|
||||
"type": "stdio",
|
||||
"allowed_origins": [
|
||||
"chrome-extension://iopaggbpplllidnfmcghoonnokmjoicf/",
|
||||
@ -47,21 +58,6 @@ JSON_CHROME=$(cat << EOF
|
||||
EOF
|
||||
)
|
||||
|
||||
JSON_OUT=""
|
||||
BASE_DIR="."
|
||||
INSTALL_DIR=""
|
||||
INSTALL_FILE="org.keepassxc.keepassxc_browser.json"
|
||||
|
||||
buildJson() {
|
||||
if [ -n "$1" ]; then
|
||||
# Insert Firefox data
|
||||
JSON_OUT=$JSON_FIREFOX
|
||||
else
|
||||
# Insert Chrome data
|
||||
JSON_OUT=$JSON_CHROME
|
||||
fi
|
||||
}
|
||||
|
||||
askBrowserSnap() {
|
||||
if (whiptail --title "Snap Choice" --defaultno \
|
||||
--yesno "Is this browser installed as a snap (usually NO)?" 8 60); then
|
||||
@ -73,33 +69,33 @@ askBrowserSnap() {
|
||||
|
||||
setupFirefox() {
|
||||
askBrowserSnap "./snap/firefox/common"
|
||||
buildJson "firefox"
|
||||
JSON_OUT=${JSON_FIREFOX}
|
||||
INSTALL_DIR="${BASE_DIR}/.mozilla/native-messaging-hosts"
|
||||
}
|
||||
|
||||
setupChrome() {
|
||||
buildJson
|
||||
JSON_OUT=${JSON_CHROME}
|
||||
INSTALL_DIR="${BASE_DIR}/.config/google-chrome/NativeMessagingHosts"
|
||||
}
|
||||
|
||||
setupChromium() {
|
||||
askBrowserSnap "./snap/chromium/current"
|
||||
buildJson
|
||||
JSON_OUT=${JSON_CHROME}
|
||||
INSTALL_DIR="${BASE_DIR}/.config/chromium/NativeMessagingHosts"
|
||||
}
|
||||
|
||||
setupVivaldi() {
|
||||
buildJson
|
||||
JSON_OUT=${JSON_CHROME}
|
||||
INSTALL_DIR="${BASE_DIR}/.config/vivaldi/NativeMessagingHosts"
|
||||
}
|
||||
|
||||
setupBrave() {
|
||||
buildJson
|
||||
JSON_OUT=${JSON_CHROME}
|
||||
INSTALL_DIR="${BASE_DIR}/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts"
|
||||
}
|
||||
|
||||
setupTorBrowser() {
|
||||
buildJson "firefox"
|
||||
JSON_OUT=${JSON_FIREFOX}
|
||||
INSTALL_DIR="${BASE_DIR}/.tor-browser/app/Browser/TorBrowser/Data/Browser/.mozilla/native-messaging-hosts"
|
||||
}
|
||||
|
||||
@ -138,8 +134,6 @@ if [ $exitstatus = 0 ]; then
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
echo "$JSON_OUT" > ${INSTALL_DIR}/${INSTALL_FILE}
|
||||
|
||||
$DEBUG && echo "Installed to: ${INSTALL_DIR}/${INSTALL_FILE}"
|
||||
|
||||
whiptail \
|
||||
--title "Installation Complete" \
|
||||
--msgbox "You will need to restart your browser in order to connect to KeePassXC" \
|
||||
|
Loading…
x
Reference in New Issue
Block a user