- support for precompiled headers
- made password dialog more userfriendly (especially key file creation/selection) - database file as command line argument is recognized again - fixed bug #1825446 (commandline option -cfg does NOT take relative path) - fixed mac buid problem (see item #1908868) git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@174 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
parent
97bac939dd
commit
bdec5c8450
12
changelog
12
changelog
|
@ -1,3 +1,15 @@
|
||||||
|
---------------
|
||||||
|
0.3.1
|
||||||
|
---------------
|
||||||
|
- made key/password dialog more user friendly
|
||||||
|
- program accepts Qt command line switches like "-style" again
|
||||||
|
|
||||||
|
---------------
|
||||||
|
0.3.0a
|
||||||
|
---------------
|
||||||
|
- fixed bug which prevented MacOS X bundle from starting (Bug #1906517)
|
||||||
|
- fixed error message about missing license file when opening about dialog (Bug #1906696)
|
||||||
|
|
||||||
---------------
|
---------------
|
||||||
0.3.0
|
0.3.0
|
||||||
---------------
|
---------------
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#include "Application_X11.h"
|
#include "Application_X11.h"
|
||||||
#include "lib/AutoType.h"
|
#include "lib/AutoType.h"
|
||||||
#include "lib/HelperX11.h"
|
#include "lib/HelperX11.h"
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#ifndef APPLICATION_X11_H
|
#ifndef APPLICATION_X11_H
|
||||||
#define APPLICATION_X11_H
|
#define APPLICATION_X11_H
|
||||||
|
|
||||||
#include <QApplication>
|
|
||||||
|
|
||||||
class KeepassApplication : public QApplication
|
class KeepassApplication : public QApplication
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,9 +18,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "Database.h"
|
|
||||||
#include "lib/random.h"
|
|
||||||
#include <QCoreApplication>
|
|
||||||
|
|
||||||
KpxUuid::KpxUuid(){
|
KpxUuid::KpxUuid(){
|
||||||
Data.fill(0,16);
|
Data.fill(0,16);
|
||||||
|
|
|
@ -21,14 +21,6 @@
|
||||||
#ifndef _DATABASE_H_
|
#ifndef _DATABASE_H_
|
||||||
#define _DATABASE_H_
|
#define _DATABASE_H_
|
||||||
|
|
||||||
#include <QList>
|
|
||||||
#include <QDateTime>
|
|
||||||
#include <QFile>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QByteArray>
|
|
||||||
#include "lib/SecString.h"
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
extern const QDateTime Date_Never;
|
extern const QDateTime Date_Never;
|
||||||
|
|
||||||
typedef enum CryptAlgorithm{
|
typedef enum CryptAlgorithm{
|
||||||
|
@ -247,6 +239,9 @@ class IDatabase:public QObject{
|
||||||
public:
|
public:
|
||||||
virtual ~IDatabase(){};
|
virtual ~IDatabase(){};
|
||||||
|
|
||||||
|
virtual bool setKey(const QString& password,const QString& keyfile)=0;
|
||||||
|
virtual bool isKeyError()=0;
|
||||||
|
|
||||||
//! Loads a database.
|
//! Loads a database.
|
||||||
/*! It is not allowed to call this function if a database is already loaded.
|
/*! It is not allowed to call this function if a database is already loaded.
|
||||||
\param identifier Normally this is the filename of the database but it can also be an IP address or something else if the database is not file based.
|
\param identifier Normally this is the filename of the database but it can also be an IP address or something else if the database is not file based.
|
||||||
|
@ -409,23 +404,6 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//! Interface for password/file based authentication
|
|
||||||
class IFilePasswordAuth{
|
|
||||||
public:
|
|
||||||
virtual void authByPwd(QString& password)=0;
|
|
||||||
virtual bool authByFile(QString& filename)=0;
|
|
||||||
virtual bool authByFileAndPwd(QString& password, QString& filename)=0;
|
|
||||||
/*! Creates a key file.
|
|
||||||
\param filename Filename of the new key file.
|
|
||||||
\param length Length of the key file.
|
|
||||||
\param Hex Wether the key file should be binary or hexadecimal ASCII code. If Hex is true the real file size will be double of length.
|
|
||||||
\return TRUE if the creation was successfull, otherwise FALSE.
|
|
||||||
*/
|
|
||||||
virtual bool createKeyFile(const QString& filename,int length=32, bool Hex=false)=0;
|
|
||||||
virtual bool isKeyError()=0;
|
|
||||||
};
|
|
||||||
|
|
||||||
class IKdbSettings{
|
class IKdbSettings{
|
||||||
public:
|
public:
|
||||||
virtual void setCryptAlgorithm(CryptAlgorithm algo)=0;
|
virtual void setCryptAlgorithm(CryptAlgorithm algo)=0;
|
||||||
|
|
|
@ -17,23 +17,9 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "global.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include <time.h>
|
|
||||||
#include <QFile>
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QDateTime>
|
|
||||||
#include <QSysInfo>
|
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QDir>
|
|
||||||
#include "crypto/twoclass.h"
|
|
||||||
#include "crypto/aescpp.h"
|
|
||||||
#include "crypto/sha256.h"
|
|
||||||
#include "crypto/yarrow.h"
|
|
||||||
#include "lib/random.h"
|
|
||||||
using namespace std;
|
|
||||||
#include "Kdb3Database.h"
|
#include "Kdb3Database.h"
|
||||||
#include "KpxConfig.h"
|
|
||||||
|
|
||||||
#define UNEXP_ERROR error=QString("Unexpected error in: %1, Line:%2").arg(__FILE__).arg(__LINE__);
|
#define UNEXP_ERROR error=QString("Unexpected error in: %1, Line:%2").arg(__FILE__).arg(__LINE__);
|
||||||
|
|
||||||
|
@ -739,29 +725,26 @@ bool Kdb3Database::convHexToBinaryKey(char* HexKey, char* dst){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
bool Kdb3Database::setKey(const QString& password,const QString& keyfile){
|
||||||
void Kdb3Database::authByPwd(QString& Password){
|
if(!password.isEmpty() && !keyfile.isEmpty())
|
||||||
if(!Password.size()) {
|
return setCompositeKey(password,keyfile);
|
||||||
memcpy(RawMasterKey,QByteArray(32,'\0').data(),32);
|
if(!password.isEmpty())
|
||||||
return;
|
return setPasswordKey(password);
|
||||||
}
|
if(!keyfile.isEmpty())
|
||||||
SHA256::hashBuffer(Password.toUtf8().data(),RawMasterKey,Password.toUtf8().size());
|
return setFileKey(keyfile);
|
||||||
return;
|
assert(false);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
void Kdb3Database::authByPwd(QString& Password){
|
bool Kdb3Database::setPasswordKey(const QString& Password){
|
||||||
if(!Password.size()) {
|
assert(Password.size());
|
||||||
memcpy(RawMasterKey,QByteArray(32,'\0').data(),32);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SHA256::hashBuffer(Password.toLatin1().data(),RawMasterKey,Password.toLatin1().size());
|
SHA256::hashBuffer(Password.toLatin1().data(),RawMasterKey,Password.toLatin1().size());
|
||||||
QByteArray lat,utf;
|
QByteArray lat,utf;
|
||||||
utf=Password.toUtf8();
|
utf=Password.toUtf8();
|
||||||
lat=Password.toLatin1();
|
lat=Password.toLatin1();
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Kdb3Database::authByFile(QString& filename){
|
bool Kdb3Database::setFileKey(const QString& filename){
|
||||||
QFile file(filename);
|
QFile file(filename);
|
||||||
if(!file.open(QIODevice::ReadOnly|QIODevice::Unbuffered)){
|
if(!file.open(QIODevice::ReadOnly|QIODevice::Unbuffered)){
|
||||||
error=decodeFileError(file.error());
|
error=decodeFileError(file.error());
|
||||||
|
@ -799,14 +782,13 @@ bool Kdb3Database::authByFile(QString& filename){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Kdb3Database::authByFileAndPwd(QString& Password, QString& filename){
|
bool Kdb3Database::setCompositeKey(const QString& Password,const QString& filename){
|
||||||
unsigned char PasswordKey[32];
|
unsigned char PasswordKey[32];
|
||||||
unsigned char FileKey[32];
|
unsigned char FileKey[32];
|
||||||
if(!authByFile(filename))return false;
|
if(!setFileKey(filename))return false;
|
||||||
memcpy(FileKey,RawMasterKey,32);
|
memcpy(FileKey,RawMasterKey,32);
|
||||||
authByPwd(Password);
|
setPasswordKey(Password);
|
||||||
memcpy(PasswordKey,RawMasterKey,32);
|
memcpy(PasswordKey,RawMasterKey,32);
|
||||||
|
|
||||||
SHA256 sha;
|
SHA256 sha;
|
||||||
sha.update(PasswordKey,32);
|
sha.update(PasswordKey,32);
|
||||||
sha.update(FileKey,32);
|
sha.update(FileKey,32);
|
||||||
|
@ -1637,38 +1619,6 @@ void Kdb3Database::rebuildIndices(QList<StdGroup*>& list){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Kdb3Database::createKeyFile(const QString& filename,int length, bool Hex){
|
|
||||||
QFile file(filename);
|
|
||||||
if(!file.open(QIODevice::WriteOnly|QIODevice::Truncate|QIODevice::Unbuffered)){
|
|
||||||
error=decodeFileError(file.error());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(Hex)length*=2;
|
|
||||||
unsigned char* key=new unsigned char[length];
|
|
||||||
randomize(key,length);
|
|
||||||
if(Hex){
|
|
||||||
for(int i=0; i<length; i+=2){
|
|
||||||
unsigned char dig1,dig2;
|
|
||||||
dig1=key[i]/16;
|
|
||||||
key[i]-=(16*dig1);
|
|
||||||
dig2=key[i];
|
|
||||||
if(dig1>9)key[i]='A'+dig1-10;
|
|
||||||
else key[i]='0'+dig1;
|
|
||||||
if(dig2>9)key[i+1]='A'+dig2-10;
|
|
||||||
else key[i+1]='0'+dig2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(file.write((char*)key,length)==-1){
|
|
||||||
delete [] key;
|
|
||||||
error=decodeFileError(file.error());
|
|
||||||
file.close();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
file.close();
|
|
||||||
delete [] key;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Kdb3Database::moveGroup(IGroupHandle* groupHandle,IGroupHandle* NewParent,int Pos){
|
void Kdb3Database::moveGroup(IGroupHandle* groupHandle,IGroupHandle* NewParent,int Pos){
|
||||||
StdGroup* Parent;
|
StdGroup* Parent;
|
||||||
|
|
|
@ -30,25 +30,13 @@
|
||||||
#define PWM_FLAG_TWOFISH 8
|
#define PWM_FLAG_TWOFISH 8
|
||||||
#define PWM_STD_KEYENCROUNDS 6000
|
#define PWM_STD_KEYENCROUNDS 6000
|
||||||
|
|
||||||
#include <QColor>
|
|
||||||
#include <QDateTime>
|
|
||||||
#include <QDate>
|
|
||||||
#include <QTime>
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QMap>
|
|
||||||
#include "main.h"
|
|
||||||
#include "lib/SecString.h"
|
|
||||||
#include "Database.h"
|
|
||||||
|
|
||||||
|
|
||||||
void memcpyFromLEnd32(quint32* dst,const char* src);
|
void memcpyFromLEnd32(quint32* dst,const char* src);
|
||||||
void memcpyFromLEnd16(quint16* dst,const char* src);
|
void memcpyFromLEnd16(quint16* dst,const char* src);
|
||||||
void memcpyToLEnd32(char* src,const quint32* dst);
|
void memcpyToLEnd32(char* src,const quint32* dst);
|
||||||
void memcpyToLEnd16(char* src,const quint16* dst);
|
void memcpyToLEnd16(char* src,const quint16* dst);
|
||||||
|
|
||||||
//! Implementation of the standard KeePassX database.
|
//! Implementation of the standard KeePassX database.
|
||||||
class Kdb3Database:public ICustomIcons,public IDatabase, public IFilePasswordAuth, public IKdbSettings{
|
class Kdb3Database:public ICustomIcons,public IDatabase, public IKdbSettings{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
class StdGroup;
|
class StdGroup;
|
||||||
|
@ -169,10 +157,6 @@ public:
|
||||||
virtual void removeIcon(int index);
|
virtual void removeIcon(int index);
|
||||||
virtual void replaceIcon(int index,const QPixmap& icon);
|
virtual void replaceIcon(int index,const QPixmap& icon);
|
||||||
virtual int builtinIcons(){return BUILTIN_ICONS;};
|
virtual int builtinIcons(){return BUILTIN_ICONS;};
|
||||||
virtual void authByPwd(QString& password);
|
|
||||||
virtual bool authByFile(QString& filename);
|
|
||||||
virtual bool authByFileAndPwd(QString& password, QString& filename);
|
|
||||||
virtual bool createKeyFile(const QString& filename,int length=32, bool Hex=false);
|
|
||||||
virtual QList<IEntryHandle*> search(IGroupHandle* Group,const QString& SearchString, bool CaseSensitve, bool RegExp,bool Recursive,bool* Fields);
|
virtual QList<IEntryHandle*> search(IGroupHandle* Group,const QString& SearchString, bool CaseSensitve, bool RegExp,bool Recursive,bool* Fields);
|
||||||
virtual QFile* file(){return File;}
|
virtual QFile* file(){return File;}
|
||||||
virtual bool changeFile(const QString& filename);
|
virtual bool changeFile(const QString& filename);
|
||||||
|
@ -180,6 +164,10 @@ public:
|
||||||
virtual CryptAlgorithm cryptAlgorithm(){return Algorithm;}
|
virtual CryptAlgorithm cryptAlgorithm(){return Algorithm;}
|
||||||
virtual unsigned int keyTransfRounds(){return KeyTransfRounds;}
|
virtual unsigned int keyTransfRounds(){return KeyTransfRounds;}
|
||||||
virtual void setKeyTransfRounds(unsigned int rounds){KeyTransfRounds=rounds;}
|
virtual void setKeyTransfRounds(unsigned int rounds){KeyTransfRounds=rounds;}
|
||||||
|
virtual bool setKey(const QString& password, const QString& keyfile);
|
||||||
|
virtual bool setPasswordKey(const QString& password);
|
||||||
|
virtual bool setFileKey(const QString& filename);
|
||||||
|
virtual bool setCompositeKey(const QString& password,const QString& filename);
|
||||||
|
|
||||||
virtual QList<IEntryHandle*> entries();
|
virtual QList<IEntryHandle*> entries();
|
||||||
virtual QList<IEntryHandle*> entries(IGroupHandle* Group);
|
virtual QList<IEntryHandle*> entries(IGroupHandle* Group);
|
||||||
|
|
|
@ -21,12 +21,7 @@
|
||||||
* 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 <QSettings>
|
|
||||||
#include <QDir>
|
|
||||||
#include <QLayout>
|
#include <QLayout>
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
KpxConfig::KpxConfig(const QString& filePath) : settings(filePath,QSettings::IniFormat){
|
KpxConfig::KpxConfig(const QString& filePath) : settings(filePath,QSettings::IniFormat){
|
||||||
configFile=filePath;
|
configFile=filePath;
|
||||||
|
|
|
@ -23,14 +23,7 @@
|
||||||
#ifndef _KPXCONFIG_H_
|
#ifndef _KPXCONFIG_H_
|
||||||
#define _KPXCONFIG_H_
|
#define _KPXCONFIG_H_
|
||||||
|
|
||||||
#include "lib/tools.h"
|
#include "lib/AutoType.h"
|
||||||
#include "AutoType.h"
|
|
||||||
#include <QBitArray>
|
|
||||||
#include <QByteArray>
|
|
||||||
#include <QColor>
|
|
||||||
#include <QList>
|
|
||||||
#include <QSettings>
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
#if defined(Q_WS_MAC)
|
#if defined(Q_WS_MAC)
|
||||||
# define DEFAULT_MOUNT_DIR "/Volumes/"
|
# define DEFAULT_MOUNT_DIR "/Volumes/"
|
||||||
|
|
|
@ -171,7 +171,7 @@
|
||||||
* Standard include files will probably be ok.
|
* Standard include files will probably be ok.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <QString> /* for memset(), memcpy(), and memcmp() */
|
//#include <QString> /* for memset(), memcpy(), and memcmp() */
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include "twofish.h"
|
#include "twofish.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#ifndef TWOFISH_H_
|
||||||
|
#define TWOFISH_H_
|
||||||
/*
|
/*
|
||||||
* Fast, portable, and easy-to-use Twofish implementation,
|
* Fast, portable, and easy-to-use Twofish implementation,
|
||||||
* Version 0.3.
|
* Version 0.3.
|
||||||
|
@ -177,3 +179,5 @@ extern void Twofish_decrypt(
|
||||||
Twofish_Byte c[16],
|
Twofish_Byte c[16],
|
||||||
Twofish_Byte p[16]
|
Twofish_Byte p[16]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#endif
|
|
@ -20,10 +20,6 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
|
||||||
# include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -17,10 +17,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QFile>
|
|
||||||
#include "lib/tools.h"
|
|
||||||
#include "AboutDlg.h"
|
#include "AboutDlg.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,7 @@
|
||||||
#ifndef _ABOUTDIALOG_H_
|
#ifndef _ABOUTDIALOG_H_
|
||||||
#define _ABOUTDIALOG_H_
|
#define _ABOUTDIALOG_H_
|
||||||
|
|
||||||
#include <QPaintEvent>
|
|
||||||
#include "ui_AboutDlg.h"
|
#include "ui_AboutDlg.h"
|
||||||
#include "lib/UrlLabel.h"
|
|
||||||
|
|
||||||
#include "main.h"
|
|
||||||
|
|
||||||
class AboutDialog : public QDialog, public Ui_AboutDlg
|
class AboutDialog : public QDialog, public Ui_AboutDlg
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,11 +17,6 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QFileInfo>
|
|
||||||
#include <QPainter>
|
|
||||||
#include "lib/tools.h"
|
|
||||||
#include "lib/FileDialogs.h"
|
|
||||||
#include "lib/bookmarks.h"
|
|
||||||
|
|
||||||
#include "AddBookmarkDlg.h"
|
#include "AddBookmarkDlg.h"
|
||||||
|
|
||||||
|
|
|
@ -20,12 +20,8 @@
|
||||||
#ifndef _ADDBOOKMARKDLG_H_
|
#ifndef _ADDBOOKMARKDLG_H_
|
||||||
#define _ADDBOOKMARKDLG_H_
|
#define _ADDBOOKMARKDLG_H_
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
#include <QPaintEvent>
|
|
||||||
#include "ui_AddBookmarkDlg.h"
|
#include "ui_AddBookmarkDlg.h"
|
||||||
|
|
||||||
#include "main.h"
|
|
||||||
|
|
||||||
class AddBookmarkDlg : public QDialog, private Ui::AddBookmarkDlg
|
class AddBookmarkDlg : public QDialog, private Ui::AddBookmarkDlg
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
@ -17,12 +17,8 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "main.h"
|
|
||||||
#include "AutoTypeDlg.h"
|
|
||||||
#include "KpxConfig.h"
|
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QPainter>
|
#include "AutoTypeDlg.h"
|
||||||
#include <QPaintEvent>
|
|
||||||
|
|
||||||
AutoTypeDlg::AutoTypeDlg(QList<IEntryHandle*> entries, QList<int> numbers){
|
AutoTypeDlg::AutoTypeDlg(QList<IEntryHandle*> entries, QList<int> numbers){
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "ui_AutoTypeDlg.h"
|
#include "ui_AutoTypeDlg.h"
|
||||||
#include "Database.h"
|
|
||||||
|
|
||||||
class AutoTypeDlg : public QWidget, private Ui::AutoTypeDlg
|
class AutoTypeDlg : public QWidget, private Ui::AutoTypeDlg
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,8 +18,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "lib/tools.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "CalendarDlg.h"
|
#include "CalendarDlg.h"
|
||||||
|
|
||||||
CalendarDialog::CalendarDialog(QWidget* parent, const QDate& Start):QDialog(parent){
|
CalendarDialog::CalendarDialog(QWidget* parent, const QDate& Start):QDialog(parent){
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#ifndef _CALENDAR_DLG_H_
|
#ifndef _CALENDAR_DLG_H_
|
||||||
#define _CALENDAR_DLG_H_
|
#define _CALENDAR_DLG_H_
|
||||||
|
|
||||||
#include <QDate>
|
|
||||||
#include "ui_CalendarDlg.h"
|
#include "ui_CalendarDlg.h"
|
||||||
|
|
||||||
class CalendarDialog:public QDialog, public Ui_CalendarDialog{
|
class CalendarDialog:public QDialog, public Ui_CalendarDialog{
|
||||||
|
|
|
@ -18,13 +18,8 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QCursor>
|
|
||||||
#include <QFile>
|
|
||||||
#include "lib/tools.h"
|
|
||||||
|
|
||||||
#include "crypto/yarrow.h"
|
#include "crypto/yarrow.h"
|
||||||
|
|
||||||
#include "CollectEntropyDlg.h"
|
#include "CollectEntropyDlg.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,12 +22,6 @@
|
||||||
#define _COLLECT_ENTROPY_DLG_H_
|
#define _COLLECT_ENTROPY_DLG_H_
|
||||||
|
|
||||||
#include "ui_CollectEntropyDlg.h"
|
#include "ui_CollectEntropyDlg.h"
|
||||||
#include <QDialog>
|
|
||||||
#include <QPaintEvent>
|
|
||||||
#include <QShowEvent>
|
|
||||||
|
|
||||||
#include "main.h"
|
|
||||||
|
|
||||||
|
|
||||||
class CollectEntropyDlg: public QDialog, public Ui_CollectEntropyDlg{
|
class CollectEntropyDlg: public QDialog, public Ui_CollectEntropyDlg{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
@ -18,16 +18,8 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QTextCursor>
|
|
||||||
#include <QTextBlockFormat>
|
|
||||||
#include <QLineEdit>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
#include <QPixmap>
|
|
||||||
#include <QMenu>
|
|
||||||
#include "main.h"
|
|
||||||
#include "CustomizeDetailViewDlg.h"
|
#include "CustomizeDetailViewDlg.h"
|
||||||
#include "KpxConfig.h"
|
|
||||||
|
|
||||||
bool DisableButtonSlots=false;
|
bool DisableButtonSlots=false;
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
#define _CUSTOMIZE_DETAIL_VIEW_H_
|
#define _CUSTOMIZE_DETAIL_VIEW_H_
|
||||||
|
|
||||||
#include "ui_CustomizeDetailViewDlg.h"
|
#include "ui_CustomizeDetailViewDlg.h"
|
||||||
#include <QColor>
|
|
||||||
#include <QAction>
|
|
||||||
|
|
||||||
class CustomizeDetailViewDialog : public QDialog, public Ui_CustomizeDetailViewDialog{
|
class CustomizeDetailViewDialog : public QDialog, public Ui_CustomizeDetailViewDialog{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
@ -18,14 +18,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QComboBox>
|
|
||||||
#include <QLineEdit>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QShowEvent>
|
|
||||||
#include <QFile>
|
|
||||||
#include "lib/tools.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "DatabaseSettingsDlg.h"
|
#include "DatabaseSettingsDlg.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,6 @@
|
||||||
#define DBSETTINGSDLG_H
|
#define DBSETTINGSDLG_H
|
||||||
|
|
||||||
#include "ui_DatabaseSettingsDlg.h"
|
#include "ui_DatabaseSettingsDlg.h"
|
||||||
#include "main.h"
|
|
||||||
#include "Database.h"
|
|
||||||
#include <QPaintEvent>
|
|
||||||
|
|
||||||
class CDbSettingsDlg : public QDialog, public Ui_DatabaseSettingsDlg
|
class CDbSettingsDlg : public QDialog, public Ui_DatabaseSettingsDlg
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,29 +18,13 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "main.h"
|
|
||||||
#include "KpxConfig.h"
|
|
||||||
#include <QPalette>
|
|
||||||
#include <QFont>
|
|
||||||
#include <QProgressBar>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QColor>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QPen>
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QToolButton>
|
|
||||||
#include <QShowEvent>
|
|
||||||
#include <QResizeEvent>
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#include "SelectIconDlg.h"
|
#include "SelectIconDlg.h"
|
||||||
#include "PasswordGenDlg.h"
|
#include "PasswordGenDlg.h"
|
||||||
#include "EditEntryDlg.h"
|
#include "EditEntryDlg.h"
|
||||||
#include "CalendarDlg.h"
|
#include "CalendarDlg.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* parent, bool modal, bool newEntry)
|
CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* parent, bool modal, bool newEntry)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,10 +20,8 @@
|
||||||
|
|
||||||
#ifndef EDITENTRYDLG_H
|
#ifndef EDITENTRYDLG_H
|
||||||
#define EDITENTRYDLG_H
|
#define EDITENTRYDLG_H
|
||||||
|
|
||||||
#include "ui_EditEntryDlg.h"
|
#include "ui_EditEntryDlg.h"
|
||||||
#include <QPixmap>
|
|
||||||
#include <QShowEvent>
|
|
||||||
#include "main.h"
|
|
||||||
#include "Kdb3Database.h"
|
#include "Kdb3Database.h"
|
||||||
|
|
||||||
class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
|
class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
|
||||||
|
|
|
@ -18,9 +18,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "main.h"
|
|
||||||
|
|
||||||
#include <QShowEvent>
|
|
||||||
#include "EditGroupDlg.h"
|
#include "EditGroupDlg.h"
|
||||||
#include "SelectIconDlg.h"
|
#include "SelectIconDlg.h"
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,6 @@
|
||||||
#define EDITGROUPDLG_H
|
#define EDITGROUPDLG_H
|
||||||
|
|
||||||
#include "ui_EditGroupDlg.h"
|
#include "ui_EditGroupDlg.h"
|
||||||
#include <QString>
|
|
||||||
#include <QShowEvent>
|
|
||||||
#include "Database.h"
|
|
||||||
|
|
||||||
class CEditGroupDialog : public QDialog, public Ui_EditGroupDialog
|
class CEditGroupDialog : public QDialog, public Ui_EditGroupDialog
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,12 +18,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QTreeWidget>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QPaintEvent>
|
|
||||||
#include <QResizeEvent>
|
|
||||||
#include "lib/tools.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "ExpiredEntriesDlg.h"
|
#include "ExpiredEntriesDlg.h"
|
||||||
|
|
||||||
ExpiredEntriesDialog::ExpiredEntriesDialog(QWidget* parent,IDatabase* database,const QList<IEntryHandle*>& ExpiredEntries):QDialog(parent){
|
ExpiredEntriesDialog::ExpiredEntriesDialog(QWidget* parent,IDatabase* database,const QList<IEntryHandle*>& ExpiredEntries):QDialog(parent){
|
||||||
|
|
|
@ -21,10 +21,8 @@
|
||||||
#ifndef _EXP_ENTRIES_DLG_
|
#ifndef _EXP_ENTRIES_DLG_
|
||||||
#define _EXP_ENTRIES_DLG_
|
#define _EXP_ENTRIES_DLG_
|
||||||
|
|
||||||
#include <QList>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include "ui_ExpiredEntriesDlg.h"
|
#include "ui_ExpiredEntriesDlg.h"
|
||||||
#include "Database.h"
|
|
||||||
|
|
||||||
class ExpiredEntriesDialog:public QDialog, public Ui_ExpiredEntriesDialog{
|
class ExpiredEntriesDialog:public QDialog, public Ui_ExpiredEntriesDialog{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
@ -17,11 +17,8 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QListWidget>
|
|
||||||
#include <QPainter>
|
#include "dialogs/ManageBookmarksDlg.h"
|
||||||
#include "lib/tools.h"
|
|
||||||
#include "ManageBookmarksDlg.h"
|
|
||||||
#include "lib/bookmarks.h"
|
|
||||||
#include "dialogs/AddBookmarkDlg.h"
|
#include "dialogs/AddBookmarkDlg.h"
|
||||||
|
|
||||||
ManageBookmarksDlg::ManageBookmarksDlg(QWidget* parent):QDialog(parent)
|
ManageBookmarksDlg::ManageBookmarksDlg(QWidget* parent):QDialog(parent)
|
||||||
|
|
|
@ -20,9 +20,6 @@
|
||||||
#ifndef MANAGEBOOKMARKSDLG_H
|
#ifndef MANAGEBOOKMARKSDLG_H
|
||||||
#define MANAGEBOOKMARKSDLG_H
|
#define MANAGEBOOKMARKSDLG_H
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
#include <QCloseEvent>
|
|
||||||
#include <QPaintEvent>
|
|
||||||
#include "ui_ManageBookmarksDlg.h"
|
#include "ui_ManageBookmarksDlg.h"
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2005-2007 by Tarek Saidi *
|
* Copyright (C) 2005-2008 by Tarek Saidi *
|
||||||
* tarek.saidi@arcor.de *
|
* tarek.saidi@arcor.de *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -17,372 +17,334 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QFileDialog>
|
#include <QTimer>
|
||||||
#include <QDir>
|
#include "dialogs/PasswordDlg.h"
|
||||||
#include <QStringList>
|
|
||||||
#include <QCheckBox>
|
|
||||||
#include <QLineEdit>
|
|
||||||
#include <QComboBox>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QPalette>
|
|
||||||
#include <QMenu>
|
|
||||||
|
|
||||||
#include "main.h"
|
PasswordDialog::PasswordDialog(QWidget* parent,DlgMode mode,DlgFlags flags,const QString& filename)
|
||||||
#include "KpxConfig.h"
|
|
||||||
#include "PasswordDlg.h"
|
|
||||||
#include "lib/FileDialogs.h"
|
|
||||||
#include "lib/bookmarks.h"
|
|
||||||
|
|
||||||
|
|
||||||
CPasswordDialog::CPasswordDialog(QWidget* parent,QString filename,IDatabase* DB,bool IsAuto,bool ChangeKeyMode)
|
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
createBanner(&BannerPixmap,getPixmap("key"),tr("Database Key"),width());
|
Mode=mode;
|
||||||
Button_Bookmarks->setIcon(getIcon("bookmark"));
|
Filename=filename;
|
||||||
db=DB;
|
QString BannerTitle;
|
||||||
LastFile=filename;
|
if(Mode==Mode_Ask){
|
||||||
if (ChangeKeyMode)
|
BannerTitle=tr("Enter Master Key");
|
||||||
setWindowTitle(tr("Change Master Key"));
|
}
|
||||||
else
|
else if(Mode==Mode_Set){
|
||||||
setWindowTitle(LastFile);
|
BannerTitle=tr("Set Master Key");
|
||||||
QString mountDir=config->mountDir();
|
}
|
||||||
QDir media(mountDir);
|
else if(Mode==Mode_Change){
|
||||||
if(media.exists()){
|
BannerTitle=tr("Change Master Key");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(filename==QString()){
|
||||||
|
setWindowTitle(tr("Database Key"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setWindowTitle(filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add list of subdirs in the mounting dir to the combobox.
|
||||||
|
// For example making /media/cd1 and /media/myflashdrive to two entries cd1 and myflashdrive in the combobox
|
||||||
|
QDir mountDir(config->mountDir());
|
||||||
|
if(mountDir.exists()){
|
||||||
QStringList Paths;
|
QStringList Paths;
|
||||||
Paths=media.entryList(QStringList()<<"*",QDir::Dirs | QDir::NoDotAndDotDot);
|
Paths=mountDir.entryList(QStringList()<<"*",QDir::Dirs | QDir::NoDotAndDotDot);
|
||||||
for(int i=0;i<Paths.count();i++)
|
for(int i=0;i<Paths.count();i++)
|
||||||
Combo_Dirs->addItem(mountDir+Paths[i]);
|
Combo_KeyFile->addItem(config->mountDir()+Paths[i]);
|
||||||
}
|
}
|
||||||
|
Combo_KeyFile->setEditText(QString());
|
||||||
|
|
||||||
Combo_Dirs->setEditText(QString());
|
if(config->rememberLastKey() && Mode!=Mode_Change && Mode!=Mode_Set){
|
||||||
if(config->rememberLastKey() && config->openLastFile() && !ChangeKeyMode){
|
|
||||||
switch(config->lastKeyType()){
|
switch(config->lastKeyType()){
|
||||||
case KEYFILE:
|
case PASSWORD:
|
||||||
setStateKeyFileOnly();
|
Check_Password->setChecked(true);
|
||||||
Combo_Dirs->setEditText(QDir::cleanPath(QDir::current().absoluteFilePath(config->lastKeyLocation())));
|
Check_KeyFile->setChecked(false);
|
||||||
break;
|
Combo_KeyFile->setEditText("");
|
||||||
|
break;
|
||||||
|
|
||||||
case BOTH:
|
case KEYFILE:
|
||||||
setStateBoth();
|
Check_Password->setChecked(false);
|
||||||
CheckBox_Both->setChecked(true);
|
Check_KeyFile->setChecked(true);
|
||||||
Combo_Dirs->setEditText(QDir::cleanPath(QDir::current().absoluteFilePath(config->lastKeyLocation())));
|
Combo_KeyFile->setEditText(QDir::cleanPath(QDir::current().absoluteFilePath(config->lastKeyLocation())));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BOTH:
|
||||||
|
Check_Password->setChecked(true);
|
||||||
|
Check_KeyFile->setChecked(true);
|
||||||
|
Combo_KeyFile->setEditText(QDir::cleanPath(QDir::current().absoluteFilePath(config->lastKeyLocation())));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// if(LastKeyType==Password){... is not required because it is already the default state.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bookmarks //
|
if(Mode!=Mode_Set && Mode!=Mode_Change){
|
||||||
QPalette palette=Button_Bookmarks->palette();
|
Button_GenKeyFile->hide();
|
||||||
palette.setColor(QPalette::Active,QPalette::Button,config->bannerColor1());
|
}
|
||||||
palette.setColor(QPalette::Active,QPalette::Window,config->bannerColor2());
|
if(flags & Flag_Auto){
|
||||||
Button_Bookmarks->setPalette(palette);
|
/*
|
||||||
palette=Label_Bookmark->palette();
|
QPushButton* Button_Quit = buttonBox->addButton(tr("Quit"),QDialogButtonBox::DestructiveRole);
|
||||||
palette.setColor(QPalette::Active,QPalette::WindowText,config->bannerTextColor());
|
connect(Button_Quit,SIGNAL(clicked()),this,SLOT(OnButtonQuit()));
|
||||||
Label_Bookmark->setPalette(palette);
|
*/
|
||||||
|
if(config->rememberLastKey()){
|
||||||
|
switch(config->lastKeyType()){
|
||||||
|
case PASSWORD:
|
||||||
|
Check_Password->setChecked(true);
|
||||||
|
Check_KeyFile->setChecked(false);
|
||||||
|
break;
|
||||||
|
case KEYFILE:
|
||||||
|
Check_Password->setChecked(false);
|
||||||
|
Check_KeyFile->setChecked(true);
|
||||||
|
Combo_KeyFile->setEditText(config->lastKeyLocation());
|
||||||
|
break;
|
||||||
|
case BOTH:
|
||||||
|
Check_Password->setChecked(true);
|
||||||
|
Check_KeyFile->setChecked(true);
|
||||||
|
Combo_KeyFile->setEditText(config->lastKeyLocation());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QMenu* BookmarkMenu=new QMenu(this);
|
// Setting up the bookmark button
|
||||||
QAction* action=new QAction(this);
|
if(Mode==Mode_Ask && config->featureBookmarks()){
|
||||||
action->setData(QString());
|
// Button Color
|
||||||
action->setText(tr("Last File"));
|
QPalette palette=Button_Bookmarks->palette();
|
||||||
action->setIcon(getIcon("document"));
|
palette.setColor(QPalette::Active,QPalette::Button,config->bannerColor1());
|
||||||
BookmarkMenu->addAction(action);
|
palette.setColor(QPalette::Active,QPalette::Window,config->bannerColor2());
|
||||||
BookmarkMenu->addSeparator();
|
Button_Bookmarks->setPalette(palette);
|
||||||
for(int i=0;i<KpxBookmarks::count();i++){
|
palette=Label_Bookmark->palette();
|
||||||
|
palette.setColor(QPalette::Active,QPalette::WindowText,config->bannerTextColor());
|
||||||
|
Label_Bookmark->setPalette(palette);
|
||||||
|
// Create menu and add "last file" menu entry
|
||||||
|
QMenu* BookmarkMenu=new QMenu(this);
|
||||||
QAction* action=new QAction(this);
|
QAction* action=new QAction(this);
|
||||||
action->setData(KpxBookmarks::path(i));
|
action->setData(QString());
|
||||||
action->setText(KpxBookmarks::title(i));
|
action->setText(tr("Last File"));
|
||||||
action->setIcon(getIcon("document"));
|
action->setIcon(getIcon("document"));
|
||||||
BookmarkMenu->addAction(action);
|
BookmarkMenu->addAction(action);
|
||||||
|
BookmarkMenu->addSeparator();
|
||||||
|
// Adding all existing bookmarks
|
||||||
|
for(int i=0;i<KpxBookmarks::count();i++){
|
||||||
|
QAction* action=new QAction(this);
|
||||||
|
action->setData(KpxBookmarks::path(i));
|
||||||
|
action->setText(KpxBookmarks::title(i));
|
||||||
|
action->setIcon(getIcon("document"));
|
||||||
|
BookmarkMenu->addAction(action);
|
||||||
|
}
|
||||||
|
Button_Bookmarks->setMenu(BookmarkMenu);
|
||||||
|
connect(BookmarkMenu,SIGNAL(triggered(QAction*)),this,SLOT(OnBookmarkTriggered(QAction*)));
|
||||||
}
|
}
|
||||||
Button_Bookmarks->setMenu(BookmarkMenu);
|
else {
|
||||||
if(!IsAuto || !config->featureBookmarks()){
|
|
||||||
Button_Bookmarks->hide();
|
Button_Bookmarks->hide();
|
||||||
Label_Bookmark->hide();
|
Label_Bookmark->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(Combo_Dirs, SIGNAL( editTextChanged(const QString&) ),this, SLOT( OnComboTextChanged(const QString&)));
|
connect(buttonBox->button(QDialogButtonBox::Cancel), SIGNAL( clicked() ), this, SLOT( OnCancel() ) );
|
||||||
connect(ButtonBox, SIGNAL( rejected() ), this, SLOT( OnCancel() ) );
|
|
||||||
connect(Edit_Password, SIGNAL( textChanged(const QString&) ), this, SLOT( OnPasswordChanged(const QString&) ) );
|
|
||||||
connect(CheckBox_Both, SIGNAL( stateChanged(int) ), this, SLOT( OnCheckBox_BothChanged(int) ) );
|
|
||||||
connect(ButtonChangeEchoMode, SIGNAL( clicked() ), this, SLOT( ChangeEchoModeDatabaseKey() ) );
|
connect(ButtonChangeEchoMode, SIGNAL( clicked() ), this, SLOT( ChangeEchoModeDatabaseKey() ) );
|
||||||
connect(Edit_Password, SIGNAL( returnPressed() ), this, SLOT( OnOK() ) );
|
connect(Edit_Password, SIGNAL( returnPressed() ), this, SLOT( OnOK() ) );
|
||||||
connect(Edit_PasswordRep, SIGNAL( returnPressed() ), this, SLOT( OnOK() ) );
|
connect(Edit_PwRepeat, SIGNAL( returnPressed() ), this, SLOT( OnOK() ) );
|
||||||
connect(BookmarkMenu,SIGNAL(triggered(QAction*)),this,SLOT(OnBookmarkTriggered(QAction*)));
|
connect(buttonBox->button(QDialogButtonBox::Ok), SIGNAL( clicked() ), this, SLOT( OnOK() ) );
|
||||||
|
connect(Button_Browse, SIGNAL( clicked() ), this, SLOT( OnButtonBrowse() ) );
|
||||||
Mode_Set=ChangeKeyMode;
|
connect(Button_GenKeyFile,SIGNAL(clicked()),this,SLOT(OnGenKeyFile()));
|
||||||
if(!ChangeKeyMode){
|
connect(Check_Password,SIGNAL(stateChanged(int)),this,SLOT(OnCheckBoxesChanged(int)));
|
||||||
Edit_PasswordRep->hide();
|
connect(Check_KeyFile,SIGNAL(stateChanged(int)),this,SLOT(OnCheckBoxesChanged(int)));
|
||||||
Label_PasswordRep->hide();
|
connect(Button_Back,SIGNAL(clicked()),this,SLOT(OnButtonBack()));
|
||||||
connect( ButtonBox, SIGNAL( accepted() ), this, SLOT( OnOK() ) );
|
|
||||||
connect( ButtonBrowse, SIGNAL( clicked() ), this, SLOT( OnButtonBrowse() ) );
|
|
||||||
}else{
|
|
||||||
connect( ButtonBox, SIGNAL( accepted() ), this, SLOT( OnOK_Set() ) );
|
|
||||||
connect( ButtonBrowse, SIGNAL( clicked() ), this, SLOT( OnButtonBrowse_Set() ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!config->showPasswordsPasswordDlg())ChangeEchoModeDatabaseKey();
|
if(!config->showPasswordsPasswordDlg())ChangeEchoModeDatabaseKey();
|
||||||
|
|
||||||
|
adjustSize();
|
||||||
|
setMaximumSize(size());
|
||||||
|
setMinimumSize(size());
|
||||||
|
createBanner(&BannerPixmap,getPixmap("key"),BannerTitle,width());
|
||||||
|
Button_Bookmarks->setIcon(getIcon("bookmark"));
|
||||||
|
OnCheckBoxesChanged(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CPasswordDialog::setStatePasswordOnly(){
|
void PasswordDialog::OnButtonBrowse()
|
||||||
Combo_Dirs->setEnabled(false);
|
|
||||||
ButtonBrowse->setEnabled(false);
|
|
||||||
Label_KeyFile->setEnabled(false);
|
|
||||||
Label_Password->setEnabled(true);
|
|
||||||
Label_PasswordRep->setEnabled(true);
|
|
||||||
Edit_Password->setEnabled(true);
|
|
||||||
Edit_PasswordRep->setEnabled(true);
|
|
||||||
ButtonChangeEchoMode->setEnabled(true);
|
|
||||||
KeyType=PASSWORD;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void CPasswordDialog::setStateKeyFileOnly(){
|
|
||||||
Combo_Dirs->setEnabled(true);
|
|
||||||
ButtonBrowse->setEnabled(true);
|
|
||||||
Label_KeyFile->setEnabled(true);
|
|
||||||
Label_Password->setEnabled(false);
|
|
||||||
Label_PasswordRep->setEnabled(false);
|
|
||||||
Edit_Password->setEnabled(false);
|
|
||||||
Edit_PasswordRep->setEnabled(false);
|
|
||||||
ButtonChangeEchoMode->setEnabled(false);
|
|
||||||
KeyType=KEYFILE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void CPasswordDialog::setStateBoth(){
|
|
||||||
Combo_Dirs->setEnabled(true);
|
|
||||||
ButtonBrowse->setEnabled(true);
|
|
||||||
Label_KeyFile->setEnabled(true);
|
|
||||||
Label_Password->setEnabled(true);
|
|
||||||
Label_PasswordRep->setEnabled(true);
|
|
||||||
Edit_Password->setEnabled(true);
|
|
||||||
Edit_PasswordRep->setEnabled(true);
|
|
||||||
ButtonChangeEchoMode->setEnabled(true);
|
|
||||||
KeyType=BOTH;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void CPasswordDialog::OnButtonBrowse()
|
|
||||||
{
|
{
|
||||||
QString filename=KpxFileDialogs::openExistingFile(this,"PasswordDlg",tr("Select a Key File"),
|
QString filename=KpxFileDialogs::openExistingFile(this,"PasswordDlg",tr("Select a Key File"),
|
||||||
QStringList() << tr("Key Files (*.key)") << tr("All Files (*)"));
|
QStringList() << tr("All Files (*)")
|
||||||
if(filename!=QString()){
|
<< tr("Key Files (*.key)"));
|
||||||
Combo_Dirs->setEditText(filename);
|
if(filename!=QString())
|
||||||
}
|
Combo_KeyFile->setEditText(filename);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPasswordDialog::OnButtonBrowse_Set()
|
void PasswordDialog::OnCancel()
|
||||||
{
|
{
|
||||||
QString filename=KpxFileDialogs::saveFile(this,"PasswordDlg",tr("Select a Key File"),
|
done(Exit_Cancel);
|
||||||
QStringList() << tr("Key Files (*.key)") << tr("All Files (*)"),
|
|
||||||
false);
|
|
||||||
if(filename!=QString()){
|
|
||||||
Combo_Dirs->setEditText(filename);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPasswordDialog::OnCancel()
|
void PasswordDialog::OnOK(){
|
||||||
{
|
if(stackedWidget->currentIndex()==1){
|
||||||
done(0);
|
if(Password==Edit_PwRepeat->text()){
|
||||||
}
|
done(Exit_Ok);
|
||||||
|
}
|
||||||
void CPasswordDialog::OnOK(){
|
Edit_PwRepeat->clear();
|
||||||
password=Edit_Password->text();
|
Edit_PwRepeat->setFocus(Qt::OtherFocusReason);
|
||||||
keyfile=Combo_Dirs->currentText();
|
Label_Unequal->show();
|
||||||
|
QTimer::singleShot(2000,Label_Unequal,SLOT(hide()));
|
||||||
if(password.isEmpty() && keyfile.isEmpty()){
|
|
||||||
QMessageBox::warning(this,tr("Error"),tr("Please enter a Password or select a key file."),tr("OK"),"","",0,0);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(KeyType==BOTH){
|
Password=Edit_Password->text();
|
||||||
if(password.isEmpty()){
|
KeyFile=Combo_KeyFile->currentText();
|
||||||
QMessageBox::warning(this,tr("Error"),tr("Please enter a Password."),tr("OK"),"","",0,0);
|
|
||||||
return;}
|
if(!Check_Password->isChecked() && !Check_KeyFile->isChecked()){
|
||||||
if(keyfile.isEmpty()){
|
showErrMsg(tr("Please enter a Password or select a key file."),this);
|
||||||
QMessageBox::warning(this,tr("Error"),tr("Please choose a key file."),tr("OK"),"","",0,0);
|
return;
|
||||||
return;}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(KeyType==BOTH || KeyType==KEYFILE){
|
if(Check_Password->isChecked() && Password.isEmpty()){
|
||||||
QFileInfo fileinfo(keyfile);
|
showErrMsg(tr("Please enter a Password."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Check_KeyFile->isChecked() && KeyFile.isEmpty()){
|
||||||
|
showErrMsg(tr("Please provide a key file."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Check_KeyFile->isChecked()){
|
||||||
|
/* Check wether key path exists and is readable */
|
||||||
|
QFileInfo fileinfo(KeyFile);
|
||||||
if(!fileinfo.exists()){
|
if(!fileinfo.exists()){
|
||||||
QMessageBox::warning(this,tr("Error"),tr("The selected key file or directory does not exist."),tr("OK"),"","",0,0);
|
showErrMsg(tr("%1:\nNo such file or directory.").arg(KeyFile),this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!fileinfo.isReadable()){
|
if(!fileinfo.isReadable()){
|
||||||
QMessageBox::warning(this,tr("Error"),tr("The selected key file or directory is not readable.\nPlease check your permissions."),tr("OK"),"","",0,0);
|
showErrMsg(tr("The selected key file or directory is not readable."),this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the given path is a directory, we need to find the key file in it */
|
||||||
if(fileinfo.isDir()){
|
if(fileinfo.isDir()){
|
||||||
if(keyfile.right(1)!="/")keyfile+="/";
|
if(KeyFile.right(1)!="/")KeyFile+="/";
|
||||||
QFile file(keyfile+"pwsafe.key");
|
// First, we try to find $path/pwsafe.key
|
||||||
if(!file.exists()){
|
QFile file(KeyFile+"pwsafe.key");
|
||||||
QDir dir(keyfile);
|
if(file.exists())
|
||||||
|
KeyFile+="pwsafe.key";
|
||||||
|
else{
|
||||||
|
// If pwsafe.key does not exist, we try to see if there is exactly one file in the
|
||||||
|
// given directory which has the extension *.key.
|
||||||
|
QDir dir(KeyFile);
|
||||||
QStringList files;
|
QStringList files;
|
||||||
files=dir.entryList(QStringList()<<"*.key",QDir::Files);
|
files=dir.entryList(QStringList()<<"*.key",QDir::Files);
|
||||||
|
// No Key Files
|
||||||
if(!files.size()){
|
if(!files.size()){
|
||||||
QMessageBox::warning(this,tr("Error"),tr("The given directory does not contain any key files."),tr("OK"),"","",0,0);
|
showErrMsg(tr("The given directory does not contain any key files."),this);
|
||||||
return;}
|
return;
|
||||||
|
}
|
||||||
|
// More than one key file
|
||||||
if(files.size()>1){
|
if(files.size()>1){
|
||||||
QMessageBox::warning(this,tr("Error"),tr("The given directory contains more then one key file.\nPlease specify the key file directly."),tr("OK"),"","",0,0);
|
showErrMsg(tr("The given directory contains more then one key files.\n"
|
||||||
return;}
|
"Please specify the key file directly."),this);
|
||||||
QFile file(keyfile+files[0]);
|
return;
|
||||||
Q_ASSERT(file.exists());
|
|
||||||
if(!QFileInfo(file).isReadable()){
|
|
||||||
QMessageBox::warning(this,tr("Error"),tr("The key file found in the given directory is not readable.\nPlease check your permissions."),tr("OK"),"","",0,0);
|
|
||||||
return;}
|
|
||||||
keyfile+=files[0];
|
|
||||||
}
|
}
|
||||||
else{ /* pwsafe.key exists */
|
KeyFile+=files[0];
|
||||||
if(!QFileInfo(file).isReadable()){
|
|
||||||
QMessageBox::warning(this,tr("Error"),tr("The key file found in the given directory is not readable.\nPlease check your permissions."),tr("OK"),"","",0,0);
|
|
||||||
return;}
|
|
||||||
keyfile+="pwsafe.key";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{ /* not a directory */
|
|
||||||
QFile file(keyfile);
|
|
||||||
if(!file.exists()){
|
|
||||||
QMessageBox::warning(this,tr("Error"),tr("Key file could not be found."),tr("OK"),"","",0,0);
|
|
||||||
return;}
|
|
||||||
if(!QFileInfo(file).isReadable()){
|
|
||||||
QMessageBox::warning(this,tr("Error"),tr("Key file is not readable.\nPlease check your permissions."),tr("OK"),"","",0,0);
|
|
||||||
return;}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if(doAuth())done(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CPasswordDialog::OnOK_Set(){
|
|
||||||
password=Edit_Password->text();
|
|
||||||
if(password!=Edit_PasswordRep->text()){
|
|
||||||
QMessageBox::warning(this,tr("Warning"),tr("Password an password repetition are not equal.\nPlease check your input."),tr("OK"),"","",0,0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
keyfile=Combo_Dirs->currentText();
|
|
||||||
if(password.isEmpty() && keyfile.isEmpty()){
|
|
||||||
QMessageBox::warning(this,tr("Error"),tr("Please enter a password or select a key file."),tr("OK"),"","",0,0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!keyfile.isEmpty()){
|
|
||||||
QFile file(keyfile);
|
|
||||||
if(QFileInfo(file).isDir()){
|
|
||||||
if(keyfile.right(1)!="/")keyfile+="/";
|
|
||||||
keyfile+="pwsafe.key";
|
|
||||||
}
|
|
||||||
if(file.exists()){
|
|
||||||
switch(QMessageBox::question(this,tr("File exists."),tr("A file with the selected name already exists, should this file be used as key file or do you want to overwrite it with a newly generated one?"),
|
|
||||||
tr("Use"),tr("Overwrite"),tr("Cancel"),0,2)){
|
|
||||||
case 0:
|
|
||||||
OverwriteKeyFile=false;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
OverwriteKeyFile=true;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
IFilePasswordAuth* DbAuth=dynamic_cast<IFilePasswordAuth*>(db);
|
// Check again whether the found file exists and is readable
|
||||||
if(OverwriteKeyFile){
|
QFileInfo fileinfo(KeyFile);
|
||||||
if(!DbAuth->createKeyFile(keyfile,32,true)){
|
if(!fileinfo.exists()){
|
||||||
QMessageBox::warning(this,tr("Error"),tr("Key file could not be created.\n%1").arg(db->getError()),tr("OK"),"","",0,0);
|
showErrMsg(tr("%1:\nNo such file or directory.").arg(KeyFile),this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!fileinfo.isReadable()){
|
||||||
|
showErrMsg(tr("%1:\nFile is not readable."),this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if(doAuth())done(1);
|
|
||||||
|
if(Check_Password->isChecked() && (Mode==Mode_Set || Mode==Mode_Change)){
|
||||||
|
Edit_PwRepeat->clear();
|
||||||
|
Label_Unequal->hide();
|
||||||
|
stackedWidget->setCurrentIndex(1);
|
||||||
|
Edit_PwRepeat->setFocus(Qt::OtherFocusReason);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
done(Exit_Ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPasswordDialog::doAuth(){
|
void PasswordDialog::OnCheckBoxesChanged(int state){
|
||||||
IFilePasswordAuth* DbAuth=dynamic_cast<IFilePasswordAuth*>(db);
|
Edit_Password->setEnabled(Check_Password->isChecked());
|
||||||
if(!password.isEmpty() && keyfile.isEmpty()){
|
Combo_KeyFile->setEnabled(Check_KeyFile->isChecked());
|
||||||
DbAuth->authByPwd(password);
|
Button_Browse->setEnabled(Check_KeyFile->isChecked());
|
||||||
}
|
Button_GenKeyFile->setEnabled(Check_KeyFile->isChecked());
|
||||||
else if(password.isEmpty() && !keyfile.isEmpty()){
|
|
||||||
if(!DbAuth->authByFile(keyfile))return false;
|
|
||||||
}
|
|
||||||
else if(!password.isEmpty() && !keyfile.isEmpty()){
|
|
||||||
if(!DbAuth->authByFileAndPwd(password, keyfile))return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(config->rememberLastKey() && config->openLastFile()){
|
|
||||||
QString KeyLocation=keyfile;
|
|
||||||
if(config->saveRelativePaths()){
|
|
||||||
KeyLocation=KeyLocation.left(KeyLocation.lastIndexOf("/"));
|
|
||||||
KeyLocation=makePathRelative(KeyLocation,QDir::currentPath())+keyfile.right(keyfile.length()-keyfile.lastIndexOf("/")-1);
|
|
||||||
}
|
|
||||||
config->setLastKeyLocation(KeyLocation);
|
|
||||||
config->setLastKeyType(KeyType);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPasswordDialog::OnPasswordChanged(const QString &txt){
|
void PasswordDialog::ChangeEchoModeDatabaseKey(){
|
||||||
Edit_PasswordRep->setText(QString());
|
if(Edit_Password->echoMode()==QLineEdit::Normal){
|
||||||
if(CheckBox_Both->isChecked() || txt.isEmpty())
|
Edit_Password->setEchoMode(QLineEdit::Password);
|
||||||
setStateBoth();
|
Edit_PwRepeat->setEchoMode(QLineEdit::Password);
|
||||||
else
|
|
||||||
setStatePasswordOnly();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CPasswordDialog::OnComboTextChanged(const QString& txt){
|
|
||||||
if(CheckBox_Both->isChecked() || txt.isEmpty())
|
|
||||||
setStateBoth();
|
|
||||||
else
|
|
||||||
setStateKeyFileOnly();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CPasswordDialog::OnCheckBox_BothChanged(int state){
|
|
||||||
if(state==Qt::Checked)
|
|
||||||
setStateBoth();
|
|
||||||
if(state==Qt::Unchecked){
|
|
||||||
if(!Edit_Password->text().isEmpty() && !Combo_Dirs->currentText().isEmpty()){
|
|
||||||
Combo_Dirs->setEditText(QString());
|
|
||||||
setStatePasswordOnly();
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if(Edit_Password->text().isEmpty())
|
Edit_Password->setEchoMode(QLineEdit::Normal);
|
||||||
setStateKeyFileOnly();
|
Edit_PwRepeat->setEchoMode(QLineEdit::Normal);
|
||||||
else
|
|
||||||
setStatePasswordOnly();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PasswordDialog::OnButtonQuit(){
|
||||||
|
done(Exit_Quit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPasswordDialog::ChangeEchoModeDatabaseKey(){
|
void PasswordDialog::paintEvent(QPaintEvent* event){
|
||||||
if(Edit_Password->echoMode()==QLineEdit::Normal){
|
|
||||||
Edit_Password->setEchoMode(QLineEdit::Password);
|
|
||||||
Edit_PasswordRep->setEchoMode(QLineEdit::Password);}
|
|
||||||
else{
|
|
||||||
Edit_Password->setEchoMode(QLineEdit::Normal);
|
|
||||||
Edit_PasswordRep->setEchoMode(QLineEdit::Normal);}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CPasswordDialog::paintEvent(QPaintEvent* event){
|
|
||||||
QDialog::paintEvent(event);
|
QDialog::paintEvent(event);
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
painter.setClipRegion(event->region());
|
painter.setClipRegion(event->region());
|
||||||
painter.drawPixmap(QPoint(0,0),BannerPixmap);
|
painter.drawPixmap(QPoint(0,0),BannerPixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPasswordDialog::OnBookmarkTriggered(QAction* action){
|
void PasswordDialog::OnBookmarkTriggered(QAction* action){
|
||||||
BookmarkFilename=action->data().toString();
|
|
||||||
if(action->data().toString()==QString())
|
if(action->data().toString()==QString())
|
||||||
setWindowTitle(LastFile);
|
setWindowTitle(Filename);
|
||||||
else
|
else
|
||||||
setWindowTitle(action->data().toString());
|
setWindowTitle(action->data().toString());
|
||||||
Label_Bookmark->setText(action->text());
|
Label_Bookmark->setText(action->text());
|
||||||
|
BookmarkFilename=action->data().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PasswordDialog::OnGenKeyFile(){
|
||||||
|
QString filename=KpxFileDialogs::saveFile(this,"PasswordDlg",tr("Create Key File..."),
|
||||||
|
QStringList() << tr("All Files (*)")
|
||||||
|
<< tr("Key Files (*.key)"));
|
||||||
|
if(!filename.isEmpty()){
|
||||||
|
QString error;
|
||||||
|
if(!createKeyFile(filename,&error,32,true)){
|
||||||
|
showErrMsg(error,this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(Check_KeyFile->isChecked())
|
||||||
|
Combo_KeyFile->setEditText(filename);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QString PasswordDialog::password(){
|
||||||
|
if(Check_Password->isChecked())
|
||||||
|
return Edit_Password->text();
|
||||||
|
else
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString PasswordDialog::keyFile(){
|
||||||
|
if(Check_KeyFile->isChecked())
|
||||||
|
return Combo_KeyFile->currentText();
|
||||||
|
else
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString PasswordDialog::selectedBookmark(){
|
||||||
|
return BookmarkFilename;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PasswordDialog::OnButtonBack(){
|
||||||
|
stackedWidget->setCurrentIndex(0);
|
||||||
|
Edit_PwRepeat->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2005 by Tarek Saidi *
|
* Copyright (C) 2005-2007 by Tarek Saidi *
|
||||||
* tarek@linux *
|
* tarek.saidi@arcor.de *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
* it under the terms of the GNU General Public License as published by *
|
* it under the terms of the GNU General Public License as published by *
|
||||||
* the Free Software Foundation; version 2 of the License. *
|
* the Free Software Foundation; version 2 of the License. *
|
||||||
|
|
||||||
* *
|
* *
|
||||||
* This program is distributed in the hope that it will be useful, *
|
* This program is distributed in the hope that it will be useful, *
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
@ -17,51 +16,69 @@
|
||||||
* Free Software Foundation, Inc., *
|
* Free Software Foundation, Inc., *
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef PASSWORDDIALOG_H
|
#ifndef PASSWORDDIALOG_H
|
||||||
#define PASSWORDDIALOG_H
|
#define PASSWORDDIALOG_H
|
||||||
#include "ui_PasswordDlg.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "lib/tools.h"
|
|
||||||
#include "lib/UrlLabel.h"
|
|
||||||
#include "Database.h"
|
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QPaintEvent>
|
#include <QPaintEvent>
|
||||||
|
#include "ui_PasswordDlg.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "lib/UrlLabel.h"
|
||||||
|
#include "Database.h"
|
||||||
|
|
||||||
|
|
||||||
class CPasswordDialog : public QDialog, public Ui_PasswordDlg
|
class PasswordDialog : public QDialog, public Ui_PasswordDlg {
|
||||||
{
|
Q_OBJECT
|
||||||
Q_OBJECT
|
public:
|
||||||
|
enum DlgMode {
|
||||||
|
Mode_Ask, // Normal password entry when opening a database
|
||||||
|
Mode_Set, // Setting password for the first time after creating a new database
|
||||||
|
Mode_Change // Changing the password of a database
|
||||||
|
};
|
||||||
|
|
||||||
private:
|
enum DlgFlags {
|
||||||
bool Mode_Set; //true = Set, false = Get
|
Flag_None = 0x00,
|
||||||
IDatabase* db;
|
Flag_Auto = 0x01 // Dialog was automatically opened on start-up
|
||||||
QPixmap BannerPixmap;
|
};
|
||||||
void setStatePasswordOnly();
|
|
||||||
void setStateKeyFileOnly();
|
|
||||||
void setStateBoth();
|
|
||||||
bool doAuth();
|
|
||||||
virtual void paintEvent(QPaintEvent*);
|
|
||||||
QString LastFile;
|
|
||||||
|
|
||||||
public:
|
enum DlgExit {
|
||||||
QString keyfile;
|
Exit_Ok,
|
||||||
QString password;
|
Exit_Cancel,
|
||||||
QString BookmarkFilename;
|
Exit_Quit
|
||||||
tKeyType KeyType;
|
};
|
||||||
bool OverwriteKeyFile;
|
|
||||||
CPasswordDialog(QWidget* parent,QString filename,IDatabase* DB,bool IsAuto=false,bool ChangeKeyMode=false);
|
|
||||||
|
|
||||||
private slots:
|
typedef bool (KeyFileGenProc)(const QString& filename,QString* error);
|
||||||
void OnOK();
|
|
||||||
void OnOK_Set();
|
PasswordDialog(QWidget* parent,DlgMode mode,DlgFlags flags,const QString& filename=QString());
|
||||||
void OnCancel();
|
|
||||||
void OnButtonBrowse();
|
// result functions
|
||||||
void OnButtonBrowse_Set();
|
QString selectedBookmark();
|
||||||
void OnPasswordChanged(const QString &txt);
|
QString keyFile();
|
||||||
void OnCheckBox_BothChanged(int state);
|
QString password();
|
||||||
void ChangeEchoModeDatabaseKey();
|
|
||||||
void OnComboTextChanged(const QString&);
|
public slots:
|
||||||
void OnBookmarkTriggered(QAction* action);
|
void OnOK();
|
||||||
|
void OnCancel();
|
||||||
|
void OnButtonBrowse();
|
||||||
|
void OnButtonQuit();
|
||||||
|
void OnGenKeyFile();
|
||||||
|
void OnButtonBack();
|
||||||
|
void ChangeEchoModeDatabaseKey();
|
||||||
|
void OnBookmarkTriggered(QAction* action);
|
||||||
|
void OnCheckBoxesChanged(int state);
|
||||||
|
|
||||||
|
private:
|
||||||
|
DlgMode Mode;
|
||||||
|
QPixmap BannerPixmap;
|
||||||
|
QString BookmarkFilename;
|
||||||
|
QString Filename;
|
||||||
|
QString Password;
|
||||||
|
QString KeyFile;
|
||||||
|
void setStatePasswordOnly();
|
||||||
|
void setStateKeyFileOnly();
|
||||||
|
void setStateBoth();
|
||||||
|
virtual void paintEvent(QPaintEvent*);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,18 +18,10 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QSpinBox>
|
|
||||||
#include <QMessageBox>
|
#include "dialogs/PasswordGenDlg.h"
|
||||||
#include <QRadioButton>
|
#include "dialogs/CollectEntropyDlg.h"
|
||||||
#include <QLineEdit>
|
|
||||||
#include <QCheckBox>
|
|
||||||
#include <QProgressBar>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <math.h>
|
|
||||||
#include "PasswordGenDlg.h"
|
|
||||||
#include "CollectEntropyDlg.h"
|
|
||||||
#include "crypto/yarrow.h"
|
#include "crypto/yarrow.h"
|
||||||
#include "KpxConfig.h"
|
|
||||||
|
|
||||||
bool CGenPwDialog::EntropyCollected=false;
|
bool CGenPwDialog::EntropyCollected=false;
|
||||||
|
|
||||||
|
|
|
@ -21,10 +21,7 @@
|
||||||
#ifndef GENPWDIALOG_H
|
#ifndef GENPWDIALOG_H
|
||||||
#define GENPWDIALOG_H
|
#define GENPWDIALOG_H
|
||||||
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QPaintEvent>
|
|
||||||
#include "ui_PasswordGenDlg.h"
|
#include "ui_PasswordGenDlg.h"
|
||||||
#include "main.h"
|
|
||||||
#include "EditEntryDlg.h"
|
#include "EditEntryDlg.h"
|
||||||
|
|
||||||
class CGenPwDialog : public QDialog, public Ui_GenPwDlg
|
class CGenPwDialog : public QDialog, public Ui_GenPwDlg
|
||||||
|
|
|
@ -19,15 +19,7 @@
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#include <QLineEdit>
|
#include "dialogs/SearchDlg.h"
|
||||||
#include <QCheckBox>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QRegExp>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QPainter>
|
|
||||||
#include "main.h"
|
|
||||||
#include "KpxConfig.h"
|
|
||||||
#include "SearchDlg.h"
|
|
||||||
|
|
||||||
|
|
||||||
SearchDialog::SearchDialog(IDatabase* database,IGroupHandle* Group,QWidget* parent):QDialog(parent)
|
SearchDialog::SearchDialog(IDatabase* database,IGroupHandle* Group,QWidget* parent):QDialog(parent)
|
||||||
|
|
|
@ -20,11 +20,7 @@
|
||||||
#ifndef SEARCHDLG_H
|
#ifndef SEARCHDLG_H
|
||||||
#define SEARCHDLG_H
|
#define SEARCHDLG_H
|
||||||
|
|
||||||
#include <QPaintEvent>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include "ui_SearchDlg.h"
|
#include "ui_SearchDlg.h"
|
||||||
#include "main.h"
|
|
||||||
#include "Database.h"
|
|
||||||
|
|
||||||
class SearchDialog : public QDialog, public Ui_Search_Dlg
|
class SearchDialog : public QDialog, public Ui_Search_Dlg
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,17 +17,8 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QDir>
|
#include "dialogs/SelectIconDlg.h"
|
||||||
#include <QFile>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QShowEvent>
|
|
||||||
#include <QFile>
|
|
||||||
#include "lib/tools.h"
|
|
||||||
#include "SelectIconDlg.h"
|
|
||||||
|
|
||||||
|
|
||||||
CSelectIconDlg::CSelectIconDlg(IDatabase* database,int CurrentId,QWidget* parent, bool modal, Qt::WFlags fl):QDialog(parent,fl){
|
CSelectIconDlg::CSelectIconDlg(IDatabase* database,int CurrentId,QWidget* parent, bool modal, Qt::WFlags fl):QDialog(parent,fl){
|
||||||
|
|
|
@ -21,11 +21,6 @@
|
||||||
#ifndef _SELECT_ICON_DLG_
|
#ifndef _SELECT_ICON_DLG_
|
||||||
#define _SELECT_ICON_DLG_
|
#define _SELECT_ICON_DLG_
|
||||||
|
|
||||||
#include <QContextMenuEvent>
|
|
||||||
#include <QMenu>
|
|
||||||
#include <QAction>
|
|
||||||
#include "main.h"
|
|
||||||
#include "Database.h"
|
|
||||||
#include "ui_SelectIconDlg.h"
|
#include "ui_SelectIconDlg.h"
|
||||||
|
|
||||||
class CSelectIconDlg:public QDialog, public Ui_SelectIconDlg{
|
class CSelectIconDlg:public QDialog, public Ui_SelectIconDlg{
|
||||||
|
|
|
@ -17,16 +17,10 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "main.h"
|
|
||||||
#include "KpxConfig.h"
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QColorDialog>
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QDir>
|
#include <QColorDialog>
|
||||||
#include <QPainter>
|
#include "dialogs/SettingsDlg.h"
|
||||||
#include "SettingsDlg.h"
|
#include "dialogs/CustomizeDetailViewDlg.h"
|
||||||
#include "CustomizeDetailViewDlg.h"
|
|
||||||
#include "FileDialogs.h"
|
|
||||||
|
|
||||||
bool CSettingsDlg::PluginsModified=false;
|
bool CSettingsDlg::PluginsModified=false;
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,7 @@
|
||||||
#ifndef SETTINGSDLG_H
|
#ifndef SETTINGSDLG_H
|
||||||
#define SETTINGSDLG_H
|
#define SETTINGSDLG_H
|
||||||
|
|
||||||
|
|
||||||
#include <QColor>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QPaintEvent>
|
|
||||||
#include "ui_SettingsDlg.h"
|
#include "ui_SettingsDlg.h"
|
||||||
#include "main.h"
|
|
||||||
#include "lib/AutoType.h"
|
#include "lib/AutoType.h"
|
||||||
|
|
||||||
class CSettingsDlg : public QDialog, public Ui_SettingsDialog
|
class CSettingsDlg : public QDialog, public Ui_SettingsDialog
|
||||||
|
|
|
@ -18,10 +18,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QLineEdit>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include "main.h"
|
|
||||||
#include "KpxConfig.h"
|
|
||||||
#include "SimplePasswordDlg.h"
|
#include "SimplePasswordDlg.h"
|
||||||
|
|
||||||
SimplePasswordDialog::SimplePasswordDialog(QWidget* parent, bool modal, Qt::WFlags fl)
|
SimplePasswordDialog::SimplePasswordDialog(QWidget* parent, bool modal, Qt::WFlags fl)
|
||||||
|
|
|
@ -18,12 +18,8 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QFile>
|
|
||||||
#include "lib/tools.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "Export.h"
|
#include "Export.h"
|
||||||
#include "lib/FileDialogs.h"
|
|
||||||
#include "dialogs/SimplePasswordDlg.h"
|
#include "dialogs/SimplePasswordDlg.h"
|
||||||
|
|
||||||
QFile* ExporterBase::openFile(QWidget* parent, QString id, QStringList Filters){
|
QFile* ExporterBase::openFile(QWidget* parent, QString id, QStringList Filters){
|
||||||
|
|
|
@ -20,10 +20,6 @@
|
||||||
#ifndef _EXPORT_H_
|
#ifndef _EXPORT_H_
|
||||||
#define _EXPORT_H_
|
#define _EXPORT_H_
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QFile>
|
|
||||||
|
|
||||||
#include "Database.h"
|
|
||||||
|
|
||||||
class IExport{
|
class IExport{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QtXml>
|
|
||||||
#include "Export_KeePassX_Xml.h"
|
#include "Export_KeePassX_Xml.h"
|
||||||
|
|
||||||
bool Export_KeePassX_Xml::exportDatabase(QWidget* GuiParent,IDatabase* database){
|
bool Export_KeePassX_Xml::exportDatabase(QWidget* GuiParent,IDatabase* database){
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#ifndef _EXPORT_KPX_XML_H_
|
#ifndef _EXPORT_KPX_XML_H_
|
||||||
#define _EXPORT_KPX_XML_H_
|
#define _EXPORT_KPX_XML_H_
|
||||||
|
|
||||||
#include <QDomElement>
|
|
||||||
#include "Export.h"
|
#include "Export.h"
|
||||||
|
|
||||||
class Export_KeePassX_Xml:public ExporterBase, public IExport{
|
class Export_KeePassX_Xml:public ExporterBase, public IExport{
|
||||||
|
|
|
@ -18,10 +18,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
#include <QFile>
|
|
||||||
#include "main.h"
|
|
||||||
#include "lib/SecString.h"
|
|
||||||
#include "Export_Txt.h"
|
#include "Export_Txt.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#ifndef _EXPORT_TXT_H_
|
#ifndef _EXPORT_TXT_H_
|
||||||
#define _EXPORT_TXT_H_
|
#define _EXPORT_TXT_H_
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include "Export.h"
|
#include "Export.h"
|
||||||
|
|
||||||
class Export_Txt:public ExporterBase, public IExport{
|
class Export_Txt:public ExporterBase, public IExport{
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>578</width>
|
<width>578</width>
|
||||||
<height>280</height>
|
<height>255</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
<sizepolicy vsizetype="Maximum" hsizetype="Maximum" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -18,13 +18,7 @@
|
||||||
<property name="minimumSize" >
|
<property name="minimumSize" >
|
||||||
<size>
|
<size>
|
||||||
<width>578</width>
|
<width>578</width>
|
||||||
<height>280</height>
|
<height>0</height>
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize" >
|
|
||||||
<size>
|
|
||||||
<width>578</width>
|
|
||||||
<height>280</height>
|
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
|
@ -37,6 +31,9 @@
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" >
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" >
|
||||||
<item>
|
<item>
|
||||||
|
@ -115,150 +112,187 @@
|
||||||
<property name="title" >
|
<property name="title" >
|
||||||
<string>Key</string>
|
<string>Key</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="layoutWidget" >
|
<layout class="QVBoxLayout" >
|
||||||
<property name="geometry" >
|
<property name="leftMargin" >
|
||||||
<rect>
|
<number>0</number>
|
||||||
<x>10</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>541</width>
|
|
||||||
<height>124</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" >
|
<property name="topMargin" >
|
||||||
<property name="spacing" >
|
<number>0</number>
|
||||||
<number>6</number>
|
</property>
|
||||||
</property>
|
<property name="rightMargin" >
|
||||||
<item>
|
<number>0</number>
|
||||||
<layout class="QGridLayout" >
|
</property>
|
||||||
<property name="horizontalSpacing" >
|
<property name="bottomMargin" >
|
||||||
<number>6</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="verticalSpacing" >
|
<item>
|
||||||
<number>6</number>
|
<widget class="QStackedWidget" name="stackedWidget" >
|
||||||
</property>
|
<property name="currentIndex" >
|
||||||
<item row="1" column="0" >
|
<number>0</number>
|
||||||
<widget class="QLabel" name="Label_PasswordRep" >
|
</property>
|
||||||
<property name="text" >
|
<widget class="QWidget" name="pw_entry" >
|
||||||
<string>Password Repet.:</string>
|
<layout class="QGridLayout" >
|
||||||
</property>
|
<item row="0" column="0" >
|
||||||
</widget>
|
<widget class="QCheckBox" name="Check_Password" >
|
||||||
</item>
|
<property name="text" >
|
||||||
<item row="0" column="1" >
|
<string>Password:</string>
|
||||||
<widget class="QLineEdit" name="Edit_Password" />
|
</property>
|
||||||
</item>
|
<property name="checked" >
|
||||||
<item row="0" column="0" >
|
<bool>true</bool>
|
||||||
<widget class="QLabel" name="Label_Password" >
|
</property>
|
||||||
<property name="sizePolicy" >
|
</widget>
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
</item>
|
||||||
<horstretch>0</horstretch>
|
<item row="0" column="1" colspan="2" >
|
||||||
<verstretch>0</verstretch>
|
<layout class="QHBoxLayout" >
|
||||||
</sizepolicy>
|
<item>
|
||||||
</property>
|
<widget class="QLineEdit" name="Edit_Password" />
|
||||||
<property name="text" >
|
</item>
|
||||||
<string>Password:</string>
|
<item>
|
||||||
</property>
|
<widget class="QToolButton" name="ButtonChangeEchoMode" >
|
||||||
</widget>
|
<property name="text" >
|
||||||
</item>
|
<string>...</string>
|
||||||
<item row="0" column="2" >
|
</property>
|
||||||
<widget class="QToolButton" name="ButtonChangeEchoMode" >
|
</widget>
|
||||||
<property name="text" >
|
</item>
|
||||||
<string>...</string>
|
</layout>
|
||||||
</property>
|
</item>
|
||||||
</widget>
|
<item row="1" column="0" >
|
||||||
</item>
|
<widget class="QCheckBox" name="Check_KeyFile" >
|
||||||
<item row="1" column="1" >
|
<property name="text" >
|
||||||
<widget class="QLineEdit" name="Edit_PasswordRep" />
|
<string>Key File:</string>
|
||||||
</item>
|
</property>
|
||||||
</layout>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="1" colspan="2" >
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" >
|
||||||
<property name="spacing" >
|
<item>
|
||||||
<number>6</number>
|
<widget class="QComboBox" name="Combo_KeyFile" >
|
||||||
</property>
|
<property name="sizePolicy" >
|
||||||
<item>
|
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
||||||
<widget class="QLabel" name="Label_KeyFile" >
|
<horstretch>0</horstretch>
|
||||||
<property name="sizePolicy" >
|
<verstretch>0</verstretch>
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
</sizepolicy>
|
||||||
<horstretch>0</horstretch>
|
</property>
|
||||||
<verstretch>0</verstretch>
|
<property name="editable" >
|
||||||
</sizepolicy>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
</widget>
|
||||||
<string>Key file or directory:</string>
|
</item>
|
||||||
</property>
|
<item>
|
||||||
</widget>
|
<widget class="QPushButton" name="Button_Browse" >
|
||||||
</item>
|
<property name="sizePolicy" >
|
||||||
<item>
|
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
|
||||||
<widget class="QComboBox" name="Combo_Dirs" >
|
<horstretch>0</horstretch>
|
||||||
<property name="sizePolicy" >
|
<verstretch>0</verstretch>
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
</sizepolicy>
|
||||||
<horstretch>0</horstretch>
|
</property>
|
||||||
<verstretch>0</verstretch>
|
<property name="text" >
|
||||||
</sizepolicy>
|
<string>&Browse...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="editable" >
|
<property name="shortcut" >
|
||||||
<bool>true</bool>
|
<string>Alt+B</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
</layout>
|
||||||
<widget class="QPushButton" name="ButtonBrowse" >
|
</item>
|
||||||
<property name="sizePolicy" >
|
<item row="2" column="1" >
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
|
<widget class="QPushButton" name="Button_GenKeyFile" >
|
||||||
<horstretch>0</horstretch>
|
<property name="text" >
|
||||||
<verstretch>0</verstretch>
|
<string>Generate Key File...</string>
|
||||||
</sizepolicy>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<property name="text" >
|
</item>
|
||||||
<string>&Browse...</string>
|
<item row="2" column="2" >
|
||||||
</property>
|
<spacer>
|
||||||
<property name="shortcut" >
|
<property name="orientation" >
|
||||||
<string>Alt+B</string>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="sizeHint" >
|
||||||
</item>
|
<size>
|
||||||
</layout>
|
<width>40</width>
|
||||||
</item>
|
<height>20</height>
|
||||||
<item>
|
</size>
|
||||||
<layout class="QHBoxLayout" >
|
</property>
|
||||||
<property name="spacing" >
|
</spacer>
|
||||||
<number>6</number>
|
</item>
|
||||||
</property>
|
</layout>
|
||||||
<item>
|
</widget>
|
||||||
<widget class="QCheckBox" name="CheckBox_Both" >
|
<widget class="QWidget" name="pw_repeat" >
|
||||||
<property name="sizePolicy" >
|
<layout class="QVBoxLayout" >
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
<item>
|
||||||
<horstretch>0</horstretch>
|
<widget class="QLabel" name="label" >
|
||||||
<verstretch>0</verstretch>
|
<property name="text" >
|
||||||
</sizepolicy>
|
<string>Please repeat your password:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
</widget>
|
||||||
<string>Use Password AND Key File</string>
|
</item>
|
||||||
</property>
|
<item>
|
||||||
</widget>
|
<widget class="QLineEdit" name="Edit_PwRepeat" />
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer>
|
<layout class="QHBoxLayout" >
|
||||||
<property name="orientation" >
|
<item>
|
||||||
<enum>Qt::Horizontal</enum>
|
<widget class="QPushButton" name="Button_Back" >
|
||||||
</property>
|
<property name="text" >
|
||||||
<property name="sizeHint" >
|
<string>Back</string>
|
||||||
<size>
|
</property>
|
||||||
<width>40</width>
|
</widget>
|
||||||
<height>20</height>
|
</item>
|
||||||
</size>
|
<item>
|
||||||
</property>
|
<spacer>
|
||||||
</spacer>
|
<property name="orientation" >
|
||||||
</item>
|
<enum>Qt::Horizontal</enum>
|
||||||
</layout>
|
</property>
|
||||||
</item>
|
<property name="sizeHint" >
|
||||||
</layout>
|
<size>
|
||||||
</widget>
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="Label_Unequal" >
|
||||||
|
<property name="font" >
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text" >
|
||||||
|
<string>Passwords are not equal.</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment" >
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="ButtonBox" >
|
<widget class="QDialogButtonBox" name="buttonBox" >
|
||||||
<property name="standardButtons" >
|
<property name="standardButtons" >
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
|
@ -269,13 +303,16 @@
|
||||||
<layoutdefault spacing="6" margin="11" />
|
<layoutdefault spacing="6" margin="11" />
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>Edit_Password</tabstop>
|
<tabstop>Edit_Password</tabstop>
|
||||||
|
<tabstop>Combo_KeyFile</tabstop>
|
||||||
|
<tabstop>Check_Password</tabstop>
|
||||||
|
<tabstop>Check_KeyFile</tabstop>
|
||||||
<tabstop>ButtonChangeEchoMode</tabstop>
|
<tabstop>ButtonChangeEchoMode</tabstop>
|
||||||
<tabstop>Edit_PasswordRep</tabstop>
|
<tabstop>Button_Browse</tabstop>
|
||||||
<tabstop>Combo_Dirs</tabstop>
|
|
||||||
<tabstop>ButtonBrowse</tabstop>
|
|
||||||
<tabstop>CheckBox_Both</tabstop>
|
|
||||||
<tabstop>ButtonBox</tabstop>
|
|
||||||
<tabstop>Button_Bookmarks</tabstop>
|
<tabstop>Button_Bookmarks</tabstop>
|
||||||
|
<tabstop>buttonBox</tabstop>
|
||||||
|
<tabstop>Button_GenKeyFile</tabstop>
|
||||||
|
<tabstop>Button_Back</tabstop>
|
||||||
|
<tabstop>Edit_PwRepeat</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
|
@ -18,12 +18,8 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QFile>
|
|
||||||
#include "lib/tools.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "Import.h"
|
#include "Import.h"
|
||||||
#include "lib/FileDialogs.h"
|
|
||||||
#include "dialogs/SimplePasswordDlg.h"
|
#include "dialogs/SimplePasswordDlg.h"
|
||||||
|
|
||||||
QFile* ImporterBase::openFile(QWidget* parent, QString id, QStringList Filters){
|
QFile* ImporterBase::openFile(QWidget* parent, QString id, QStringList Filters){
|
||||||
|
|
|
@ -20,11 +20,6 @@
|
||||||
#ifndef _IMPORT_H_
|
#ifndef _IMPORT_H_
|
||||||
#define _IMPORT_H_
|
#define _IMPORT_H_
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QFile>
|
|
||||||
|
|
||||||
#include "Database.h"
|
|
||||||
|
|
||||||
class IImport{
|
class IImport{
|
||||||
public:
|
public:
|
||||||
virtual ~IImport(){};
|
virtual ~IImport(){};
|
||||||
|
|
|
@ -18,11 +18,8 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "Import_KWalletXml.h"
|
|
||||||
#include <QFile>
|
|
||||||
#include <QtXml>
|
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
|
#include "Import_KWalletXml.h"
|
||||||
|
|
||||||
bool Import_KWalletXml::importDatabase(QWidget* GuiParent, IDatabase* db){
|
bool Import_KWalletXml::importDatabase(QWidget* GuiParent, IDatabase* db){
|
||||||
QFile* file=openFile(GuiParent,identifier(),QStringList()<<tr("XML Files (*.xml)")<<tr("All Files (*)"));
|
QFile* file=openFile(GuiParent,identifier(),QStringList()<<tr("XML Files (*.xml)")<<tr("All Files (*)"));
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
#ifndef _IMPORT_KWALLET_H_
|
#ifndef _IMPORT_KWALLET_H_
|
||||||
#define _IMPORT_KWALLET_H_
|
#define _IMPORT_KWALLET_H_
|
||||||
#include "Database.h"
|
|
||||||
#include "Import.h"
|
#include "Import.h"
|
||||||
|
|
||||||
class Import_KWalletXml:public ImporterBase, public IImport{
|
class Import_KWalletXml:public ImporterBase, public IImport{
|
||||||
|
|
|
@ -18,9 +18,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QtXml>
|
|
||||||
#include "Import_KeePassX_Xml.h"
|
#include "Import_KeePassX_Xml.h"
|
||||||
|
|
||||||
bool Import_KeePassX_Xml::importDatabase(QWidget* Parent, IDatabase* database){
|
bool Import_KeePassX_Xml::importDatabase(QWidget* Parent, IDatabase* database){
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#ifndef _IMPORT_KPX_XML_H_
|
#ifndef _IMPORT_KPX_XML_H_
|
||||||
#define _IMPORT_KPX_XML_H_
|
#define _IMPORT_KPX_XML_H_
|
||||||
|
|
||||||
#include <QDomElement>
|
|
||||||
#include "Import.h"
|
#include "Import.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,14 +18,9 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QFile>
|
|
||||||
#include <iostream>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QtXml>
|
|
||||||
#include "crypto/blowfish.h"
|
|
||||||
#include "crypto/sha1.h"
|
|
||||||
#include "Import_PwManager.h"
|
#include "Import_PwManager.h"
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
bool Import_PwManager::importDatabase(QWidget* GuiParent, IDatabase* db){
|
bool Import_PwManager::importDatabase(QWidget* GuiParent, IDatabase* db){
|
||||||
database=db;
|
database=db;
|
||||||
|
@ -115,7 +110,7 @@ bool Import_PwManager::importDatabase(QWidget* GuiParent, IDatabase* db){
|
||||||
if(!parseXmlContent((char*)xml)){
|
if(!parseXmlContent((char*)xml)){
|
||||||
delete [] xml;
|
delete [] xml;
|
||||||
QMessageBox::critical(GuiParent,tr("Import Failed"),tr("Invalid XML data (see stdout for details).")); return false;}
|
QMessageBox::critical(GuiParent,tr("Import Failed"),tr("Invalid XML data (see stdout for details).")); return false;}
|
||||||
dynamic_cast<IFilePasswordAuth*>(database)->authByPwd(password);
|
database->setKey(password,QString());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,7 @@
|
||||||
|
|
||||||
#ifndef _IMPORT_PWMANAGER_
|
#ifndef _IMPORT_PWMANAGER_
|
||||||
#define _IMPORT_PWMANAGER_
|
#define _IMPORT_PWMANAGER_
|
||||||
#include <QDomElement>
|
|
||||||
#include <QString>
|
|
||||||
#include "Database.h"
|
|
||||||
#include "Import.h"
|
#include "Import.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,6 @@
|
||||||
#ifndef _AUTOTYPE_H_
|
#ifndef _AUTOTYPE_H_
|
||||||
#define _AUTOTYPE_H_
|
#define _AUTOTYPE_H_
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
#include "Database.h"
|
|
||||||
|
|
||||||
#ifdef GLOBAL_AUTOTYPE
|
#ifdef GLOBAL_AUTOTYPE
|
||||||
struct Shortcut{
|
struct Shortcut{
|
||||||
bool ctrl, shift, alt, altgr, win;
|
bool ctrl, shift, alt, altgr, win;
|
||||||
|
|
|
@ -18,18 +18,14 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QtCore>
|
|
||||||
#include "KpxConfig.h"
|
|
||||||
#include "AutoType.h"
|
|
||||||
#include "mainwindow.h"
|
|
||||||
#include <QList>
|
|
||||||
#include <QChar>
|
|
||||||
#include <QX11Info>
|
#include <QX11Info>
|
||||||
#include "HelperX11.h"
|
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include "HelperX11.h"
|
||||||
|
#include "AutoType.h"
|
||||||
|
|
||||||
#ifdef GLOBAL_AUTOTYPE
|
#ifdef GLOBAL_AUTOTYPE
|
||||||
#include "dialogs/AutoTypeDlg.h"
|
#include "dialogs/AutoTypeDlg.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum AutoTypeActionType{
|
enum AutoTypeActionType{
|
||||||
|
|
|
@ -18,24 +18,12 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#include <QDragEnterEvent>
|
|
||||||
#include <QDragMoveEvent>
|
|
||||||
#include <QDragLeaveEvent>
|
|
||||||
#include <QDropEvent>
|
|
||||||
#include <QMouseEvent>
|
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QTime>
|
#include <QClipboard>
|
||||||
#include <QApplication>
|
#include <QFileDialog>
|
||||||
#include <QPainter>
|
|
||||||
#include <QPair>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include "main.h"
|
|
||||||
#include "KpxConfig.h"
|
|
||||||
#include "EntryView.h"
|
|
||||||
#include "dialogs/EditEntryDlg.h"
|
|
||||||
#include "lib/AutoType.h"
|
#include "lib/AutoType.h"
|
||||||
#include "Database.h"
|
#include "lib/EntryView.h"
|
||||||
|
#include "dialogs/EditEntryDlg.h"
|
||||||
|
|
||||||
// just for the lessThan funtion
|
// just for the lessThan funtion
|
||||||
QList<EntryViewItem*>* pItems;
|
QList<EntryViewItem*>* pItems;
|
||||||
|
|
|
@ -21,15 +21,7 @@
|
||||||
#ifndef _ENTRY_VIEW_H_
|
#ifndef _ENTRY_VIEW_H_
|
||||||
#define _ENTRY_VIEW_H_
|
#define _ENTRY_VIEW_H_
|
||||||
|
|
||||||
#include <QMenu>
|
#include "Kdb3Database.h"
|
||||||
#include <QTreeWidget>
|
|
||||||
#include <QContextMenuEvent>
|
|
||||||
#include <QHeaderView>
|
|
||||||
#include <QTimer>
|
|
||||||
#include <QClipboard>
|
|
||||||
#include <QBitArray>
|
|
||||||
#include <QList>
|
|
||||||
#include "../Kdb3Database.h"
|
|
||||||
|
|
||||||
#define NUM_COLUMNS 11
|
#define NUM_COLUMNS 11
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QDir>
|
#include <QFileDialog>
|
||||||
#include "main.h"
|
|
||||||
#include "KpxConfig.h"
|
|
||||||
#include "FileDialogs.h"
|
|
||||||
|
|
||||||
|
|
||||||
IFileDialog* KpxFileDialogs::iFileDialog=NULL;
|
IFileDialog* KpxFileDialogs::iFileDialog=NULL;
|
||||||
QtStandardFileDialogs DefaultQtDlgs;
|
QtStandardFileDialogs DefaultQtDlgs;
|
||||||
|
|
|
@ -20,10 +20,6 @@
|
||||||
#ifndef _FILE_DIALOGS_H_
|
#ifndef _FILE_DIALOGS_H_
|
||||||
#define _FILE_DIALOGS_H_
|
#define _FILE_DIALOGS_H_
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QFileDialog>
|
|
||||||
#include <QList>
|
|
||||||
#include <QHash>
|
|
||||||
#include "plugins/interfaces/IFileDialog.h"
|
#include "plugins/interfaces/IFileDialog.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,24 +17,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QDragEnterEvent>
|
|
||||||
#include <QDragMoveEvent>
|
|
||||||
#include <QDragLeaveEvent>
|
|
||||||
#include <QDropEvent>
|
|
||||||
#include <QPaintEvent>
|
|
||||||
#include <QMouseEvent>
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QFont>
|
|
||||||
#include <QFontMetrics>
|
|
||||||
#include <QSize>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QPen>
|
|
||||||
#include <QBrush>
|
|
||||||
#include <QMenu>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include "KpxConfig.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "EntryView.h"
|
#include "EntryView.h"
|
||||||
#include "GroupView.h"
|
#include "GroupView.h"
|
||||||
#include "dialogs/EditGroupDlg.h"
|
#include "dialogs/EditGroupDlg.h"
|
||||||
|
|
|
@ -20,10 +20,7 @@
|
||||||
#ifndef _GROUP_VIEW_H_
|
#ifndef _GROUP_VIEW_H_
|
||||||
#define _GROUP_VIEW_H_
|
#define _GROUP_VIEW_H_
|
||||||
|
|
||||||
#include <QTreeWidget>
|
#include "Kdb3Database.h"
|
||||||
#include <QLine>
|
|
||||||
#include <QContextMenuEvent>
|
|
||||||
#include "../Kdb3Database.h"
|
|
||||||
|
|
||||||
class GroupViewItem;
|
class GroupViewItem;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "HelperX11.h"
|
#include "HelperX11.h"
|
||||||
|
|
||||||
#include <QX11Info>
|
#include <QX11Info>
|
||||||
|
|
||||||
int HelperX11::getModifiers(Display *d,KeySym keysym, int keycode){
|
int HelperX11::getModifiers(Display *d,KeySym keysym, int keycode){
|
||||||
|
|
|
@ -18,10 +18,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "SecString.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include "crypto/arcfour.h"
|
|
||||||
#include "crypto/yarrow.h"
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
CArcFour SecString::RC4;
|
CArcFour SecString::RC4;
|
||||||
|
|
|
@ -20,11 +20,6 @@
|
||||||
#ifndef _SECSTRING_H_
|
#ifndef _SECSTRING_H_
|
||||||
#define _SECSTRING_H_
|
#define _SECSTRING_H_
|
||||||
|
|
||||||
#include <QByteArray>
|
|
||||||
#include <QString>
|
|
||||||
#include <QGlobalStatic>
|
|
||||||
#include "crypto/arcfour.h"
|
|
||||||
|
|
||||||
//! QString based class with in-memory encryption of its content.
|
//! QString based class with in-memory encryption of its content.
|
||||||
/*!
|
/*!
|
||||||
This class can hold a QString object in an encrypted buffer. To get access to the string it is neccassary to unlock the SecString object.
|
This class can hold a QString object in an encrypted buffer. To get access to the string it is neccassary to unlock the SecString object.
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#ifndef SHORTCUT_WIDGET_H
|
#ifndef SHORTCUT_WIDGET_H
|
||||||
#define SHORTCUT_WIDGET_H
|
#define SHORTCUT_WIDGET_H
|
||||||
|
|
||||||
#include <QLineEdit>
|
|
||||||
|
|
||||||
#if defined(GLOBAL_AUTOTYPE) && defined(Q_WS_X11)
|
#if defined(GLOBAL_AUTOTYPE) && defined(Q_WS_X11)
|
||||||
#include "lib/AutoType.h"
|
#include "lib/AutoType.h"
|
||||||
|
|
|
@ -20,15 +20,6 @@
|
||||||
|
|
||||||
|
|
||||||
#include "UrlLabel.h"
|
#include "UrlLabel.h"
|
||||||
#include "main.h"
|
|
||||||
#include "lib/tools.h"
|
|
||||||
#include <QFont>
|
|
||||||
#include <QColor>
|
|
||||||
#include <QCursor>
|
|
||||||
#include <QFontMetrics>
|
|
||||||
#include <QMouseEvent>
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QPalette>
|
|
||||||
|
|
||||||
LinkLabel::LinkLabel(QWidget *parent,const QString& text, int x, int y,Qt::WFlags f) : QLabel(parent,f){
|
LinkLabel::LinkLabel(QWidget *parent,const QString& text, int x, int y,Qt::WFlags f) : QLabel(parent,f){
|
||||||
QFont font(parentWidget()->font()); font.setUnderline(true);
|
QFont font(parentWidget()->font()); font.setUnderline(true);
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
|
|
||||||
#ifndef _LINKLABEL_H_
|
#ifndef _LINKLABEL_H_
|
||||||
#define _LINKLABEL_H_
|
#define _LINKLABEL_H_
|
||||||
#include <QLabel>
|
|
||||||
#include <QMouseEvent>
|
|
||||||
|
|
||||||
class LinkLabel : public QLabel{
|
class LinkLabel : public QLabel{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
@ -18,10 +18,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QRectF>
|
|
||||||
#include "main.h"
|
|
||||||
#include "WaitAnimationWidget.h"
|
#include "WaitAnimationWidget.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,6 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QPaintEvent>
|
|
||||||
#include <QResizeEvent>
|
|
||||||
#include <QTimer>
|
|
||||||
#include <QPointF>
|
|
||||||
|
|
||||||
class WaitAnimationWidget:public QWidget{
|
class WaitAnimationWidget:public QWidget{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
@ -17,9 +17,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "bookmarks.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "KpxConfig.h"
|
|
||||||
|
|
||||||
QList<KpxBookmarks::BookmarkEntry> KpxBookmarks::Bookmarks;
|
QList<KpxBookmarks::BookmarkEntry> KpxBookmarks::Bookmarks;
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,6 @@
|
||||||
#ifndef _BOOKMARKS_H_
|
#ifndef _BOOKMARKS_H_
|
||||||
#define _BOOKMARKS_H_
|
#define _BOOKMARKS_H_
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
#include <QList>
|
|
||||||
|
|
||||||
class KpxBookmarks {
|
class KpxBookmarks {
|
||||||
public:
|
public:
|
||||||
static void load();
|
static void load();
|
||||||
|
|
|
@ -17,4 +17,10 @@
|
||||||
* Free Software Foundation, Inc., *
|
* Free Software Foundation, Inc., *
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
#ifndef RANDOM_H_
|
||||||
|
#define RANDOM_H_
|
||||||
|
|
||||||
extern void getRandomBytes(void* buffer,int NumBlocks,int BlockSize=1,bool Strong=false);
|
extern void getRandomBytes(void* buffer,int NumBlocks,int BlockSize=1,bool Strong=false);
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
|
@ -16,12 +16,9 @@
|
||||||
* Free Software Foundation, Inc., *
|
* Free Software Foundation, Inc., *
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include <QtCore>
|
|
||||||
#include <QtGui>
|
|
||||||
#include "KpxConfig.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "lib/tools.h"
|
|
||||||
|
|
||||||
|
#include <QProcess>
|
||||||
|
#include <QDesktopServices>
|
||||||
|
|
||||||
void createBanner(QPixmap* Pixmap,const QPixmap* IconAlpha,const QString& Text,int Width){
|
void createBanner(QPixmap* Pixmap,const QPixmap* IconAlpha,const QString& Text,int Width){
|
||||||
createBanner(Pixmap,IconAlpha,Text,Width,config->bannerColor1(),config->bannerColor2(),config->bannerTextColor());
|
createBanner(Pixmap,IconAlpha,Text,Width,config->bannerColor1(),config->bannerColor2(),config->bannerTextColor());
|
||||||
|
@ -177,3 +174,37 @@ const QPixmap* getPixmap(const QString& name){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool createKeyFile(const QString& filename,QString* error,int length, bool Hex){
|
||||||
|
QFile file(filename);
|
||||||
|
if(!file.open(QIODevice::WriteOnly|QIODevice::Truncate|QIODevice::Unbuffered)){
|
||||||
|
*error=decodeFileError(file.error());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(Hex)length*=2;
|
||||||
|
unsigned char* key=new unsigned char[length];
|
||||||
|
randomize(key,length);
|
||||||
|
if(Hex){
|
||||||
|
// convert binary data to hex code (8 bit ==> 2 digits)
|
||||||
|
for(int i=0; i<length; i+=2){
|
||||||
|
unsigned char dig1,dig2;
|
||||||
|
dig1=key[i]/16;
|
||||||
|
key[i]-=(16*dig1);
|
||||||
|
dig2=key[i];
|
||||||
|
if(dig1>9)key[i]='A'+dig1-10;
|
||||||
|
else key[i]='0'+dig1;
|
||||||
|
if(dig2>9)key[i+1]='A'+dig2-10;
|
||||||
|
else key[i+1]='0'+dig2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(file.write((char*)key,length)==-1){
|
||||||
|
delete [] key;
|
||||||
|
*error=decodeFileError(file.error());
|
||||||
|
file.close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
file.close();
|
||||||
|
delete [] key;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,6 @@
|
||||||
#ifndef TOOLS_H
|
#ifndef TOOLS_H
|
||||||
#define TOOLS_H
|
#define TOOLS_H
|
||||||
|
|
||||||
#include <QFile>
|
|
||||||
#include <QString>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QIcon>
|
|
||||||
|
|
||||||
#define CSTR(x)(x.toLocal8Bit().constData())
|
#define CSTR(x)(x.toLocal8Bit().constData())
|
||||||
class IEntryHandle;
|
class IEntryHandle;
|
||||||
typedef enum tKeyType {PASSWORD=0,KEYFILE=1,BOTH=2};
|
typedef enum tKeyType {PASSWORD=0,KEYFILE=1,BOTH=2};
|
||||||
|
@ -37,5 +32,6 @@ void showErrMsg(const QString& msg,QWidget* parent=NULL);
|
||||||
QString decodeFileError(QFile::FileError Code);
|
QString decodeFileError(QFile::FileError Code);
|
||||||
QString makePathRelative(const QString& Abs,const QString& Cur);
|
QString makePathRelative(const QString& Abs,const QString& Cur);
|
||||||
QString getImageFile(const QString& name);
|
QString getImageFile(const QString& name);
|
||||||
|
bool createKeyFile(const QString& filename,QString* err, int length=32, bool Hex=true);
|
||||||
|
|
||||||
#endif //TOOLS_H
|
#endif //TOOLS_H
|
||||||
|
|
34
src/main.cpp
34
src/main.cpp
|
@ -19,10 +19,6 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QtCore>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#include "plugins/interfaces/IFileDialog.h"
|
#include "plugins/interfaces/IFileDialog.h"
|
||||||
#include "plugins/interfaces/IKdeInit.h"
|
#include "plugins/interfaces/IKdeInit.h"
|
||||||
|
@ -31,12 +27,10 @@
|
||||||
#include "lib/FileDialogs.h"
|
#include "lib/FileDialogs.h"
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include <QTranslator>
|
||||||
#include "lib/FileDialogs.h"
|
#include <QLibraryInfo>
|
||||||
#include "lib/bookmarks.h"
|
|
||||||
#include "KpxConfig.h"
|
|
||||||
#include "Kdb3Database.h"
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "main.h"
|
||||||
#include "crypto/yarrow.h"
|
#include "crypto/yarrow.h"
|
||||||
#if defined(Q_WS_X11) && defined(GLOBAL_AUTOTYPE)
|
#if defined(Q_WS_X11) && defined(GLOBAL_AUTOTYPE)
|
||||||
#include "Application_X11.h"
|
#include "Application_X11.h"
|
||||||
|
@ -55,10 +49,6 @@ QString DetailViewTemplate;
|
||||||
QPixmap* EntryIcons;
|
QPixmap* EntryIcons;
|
||||||
//IIconTheme* IconLoader=NULL; //TODO plugins
|
//IIconTheme* IconLoader=NULL; //TODO plugins
|
||||||
|
|
||||||
inline void loadImages();
|
|
||||||
inline void parseCmdLineArgs(int argc, char** argv,QString &ArgFile,QString& ArgCfg,QString& ArgLang,bool& ArgMin,bool& ArgLock);
|
|
||||||
bool loadTranslation(QTranslator* tr,const QString& prefix,const QString& LocaleCode,const QStringList& SearchPaths);
|
|
||||||
void initAppPaths();
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
@ -68,7 +58,7 @@ int main(int argc, char **argv)
|
||||||
#else
|
#else
|
||||||
app = new QApplication(argc,argv);
|
app = new QApplication(argc,argv);
|
||||||
#endif
|
#endif
|
||||||
initAppPaths();
|
initAppPaths(argc,argv);
|
||||||
CmdLineArgs args;
|
CmdLineArgs args;
|
||||||
args.parse(QApplication::arguments());
|
args.parse(QApplication::arguments());
|
||||||
qDebug(CSTR(AppDir));
|
qDebug(CSTR(AppDir));
|
||||||
|
@ -243,7 +233,8 @@ bool CmdLineArgs::parse(const QStringList& argv){
|
||||||
Error=QString("Expected a path as argument for '-cfg' but got '%1.'").arg(argv[i+1]);
|
Error=QString("Expected a path as argument for '-cfg' but got '%1.'").arg(argv[i+1]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ConfigLocation=argv[i+1];
|
QFileInfo file(argv[i+1]);
|
||||||
|
ConfigLocation=file.absolutePath();
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -268,6 +259,10 @@ bool CmdLineArgs::parse(const QStringList& argv){
|
||||||
StartLocked=true;
|
StartLocked=true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if(i==1){
|
||||||
|
File=argv[1];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Error=QString("** Unrecognized argument: '%1'").arg(argv[i]);
|
Error=QString("** Unrecognized argument: '%1'").arg(argv[i]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -288,6 +283,10 @@ void CmdLineArgs::printHelp(){
|
||||||
cout << " pt_BR Portuguese(Brazil)"<<endl;
|
cout << " pt_BR Portuguese(Brazil)"<<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//TODO Plugins
|
//TODO Plugins
|
||||||
/*
|
/*
|
||||||
QString findPlugin(const QString& filename){
|
QString findPlugin(const QString& filename){
|
||||||
|
@ -300,3 +299,8 @@ QString findPlugin(const QString& filename){
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
32
src/main.h
32
src/main.h
|
@ -20,36 +20,10 @@
|
||||||
#ifndef _MAIN_H_
|
#ifndef _MAIN_H_
|
||||||
#define _MAIN_H_
|
#define _MAIN_H_
|
||||||
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QString>
|
|
||||||
#include <QColor>
|
|
||||||
#include <QIcon>
|
|
||||||
#include <QFile>
|
|
||||||
|
|
||||||
#define APP_DISPLAY_NAME "KeePassX"
|
|
||||||
#define APP_CODE_NAME "keepassx"
|
|
||||||
|
|
||||||
#define APP_SHORT_FUNC "Password Manager"
|
|
||||||
#define APP_LONG_FUNC "Cross Platform Password Manager"
|
|
||||||
|
|
||||||
#define APP_VERSION "0.3.0a"
|
|
||||||
|
|
||||||
#define BUILTIN_ICONS 65
|
|
||||||
|
|
||||||
|
|
||||||
//QString findPlugin(const QString& filename); //TODO Plugins
|
//QString findPlugin(const QString& filename); //TODO Plugins
|
||||||
|
void loadImages();
|
||||||
class KpxConfig;
|
bool loadTranslation(QTranslator* tr,const QString& prefix,const QString& LocaleCode,const QStringList& SearchPaths);
|
||||||
extern QString PluginLoadError;
|
void initAppPaths(int argc, char **argv);
|
||||||
extern KpxConfig *config;
|
|
||||||
extern QString AppDir;
|
|
||||||
extern QString HomeDir;
|
|
||||||
extern QString DataDir;
|
|
||||||
extern bool TrActive;
|
|
||||||
extern QString DetailViewTemplate;
|
|
||||||
extern QPixmap *EntryIcons;
|
|
||||||
|
|
||||||
|
|
||||||
class CmdLineArgs {
|
class CmdLineArgs {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -19,12 +19,10 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QVarLengthArray>
|
|
||||||
#include <QDir>
|
|
||||||
#include <Carbon/Carbon.h>
|
#include <Carbon/Carbon.h>
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
void initAppPaths() {
|
void initAppPaths(int argc,char** argv) {
|
||||||
CFURLRef bundleURL(CFBundleCopyExecutableURL(CFBundleGetMainBundle()));
|
CFURLRef bundleURL(CFBundleCopyExecutableURL(CFBundleGetMainBundle()));
|
||||||
//assert(bundleURL);
|
//assert(bundleURL);
|
||||||
CFStringRef cfPath(CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle));
|
CFStringRef cfPath(CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle));
|
||||||
|
|
|
@ -19,14 +19,56 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QByteArray>
|
|
||||||
#include <QDir>
|
|
||||||
#include <QFileInfo>
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
void initAppPaths() {
|
void initAppPaths(int argc,char** argv) {
|
||||||
AppDir = QApplication::applicationDirPath();
|
// Try looking for a /proc/<pid>/exe symlink first which points to
|
||||||
DataDir = QDir(AppDir+"/../share/keepassx").canonicalPath();
|
// the absolute path of the executable
|
||||||
|
QFileInfo pfi(QString::fromLatin1("/proc/%1/exe").arg(getpid()));
|
||||||
|
if (pfi.exists() && pfi.isSymLink()) {
|
||||||
|
AppDir = pfi.canonicalFilePath();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
QString argv0 = QFile::decodeName(QByteArray(argv[0]));
|
||||||
|
QString absPath;
|
||||||
|
|
||||||
|
if (!argv0.isEmpty() && argv0.at(0) == QLatin1Char('/')) {
|
||||||
|
/*
|
||||||
|
If argv0 starts with a slash, it is already an absolute
|
||||||
|
file path.
|
||||||
|
*/
|
||||||
|
absPath = argv0;
|
||||||
|
} else if (argv0.contains(QLatin1Char('/'))) {
|
||||||
|
/*
|
||||||
|
If argv0 contains one or more slashes, it is a file path
|
||||||
|
relative to the current directory.
|
||||||
|
*/
|
||||||
|
absPath = QDir::current().absoluteFilePath(argv0);
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
Otherwise, the file path has to be determined using the
|
||||||
|
PATH environment variable.
|
||||||
|
*/
|
||||||
|
QByteArray pEnv = qgetenv("PATH");
|
||||||
|
QDir currentDir = QDir::current();
|
||||||
|
QStringList paths = QString::fromLocal8Bit(pEnv.constData()).split(QLatin1String(":"));
|
||||||
|
for (QStringList::const_iterator p = paths.constBegin(); p != paths.constEnd(); ++p) {
|
||||||
|
if ((*p).isEmpty())
|
||||||
|
continue;
|
||||||
|
QString candidate = currentDir.absoluteFilePath(*p + QLatin1Char('/') + argv0);
|
||||||
|
QFileInfo candidate_fi(candidate);
|
||||||
|
if (candidate_fi.exists() && !candidate_fi.isDir()) {
|
||||||
|
absPath = candidate;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
absPath = QDir::cleanPath(absPath);
|
||||||
|
QFileInfo fi(absPath);
|
||||||
|
AppDir = fi.exists() ? fi.canonicalFilePath() : QString();
|
||||||
|
}
|
||||||
|
AppDir.truncate(AppDir.lastIndexOf("/"));
|
||||||
|
DataDir=AppDir+"/../share/keepassx";
|
||||||
HomeDir = QDir::homePath()+"/.keepassx";
|
HomeDir = QDir::homePath()+"/.keepassx";
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QDir>
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
|
|
|
@ -17,53 +17,18 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "mainwindow.h"
|
|
||||||
|
|
||||||
#include <QToolButton>
|
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
#include <QMenuBar>
|
|
||||||
#include <QAction>
|
|
||||||
#include <QImage>
|
|
||||||
#include <QClipboard>
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QColor>
|
|
||||||
#include <QLocale>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QDropEvent>
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QShowEvent>
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QFileDialog>
|
|
||||||
#include <QStatusBar>
|
#include <QStatusBar>
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
//#include "KpxFirefox.h"
|
|
||||||
#include "lib/random.h"
|
|
||||||
#include "lib/AutoType.h"
|
#include "lib/AutoType.h"
|
||||||
#include "lib/FileDialogs.h"
|
#include "lib/FileDialogs.h"
|
||||||
#include "lib/bookmarks.h"
|
|
||||||
#include "import/Import_PwManager.h"
|
#include "import/Import_PwManager.h"
|
||||||
#include "import/Import_KWalletXml.h"
|
#include "import/Import_KWalletXml.h"
|
||||||
#include "import/Import_KeePassX_Xml.h"
|
#include "import/Import_KeePassX_Xml.h"
|
||||||
#include "export/Export_Txt.h"
|
#include "export/Export_Txt.h"
|
||||||
#include "export/Export_KeePassX_Xml.h"
|
#include "export/Export_KeePassX_Xml.h"
|
||||||
|
|
||||||
#include "dialogs/AboutDlg.h"
|
#include "dialogs/dialogs.h"
|
||||||
#include "dialogs/SearchDlg.h"
|
|
||||||
#include "dialogs/SettingsDlg.h"
|
|
||||||
#include "dialogs/DatabaseSettingsDlg.h"
|
|
||||||
#include "dialogs/PasswordDlg.h"
|
|
||||||
#include "dialogs/SimplePasswordDlg.h"
|
|
||||||
#include "dialogs/PasswordGenDlg.h"
|
|
||||||
#include "dialogs/CollectEntropyDlg.h"
|
|
||||||
#include "dialogs/CustomizeDetailViewDlg.h"
|
|
||||||
#include "dialogs/ExpiredEntriesDlg.h"
|
|
||||||
//#include "dialogs/TrashCanDlg.h" //TODO TrashCan
|
|
||||||
#include "dialogs/AddBookmarkDlg.h"
|
|
||||||
#include "dialogs/ManageBookmarksDlg.h"
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
Import_KeePassX_Xml import_KeePassX_Xml;
|
Import_KeePassX_Xml import_KeePassX_Xml;
|
||||||
Import_PwManager import_PwManager;
|
Import_PwManager import_PwManager;
|
||||||
|
@ -408,25 +373,29 @@ bool KeepassMainWindow::openDatabase(QString filename,bool IsAuto){
|
||||||
config->setLastKeyType(PASSWORD);
|
config->setLastKeyType(PASSWORD);
|
||||||
}
|
}
|
||||||
db=dynamic_cast<IDatabase*>(new Kdb3Database());
|
db=dynamic_cast<IDatabase*>(new Kdb3Database());
|
||||||
CPasswordDialog PasswordDlg(this,filename,db,(IsAuto&&!InUnLock),false);
|
PasswordDialog::DlgFlags flags=PasswordDialog::Flag_None;
|
||||||
|
if(IsAuto)
|
||||||
|
flags = PasswordDialog::Flag_Auto;
|
||||||
|
PasswordDialog dlg(this,PasswordDialog::Mode_Ask,flags,filename);
|
||||||
if (InUnLock){
|
if (InUnLock){
|
||||||
PasswordDlg.setWindowModality(Qt::WindowModal);
|
dlg.setWindowModality(Qt::WindowModal);
|
||||||
unlockDlg = &PasswordDlg;
|
unlockDlg = &dlg;
|
||||||
}
|
}
|
||||||
bool rejected = (PasswordDlg.exec()==QDialog::Rejected);
|
bool rejected = (dlg.exec()==PasswordDialog::Exit_Cancel);
|
||||||
if (InUnLock)
|
if (InUnLock)
|
||||||
unlockDlg = NULL;
|
unlockDlg = NULL;
|
||||||
if (rejected)
|
if (rejected)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(PasswordDlg.BookmarkFilename!=QString())
|
if(dlg.selectedBookmark()!=QString())
|
||||||
filename=PasswordDlg.BookmarkFilename;
|
filename=dlg.selectedBookmark();
|
||||||
|
|
||||||
GroupView->db=db;
|
GroupView->db=db;
|
||||||
EntryView->db=db;
|
EntryView->db=db;
|
||||||
setupDatabaseConnections(db);
|
setupDatabaseConnections(db);
|
||||||
QString err;
|
QString err;
|
||||||
StatusBarGeneral->setText(tr("Loading Database..."));
|
StatusBarGeneral->setText(tr("Loading Database..."));
|
||||||
|
db->setKey(dlg.password(),dlg.keyFile());
|
||||||
if(db->load(filename)==true){
|
if(db->load(filename)==true){
|
||||||
if (IsLocked)
|
if (IsLocked)
|
||||||
resetLock();
|
resetLock();
|
||||||
|
@ -442,10 +411,10 @@ bool KeepassMainWindow::openDatabase(QString filename,bool IsAuto){
|
||||||
StatusBarGeneral->setText(tr("Loading Failed"));
|
StatusBarGeneral->setText(tr("Loading Failed"));
|
||||||
QString error=db->getError();
|
QString error=db->getError();
|
||||||
if(error.isEmpty())error=tr("Unknown error while loading database.");
|
if(error.isEmpty())error=tr("Unknown error while loading database.");
|
||||||
QMessageBox::critical(this,tr("Error")
|
QMessageBox::critical(this,tr("Error"),
|
||||||
,QString("%1\n%2").arg(tr("The following error occured while opening the database:"))
|
QString("%1\n%2").arg(tr("The following error occured while opening the database:"))
|
||||||
.arg(error));
|
.arg(error));
|
||||||
if(dynamic_cast<IFilePasswordAuth*>(db)->isKeyError()){
|
if(db->isKeyError()){
|
||||||
delete db;
|
delete db;
|
||||||
return openDatabase(filename,IsAuto);
|
return openDatabase(filename,IsAuto);
|
||||||
}
|
}
|
||||||
|
@ -510,14 +479,14 @@ bool KeepassMainWindow::closeDatabase(bool lock){
|
||||||
void KeepassMainWindow::OnFileNewKdb(){
|
void KeepassMainWindow::OnFileNewKdb(){
|
||||||
IDatabase* db_new=dynamic_cast<IDatabase*>(new Kdb3Database());
|
IDatabase* db_new=dynamic_cast<IDatabase*>(new Kdb3Database());
|
||||||
db_new->create();
|
db_new->create();
|
||||||
CPasswordDialog dlg(this,QString(),db_new,false,true);
|
PasswordDialog dlg(this,PasswordDialog::Mode_Set,PasswordDialog::Flag_None,"New Database");
|
||||||
dlg.setWindowTitle(tr("New Database"));
|
if(dlg.exec()==PasswordDialog::Exit_Ok){
|
||||||
if(dlg.exec()==1){
|
|
||||||
if(FileOpen)
|
if(FileOpen)
|
||||||
if(!closeDatabase())return;
|
if(!closeDatabase())return;
|
||||||
if (IsLocked)
|
if (IsLocked)
|
||||||
resetLock();
|
resetLock();
|
||||||
db=dynamic_cast<IDatabase*>(db_new);
|
db=db_new;
|
||||||
|
db->setKey(dlg.password(),dlg.keyFile());
|
||||||
setWindowTitle(QString("[%1][*] - KeePassX").arg(tr("new")));
|
setWindowTitle(QString("[%1][*] - KeePassX").arg(tr("new")));
|
||||||
GroupView->db=db;
|
GroupView->db=db;
|
||||||
EntryView->db=db;
|
EntryView->db=db;
|
||||||
|
@ -533,7 +502,6 @@ void KeepassMainWindow::OnFileNewKdb(){
|
||||||
else{
|
else{
|
||||||
delete db_new;
|
delete db_new;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Kxdb
|
// TODO Kxdb
|
||||||
|
@ -854,9 +822,13 @@ void KeepassMainWindow::OnFileSettings(){
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeepassMainWindow::OnFileChangeKey(){
|
void KeepassMainWindow::OnFileChangeKey(){
|
||||||
CPasswordDialog dlg(this,QString(),db,false,true);
|
QFile* file=db->file();
|
||||||
if(dlg.exec())
|
QString filename = file ? file->fileName() : QString();
|
||||||
|
PasswordDialog dlg(this,PasswordDialog::Mode_Change,PasswordDialog::Flag_None,filename);
|
||||||
|
if(dlg.exec()==PasswordDialog::Exit_Ok){
|
||||||
setStateFileModified(true);
|
setStateFileModified(true);
|
||||||
|
db->setKey(dlg.password(),dlg.keyFile());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeepassMainWindow::OnFileExit(){
|
void KeepassMainWindow::OnFileExit(){
|
||||||
|
@ -875,25 +847,24 @@ void KeepassMainWindow::OnImport(QAction* action){
|
||||||
IDatabase* tmpdb=dynamic_cast<IDatabase*>(new Kdb3Database());
|
IDatabase* tmpdb=dynamic_cast<IDatabase*>(new Kdb3Database());
|
||||||
tmpdb->create();
|
tmpdb->create();
|
||||||
if(dynamic_cast<IImport*>(action->data().value<QObject*>())->importDatabase(this,tmpdb)){
|
if(dynamic_cast<IImport*>(action->data().value<QObject*>())->importDatabase(this,tmpdb)){
|
||||||
CPasswordDialog dlg(this,QString(),tmpdb,false,true);
|
PasswordDialog dlg(this,PasswordDialog::Mode_Set,PasswordDialog::Flag_None,QString());
|
||||||
dlg.setWindowTitle(tr("Set Master Key"));
|
if(dlg.exec()!=PasswordDialog::Exit_Ok){
|
||||||
if(!dlg.exec()){
|
delete tmpdb;
|
||||||
delete tmpdb;
|
return;
|
||||||
return;
|
}
|
||||||
}
|
db=tmpdb;
|
||||||
db=tmpdb;
|
db->setKey(dlg.password(),dlg.keyFile());
|
||||||
GroupView->db=db;
|
GroupView->db=db;
|
||||||
EntryView->db=db;
|
EntryView->db=db;
|
||||||
setupDatabaseConnections(db);
|
setupDatabaseConnections(db);
|
||||||
setWindowTitle(QString("[%1][*] - KeePassX").arg(tr("new")));
|
setWindowTitle(QString("[%1][*] - KeePassX").arg(tr("new")));
|
||||||
GroupView->createItems();
|
GroupView->createItems();
|
||||||
EntryView->showGroup(NULL);
|
EntryView->showGroup(NULL);
|
||||||
setStateFileOpen(true);
|
setStateFileOpen(true);
|
||||||
setStateFileModified(true);
|
setStateFileModified(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
delete tmpdb;
|
delete tmpdb;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -21,27 +21,7 @@
|
||||||
#ifndef MAINWINDOW_H
|
#ifndef MAINWINDOW_H
|
||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
#include <QImage>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QFont>
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QTime>
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QShowEvent>
|
|
||||||
#include <QTranslator>
|
|
||||||
#include <QDropEvent>
|
|
||||||
#include <QListWidget>
|
|
||||||
#include <QTreeWidget>
|
|
||||||
#include <QClipboard>
|
|
||||||
#include <QTimer>
|
|
||||||
#include <QToolButton>
|
|
||||||
#include <QSystemTrayIcon>
|
#include <QSystemTrayIcon>
|
||||||
//#include <QAssistantClient> //TODO HelpBrowser
|
|
||||||
#include <QUrl>
|
|
||||||
|
|
||||||
#include "Kdb3Database.h"
|
|
||||||
#include "KpxConfig.h"
|
|
||||||
#include "lib/EntryView.h"
|
#include "lib/EntryView.h"
|
||||||
#include "lib/GroupView.h"
|
#include "lib/GroupView.h"
|
||||||
#include "export/Export.h"
|
#include "export/Export.h"
|
||||||
|
|
122
src/src.pro
122
src/src.pro
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
CONFIG = qt uic resources thread stl warn_off
|
CONFIG = qt uic resources thread stl warn_off precompile_header
|
||||||
QT += xml
|
QT += xml
|
||||||
|
|
||||||
DEPENDPATH += crypto dialogs export forms import lib translations res
|
DEPENDPATH += crypto dialogs export forms import lib translations res
|
||||||
|
@ -10,102 +10,102 @@ UI_DIR = ../build/ui
|
||||||
OBJECTS_DIR = ../build
|
OBJECTS_DIR = ../build
|
||||||
RCC_DIR = ../build/rcc
|
RCC_DIR = ../build/rcc
|
||||||
|
|
||||||
isEqual(DEBUG,1) {
|
isEqual(DEBUG,1){
|
||||||
CONFIG += debug
|
CONFIG += debug
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CONFIG += release
|
CONFIG += release
|
||||||
}
|
}
|
||||||
|
|
||||||
win32:QMAKE_WIN32 = 1
|
win32 : QMAKE_WIN32 = 1
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Platform Specific: Unix (except MacOS X)
|
# Platform Specific: Unix (except MacOS X)
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
unix : !macx : !isEqual(QMAKE_WIN32,1) {
|
unix : !macx : !isEqual(QMAKE_WIN32,1){
|
||||||
isEmpty(PREFIX):PREFIX = /usr
|
isEmpty(PREFIX): PREFIX = /usr
|
||||||
!isEqual(AUTOTYPE,0) {
|
!isEqual(AUTOTYPE,0){
|
||||||
DEFINES += AUTOTYPE
|
DEFINES += AUTOTYPE
|
||||||
!isEqual(GLOBAL_AUTOTYPE,0) {
|
!isEqual(GLOBAL_AUTOTYPE,0){
|
||||||
DEFINES += GLOBAL_AUTOTYPE
|
DEFINES += GLOBAL_AUTOTYPE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TARGET = ../bin/keepassx
|
||||||
|
target.path = $${PREFIX}/bin
|
||||||
|
data.files += ../share/keepassx
|
||||||
|
data.path = $${PREFIX}/share
|
||||||
|
pixmaps.files = ../share/pixmaps/*
|
||||||
|
pixmaps.path = $${PREFIX}/share/pixmaps
|
||||||
|
desktop.files = ../share/applications/*
|
||||||
|
desktop.path = $${PREFIX}/share/applications
|
||||||
|
INSTALLS += pixmaps desktop
|
||||||
|
contains(DEFINES,AUTOTYPE){
|
||||||
|
LIBS += -lXtst
|
||||||
|
SOURCES += lib/HelperX11.cpp lib/AutoType_X11.cpp
|
||||||
|
HEADERS += lib/HelperX11.h
|
||||||
|
}
|
||||||
|
contains(DEFINES,GLOBAL_AUTOTYPE){
|
||||||
|
SOURCES += Application_X11.cpp
|
||||||
|
HEADERS += Application_X11.h
|
||||||
|
}
|
||||||
|
SOURCES += main_unix.cpp
|
||||||
}
|
}
|
||||||
}
|
|
||||||
TARGET = ../bin/keepassx
|
|
||||||
target.path = $${PREFIX}/bin
|
|
||||||
data.files = ../share/keepassx
|
|
||||||
data.path = $${PREFIX}/share
|
|
||||||
pixmaps.files = ../share/pixmaps/*
|
|
||||||
pixmaps.path = $${PREFIX}/share/pixmaps
|
|
||||||
desktop.files = ../share/applications/*
|
|
||||||
desktop.path = $${PREFIX}/share/applications
|
|
||||||
INSTALLS += pixmaps desktop
|
|
||||||
contains(DEFINES,AUTOTYPE) {
|
|
||||||
LIBS += -lXtst
|
|
||||||
SOURCES += lib/HelperX11.cpp lib/AutoType_X11.cpp
|
|
||||||
HEADERS += lib/HelperX11.h
|
|
||||||
}
|
|
||||||
contains(DEFINES,GLOBAL_AUTOTYPE) {
|
|
||||||
SOURCES += Application_X11.cpp
|
|
||||||
HEADERS += Application_X11.h
|
|
||||||
}
|
|
||||||
SOURCES += main_unix.cpp
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Platform Specific: MacOS X
|
# Platform Specific: MacOS X
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
macx {
|
macx {
|
||||||
isEmpty(PREFIX):PREFIX = /Applications
|
isEmpty(PREFIX): PREFIX = /Applications
|
||||||
TARGET = ../bin/KeePassX
|
TARGET = ../bin/KeePassX
|
||||||
target.path = $${PREFIX}
|
target.path = $${PREFIX}
|
||||||
data.files = ../share/keepassx
|
data.files += ../share/keepassx
|
||||||
data.path = Contents/Resources
|
data.path = Contents/Resources
|
||||||
LIBS += -framework CoreFoundation
|
LIBS += -framework CoreFoundation
|
||||||
isEqual(LINK,DYNAMIC) {
|
isEqual(LINK,DYNAMIC){
|
||||||
isEmpty(QT_FRAMEWORK_DIR) : QT_FRAMEWORK_DIR = /Library/Frameworks
|
isEmpty(QT_FRAMEWORK_DIR): QT_FRAMEWORK_DIR = /Library/Frameworks
|
||||||
private_frameworks.files += $${QT_FRAMEWORK_DIR}/QtCore.framework
|
private_frameworks.files += $${QT_FRAMEWORK_DIR}/QtCore.framework
|
||||||
private_frameworks.files += $${QT_FRAMEWORK_DIR}/QtGui.framework
|
private_frameworks.files += $${QT_FRAMEWORK_DIR}/QtGui.framework
|
||||||
private_frameworks.files += $${QT_FRAMEWORK_DIR}/QtXml.framework
|
private_frameworks.files += $${QT_FRAMEWORK_DIR}/QtXml.framework
|
||||||
private_frameworks.path = Contents/Frameworks
|
private_frameworks.path = Contents/Frameworks
|
||||||
QMAKE_BUNDLE_DATA += private_frameworks
|
QMAKE_BUNDLE_DATA += private_frameworks
|
||||||
}
|
}
|
||||||
isEqual(LINK,STATIC){
|
isEqual(LINK,STATIC){
|
||||||
LIBS += -framework Carbon -framework AppKit -lz
|
LIBS += -framework Carbon -framework AppKit -lz
|
||||||
}
|
}
|
||||||
QMAKE_BUNDLE_DATA += data
|
QMAKE_BUNDLE_DATA += data
|
||||||
ICON = ../share/macx_bundle/icon.icns
|
ICON = ../share/macx_bundle/icon.icns
|
||||||
CONFIG += app_bundle
|
CONFIG += app_bundle
|
||||||
isEqual(ARCH,UNIVERSAL) : CONFIG += x86 ppc
|
isEqual(ARCH,UNIVERSAL): CONFIG += x86 ppc
|
||||||
isEqual(ARCH,INTEL) : CONFIG += x86
|
isEqual(ARCH,INTEL): CONFIG += x86
|
||||||
isEqual(ARCH,PPC) : CONFIG += ppc
|
isEqual(ARCH,PPC): CONFIG += ppc
|
||||||
SOURCES += main_macx.cpp
|
SOURCES += main_macx.cpp
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Platform Specific: Windows
|
# Platform Specific: Windows
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
isEqual(QMAKE_WIN32,1) {
|
isEqual(QMAKE_WIN32,1){
|
||||||
CONFIG += windows
|
CONFIG += windows
|
||||||
isEmpty(PREFIX):PREFIX = "C:/Program files/KeePassX"
|
isEmpty(PREFIX): PREFIX = "C:/Program files/KeePassX"
|
||||||
TARGET = ../bin/KeePassX
|
TARGET = ../bin/KeePassX
|
||||||
target.path = $${PREFIX}
|
target.path = $${PREFIX}
|
||||||
data.files = ../share/keepassx/*
|
data.files += ../share/keepassx/*
|
||||||
data.path = $${PREFIX}/share
|
data.path = $${PREFIX}/share
|
||||||
!isEqual(INSTALL_QTLIB,0) {
|
!isEqual(INSTALL_QTLIB,0){
|
||||||
qt_libs.files = $${QMAKE_LIBDIR_QT}/QtCore4.dll $${QMAKE_LIBDIR_QT}/QtGui4.dll $${QMAKE_LIBDIR_QT}/QtXml4.dll
|
qt_libs.files = $${QMAKE_LIBDIR_QT}/QtCore4.dll $${QMAKE_LIBDIR_QT}/QtGui4.dll $${QMAKE_LIBDIR_QT}/QtXml4.dll
|
||||||
qt_libs.path = $${PREFIX}
|
qt_libs.path = $${PREFIX}
|
||||||
INSTALLS += qt_libs
|
INSTALLS += qt_libs
|
||||||
}
|
}
|
||||||
RC_FILE = ../share/win_ico/keepassx.rc
|
RC_FILE = ../share/win_ico/keepassx.rc
|
||||||
QMAKE_LINK_OBJECT_SCRIPT = $${OBJECTS_DIR}/$${QMAKE_LINK_OBJECT_SCRIPT}
|
QMAKE_LINK_OBJECT_SCRIPT = $${OBJECTS_DIR}/$${QMAKE_LINK_OBJECT_SCRIPT}
|
||||||
SOURCES += main_win32.cpp
|
SOURCES += main_win32.cpp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
INSTALLS += target data
|
INSTALLS += target data
|
||||||
|
|
||||||
contains(DEFINES,GLOBAL_AUTOTYPE) {
|
contains(DEFINES,GLOBAL_AUTOTYPE){
|
||||||
FORMS += forms/AutoTypeDlg.ui
|
FORMS += forms/AutoTypeDlg.ui
|
||||||
HEADERS += dialogs/AutoTypeDlg.h
|
HEADERS += dialogs/AutoTypeDlg.h
|
||||||
SOURCES += dialogs/AutoTypeDlg.cpp
|
SOURCES += dialogs/AutoTypeDlg.cpp
|
||||||
|
@ -180,7 +180,6 @@ HEADERS += lib/UrlLabel.h \
|
||||||
lib/GroupView.h \
|
lib/GroupView.h \
|
||||||
lib/EntryView.h \
|
lib/EntryView.h \
|
||||||
crypto/arcfour.h \
|
crypto/arcfour.h \
|
||||||
lib/KpFileIconProvider.h \
|
|
||||||
crypto/aes_edefs.h \
|
crypto/aes_edefs.h \
|
||||||
crypto/aes_tdefs.h \
|
crypto/aes_tdefs.h \
|
||||||
crypto/aes.h \
|
crypto/aes.h \
|
||||||
|
@ -200,7 +199,9 @@ HEADERS += lib/UrlLabel.h \
|
||||||
# KpxFirefox.h \
|
# KpxFirefox.h \
|
||||||
dialogs/AddBookmarkDlg.h \
|
dialogs/AddBookmarkDlg.h \
|
||||||
lib/bookmarks.h \
|
lib/bookmarks.h \
|
||||||
dialogs/ManageBookmarksDlg.h
|
dialogs/ManageBookmarksDlg.h \
|
||||||
|
dialogs/dialogs.h
|
||||||
|
|
||||||
SOURCES += lib/UrlLabel.cpp \
|
SOURCES += lib/UrlLabel.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
mainwindow.cpp \
|
mainwindow.cpp \
|
||||||
|
@ -240,12 +241,7 @@ SOURCES += lib/UrlLabel.cpp \
|
||||||
lib/EntryView.cpp \
|
lib/EntryView.cpp \
|
||||||
lib/FileDialogs.cpp \
|
lib/FileDialogs.cpp \
|
||||||
crypto/arcfour.cpp \
|
crypto/arcfour.cpp \
|
||||||
lib/KpFileIconProvider.cpp \
|
|
||||||
lib/ShortcutWidget.cpp \
|
lib/ShortcutWidget.cpp \
|
||||||
crypto/aescrypt.c \
|
|
||||||
crypto/aeskey.c \
|
|
||||||
crypto/aestab.c \
|
|
||||||
crypto/aes_modes.c \
|
|
||||||
crypto/sha256.cpp \
|
crypto/sha256.cpp \
|
||||||
crypto/yarrow.cpp \
|
crypto/yarrow.cpp \
|
||||||
lib/WaitAnimationWidget.cpp \
|
lib/WaitAnimationWidget.cpp \
|
||||||
|
@ -253,6 +249,12 @@ SOURCES += lib/UrlLabel.cpp \
|
||||||
# KpxFirefox.cpp \
|
# KpxFirefox.cpp \
|
||||||
dialogs/AddBookmarkDlg.cpp \
|
dialogs/AddBookmarkDlg.cpp \
|
||||||
lib/bookmarks.cpp \
|
lib/bookmarks.cpp \
|
||||||
dialogs/ManageBookmarksDlg.cpp
|
dialogs/ManageBookmarksDlg.cpp \
|
||||||
|
crypto/aescrypt.c \
|
||||||
|
crypto/aeskey.c \
|
||||||
|
crypto/aes_modes.c \
|
||||||
|
crypto/aestab.c
|
||||||
|
|
||||||
|
PRECOMPILED_HEADER = keepassx.h
|
||||||
|
|
||||||
RESOURCES += res/resources.qrc
|
RESOURCES += res/resources.qrc
|
||||||
|
|
Loading…
Reference in New Issue