auto-type delays
git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@137 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
parent
276939290d
commit
c2554f30f0
|
@ -2,7 +2,7 @@
|
||||||
min-height: 120px;
|
min-height: 120px;
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
height: 120px;
|
height: 120px;
|
||||||
background-image: url('../images/headerbackground.png');
|
background-image: url('./images/headerbackground.png');
|
||||||
background-repeat: repeat-x;
|
background-repeat: repeat-x;
|
||||||
padding: 0 25px 15px 25px;
|
padding: 0 25px 15px 25px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
min-height: 120px;
|
min-height: 120px;
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
height: 120px;
|
height: 120px;
|
||||||
background-image: url('../images/logo.png');
|
background-image: url('./images/logo.png');
|
||||||
padding: 0 25px 15px 25px;
|
padding: 0 25px 15px 25px;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -1,13 +1,110 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
<html>
|
<HTML
|
||||||
<head>
|
><HEAD
|
||||||
<title>KeePassX</title>
|
><TITLE
|
||||||
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
>KeePassX User Guide</TITLE
|
||||||
</head>
|
><META
|
||||||
<body>
|
NAME="GENERATOR"
|
||||||
<div id="wrapheader">
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||||
<div id="logo"/>
|
REL="NEXT"
|
||||||
</div>
|
TITLE="Introduction"
|
||||||
<h1>Introduction</h1><br/>
|
HREF="f3.html"></HEAD
|
||||||
- to be written -
|
><BODY
|
||||||
</body>
|
CLASS="book"
|
||||||
|
BGCOLOR="#FFFFFF"
|
||||||
|
TEXT="#000000"
|
||||||
|
LINK="#0000FF"
|
||||||
|
VLINK="#840084"
|
||||||
|
ALINK="#0000FF"
|
||||||
|
><DIV
|
||||||
|
CLASS="BOOK"
|
||||||
|
><A
|
||||||
|
NAME="basic_usage"
|
||||||
|
></A
|
||||||
|
><DIV
|
||||||
|
CLASS="TITLEPAGE"
|
||||||
|
><H1
|
||||||
|
CLASS="title"
|
||||||
|
><A
|
||||||
|
NAME="basic_usage"
|
||||||
|
>KeePassX User Guide</A
|
||||||
|
></H1
|
||||||
|
><HR></DIV
|
||||||
|
><DIV
|
||||||
|
CLASS="TOC"
|
||||||
|
><DL
|
||||||
|
><DT
|
||||||
|
><B
|
||||||
|
>Table of Contents</B
|
||||||
|
></DT
|
||||||
|
><DT
|
||||||
|
><A
|
||||||
|
HREF="f3.html"
|
||||||
|
>Introduction</A
|
||||||
|
></DT
|
||||||
|
><DT
|
||||||
|
>1. <A
|
||||||
|
HREF="c15.html"
|
||||||
|
>First Steps</A
|
||||||
|
></DT
|
||||||
|
><DT
|
||||||
|
>2. <A
|
||||||
|
HREF="c18.html"
|
||||||
|
></A
|
||||||
|
></DT
|
||||||
|
></DL
|
||||||
|
></DIV
|
||||||
|
></DIV
|
||||||
|
><DIV
|
||||||
|
CLASS="NAVFOOTER"
|
||||||
|
><HR
|
||||||
|
ALIGN="LEFT"
|
||||||
|
WIDTH="100%"><TABLE
|
||||||
|
SUMMARY="Footer navigation table"
|
||||||
|
WIDTH="100%"
|
||||||
|
BORDER="0"
|
||||||
|
CELLPADDING="0"
|
||||||
|
CELLSPACING="0"
|
||||||
|
><TR
|
||||||
|
><TD
|
||||||
|
WIDTH="33%"
|
||||||
|
ALIGN="left"
|
||||||
|
VALIGN="top"
|
||||||
|
> </TD
|
||||||
|
><TD
|
||||||
|
WIDTH="34%"
|
||||||
|
ALIGN="center"
|
||||||
|
VALIGN="top"
|
||||||
|
> </TD
|
||||||
|
><TD
|
||||||
|
WIDTH="33%"
|
||||||
|
ALIGN="right"
|
||||||
|
VALIGN="top"
|
||||||
|
><A
|
||||||
|
HREF="f3.html"
|
||||||
|
ACCESSKEY="N"
|
||||||
|
>Next</A
|
||||||
|
></TD
|
||||||
|
></TR
|
||||||
|
><TR
|
||||||
|
><TD
|
||||||
|
WIDTH="33%"
|
||||||
|
ALIGN="left"
|
||||||
|
VALIGN="top"
|
||||||
|
> </TD
|
||||||
|
><TD
|
||||||
|
WIDTH="34%"
|
||||||
|
ALIGN="center"
|
||||||
|
VALIGN="top"
|
||||||
|
> </TD
|
||||||
|
><TD
|
||||||
|
WIDTH="33%"
|
||||||
|
ALIGN="right"
|
||||||
|
VALIGN="top"
|
||||||
|
>Introduction</TD
|
||||||
|
></TR
|
||||||
|
></TABLE
|
||||||
|
></DIV
|
||||||
|
></BODY
|
||||||
|
></HTML
|
||||||
|
>
|
|
@ -89,6 +89,8 @@ public:
|
||||||
QString urlCmd(){return settings.value("Options/UrlCmd").toString();}
|
QString urlCmd(){return settings.value("Options/UrlCmd").toString();}
|
||||||
QByteArray vSplitterPos(){return settings.value("UI/VSplitterPos").toByteArray();}
|
QByteArray vSplitterPos(){return settings.value("UI/VSplitterPos").toByteArray();}
|
||||||
bool askBeforeDelete(){return settings.value("Options/AskBeforeDelete",true).toBool();}
|
bool askBeforeDelete(){return settings.value("Options/AskBeforeDelete",true).toBool();}
|
||||||
|
int autoTypePreGap(){return settings.value("Options/AutoTypePreGap",500).toInt();}
|
||||||
|
int autoTypeKeyStrokeDelay(){return settings.value("Options/AutoTypeKeyStrokeDelay",0).toInt();}
|
||||||
|
|
||||||
void setAlternatingRowColors(bool value){settings.setValue("Options/AlternatingRowColors",value);}
|
void setAlternatingRowColors(bool value){settings.setValue("Options/AlternatingRowColors",value);}
|
||||||
void setBannerColor1(const QColor& value){settings.setValue("Options/BannerColor1",colorToString(value));}
|
void setBannerColor1(const QColor& value){settings.setValue("Options/BannerColor1",colorToString(value));}
|
||||||
|
@ -130,6 +132,8 @@ public:
|
||||||
void setUrlCmd(const QString& value){settings.setValue("Options/UrlCmd",value);}
|
void setUrlCmd(const QString& value){settings.setValue("Options/UrlCmd",value);}
|
||||||
void setVSplitterPos(const QByteArray& value){settings.setValue("UI/VSplitterPos",value);}
|
void setVSplitterPos(const QByteArray& value){settings.setValue("UI/VSplitterPos",value);}
|
||||||
void setAskBeforeDelete(bool value){settings.setValue("Options/AskBeforeDelete",value);}
|
void setAskBeforeDelete(bool value){settings.setValue("Options/AskBeforeDelete",value);}
|
||||||
|
void setAutoTypePreGap(int value){settings.setValue("Options/AutoTypePreGap",value);}
|
||||||
|
void setAutoTypeKeyStrokeDelay(int value){settings.setValue("Options/AutoTypeKeyStrokeDelay",value);}
|
||||||
|
|
||||||
unsigned fileDlgHistorySize();
|
unsigned fileDlgHistorySize();
|
||||||
void clearFileDlgHistory(){settings.remove("FileDlgHistory");};
|
void clearFileDlgHistory(){settings.remove("FileDlgHistory");};
|
||||||
|
|
|
@ -81,6 +81,7 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl)
|
||||||
Check_CollectOncePerSession->setChecked(pwGenOptions.at(9));
|
Check_CollectOncePerSession->setChecked(pwGenOptions.at(9));
|
||||||
OnRadio1StateChanged(pwGenOptions.at(0));
|
OnRadio1StateChanged(pwGenOptions.at(0));
|
||||||
OnRadio2StateChanged(!pwGenOptions.at(0));
|
OnRadio2StateChanged(!pwGenOptions.at(0));
|
||||||
|
Spin_Num->setValue(config->pwGenLength());
|
||||||
}
|
}
|
||||||
|
|
||||||
CGenPwDialog::~CGenPwDialog(){
|
CGenPwDialog::~CGenPwDialog(){
|
||||||
|
@ -96,6 +97,7 @@ CGenPwDialog::~CGenPwDialog(){
|
||||||
pwGenOptions.setBit(8,Check_CollectEntropy->isChecked());
|
pwGenOptions.setBit(8,Check_CollectEntropy->isChecked());
|
||||||
pwGenOptions.setBit(9,Check_CollectOncePerSession->isChecked());
|
pwGenOptions.setBit(9,Check_CollectOncePerSession->isChecked());
|
||||||
config->setPwGenOptions(pwGenOptions);
|
config->setPwGenOptions(pwGenOptions);
|
||||||
|
config->setPwGenLength(Spin_Num->value());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGenPwDialog::paintEvent(QPaintEvent *event){
|
void CGenPwDialog::paintEvent(QPaintEvent *event){
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include "SettingsDlg.h"
|
#include "SettingsDlg.h"
|
||||||
#include "CustomizeDetailViewDlg.h"
|
#include "CustomizeDetailViewDlg.h"
|
||||||
|
#include "FileDialogs.h"
|
||||||
|
|
||||||
bool CSettingsDlg::PluginsModified=false;
|
bool CSettingsDlg::PluginsModified=false;
|
||||||
|
|
||||||
|
@ -41,6 +42,7 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
|
||||||
connect(DialogButtons, SIGNAL( rejected() ), this, SLOT( OnCancel() ) );
|
connect(DialogButtons, SIGNAL( rejected() ), this, SLOT( OnCancel() ) );
|
||||||
connect(DialogButtons, SIGNAL( clicked(QAbstractButton*)), this, SLOT(OnOtherButton(QAbstractButton*)));
|
connect(DialogButtons, SIGNAL( clicked(QAbstractButton*)), this, SLOT(OnOtherButton(QAbstractButton*)));
|
||||||
|
|
||||||
|
connect(Button_ClearFileDlgHistory, SIGNAL(clicked()), &fileDlgHistory, SLOT(clear()));
|
||||||
connect(ButtonColor1, SIGNAL( clicked() ), this, SLOT( OnColor1() ) );
|
connect(ButtonColor1, SIGNAL( clicked() ), this, SLOT( OnColor1() ) );
|
||||||
connect(ButtonColor2, SIGNAL( clicked() ), this, SLOT( OnColor2() ) );
|
connect(ButtonColor2, SIGNAL( clicked() ), this, SLOT( OnColor2() ) );
|
||||||
connect(ButtonTextColor, SIGNAL( clicked() ), this, SLOT( OnTextColor() ) );
|
connect(ButtonTextColor, SIGNAL( clicked() ), this, SLOT( OnTextColor() ) );
|
||||||
|
@ -138,7 +140,8 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
|
||||||
|
|
||||||
Edit_MountDir->setText(config->mountDir());
|
Edit_MountDir->setText(config->mountDir());
|
||||||
CheckBox_SaveRelativePaths->setChecked(config->saveRelativePaths());
|
CheckBox_SaveRelativePaths->setChecked(config->saveRelativePaths());
|
||||||
|
SpinBox_AutoTypePreGap->setValue(config->autoTypePreGap());
|
||||||
|
SpinBox_AutoTypeKeyStrokeDelay->setValue(config->autoTypeKeyStrokeDelay());
|
||||||
}
|
}
|
||||||
|
|
||||||
CSettingsDlg::~CSettingsDlg()
|
CSettingsDlg::~CSettingsDlg()
|
||||||
|
@ -217,6 +220,8 @@ void CSettingsDlg::apply(){
|
||||||
if(CheckBox_BrowserDefault->isChecked())config->setUrlCmd(QString());
|
if(CheckBox_BrowserDefault->isChecked())config->setUrlCmd(QString());
|
||||||
else config->setUrlCmd(Edit_BrowserCmd->text());
|
else config->setUrlCmd(Edit_BrowserCmd->text());
|
||||||
config->setSaveRelativePaths(CheckBox_SaveRelativePaths->isChecked());
|
config->setSaveRelativePaths(CheckBox_SaveRelativePaths->isChecked());
|
||||||
|
config->setAutoTypePreGap(SpinBox_AutoTypePreGap->value());
|
||||||
|
config->setAutoTypeKeyStrokeDelay(SpinBox_AutoTypeKeyStrokeDelay->value());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,6 +157,7 @@
|
||||||
<addaction name="menuImport" />
|
<addaction name="menuImport" />
|
||||||
<addaction name="menuExport" />
|
<addaction name="menuExport" />
|
||||||
<addaction name="separator" />
|
<addaction name="separator" />
|
||||||
|
<addaction name="FileUnLockWorkspaceAction" />
|
||||||
<addaction name="FileExitAction" />
|
<addaction name="FileExitAction" />
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuBearbeiten" >
|
<widget class="QMenu" name="menuBearbeiten" >
|
||||||
|
@ -544,6 +545,11 @@
|
||||||
<string>Recycle Bin...</string>
|
<string>Recycle Bin...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="FileUnLockWorkspaceAction" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Lock Workspace</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
|
|
@ -1060,7 +1060,7 @@
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="1" >
|
<item row="0" column="1" >
|
||||||
<widget class="QSpinBox" name="spinBox_PreGap" >
|
<widget class="QSpinBox" name="SpinBox_AutoTypePreGap" >
|
||||||
<property name="whatsThis" >
|
<property name="whatsThis" >
|
||||||
<string>Time between the activation of an auto-type action by the user and the first simulated key stroke.</string>
|
<string>Time between the activation of an auto-type action by the user and the first simulated key stroke.</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -1106,7 +1106,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1" >
|
<item row="1" column="1" >
|
||||||
<widget class="QSpinBox" name="spinBox_KeyStrokeDelay" >
|
<widget class="QSpinBox" name="SpinBox_AutoTypeKeyStrokeDelay" >
|
||||||
<property name="whatsThis" >
|
<property name="whatsThis" >
|
||||||
<string>Delay between two simulated key strokes. Increase this if Auto-Type is randomly skipping characters.</string>
|
<string>Delay between two simulated key strokes. Increase this if Auto-Type is randomly skipping characters.</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -18,12 +18,14 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "KpxConfig.h"
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include "AutoType.h"
|
#include "AutoType.h"
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QChar>
|
#include <QChar>
|
||||||
|
|
||||||
|
|
||||||
QWidget* AutoType::MainWin=NULL;
|
QWidget* AutoType::MainWin=NULL;
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,11 +66,19 @@ void AutoType::pressModifiers(Display* d,int mods,bool press){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sleepKeyStrokeDelay(){
|
||||||
|
if(config->autoTypeKeyStrokeDelay()==0)return;
|
||||||
|
struct timespec timeOut,remains;
|
||||||
|
timeOut.tv_sec = 0;
|
||||||
|
timeOut.tv_nsec = config->autoTypeKeyStrokeDelay()*100000;
|
||||||
|
nanosleep(&timeOut, &remains);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AutoType::perform(IEntryHandle* entry, QString& err){
|
void AutoType::perform(IEntryHandle* entry, QString& err){
|
||||||
struct timespec timeOut,remains;
|
struct timespec timeOut,remains;
|
||||||
timeOut.tv_sec = 0;
|
timeOut.tv_sec = 0;
|
||||||
timeOut.tv_nsec = 30000000; /* 300 milliseconds */
|
timeOut.tv_nsec = config->autoTypePreGap()*100000;
|
||||||
for(int i=0;i<10;i++)nanosleep(&timeOut, &remains);
|
for(int i=0;i<10;i++)nanosleep(&timeOut, &remains);
|
||||||
|
|
||||||
QString str;
|
QString str;
|
||||||
|
@ -119,9 +129,13 @@ void AutoType::pressModifiers(Display* d,int mods,bool press){
|
||||||
int keycode=XKeysymToKeycode(pDisplay,Keys[i]);
|
int keycode=XKeysymToKeycode(pDisplay,Keys[i]);
|
||||||
int mods=getModifiers(pDisplay,Keys[i],keycode);
|
int mods=getModifiers(pDisplay,Keys[i],keycode);
|
||||||
pressModifiers(pDisplay,mods);
|
pressModifiers(pDisplay,mods);
|
||||||
|
sleepKeyStrokeDelay();
|
||||||
XTestFakeKeyEvent(pDisplay,keycode,True,0);
|
XTestFakeKeyEvent(pDisplay,keycode,True,0);
|
||||||
|
sleepKeyStrokeDelay();
|
||||||
XTestFakeKeyEvent(pDisplay,keycode,False,1);
|
XTestFakeKeyEvent(pDisplay,keycode,False,1);
|
||||||
|
sleepKeyStrokeDelay();
|
||||||
releaseModifiers(pDisplay,mods);
|
releaseModifiers(pDisplay,mods);
|
||||||
|
sleepKeyStrokeDelay();
|
||||||
}
|
}
|
||||||
XCloseDisplay(pDisplay);
|
XCloseDisplay(pDisplay);
|
||||||
MainWin->show();
|
MainWin->show();
|
||||||
|
|
|
@ -135,36 +135,32 @@ void FileDlgHistory::set(const QString& name,const QString& dir, int filter){
|
||||||
}
|
}
|
||||||
void FileDlgHistory::save(){
|
void FileDlgHistory::save(){
|
||||||
if(config->saveFileDlgHistory()){
|
if(config->saveFileDlgHistory()){
|
||||||
//settings->beginGroup("FileDlgHistory");
|
|
||||||
for(unsigned i=0;i<static_cast<unsigned>(History.size());i++){
|
for(unsigned i=0;i<static_cast<unsigned>(History.size());i++){
|
||||||
QStringList entry;
|
QStringList entry;
|
||||||
entry << History.keys().at(i)
|
entry << History.keys().at(i)
|
||||||
<< History.values().at(i).Dir
|
<< History.values().at(i).Dir
|
||||||
<< QString::number(History.values().at(i).Filter);
|
<< QString::number(History.values().at(i).Filter);
|
||||||
//settings->setValue(QString("ENTRY%1").arg(i),QVariant(entry));
|
|
||||||
config->setFileDlgHistory(i,entry);
|
config->setFileDlgHistory(i,entry);
|
||||||
}
|
}
|
||||||
//settings->endGroup();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileDlgHistory::load(){
|
void FileDlgHistory::load(){
|
||||||
if(config->saveFileDlgHistory()){
|
if(config->saveFileDlgHistory()){
|
||||||
//settings->beginGroup("FileDlgHistory");
|
|
||||||
//QStringList keys=settings->childKeys();
|
|
||||||
unsigned count=config->fileDlgHistorySize();
|
unsigned count=config->fileDlgHistorySize();
|
||||||
for(unsigned i=0;i</*keys.size()*/count;i++){
|
for(unsigned i=0;i</*keys.size()*/count;i++){
|
||||||
Entry entry;
|
Entry entry;
|
||||||
QStringList value=config->fileDlgHistory(i);//settings->value(QString("ENTRY%1").arg(i)).toStringList();
|
QStringList value=config->fileDlgHistory(i);
|
||||||
entry.Dir=value[1];
|
entry.Dir=value[1];
|
||||||
entry.Filter=value[2].toInt();
|
entry.Filter=value[2].toInt();
|
||||||
History[value[0]]=entry;
|
History[value[0]]=entry;
|
||||||
}
|
}
|
||||||
//settings->endGroup();
|
|
||||||
}
|
}
|
||||||
else{
|
else
|
||||||
config->clearFileDlgHistory();
|
config->clearFileDlgHistory();
|
||||||
//settings->remove("FileDlgHistory");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FileDlgHistory::clear(){
|
||||||
|
History=QHash<QString,Entry>();
|
||||||
|
config->clearFileDlgHistory();
|
||||||
|
}
|
|
@ -27,13 +27,16 @@
|
||||||
#include "plugins/interfaces/IFileDialog.h"
|
#include "plugins/interfaces/IFileDialog.h"
|
||||||
|
|
||||||
|
|
||||||
class FileDlgHistory{
|
class FileDlgHistory:public QObject{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QString getDir(const QString& name);
|
QString getDir(const QString& name);
|
||||||
int getFilter(const QString& name);
|
int getFilter(const QString& name);
|
||||||
|
public slots:
|
||||||
void set(const QString& name,const QString& dir,int filter);
|
void set(const QString& name,const QString& dir,int filter);
|
||||||
void save();
|
void save();
|
||||||
void load();
|
void load();
|
||||||
|
void clear();
|
||||||
private:
|
private:
|
||||||
class Entry{
|
class Entry{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QStatusBar>
|
#include <QStatusBar>
|
||||||
|
|
||||||
|
|
||||||
#include "KpxFirefox.h"
|
#include "KpxFirefox.h"
|
||||||
#include "lib/random.h"
|
#include "lib/random.h"
|
||||||
#include "lib/AutoType.h"
|
#include "lib/AutoType.h"
|
||||||
|
@ -94,6 +95,13 @@ KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,QWidget *parent, Qt:
|
||||||
statusBar()->addWidget(StatusBarGeneral,15);
|
statusBar()->addWidget(StatusBarGeneral,15);
|
||||||
statusBar()->addWidget(StatusBarSelection,85);
|
statusBar()->addWidget(StatusBarSelection,85);
|
||||||
statusBar()->setVisible(config->showStatusbar());
|
statusBar()->setVisible(config->showStatusbar());
|
||||||
|
|
||||||
|
NormalCentralWidget=QMainWindow::centralWidget();
|
||||||
|
LockedCentralWidget=new QWidget(this);
|
||||||
|
WorkspaceLockedWidget.setupUi(LockedCentralWidget);
|
||||||
|
LockedCentralWidget->setVisible(false);
|
||||||
|
IsLocked=false;
|
||||||
|
|
||||||
setupConnections();
|
setupConnections();
|
||||||
|
|
||||||
FileOpen=false;
|
FileOpen=false;
|
||||||
|
@ -106,6 +114,8 @@ KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,QWidget *parent, Qt:
|
||||||
else
|
else
|
||||||
config->setLastFile(QString());
|
config->setLastFile(QString());
|
||||||
}
|
}
|
||||||
|
HelpBrowser = new QAssistantClient(QString(),this);
|
||||||
|
HelpBrowser->setArguments(QStringList()<< "-profile" << "/home/tarek/Documents/KeePassX/share/keepass/doc/keepassx.adp");
|
||||||
|
|
||||||
// DBus Server of Qt 4.2 does not work - 4.3 snapshot seems to work fine
|
// DBus Server of Qt 4.2 does not work - 4.3 snapshot seems to work fine
|
||||||
/*
|
/*
|
||||||
|
@ -132,6 +142,7 @@ void KeepassMainWindow::setupConnections(){
|
||||||
connect(FileSettingsAction, SIGNAL(triggered()), this, SLOT(OnFileSettings()));
|
connect(FileSettingsAction, SIGNAL(triggered()), this, SLOT(OnFileSettings()));
|
||||||
connect(FileChangeKeyAction, SIGNAL(triggered()), this, SLOT(OnFileChangeKey()));
|
connect(FileChangeKeyAction, SIGNAL(triggered()), this, SLOT(OnFileChangeKey()));
|
||||||
connect(FileExitAction, SIGNAL(triggered()), this, SLOT(OnFileExit()));
|
connect(FileExitAction, SIGNAL(triggered()), this, SLOT(OnFileExit()));
|
||||||
|
connect(FileUnLockWorkspaceAction,SIGNAL(triggered()), this, SLOT(OnUnLockWorkspace()));
|
||||||
connect(menuImport,SIGNAL(triggered(QAction*)),this,SLOT(OnImport(QAction*)));
|
connect(menuImport,SIGNAL(triggered(QAction*)),this,SLOT(OnImport(QAction*)));
|
||||||
connect(menuExport,SIGNAL(triggered(QAction*)),this,SLOT(OnExport(QAction*)));
|
connect(menuExport,SIGNAL(triggered(QAction*)),this,SLOT(OnExport(QAction*)));
|
||||||
|
|
||||||
|
@ -183,6 +194,8 @@ void KeepassMainWindow::setupConnections(){
|
||||||
|
|
||||||
connect(SysTray,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,SLOT(OnSysTrayActivated(QSystemTrayIcon::ActivationReason)));
|
connect(SysTray,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,SLOT(OnSysTrayActivated(QSystemTrayIcon::ActivationReason)));
|
||||||
connect(DetailView,SIGNAL(anchorClicked(const QUrl&)),this,SLOT(OnDetailViewUrlClicked(const QUrl&)));
|
connect(DetailView,SIGNAL(anchorClicked(const QUrl&)),this,SLOT(OnDetailViewUrlClicked(const QUrl&)));
|
||||||
|
connect(WorkspaceLockedWidget.Button_Unlock,SIGNAL(clicked()),this,SLOT(OnUnLockWorkspace()));
|
||||||
|
connect(WorkspaceLockedWidget.Button_CloseDatabase,SIGNAL(clicked()),this,SLOT(OnFileClose()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeepassMainWindow::setupToolbar(){
|
void KeepassMainWindow::setupToolbar(){
|
||||||
|
@ -877,7 +890,9 @@ dlg.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeepassMainWindow::OnHelpHandbook(){
|
void KeepassMainWindow::OnHelpHandbook(){
|
||||||
openBrowser(AppDir+"/../share/doc/keepass/index.html");
|
HelpBrowser->openAssistant();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeepassMainWindow::OnViewShowToolbar(bool show){
|
void KeepassMainWindow::OnViewShowToolbar(bool show){
|
||||||
|
@ -984,3 +999,18 @@ void KeepassMainWindow::OnDetailViewUrlClicked(const QUrl& url){
|
||||||
openBrowser(url.toString());
|
openBrowser(url.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KeepassMainWindow::OnUnLockWorkspace(){
|
||||||
|
if(IsLocked){
|
||||||
|
LockedCentralWidget->setVisible(false);
|
||||||
|
LockedCentralWidget->setParent(NULL);
|
||||||
|
setCentralWidget(NormalCentralWidget);
|
||||||
|
NormalCentralWidget->setVisible(true);
|
||||||
|
IsLocked=false;
|
||||||
|
} else {
|
||||||
|
NormalCentralWidget->setVisible(false);
|
||||||
|
NormalCentralWidget->setParent(NULL);
|
||||||
|
setCentralWidget(LockedCentralWidget);
|
||||||
|
LockedCentralWidget->setVisible(true);
|
||||||
|
IsLocked=true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -38,6 +38,7 @@
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QSystemTrayIcon>
|
#include <QSystemTrayIcon>
|
||||||
|
#include <QAssistantClient>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
#include "Kdb3Database.h"
|
#include "Kdb3Database.h"
|
||||||
|
@ -47,6 +48,7 @@
|
||||||
#include "export/Export.h"
|
#include "export/Export.h"
|
||||||
|
|
||||||
#include "ui_MainWindow.h"
|
#include "ui_MainWindow.h"
|
||||||
|
#include "ui_WorkspaceLockedWidget.h"
|
||||||
|
|
||||||
class KeepassMainWindow : public QMainWindow, public Ui_MainWindow{
|
class KeepassMainWindow : public QMainWindow, public Ui_MainWindow{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -94,12 +96,14 @@ class KeepassMainWindow : public QMainWindow, public Ui_MainWindow{
|
||||||
void OnImport(QAction*);
|
void OnImport(QAction*);
|
||||||
void OnExport(QAction*);
|
void OnExport(QAction*);
|
||||||
void OnDetailViewUrlClicked(const QUrl& url);
|
void OnDetailViewUrlClicked(const QUrl& url);
|
||||||
|
void OnUnLockWorkspace();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void closeEvent(QCloseEvent* event);
|
void closeEvent(QCloseEvent* event);
|
||||||
SelectionState GroupSelection, EntrySelection;
|
SelectionState GroupSelection, EntrySelection;
|
||||||
bool FileOpen;
|
bool FileOpen;
|
||||||
bool ModFlag;
|
bool ModFlag;
|
||||||
|
bool IsLocked;
|
||||||
QList<quint32> SearchResults;
|
QList<quint32> SearchResults;
|
||||||
inline void setupToolbar();
|
inline void setupToolbar();
|
||||||
inline void setupIcons();
|
inline void setupIcons();
|
||||||
|
@ -124,6 +128,10 @@ class KeepassMainWindow : public QMainWindow, public Ui_MainWindow{
|
||||||
QSystemTrayIcon* SysTray;
|
QSystemTrayIcon* SysTray;
|
||||||
QAction* ViewShowToolbarAction;
|
QAction* ViewShowToolbarAction;
|
||||||
QMenu* SysTrayMenu;
|
QMenu* SysTrayMenu;
|
||||||
|
QAssistantClient* HelpBrowser;
|
||||||
|
QWidget* NormalCentralWidget;
|
||||||
|
QWidget* LockedCentralWidget;
|
||||||
|
Ui_WorkspaceLockedWidget WorkspaceLockedWidget;
|
||||||
bool ShutingDown;
|
bool ShutingDown;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,8 @@ FORMS += forms/EditGroupDlg.ui \
|
||||||
forms/CustomizeDetailViewDlg.ui \
|
forms/CustomizeDetailViewDlg.ui \
|
||||||
forms/CalendarDlg.ui \
|
forms/CalendarDlg.ui \
|
||||||
forms/TrashCanDlg.ui \
|
forms/TrashCanDlg.ui \
|
||||||
forms/ExpiredEntriesDlg.ui
|
forms/ExpiredEntriesDlg.ui \
|
||||||
|
forms/WorkspaceLockedWidget.ui
|
||||||
TRANSLATIONS += translations/keepass-de_DE.ts \
|
TRANSLATIONS += translations/keepass-de_DE.ts \
|
||||||
translations/keepass-ru_RU.ts \
|
translations/keepass-ru_RU.ts \
|
||||||
translations/keepass-es_ES.ts \
|
translations/keepass-es_ES.ts \
|
||||||
|
@ -172,7 +173,8 @@ CONFIG += debug \
|
||||||
qt \
|
qt \
|
||||||
thread \
|
thread \
|
||||||
warn_off \
|
warn_off \
|
||||||
dbus
|
dbus \
|
||||||
|
assistant
|
||||||
QT += dbus xml
|
QT += dbus xml
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
INCLUDEPATH += . \
|
INCLUDEPATH += . \
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue