mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-27 00:09:53 -05:00
parent
0bac9752ba
commit
6c695e3fd0
@ -91,6 +91,7 @@ void Config::init(const QString& fileName)
|
||||
m_defaults.insert("ModifiedOnExpandedStateChanges", true);
|
||||
m_defaults.insert("AutoSaveAfterEveryChange", false);
|
||||
m_defaults.insert("AutoSaveOnExit", false);
|
||||
m_defaults.insert("ShowToolbar", true);
|
||||
m_defaults.insert("security/clearclipboard", true);
|
||||
m_defaults.insert("security/clearclipboardtimeout", 10);
|
||||
}
|
||||
|
@ -41,6 +41,9 @@ MainWindow::MainWindow()
|
||||
QAction* toggleViewAction = m_ui->toolBar->toggleViewAction();
|
||||
toggleViewAction->setText(tr("Show toolbar"));
|
||||
m_ui->menuView->addAction(toggleViewAction);
|
||||
bool showToolbar = config()->get("ShowToolbar").toBool();
|
||||
m_ui->toolBar->setVisible(showToolbar);
|
||||
connect(m_ui->toolBar, SIGNAL(visibilityChanged(bool)), this, SLOT(saveToolbarState(bool)));
|
||||
|
||||
m_clearHistoryAction = new QAction("Clear history", m_ui->menuFile);
|
||||
m_lastDatabasesActions = new QActionGroup(m_ui->menuRecentDatabases);
|
||||
@ -353,6 +356,11 @@ void MainWindow::showGroupContextMenu(const QPoint& globalPos)
|
||||
m_ui->menuGroups->popup(globalPos);
|
||||
}
|
||||
|
||||
void MainWindow::saveToolbarState(bool value)
|
||||
{
|
||||
config()->set("ShowToolbar", value);
|
||||
}
|
||||
|
||||
void MainWindow::setShortcut(QAction* action, QKeySequence::StandardKey standard, int fallback)
|
||||
{
|
||||
if (!QKeySequence::keyBindings(standard).isEmpty()) {
|
||||
|
@ -55,6 +55,7 @@ private Q_SLOTS:
|
||||
void updateLastDatabasesMenu();
|
||||
void showEntryContextMenu(const QPoint& globalPos);
|
||||
void showGroupContextMenu(const QPoint& globalPos);
|
||||
void saveToolbarState(bool value);
|
||||
|
||||
private:
|
||||
static void setShortcut(QAction* action, QKeySequence::StandardKey standard, int fallback = 0);
|
||||
|
Loading…
Reference in New Issue
Block a user