Added: automatically lock database after inactivity (closes #1906699)
git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@177 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
@@ -87,6 +87,15 @@ void AutoTypeDlg::resizeEvent(QResizeEvent* event){
|
||||
createBanner(&BannerPixmap,getPixmap("keepassx_large"),tr("Auto-Type"),width());
|
||||
}
|
||||
|
||||
bool AutoTypeDlg::event(QEvent* event){
|
||||
if (!EventOccurred){
|
||||
int t = event->type();
|
||||
if ( t>=QEvent::MouseButtonPress&&t<=QEvent::KeyRelease || t>=QEvent::HoverEnter&&t<=QEvent::HoverMove )
|
||||
EventOccurred = true;
|
||||
}
|
||||
return QWidget::event(event);
|
||||
}
|
||||
|
||||
void AutoTypeDlg::itemSelected(QTreeWidgetItem* item){
|
||||
close();
|
||||
QString err;
|
||||
|
||||
@@ -29,6 +29,7 @@ class AutoTypeDlg : public QWidget, private Ui::AutoTypeDlg
|
||||
protected:
|
||||
void paintEvent(QPaintEvent* event);
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
bool event(QEvent* event);
|
||||
|
||||
private slots:
|
||||
void itemSelected(QTreeWidgetItem* item);
|
||||
|
||||
@@ -50,6 +50,7 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
|
||||
connect(Radio_IntPlugin_Kde,SIGNAL(toggled(bool)),this,SLOT(OnIntPluginKde()));
|
||||
|
||||
connect(Button_CustomizeEntryDetails,SIGNAL(clicked()),this,SLOT(OnCustomizeEntryDetails()));
|
||||
connect(CheckBox_InactivityLock, SIGNAL(toggled(bool)), SLOT(OnInactivityLockChange(bool)));
|
||||
|
||||
#if !defined(AUTOTYPE)
|
||||
Box_AutoType->setVisible(false);
|
||||
@@ -115,6 +116,8 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
|
||||
CheckBox_ShowPasswords->setChecked(config->showPasswords());
|
||||
CheckBox_ShowPasswords_PasswordDlg->setChecked(config->showPasswordsPasswordDlg());
|
||||
CheckBox_LockMinimize->setChecked(config->lockOnMinimize());
|
||||
CheckBox_InactivityLock->setChecked(config->lockOnInactivity());
|
||||
SpinBox_InacitivtyTime->setValue(config->lockAfterSec());
|
||||
|
||||
//Features
|
||||
CheckBox_FeatureBookmarks->setChecked(config->featureBookmarks());
|
||||
@@ -221,6 +224,8 @@ void CSettingsDlg::apply(){
|
||||
config->setShowPasswords(CheckBox_ShowPasswords->isChecked());
|
||||
config->setShowPasswordsPasswordDlg(CheckBox_ShowPasswords_PasswordDlg->isChecked());
|
||||
config->setLockOnMinimize(CheckBox_LockMinimize->isChecked());
|
||||
config->setLockOnInactivity(CheckBox_InactivityLock->isChecked());
|
||||
config->setLockAfterSec(SpinBox_InacitivtyTime->value());
|
||||
|
||||
//Features
|
||||
config->setFeatureBookmarks(CheckBox_FeatureBookmarks->isChecked());
|
||||
@@ -321,6 +326,10 @@ void CSettingsDlg::OnCustomizeEntryDetails(){
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
void CSettingsDlg::OnInactivityLockChange(bool checked){
|
||||
SpinBox_InacitivtyTime->setEnabled(checked);
|
||||
}
|
||||
|
||||
#ifdef GLOBAL_AUTOTYPE
|
||||
void CSettingsDlg::resetGlobalShortcut(){
|
||||
AutoType::unregisterGlobalShortcut();
|
||||
|
||||
@@ -44,7 +44,7 @@ class CSettingsDlg : public QDialog, public Ui_SettingsDialog
|
||||
void OnMountDirBrowse();
|
||||
void OnBrowserCmdBrowse();
|
||||
void OnCustomizeEntryDetails();
|
||||
|
||||
void OnInactivityLockChange(bool checked);
|
||||
|
||||
#ifdef GLOBAL_AUTOTYPE
|
||||
private slots:
|
||||
|
||||
Reference in New Issue
Block a user