added calendar dialog,

added calendar access button in edit entry dialog,
added customize detail view dialog for editing detail view templates,
added 'show expired entries' dialog,
new icon loading mechansim,
added and replaced some icons.

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@130 b624d157-de02-0410-bad0-e51aec6abb33
master
tarek_saidi 18 years ago
parent 88f42dfe6b
commit fbc6febc0c
  1. BIN
      share/keepass/icons/alarmclock.png
  2. BIN
      share/keepass/icons/appsettings.png
  3. 0
      share/keepass/icons/autotype.png
  4. BIN
      share/keepass/icons/clock.png
  5. 0
      share/keepass/icons/cloneentry.png
  6. BIN
      share/keepass/icons/copypwd.png
  7. BIN
      share/keepass/icons/copyusername.png
  8. BIN
      share/keepass/icons/dbsearch.png
  9. 0
      share/keepass/icons/dbsettings.png
  10. BIN
      share/keepass/icons/delete.png
  11. BIN
      share/keepass/icons/deleteentry.png
  12. BIN
      share/keepass/icons/deletegroup.png
  13. BIN
      share/keepass/icons/dice.png
  14. BIN
      share/keepass/icons/editentry.png
  15. BIN
      share/keepass/icons/editgroup.png
  16. 0
      share/keepass/icons/exit.png
  17. BIN
      share/keepass/icons/expired.png
  18. 0
      share/keepass/icons/fileclose.png
  19. BIN
      share/keepass/icons/filedelete.png
  20. 0
      share/keepass/icons/filenew.png
  21. 0
      share/keepass/icons/fileopen.png
  22. 0
      share/keepass/icons/filesave.png
  23. 0
      share/keepass/icons/filesaveas.png
  24. BIN
      share/keepass/icons/filesavedisabled.png
  25. BIN
      share/keepass/icons/generator.png
  26. BIN
      share/keepass/icons/groupsearch.png
  27. 0
      share/keepass/icons/help.png
  28. BIN
      share/keepass/icons/key.png
  29. BIN
      share/keepass/icons/manual.png
  30. BIN
      share/keepass/icons/newentry.png
  31. BIN
      share/keepass/icons/newgroup.png
  32. BIN
      share/keepass/icons/nuvola/32x32/actions/edit.png
  33. BIN
      share/keepass/icons/nuvola/32x32/actions/edit_add.png
  34. BIN
      share/keepass/icons/nuvola/32x32/actions/editdelete.png
  35. BIN
      share/keepass/icons/nuvola/32x32/actions/fileexport.png
  36. BIN
      share/keepass/icons/nuvola/32x32/actions/find.png
  37. BIN
      share/keepass/icons/nuvola/32x32/actions/identity.png
  38. BIN
      share/keepass/icons/nuvola/32x32/actions/klipper_dock.png
  39. BIN
      share/keepass/icons/nuvola/32x32/actions/run.png
  40. BIN
      share/keepass/icons/nuvola/32x32/filesystems/desktop.png
  41. BIN
      share/keepass/icons/nuvola/32x32/filesystems/folder.png
  42. BIN
      share/keepass/icons/nuvola/32x32/filesystems/folder_home.png
  43. BIN
      share/keepass/icons/nuvola/32x32/filesystems/network_local.png
  44. BIN
      share/keepass/icons/nuvola/32x32/filesystems/trashcan_full.png
  45. BIN
      share/keepass/icons/openurl.png
  46. BIN
      share/keepass/icons/settings.png
  47. 0
      share/keepass/icons/swap.png
  48. BIN
      share/keepass/icons/templates.png
  49. BIN
      share/keepass/icons/text_block.png
  50. BIN
      share/keepass/icons/text_bold.png
  51. BIN
      share/keepass/icons/text_center.png
  52. BIN
      share/keepass/icons/text_italic.png
  53. BIN
      share/keepass/icons/text_left.png
  54. BIN
      share/keepass/icons/text_right.png
  55. BIN
      share/keepass/icons/text_under.png
  56. 3
      src/Database.h
  57. 259
      src/StandardDatabase.cpp
  58. 18
      src/StandardDatabase.h
  59. 2
      src/crypto/sha256.cpp
  60. 2
      src/crypto/sha256.h
  61. 22
      src/dialogs/AboutDlg.cpp
  62. 15
      src/dialogs/AboutDlg.h
  63. 29
      src/dialogs/CalendarDlg.cpp
  64. 35
      src/dialogs/CalendarDlg.h
  65. 2
      src/dialogs/CollectEntropyDlg.cpp
  66. 217
      src/dialogs/CustomizeDetailViewDlg.cpp
  67. 55
      src/dialogs/CustomizeDetailViewDlg.h
  68. 2
      src/dialogs/DatabaseSettingsDlg.cpp
  69. 54
      src/dialogs/EditEntryDlg.cpp
  70. 9
      src/dialogs/EditEntryDlg.h
  71. 63
      src/dialogs/ExpiredEntriesDlg.cpp
  72. 47
      src/dialogs/ExpiredEntriesDlg.h
  73. 4
      src/dialogs/PasswordDlg.cpp
  74. 2
      src/dialogs/PasswordGenDlg.cpp
  75. 21
      src/dialogs/SearchDlg.cpp
  76. 11
      src/dialogs/SearchDlg.h
  77. 4
      src/dialogs/SelectIconDlg.cpp
  78. 20
      src/dialogs/SettingsDlg.cpp
  79. 1
      src/dialogs/SettingsDlg.h
  80. 203
      src/forms/AboutDlg.ui
  81. 72
      src/forms/CalendarDlg.ui
  82. 368
      src/forms/CustomizeDetailViewDlg.ui
  83. 10
      src/forms/EditEntryDlg.ui
  84. 131
      src/forms/ExpiredEntriesDlg.ui
  85. 51
      src/forms/MainWindow.ui
  86. 327
      src/forms/SearchDlg.ui
  87. 138
      src/forms/SettingsDlg.ui
  88. 15
      src/lib/EntryView.cpp
  89. 2
      src/lib/EntryView.h
  90. 10
      src/lib/GroupView.cpp
  91. 1
      src/lib/GroupView.h
  92. 155
      src/main.cpp
  93. 36
      src/main.h
  94. 175
      src/mainwindow.cpp
  95. 1
      src/mainwindow.h
  96. 16
      src/src.pro

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 880 B

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -285,6 +285,9 @@ public:
//! \return a list of pointers to the handles of all entries which belong to the given group. The list contains only valid handles and is sorted in an ascending order regarding to the entry indices.
virtual QList<IEntryHandle*> entries(IGroupHandle* Group)=0;
//! \return a list with the pointers to the handles of all expired entries of the database. The list contains only valid handles. The list is not sorted.
virtual QList<IEntryHandle*> expiredEntries()=0;
//! \return a list with the pointers to the handles of all entries of the database. The list contains only valid handles and is not sorted.
virtual QList<IGroupHandle*> groups()=0;

@ -50,21 +50,21 @@ bool EntryHandleLessThan(const IEntryHandle* This,const IEntryHandle* Other){
}
bool StdEntryLessThan(const StandardDatabase::StdEntry& This,const StandardDatabase::StdEntry& Other){
bool StdEntryLessThan(const Kdb3Database::StdEntry& This,const Kdb3Database::StdEntry& Other){
return This.Index<Other.Index;
}
QString StandardDatabase::getError(){
QString Kdb3Database::getError(){
return error;
}
void StandardDatabase::addIcon(const QPixmap& icon){
void Kdb3Database::addIcon(const QPixmap& icon){
CustomIcons << icon;
emit iconsModified();
}
QPixmap& StandardDatabase::icon(int i){
QPixmap& Kdb3Database::icon(int i){
if(i>=builtinIcons()+CustomIcons.size())
return EntryIcons[0];
if(i<builtinIcons())
@ -72,7 +72,7 @@ QPixmap& StandardDatabase::icon(int i){
return CustomIcons[i-builtinIcons()];
}
void StandardDatabase::removeIcon(int id){
void Kdb3Database::removeIcon(int id){
id-=builtinIcons();
if(id < 0 ) return;
if(id >= CustomIcons.size()) return;
@ -92,17 +92,17 @@ void StandardDatabase::removeIcon(int id){
emit iconsModified();
}
void StandardDatabase::replaceIcon(int id,const QPixmap& icon){
void Kdb3Database::replaceIcon(int id,const QPixmap& icon){
if(id<builtinIcons())return;
CustomIcons[id-builtinIcons()]=icon;
emit iconsModified();
}
int StandardDatabase::numIcons(){
int Kdb3Database::numIcons(){
return builtinIcons()+CustomIcons.size();
}
bool StandardDatabase::parseMetaStream(const StdEntry& entry){
bool Kdb3Database::parseMetaStream(const StdEntry& entry){
qDebug("%s",entry.Comment.toUtf8().data());
@ -123,7 +123,7 @@ bool StandardDatabase::parseMetaStream(const StdEntry& entry){
return false; //unknown MetaStream
}
bool StandardDatabase::isMetaStream(StdEntry& p){
bool Kdb3Database::isMetaStream(StdEntry& p){
if(p.Binary.isNull()) return false;
if(p.Comment == "") return false;
if(p.BinaryDesc != "bin-stream") return false;
@ -135,17 +135,17 @@ bool StandardDatabase::isMetaStream(StdEntry& p){
}
bool StandardDatabase::parseCustomIconsMetaStreamV1(const QByteArray& dta){
bool Kdb3Database::parseCustomIconsMetaStreamV1(const QByteArray& dta){
qDebug("Removed old CuIcMeSt v1");
return true;
}
bool StandardDatabase::parseCustomIconsMetaStreamV2(const QByteArray& dta){
bool Kdb3Database::parseCustomIconsMetaStreamV2(const QByteArray& dta){
qDebug("Removed old CuIcMeSt v2");
return true;
}
void StandardDatabase::parseCustomIconsMetaStream(const QByteArray& dta){
void Kdb3Database::parseCustomIconsMetaStream(const QByteArray& dta){
//Rev 3
quint32 NumIcons,NumEntries,NumGroups,offset;
memcpyFromLEnd32(&NumIcons,dta.data());
@ -200,7 +200,7 @@ void StandardDatabase::parseCustomIconsMetaStream(const QByteArray& dta){
return;
}
void StandardDatabase::parseGroupTreeStateMetaStream(const QByteArray& dta){
void Kdb3Database::parseGroupTreeStateMetaStream(const QByteArray& dta){
if(dta.size()<4){qWarning("Discarded metastream KPX_GROUP_TREE_STATE because of a parsing error."); return;}
quint32 Num;
memcpyFromLEnd32(&Num,dta.data());
@ -216,7 +216,7 @@ void StandardDatabase::parseGroupTreeStateMetaStream(const QByteArray& dta){
return;
}
void StandardDatabase::createGroupTreeStateMetaStream(StdEntry* e){
void Kdb3Database::createGroupTreeStateMetaStream(StdEntry* e){
e->BinaryDesc="bin-stream";
e->Title="Meta-Info";
e->Username="SYSTEM";
@ -239,13 +239,13 @@ void StandardDatabase::createGroupTreeStateMetaStream(StdEntry* e){
e->Binary=bin;
}
StandardDatabase::StdEntry* StandardDatabase::getEntry(const KpxUuid& uuid){
Kdb3Database::StdEntry* Kdb3Database::getEntry(const KpxUuid& uuid){
for(int i=0; i<Entries.size();i++)
if(Entries[i].Uuid==uuid)return &Entries[i];
return NULL;
}
StandardDatabase::StdGroup* StandardDatabase::getGroup(quint32 Id){
Kdb3Database::StdGroup* Kdb3Database::getGroup(quint32 Id){
for(int i=0; i<Groups.size();i++)
if(Groups[i].Id==Id)return &Groups[i];
return NULL;
@ -253,7 +253,7 @@ StandardDatabase::StdGroup* StandardDatabase::getGroup(quint32 Id){
//! Extracts one entry from raw decrypted data.
bool StandardDatabase::readEntryField(StdEntry* entry, quint16 FieldType, quint32 FieldSize, quint8 *pData){
bool Kdb3Database::readEntryField(StdEntry* entry, quint16 FieldType, quint32 FieldSize, quint8 *pData){
switch(FieldType)
{
case 0x0000:
@ -315,7 +315,7 @@ switch(FieldType)
}
//! Extracts one group from raw decrypted data.
bool StandardDatabase::readGroupField(StdGroup* group,QList<quint32>& Levels,quint16 FieldType, quint32 FieldSize, quint8 *pData)
bool Kdb3Database::readGroupField(StdGroup* group,QList<quint32>& Levels,quint16 FieldType, quint32 FieldSize, quint8 *pData)
{
switch(FieldType)
{
@ -358,7 +358,7 @@ bool StandardDatabase::readGroupField(StdGroup* group,QList<quint32>& Levels,qui
return true; // Field supported
}
bool StandardDatabase::createGroupTree(QList<quint32>& Levels){
bool Kdb3Database::createGroupTree(QList<quint32>& Levels){
if(Levels[0]!=0) return false;
//find the parent for every group
for(int i=0;i<Groups.size();i++){
@ -398,7 +398,7 @@ bool StandardDatabase::createGroupTree(QList<quint32>& Levels){
return true;
}
void StandardDatabase::createHandles(){
void Kdb3Database::createHandles(){
for(int i=0;i<Groups.size();i++){
GroupHandles.append(GroupHandle(this));
Groups[i].Handle=&GroupHandles.back();
@ -411,7 +411,7 @@ void StandardDatabase::createHandles(){
}
}
void StandardDatabase::restoreGroupTreeState(){
void Kdb3Database::restoreGroupTreeState(){
if(settings->value("GroupTreeState","ExpandAll")=="ExpandAll"){
for(int i=0;i<Groups.size();i++){
Groups[i].IsExpanded=true;
@ -426,7 +426,7 @@ void StandardDatabase::restoreGroupTreeState(){
}
}
bool StandardDatabase::load(QString filename){
bool Kdb3Database::load(QString filename){
unsigned long total_size,crypto_size;
quint32 Signature1,Signature2,Version,NumGroups,NumEntries,Flags;
quint8 TransfRandomSeed[32];
@ -614,7 +614,7 @@ restoreGroupTreeState();
return true;
}
QDateTime StandardDatabase::dateFromPackedStruct5(const unsigned char* pBytes){
QDateTime Kdb3Database::dateFromPackedStruct5(const unsigned char* pBytes){
quint32 dw1, dw2, dw3, dw4, dw5;
dw1 = (quint32)pBytes[0]; dw2 = (quint32)pBytes[1]; dw3 = (quint32)pBytes[2];
dw4 = (quint32)pBytes[3]; dw5 = (quint32)pBytes[4];
@ -628,7 +628,7 @@ return QDateTime(QDate(y,mon,d),QTime(h,min,s));
}
void StandardDatabase::dateToPackedStruct5(const QDateTime& d,unsigned char* pBytes){
void Kdb3Database::dateToPackedStruct5(const QDateTime& d,unsigned char* pBytes){
pBytes[0] = (quint8)(((quint32)d.date().year() >> 6) & 0x0000003F);
pBytes[1] = (quint8)((((quint32)d.date().year() & 0x0000003F) << 2) | (((quint32)d.date().month() >> 2) & 0x00000003));
pBytes[2] = (quint8)((((quint32)d.date().month() & 0x00000003) << 6) | (((quint32)d.date().day() & 0x0000001F) << 1) | (((quint32)d.time().hour() >> 4) & 0x00000001));
@ -637,7 +637,7 @@ pBytes[4] = (quint8)((((quint32)d.time().minute() & 0x00000003) << 6) | ((quint3
}
bool StandardDatabase::transformKey(quint8* src,quint8* dst,quint8* KeySeed,int rounds){
bool Kdb3Database::transformKey(quint8* src,quint8* dst,quint8* KeySeed,int rounds){
quint8 tmp[32];
AESencrypt aes;
aes.key256(KeySeed);
@ -650,17 +650,17 @@ bool StandardDatabase::transformKey(quint8* src,quint8* dst,quint8* KeySeed,int
}
int StandardDatabase::numGroups(){
int Kdb3Database::numGroups(){
return Groups.size();
}
int StandardDatabase::numEntries(){
int Kdb3Database::numEntries(){
return Entries.size();
}
void StandardDatabase::deleteGroup(StdGroup* group){
void Kdb3Database::deleteGroup(StdGroup* group){
while(group->Childs.size())
deleteGroup(group->Childs.front());
@ -686,11 +686,11 @@ void StandardDatabase::deleteGroup(StdGroup* group){
}
void StandardDatabase::deleteGroup(IGroupHandle* group){
void Kdb3Database::deleteGroup(IGroupHandle* group){
deleteGroup(((GroupHandle*)group)->Group);
}
void StandardDatabase::GroupHandle::setIndex(int index){
void Kdb3Database::GroupHandle::setIndex(int index){
/*
quint32 ParentId=((GroupHandle*)parent())->Id;
int Pos=pDB->getGroupListIndex(this);
@ -728,7 +728,7 @@ void StandardDatabase::GroupHandle::setIndex(int index){
}
bool StandardDatabase::convHexToBinaryKey(char* HexKey, char* dst){
bool Kdb3Database::convHexToBinaryKey(char* HexKey, char* dst){
QString hex=QString::fromAscii(HexKey,64);
for(int i=0; i<64; i+=2){
bool err;
@ -740,17 +740,31 @@ bool StandardDatabase::convHexToBinaryKey(char* HexKey, char* dst){
return true;
}
void StandardDatabase::authByPwd(QString& Password){
/*
void Kdb3Database::authByPwd(QString& Password){
if(!Password.size()) {
memcpy(RawMasterKey,QByteArray(32,'\0').data(),32);
return;
}
SHA256::hashBuffer(Password.toUtf8().data(),RawMasterKey,Password.toUtf8().size());
return;
}*/
void Kdb3Database::authByPwd(QString& Password){
if(!Password.size()) {
memcpy(RawMasterKey,QByteArray(32,'\0').data(),32);
return;
}
SHA256::hashBuffer(Password.toLatin1().data(),RawMasterKey,Password.toLatin1().size());
QByteArray lat,utf;
utf=Password.toUtf8();
lat=Password.toLatin1();
char *Lat=lat.data();
char *Utf=utf.data();
return;
}
bool StandardDatabase::authByFile(QString& filename){
bool Kdb3Database::authByFile(QString& filename){
QFile file(filename);
if(!file.open(QIODevice::ReadOnly|QIODevice::Unbuffered)){
error=decodeFileError(file.error());
@ -788,7 +802,7 @@ bool StandardDatabase::authByFile(QString& filename){
return true;
}
bool StandardDatabase::authByFileAndPwd(QString& Password, QString& filename){
bool Kdb3Database::authByFileAndPwd(QString& Password, QString& filename){
unsigned char PasswordKey[32];
unsigned char FileKey[32];
if(!authByFile(filename))return false;
@ -803,7 +817,7 @@ bool StandardDatabase::authByFileAndPwd(QString& Password, QString& filename){
return true;
}
QList<IEntryHandle*> StandardDatabase::entries(){
QList<IEntryHandle*> Kdb3Database::entries(){
QList<IEntryHandle*> handles;
for(int i=0; i<EntryHandles.size(); i++){
if(EntryHandles[i].isValid())handles.append(&EntryHandles[i]);
@ -811,7 +825,18 @@ QList<IEntryHandle*> StandardDatabase::entries(){
return handles;
}
QList<IEntryHandle*> StandardDatabase::entries(IGroupHandle* group){
QList<IEntryHandle*> Kdb3Database::expiredEntries(){
QList<IEntryHandle*> handles;
for(int i=0; i<EntryHandles.size(); i++){
if(EntryHandles[i].isValid() &&
(EntryHandles[i].expire()<=QDateTime::currentDateTime()) &&
(EntryHandles[i].expire()!=Date_Never))
handles.append(&EntryHandles[i]);
}
return handles;
}
QList<IEntryHandle*> Kdb3Database::entries(IGroupHandle* group){
QList<IEntryHandle*> handles;
for(int i=0; i<EntryHandles.size(); i++){
if(EntryHandles[i].isValid() && (EntryHandles[i].group()==group))
@ -823,7 +848,7 @@ QList<IEntryHandle*> StandardDatabase::entries(IGroupHandle* group){
return handles;
}
void StandardDatabase::deleteEntry(IEntryHandle* entry){
void Kdb3Database::deleteEntry(IEntryHandle* entry){
if(!entry)return;
StdGroup* Group=((EntryHandle*)entry)->Entry->Group;
int j;
@ -835,13 +860,13 @@ void StandardDatabase::deleteEntry(IEntryHandle* entry){
Entries.removeAt(j);
}
void StandardDatabase::moveEntry(IEntryHandle* entry, IGroupHandle* group){
void Kdb3Database::moveEntry(IEntryHandle* entry, IGroupHandle* group){
((EntryHandle*)entry)->Entry->GroupId=((GroupHandle*)group)->Group->Id;
((EntryHandle*)entry)->Entry->Group=((GroupHandle*)group)->Group;
}
void StandardDatabase::deleteEntries(QList<IEntryHandle*> entries){
void Kdb3Database::deleteEntries(QList<IEntryHandle*> entries){
if(!entries.size())return;
StdGroup* Group=((EntryHandle*)entries[0])->Entry->Group;
for(int i=0;i<entries.size();i++){
@ -860,7 +885,7 @@ void StandardDatabase::deleteEntries(QList<IEntryHandle*> entries){
}
};
QList<IGroupHandle*> StandardDatabase::groups(){
QList<IGroupHandle*> Kdb3Database::groups(){
QList<IGroupHandle*> handles;
for(int i=0; i<GroupHandles.size(); i++){
if(GroupHandles[i].isValid())handles.append(&GroupHandles[i]);
@ -868,7 +893,7 @@ QList<IGroupHandle*> StandardDatabase::groups(){
return handles;
}
quint32 StandardDatabase::getNewGroupId(){
quint32 Kdb3Database::getNewGroupId(){
quint32 id;
bool used;
while(1){
@ -882,7 +907,7 @@ quint32 StandardDatabase::getNewGroupId(){
return id;
}
IGroupHandle* StandardDatabase::addGroup(const CGroup* group,IGroupHandle* ParentHandle){
IGroupHandle* Kdb3Database::addGroup(const CGroup* group,IGroupHandle* ParentHandle){
GroupHandles.append(GroupHandle(this));
Groups.append(*group);
Groups.back().Id=getNewGroupId();
@ -901,7 +926,7 @@ IGroupHandle* StandardDatabase::addGroup(const CGroup* group,IGroupHandle* Paren
return &GroupHandles.back();
}
StandardDatabase::StdGroup::StdGroup(const CGroup& other){
Kdb3Database::StdGroup::StdGroup(const CGroup& other){
OldImage=0;
Index=0;
Id=other.Id;
@ -909,64 +934,64 @@ StandardDatabase::StdGroup::StdGroup(const CGroup& other){
Title=other.Title;
}
void StandardDatabase::EntryHandle::setTitle(const QString& Title){Entry->Title=Title; }
void StandardDatabase::EntryHandle::setUsername(const QString& Username){Entry->Username=Username;}
void StandardDatabase::EntryHandle::setUrl(const QString& Url){Entry->Url=Url;}
void StandardDatabase::EntryHandle::setPassword(const SecString& Password){Entry->Password=Password;}
void StandardDatabase::EntryHandle::setExpire(const KpxDateTime& s){Entry->Expire=s;}
void StandardDatabase::EntryHandle::setCreation(const KpxDateTime& s){Entry->Creation=s;}
void StandardDatabase::EntryHandle::setLastAccess(const KpxDateTime& s){Entry->LastAccess=s;}
void StandardDatabase::EntryHandle::setLastMod(const KpxDateTime& s){Entry->LastMod=s;}
void StandardDatabase::EntryHandle::setBinaryDesc(const QString& s){Entry->BinaryDesc=s;}
void StandardDatabase::EntryHandle::setComment(const QString& s){Entry->Comment=s;}
void StandardDatabase::EntryHandle::setBinary(const QByteArray& s){Entry->Binary=s;}
void StandardDatabase::EntryHandle::setImage(const quint32& s){Entry->Image=s;}
void StandardDatabase::EntryHandle::setOldImage(const quint32& s){Entry->OldImage=s;}
KpxUuid StandardDatabase::EntryHandle::uuid(){return Entry->Uuid;}
IGroupHandle* StandardDatabase::EntryHandle::group(){return Entry->Group->Handle;}
quint32 StandardDatabase::EntryHandle::image(){return Entry->Image;}
quint32 StandardDatabase::EntryHandle::oldImage(){return Entry->OldImage;}
QString StandardDatabase::EntryHandle::title(){return Entry->Title;}
QString StandardDatabase::EntryHandle::url(){return Entry->Url;}
QString StandardDatabase::EntryHandle::username(){return Entry->Username;}
SecString StandardDatabase::EntryHandle::password(){return Entry->Password;}
QString StandardDatabase::EntryHandle::comment(){return Entry->Comment;}
QString StandardDatabase::EntryHandle::binaryDesc(){return Entry->BinaryDesc;}
KpxDateTime StandardDatabase::EntryHandle::creation(){return Entry->Creation;}
KpxDateTime StandardDatabase::EntryHandle::lastMod(){return Entry->LastMod;}
KpxDateTime StandardDatabase::EntryHandle::lastAccess(){return Entry->LastAccess;}
KpxDateTime StandardDatabase::EntryHandle::expire(){return Entry->Expire;}
QByteArray StandardDatabase::EntryHandle::binary(){return Entry->Binary;}
quint32 StandardDatabase::EntryHandle::binarySize(){return Entry->Binary.size();}
int StandardDatabase::EntryHandle::visualIndex()const{return Entry->Index;}
void StandardDatabase::EntryHandle::setVisualIndexDirectly(int i){Entry->Index=i;}
bool StandardDatabase::EntryHandle::isValid()const{return valid;}
void StandardDatabase::EntryHandle::setVisualIndex(int index){
void Kdb3Database::EntryHandle::setTitle(const QString& Title){Entry->Title=Title; }
void Kdb3Database::EntryHandle::setUsername(const QString& Username){Entry->Username=Username;}
void Kdb3Database::EntryHandle::setUrl(const QString& Url){Entry->Url=Url;}
void Kdb3Database::EntryHandle::setPassword(const SecString& Password){Entry->Password=Password;}
void Kdb3Database::EntryHandle::setExpire(const KpxDateTime& s){Entry->Expire=s;}
void Kdb3Database::EntryHandle::setCreation(const KpxDateTime& s){Entry->Creation=s;}
void Kdb3Database::EntryHandle::setLastAccess(const KpxDateTime& s){Entry->LastAccess=s;}
void Kdb3Database::EntryHandle::setLastMod(const KpxDateTime& s){Entry->LastMod=s;}
void Kdb3Database::EntryHandle::setBinaryDesc(const QString& s){Entry->BinaryDesc=s;}
void Kdb3Database::EntryHandle::setComment(const QString& s){Entry->Comment=s;}
void Kdb3Database::EntryHandle::setBinary(const QByteArray& s){Entry->Binary=s;}
void Kdb3Database::EntryHandle::setImage(const quint32& s){Entry->Image=s;}
void Kdb3Database::EntryHandle::setOldImage(const quint32& s){Entry->OldImage=s;}
KpxUuid Kdb3Database::EntryHandle::uuid(){return Entry->Uuid;}
IGroupHandle* Kdb3Database::EntryHandle::group(){return Entry->Group->Handle;}
quint32 Kdb3Database::EntryHandle::image(){return Entry->Image;}
quint32 Kdb3Database::EntryHandle::oldImage(){return Entry->OldImage;}
QString Kdb3Database::EntryHandle::title(){return Entry->Title;}
QString Kdb3Database::EntryHandle::url(){return Entry->Url;}
QString Kdb3Database::EntryHandle::username(){return Entry->Username;}
SecString Kdb3Database::EntryHandle::password(){return Entry->Password;}
QString Kdb3Database::EntryHandle::comment(){return Entry->Comment;}
QString Kdb3Database::EntryHandle::binaryDesc(){return Entry->BinaryDesc;}
KpxDateTime Kdb3Database::EntryHandle::creation(){return Entry->Creation;}
KpxDateTime Kdb3Database::EntryHandle::lastMod(){return Entry->LastMod;}
KpxDateTime Kdb3Database::EntryHandle::lastAccess(){return Entry->LastAccess;}
KpxDateTime Kdb3Database::EntryHandle::expire(){return Entry->Expire;}
QByteArray Kdb3Database::EntryHandle::binary(){return Entry->Binary;}
quint32 Kdb3Database::EntryHandle::binarySize(){return Entry->Binary.size();}
int Kdb3Database::EntryHandle::visualIndex()const{return Entry->Index;}
void Kdb3Database::EntryHandle::setVisualIndexDirectly(int i){Entry->Index=i;}
bool Kdb3Database::EntryHandle::isValid()const{return valid;}
void Kdb3Database::EntryHandle::setVisualIndex(int index){
QList<IEntryHandle*>Entries=pDB->entries(Entry->Group->Handle);
Entries.move(visualIndex(),index);
for(int i=0;i<Entries.size();i++){
dynamic_cast<StandardDatabase::EntryHandle*>(Entries[i])->Entry->Index=index;
dynamic_cast<Kdb3Database::EntryHandle*>(Entries[i])->Entry->Index=index;
}
}
StandardDatabase::EntryHandle::EntryHandle(StandardDatabase* db){
Kdb3Database::EntryHandle::EntryHandle(Kdb3Database* db){
pDB=db;
ListIndex=0;
valid=true;
}
bool StandardDatabase::GroupHandle::isValid(){return valid;}
void StandardDatabase::GroupHandle::setOldImage(const quint32& s){Group->OldImage=s;}
QString StandardDatabase::GroupHandle::title(){return Group->Title;}
quint32 StandardDatabase::GroupHandle::oldImage(){return Group->OldImage;}
quint32 StandardDatabase::GroupHandle::image(){return Group->Image;}
int StandardDatabase::GroupHandle::index(){return Group->Index;}
void StandardDatabase::GroupHandle::setTitle(const QString& Title){Group->Title=Title;}
void StandardDatabase::GroupHandle::setExpanded(bool IsExpanded){Group->IsExpanded=IsExpanded;}
bool StandardDatabase::GroupHandle::expanded(){return Group->IsExpanded;}
void StandardDatabase::GroupHandle::setImage(const quint32& New)
bool Kdb3Database::GroupHandle::isValid(){return valid;}
void Kdb3Database::GroupHandle::setOldImage(const quint32& s){Group->OldImage=s;}
QString Kdb3Database::GroupHandle::title(){return Group->Title;}
quint32 Kdb3Database::GroupHandle::oldImage(){return Group->OldImage;}
quint32 Kdb3Database::GroupHandle::image(){return Group->Image;}
int Kdb3Database::GroupHandle::index(){return Group->Index;}
void Kdb3Database::GroupHandle::setTitle(const QString& Title){Group->Title=Title;}
void Kdb3Database::GroupHandle::setExpanded(bool IsExpanded){Group->IsExpanded=IsExpanded;}
bool Kdb3Database::GroupHandle::expanded(){return Group->IsExpanded;}
void Kdb3Database::GroupHandle::setImage(const quint32& New)
{
if(Group->Image < pDB->builtinIcons() && New >= pDB->builtinIcons())
Group->OldImage=Group->Image;
@ -978,17 +1003,17 @@ void StandardDatabase::GroupHandle::setImage(const quint32& New)
}
StandardDatabase::GroupHandle::GroupHandle(StandardDatabase* db){
Kdb3Database::GroupHandle::GroupHandle(Kdb3Database* db){
pDB=db;
valid=true;
Group=NULL;
}
IGroupHandle* StandardDatabase::GroupHandle::parent(){
IGroupHandle* Kdb3Database::GroupHandle::parent(){
return (IGroupHandle*)Group->Parent->Handle;
}
int StandardDatabase::GroupHandle::level(){
int Kdb3Database::GroupHandle::level(){
int i=0;
StdGroup* group=Group;
while(group->Parent){
@ -1000,7 +1025,7 @@ int StandardDatabase::GroupHandle::level(){
}
QList<IGroupHandle*> StandardDatabase::GroupHandle::childs(){
QList<IGroupHandle*> Kdb3Database::GroupHandle::childs(){
QList<IGroupHandle*> childs;
for(int i=0;i<Group->Childs.size();i++){
childs.append(Group->Childs[i]->Handle);
@ -1053,7 +1078,7 @@ else
memcpy(dst,src,2);
}
bool StandardDatabase::save(){
bool Kdb3Database::save(){
if(!Groups.size()){
error=tr("The database must contain at least one group.");
return false;
@ -1212,7 +1237,7 @@ bool StandardDatabase::save(){
return true;
}
void StandardDatabase::createCustomIconsMetaStream(StdEntry* e){
void Kdb3Database::createCustomIconsMetaStream(StdEntry* e){
/* Rev 3 */
e->BinaryDesc="bin-stream";
e->Title="Meta-Info";
@ -1261,14 +1286,14 @@ void StandardDatabase::createCustomIconsMetaStream(StdEntry* e){
}
}
QList<IGroupHandle*> StandardDatabase::sortedGroups(){
QList<IGroupHandle*> Kdb3Database::sortedGroups(){
QList<IGroupHandle*> SortedGroups;
appendChildsToGroupList(SortedGroups,RootGroup);
return SortedGroups;
}
void StandardDatabase::appendChildsToGroupList(QList<IGroupHandle*>& list,StdGroup& group){
void Kdb3Database::appendChildsToGroupList(QList<IGroupHandle*>& list,StdGroup& group){
for(int i=0;i<group.Childs.size();i++){
list << group.Childs[i]->Handle;
appendChildsToGroupList(list,*group.Childs[i]);
@ -1276,7 +1301,7 @@ void StandardDatabase::appendChildsToGroupList(QList<IGroupHandle*>& list,StdGro
}
void StandardDatabase::appendChildsToGroupList(QList<StdGroup*>& list,StdGroup& group){
void Kdb3Database::appendChildsToGroupList(QList<StdGroup*>& list,StdGroup& group){
for(int i=0;i<group.Childs.size();i++){
list << group.Childs[i];
appendChildsToGroupList(list,*group.Childs[i]);
@ -1284,7 +1309,7 @@ void StandardDatabase::appendChildsToGroupList(QList<StdGroup*>& list,StdGroup&
}
void StandardDatabase::serializeGroups(QList<StdGroup>& GroupList,char* buffer,unsigned int& pos){
void Kdb3Database::serializeGroups(QList<StdGroup>& GroupList,char* buffer,unsigned int& pos){
quint16 FieldType;
quint32 FieldSize;
quint32 Flags=0; //unused
@ -1355,7 +1380,7 @@ void StandardDatabase::serializeGroups(QList<StdGroup>& GroupList,char* buffer,u
}
void StandardDatabase::serializeEntries(QList<StdEntry>& EntryList,char* buffer,unsigned int& pos){
void Kdb3Database::serializeEntries(QList<StdEntry>& EntryList,char* buffer,unsigned int& pos){
quint16 FieldType;
quint32 FieldSize;
for(int i = 0; i < EntryList.size(); i++){
@ -1447,11 +1472,11 @@ void StandardDatabase::serializeEntries(QList<StdEntry>& EntryList,char* buffer,
}
}
bool StandardDatabase::close(){
bool Kdb3Database::close(){
return true;
}
void StandardDatabase::create(){
void Kdb3Database::create(){
File=NULL;
RootGroup.Title="$ROOT$";
RootGroup.Parent=NULL;
@ -1461,7 +1486,7 @@ void StandardDatabase::create(){
KeyError=false;
}
bool StandardDatabase::isKeyError(){
bool Kdb3Database::isKeyError(){
if(KeyError){
KeyError=false;
return true;
@ -1470,7 +1495,7 @@ bool StandardDatabase::isKeyError(){
return false;
}
IEntryHandle* StandardDatabase::cloneEntry(const IEntryHandle* entry){
IEntryHandle* Kdb3Database::cloneEntry(const IEntryHandle* entry){
StdEntry dolly;
dolly=*((EntryHandle*)entry)->Entry;
dolly.Uuid.generate();
@ -1481,7 +1506,7 @@ IEntryHandle* StandardDatabase::cloneEntry(const IEntryHandle* entry){
return &EntryHandles.back();
}
IEntryHandle* StandardDatabase::newEntry(IGroupHandle* group){
IEntryHandle* Kdb3Database::newEntry(IGroupHandle* group){
StdEntry Entry;
Entry.Uuid.generate();
Entry.Group=((GroupHandle*)group)->Group;
@ -1493,7 +1518,7 @@ IEntryHandle* StandardDatabase::newEntry(IGroupHandle* group){
return &EntryHandles.back();
}
IEntryHandle* StandardDatabase::addEntry(const CEntry* NewEntry, IGroupHandle* Group){
IEntryHandle* Kdb3Database::addEntry(const CEntry* NewEntry, IGroupHandle* Group){
StdEntry Entry(*((StdEntry*)NewEntry));
Entry.Uuid.generate();
Entry.Group=((GroupHandle*)Group)->Group;
@ -1505,12 +1530,12 @@ IEntryHandle* StandardDatabase::addEntry(const CEntry* NewEntry, IGroupHandle* G
return &EntryHandles.back();
}
void StandardDatabase::deleteLastEntry(){
void Kdb3Database::deleteLastEntry(){
Entries.removeAt(Entries.size()-1);
EntryHandles.back().invalidate();
}
bool StandardDatabase::isParent(IGroupHandle* parent, IGroupHandle* child){
bool Kdb3Database::isParent(IGroupHandle* parent, IGroupHandle* child){
StdGroup* group=((GroupHandle*)child)->Group;
while(group->Parent!=&RootGroup){
if(group->Parent==((GroupHandle*)parent)->Group)return true;
@ -1521,9 +1546,9 @@ bool StandardDatabase::isParent(IGroupHandle* parent, IGroupHandle* child){
void StandardDatabase::cleanUpHandles(){}
void Kdb3Database::cleanUpHandles(){}
bool StandardDatabase::searchStringContains(const QString& search, const QString& string,bool Cs, bool RegExp){
bool Kdb3Database::searchStringContains(const QString& search, const QString& string,bool Cs, bool RegExp){
if(RegExp){
QRegExp exp(search,Cs ? Qt::CaseSensitive : Qt::CaseInsensitive);
if(string.contains(exp)==0)return false;}
@ -1533,14 +1558,14 @@ bool StandardDatabase::searchStringContains(const QString& search, const QString
return true;
}
void StandardDatabase::getEntriesRecursive(IGroupHandle* Group, QList<IEntryHandle*>& EntryList){
void Kdb3Database::getEntriesRecursive(IGroupHandle* Group, QList<IEntryHandle*>& EntryList){
EntryList<<entries(Group);
for(int i=0;i<((GroupHandle*)Group)->Group->Childs.size(); i++){
getEntriesRecursive(((GroupHandle*)Group)->Group->Childs[i]->Handle,EntryList);
}
}
QList<IEntryHandle*> StandardDatabase::search(IGroupHandle* Group,const QString& search, bool CaseSensitive, bool RegExp, bool Recursive,bool* Fields){
QList<IEntryHandle*> Kdb3Database::search(IGroupHandle* Group,const QString& search, bool CaseSensitive, bool RegExp, bool Recursive,bool* Fields){
bool fields[6]={true,true,true,false,true,true};
if(!Fields)
Fields=fields;
@ -1574,13 +1599,13 @@ QList<IEntryHandle*> StandardDatabase::search(IGroupHandle* Group,const QString&
return SearchEntries;
}
void StandardDatabase::rebuildIndices(QList<StdGroup*>& list){
void Kdb3Database::rebuildIndices(QList<StdGroup*>& list){
for(int i=0;i<list.size();i++){
list[i]->Index=i;
}
}
bool StandardDatabase::createKeyFile(const QString& filename,int length, bool Hex){
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());
@ -1613,7 +1638,7 @@ bool StandardDatabase::createKeyFile(const QString& filename,int length, bool He
}
void StandardDatabase::moveGroup(IGroupHandle* groupHandle,IGroupHandle* NewParent,int Pos){
void Kdb3Database::moveGroup(IGroupHandle* groupHandle,IGroupHandle* NewParent,int Pos){
StdGroup* Parent;
StdGroup* Group=((GroupHandle*)groupHandle)->Group;
if(NewParent)
@ -1634,7 +1659,7 @@ void StandardDatabase::moveGroup(IGroupHandle* groupHandle,IGroupHandle* NewPare
rebuildIndices(Parent->Childs);
}
bool StandardDatabase::changeFile(const QString& filename){
bool Kdb3Database::changeFile(const QString& filename){
if(File)
delete File;
if(filename==QString()){

@ -49,15 +49,15 @@ void memcpyToLEnd32(char* src,const quint32* dst);
void memcpyToLEnd16(char* src,const quint16* dst);
//! Implementation of the standard KeePassX database.
class StandardDatabase:public ICustomIcons,public IDatabase, public IFilePasswordAuth, public IKdbSettings{
class Kdb3Database:public ICustomIcons,public IDatabase, public IFilePasswordAuth, public IKdbSettings{
Q_OBJECT
public:
class StdGroup;
class StdEntry;
class EntryHandle:public IEntryHandle{
friend class StandardDatabase;
friend class Kdb3Database;
public:
EntryHandle(StandardDatabase* db);
EntryHandle(Kdb3Database* db);
virtual void setImage(const quint32& ImageID);
void setOldImage(const quint32& OldImgID);
virtual void setTitle(const QString& Title);
@ -96,12 +96,12 @@ public:
bool valid;
unsigned int ListIndex;
KpxUuid Uuid;
StandardDatabase* pDB;
Kdb3Database* pDB;
StdEntry* Entry;
};
class GroupHandle:public IGroupHandle{
friend class StandardDatabase;
GroupHandle(StandardDatabase* db);
friend class Kdb3Database;
GroupHandle(Kdb3Database* db);
public:
virtual void setTitle(const QString& Title);
virtual void setImage(const quint32& ImageId);
@ -121,7 +121,7 @@ public:
void invalidate(){valid=false;}
bool valid;
StdGroup* Group;
StandardDatabase* pDB;
Kdb3Database* pDB;
};
friend class EntryHandle;
friend class GroupHandle;
@ -143,7 +143,7 @@ public:
QList<StdGroup*> Childs;
QList<StdEntry*> Entries;
};
virtual ~StandardDatabase(){};
virtual ~Kdb3Database(){};
virtual bool load(QString identifier);
virtual bool save();
virtual bool close();
@ -173,6 +173,8 @@ public:
virtual QList<IEntryHandle*> entries();
virtual QList<IEntryHandle*> entries(IGroupHandle* Group);
virtual QList<IEntryHandle*> expiredEntries();
virtual IEntryHandle* cloneEntry(const IEntryHandle* entry);
virtual void deleteEntry(IEntryHandle* entry);
virtual void deleteEntries(QList<IEntryHandle*> entries);

@ -38,7 +38,7 @@
(b)[(i) + 3] = (quint8) ( (n) ); \
}
void SHA256::hashBuffer(void* input, void* digest, quint32 length){
void SHA256::hashBuffer(const void* input, void* digest, quint32 length){
sha256_context ctx;
sha256_starts(&ctx);
sha256_update(&ctx,(quint8*)input,length);

@ -40,7 +40,7 @@ class SHA256{
SHA256(){sha256_starts(&ctx);}
void update(void* input,quint32 length){sha256_update(&ctx,(quint8*)input,length);}
void finish(void* digest){sha256_finish(&ctx,(quint8*)digest);}
static void hashBuffer(void* input, void* digest,quint32 length);
static void hashBuffer(const void* input, void* digest,quint32 length);
private:
sha256_context ctx;
};

@ -22,15 +22,15 @@
#include <qlabel.h>
#include <qdialog.h>
#include <qfile.h>
#include <QPainter>
#include "main.h"
#include "AboutDlg.h"
CAboutDialog::CAboutDialog(QWidget* parent,bool modal, Qt::WFlags fl)
: QDialog(parent,fl)
AboutDialog::AboutDialog(QWidget* parent):QDialog(parent)
{
setupUi(this);
createBanner(Banner,Icon_Key32x32,tr("KeePassX %1").arg(KEEPASS_VERSION));
createBanner(&BannerPixmap,getPixmap("keepassx_large"),tr("KeePassX %1").arg(KEEPASS_VERSION),width());
loadLicFromFile();
QString AboutTr=tr("<b>Current Translation: None</b><br><br>","Please replace 'None' with the language of your translation");
@ -61,17 +61,19 @@ str+="<u>"+tr("James Nicholls")+"</u><br>"+tr("Main Application Icon")/*+"<br>"+
Edit_Thanks->setHtml(str);
}
CAboutDialog::~CAboutDialog()
{
void AboutDialog::paintEvent(QPaintEvent *event){
QDialog::paintEvent(event);
QPainter painter(this);
painter.setClipRegion(event->region());
painter.drawPixmap(QPoint(0,0),BannerPixmap);
}
void CAboutDialog::OnClose()
void AboutDialog::OnClose()
{
close();
}
void CAboutDialog::loadLicFromFile(){
void AboutDialog::loadLicFromFile(){
QFile gpl(AppDir+"/../share/keepass/license.html");
if(!gpl.exists()){
@ -95,11 +97,11 @@ Edit_License->setHtml(QString::fromUtf8(buffer,l));
delete buffer;
}
void CAboutDialog::OnHomepageClicked(){
void AboutDialog::OnHomepageClicked(){
openBrowser(tr("http://keepassx.sf.net"));
}
void CAboutDialog::OnEMailClicked(){
void AboutDialog::OnEMailClicked(){
openBrowser("mailto:keepassx@gmail.com");
}

@ -1,6 +1,6 @@
/***************************************************************************
* Copyright (C) 2005 by Tarek Saidi *
* tarek@linux *
* Copyright (C) 2005-2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* 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 *
@ -19,25 +19,30 @@
***************************************************************************/
#ifndef _ABOUTDIALOG_H_
#define _ABOUTDIALOG_H_
#include <QPaintEvent>
#include <QPixmap>
#include "ui_AboutDlg.h"
#include "lib/UrlLabel.h"
#include "main.h"
class CAboutDialog : public QDialog, public Ui_AboutDlg
class AboutDialog : public QDialog, public Ui_AboutDlg
{
Q_OBJECT
public:
CAboutDialog(QWidget* parent = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
~CAboutDialog();
AboutDialog(QWidget* parent);
public slots:
virtual void OnClose();
void OnHomepageClicked();
void OnEMailClicked();
private:
QPixmap BannerPixmap;
inline void loadLicFromFile();
virtual void paintEvent(QPaintEvent*);
};
#endif

@ -0,0 +1,29 @@
/***************************************************************************
* Copyright (C) 2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* 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 *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "main.h"
#include "CalendarDlg.h"
CalendarDialog::CalendarDialog(QWidget* parent, const QDate& Start):QDialog(parent){
setupUi(this);
calendarWidget->setSelectedDate(Start);
setWindowIcon(getIcon("clock"));
setWindowFlags(Qt::Sheet);
}

@ -0,0 +1,35 @@
/***************************************************************************
* Copyright (C) 2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* 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 *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _CALENDAR_DLG_H_
#define _CALENDAR_DLG_H_
#include <QDate>
#include "ui_CalendarDlg.h"
class CalendarDialog:public QDialog, public Ui_CalendarDialog{
Q_OBJECT
public:
CalendarDialog(QWidget* parent, const QDate& Start=QDate::currentDate());
};
#endif

@ -26,7 +26,7 @@
CollectEntropyDlg::CollectEntropyDlg(QWidget* parent):QDialog(parent){
setupUi(this);
createBanner(&BannerPixmap,Icon_Key32x32,tr("Entropy Collection"),width());
createBanner(&BannerPixmap,getPixmap("dice"),tr("Entropy Collection"),width());
KeyEntropyBuffer=new unsigned char[105];
MouseEntropyBuffer=new quint16[210];
KeyCounter=0;

@ -0,0 +1,217 @@
/***************************************************************************
* Copyright (C) 2005-2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* 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 *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <QTextCursor>
#include <QTextBlockFormat>
#include <QLineEdit>
#include <QPushButton>
#include <QColorDialog>
#include <QPixmap>
#include <QMenu>
#include "main.h"
#include "CustomizeDetailViewDlg.h"
bool DisableButtonSlots=false;
CustomizeDetailViewDialog::CustomizeDetailViewDialog(QWidget* parent):QDialog(parent){
setupUi(this);
BtnBold->setIcon(getIcon("text_bold"));
BtnItalic->setIcon(getIcon("text_italic"));
BtnUnderline->setIcon(getIcon("text_under"));
BtnAlignLeft->setIcon(getIcon("text_left"));
BtnAlignRight->setIcon(getIcon("text_right"));
BtnAlignCenter->setIcon(getIcon("text_center"));
BtnAlignBlock->setIcon(getIcon("text_block"));
BtnTemplates->setIcon(getIcon("templates"));
QMenu* tmplmenu=new QMenu();
tmplmenu->addAction(tr("Group"))->setData("%group%");
tmplmenu->addAction(tr("Title"))->setData("%title%");
tmplmenu->addAction(tr("Username"))->setData("%username%");
tmplmenu->addAction(tr("Password"))->setData("%password%");
tmplmenu->addAction(tr("Url"))->setData("%url%");
tmplmenu->addAction(tr("Comment"))->setData("%comment%");
tmplmenu->addAction(tr("Attachment Name"))->setData("%attachment%");
tmplmenu->addAction(tr("Creation Date"))->setData("%creation%");
tmplmenu->addAction(tr("Last Access Date"))->setData("%lastaccess%");
tmplmenu->addAction(tr("Last Modification Date"))->setData("%lastmod%");
tmplmenu->addAction(tr("Expiration Date"))->setData("%expire%");
tmplmenu->addAction(tr("Time till Expiration"))->setData("%expire-timeleft%");
BtnTemplates->setMenu(tmplmenu);
connect(BtnBold,SIGNAL(toggled(bool)),this,SLOT(OnBtnBold(bool)));
connect(BtnItalic,SIGNAL(toggled(bool)),this,SLOT(OnBtnItalic(bool)));
connect(BtnUnderline,SIGNAL(toggled(bool)),this,SLOT(OnBtnUnderline(bool)));
connect(BtnAlignLeft,SIGNAL(toggled(bool)),this,SLOT(OnBtnAlignLeft(bool)));
connect(BtnAlignRight,SIGNAL(toggled(bool)),this,SLOT(OnBtnAlignRight(bool)));
connect(BtnAlignCenter,SIGNAL(toggled(bool)),this,SLOT(OnBtnAlignCenter(bool)));
connect(BtnAlignBlock,SIGNAL(toggled(bool)),this,SLOT(OnBtnAlignBlock(bool)));
connect(BtnColor,SIGNAL(clicked()),this,SLOT(OnBtnColor()));
connect(ButtonSave,SIGNAL(clicked()),this,SLOT(OnSave()));
connect(ButtonCancel,SIGNAL(clicked()),this,SLOT(OnCancel()));
connect(ButtonRestore,SIGNAL(clicked()),this,SLOT(OnRestoreDefault()));
connect(tmplmenu,SIGNAL(triggered(QAction*)),this,SLOT(OnInsertTemplate(QAction*)));
connect(RichEdit,SIGNAL(cursorPositionChanged()),this,SLOT(OnCursorPositionChanged()));
connect(TabWidget,SIGNAL(currentChanged(int)),this,SLOT(OnTabChanged(int)));
connect(FontSize,SIGNAL(activated(const QString&)),this,SLOT(OnFontSizeChanged(const QString&)));
connect(FontSize->lineEdit(),SIGNAL(returnPressed()),this,SLOT(OnFontSizeChanged()));
RichEdit->setHtml(DetailViewTemplate);
OnCursorPositionChanged();
}
void CustomizeDetailViewDialog::OnTabChanged(int index){
if(index==0){
RichEdit->setHtml(HtmlEdit->toPlainText());
}
if(index==1){
HtmlEdit->setPlainText(RichEdit->toHtml());
}
}
void CustomizeDetailViewDialog::OnFontSizeChanged(const QString& text){
bool ok=false;
int size=text.toInt(&ok);
if(ok && size > 0){
RichEdit->setFontPointSize(size);
}
}
void CustomizeDetailViewDialog::OnCursorPositionChanged(){
DisableButtonSlots=true;
if(RichEdit->fontWeight()==QFont::Bold)BtnBold->setChecked(true);
else BtnBold->setChecked(false);
BtnItalic->setChecked(RichEdit->fontItalic());
BtnUnderline->setChecked(RichEdit->fontUnderline());
switch(RichEdit->alignment()){
case Qt::AlignLeft:
BtnAlignLeft->setChecked(true);
BtnAlignCenter->setChecked(false);
BtnAlignRight->setChecked(false);
BtnAlignBlock->setChecked(false);
break;
case Qt::AlignHCenter:
BtnAlignLeft->setChecked(false);
BtnAlignCenter->setChecked(true);
BtnAlignRight->setChecked(false);
BtnAlignBlock->setChecked(false);
break;
case Qt::AlignRight:
BtnAlignLeft->setChecked(false);
BtnAlignCenter->setChecked(false);
BtnAlignRight->setChecked(true);
BtnAlignBlock->setChecked(false);
break;
case Qt::AlignJustify:
BtnAlignLeft->setChecked(false);
BtnAlignCenter->setChecked(false);
BtnAlignRight->setChecked(false);
BtnAlignBlock->setChecked(true);
break;
}
CurrentColor=RichEdit->textColor();
QPixmap pixmap=QPixmap(16,16);
pixmap.fill(CurrentColor);
BtnColor->setIcon(QIcon(pixmap));
if(RichEdit->fontPointSize()>0)
FontSize->lineEdit()->setText(QString::number((int)RichEdit->fontPointSize()));
else
FontSize->lineEdit()->setText("9");
DisableButtonSlots=false;
}
void CustomizeDetailViewDialog::OnBtnBold(bool toggled){
if(DisableButtonSlots)return;
if(toggled)
RichEdit->setFontWeight(QFont::Bold);
else
RichEdit->setFontWeight(QFont::Normal);
}
void CustomizeDetailViewDialog::OnBtnItalic(bool toggled){
if(DisableButtonSlots)return;
RichEdit->setFontItalic(toggled);
}
void CustomizeDetailViewDialog::OnBtnUnderline(bool toggled){
if(DisableButtonSlots)return;
RichEdit->setFontUnderline(toggled);
}
void CustomizeDetailViewDialog::OnBtnAlignLeft(bool toggled){
if(DisableButtonSlots)return;
RichEdit->setAlignment(Qt::AlignLeft);
OnCursorPositionChanged();
}
void CustomizeDetailViewDialog::OnBtnAlignRight(bool toggled){
if(DisableButtonSlots)return;
RichEdit->setAlignment(Qt::AlignRight);
OnCursorPositionChanged();
}
void CustomizeDetailViewDialog::OnBtnAlignCenter(bool toggled){
if(DisableButtonSlots)return;
RichEdit->setAlignment(Qt::AlignHCenter);
OnCursorPositionChanged();
}
void CustomizeDetailViewDialog::OnBtnAlignBlock(bool toggled){
if(DisableButtonSlots)return;
RichEdit->setAlignment(Qt::AlignJustify);
OnCursorPositionChanged();
}
void CustomizeDetailViewDialog::OnBtnColor(){
CurrentColor=QColorDialog::getColor(CurrentColor,this);
QPixmap pixmap=QPixmap(16,16);
pixmap.fill(CurrentColor);
BtnColor->setIcon(QIcon(pixmap));
RichEdit->setTextColor(CurrentColor);
}
void CustomizeDetailViewDialog::OnInsertTemplate(QAction* action){
RichEdit->insertPlainText(action->data().toString());
}
void CustomizeDetailViewDialog::OnSave(){
if(TabWidget->currentIndex()==0)
DetailViewTemplate=RichEdit->toHtml();
else if(TabWidget->currentIndex()==1)
DetailViewTemplate=HtmlEdit->toPlainText();
done(1);
}
void CustomizeDetailViewDialog::OnCancel(){
done(0);
}
void CustomizeDetailViewDialog::OnRestoreDefault(){
loadDefaultDetailViewTemplate();
HtmlEdit->setPlainText(DetailViewTemplate);
RichEdit->setHtml(DetailViewTemplate);
}

@ -0,0 +1,55 @@
/***************************************************************************
* Copyright (C) 2005-2006 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* 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 *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _CUSTOMIZE_DETAIL_VIEW_H_
#define _CUSTOMIZE_DETAIL_VIEW_H_
#include "ui_CustomizeDetailViewDlg.h";
#include <QColor>
#include <QAction>
class CustomizeDetailViewDialog : public QDialog, public Ui_CustomizeDetailViewDialog{
Q_OBJECT
public:
CustomizeDetailViewDialog(QWidget* parent);
private slots:
void OnBtnBold(bool);
void OnBtnItalic(bool);
void OnBtnUnderline(bool);
void OnBtnAlignLeft(bool);
void OnBtnAlignRight(bool);
void OnBtnAlignCenter(bool);
void OnBtnAlignBlock(bool);
void OnBtnColor();
void OnSave();
void OnCancel();
void OnRestoreDefault();
void OnInsertTemplate(QAction*);
void OnCursorPositionChanged();
void OnTabChanged(int index);
void OnFontSizeChanged(const QString& text=QString());
private:
QColor CurrentColor;
};
#endif

@ -32,7 +32,7 @@ CDbSettingsDlg::CDbSettingsDlg(QWidget* parent,IDatabase* db, bool modal, Qt::W
{
setupUi(this);
database=dynamic_cast<IKdbSettings*>(db);
createBanner(&BannerPixmap,Icon_Settings32x32,tr("Settings"),width());
createBanner(&BannerPixmap,getPixmap("appsettings"),tr("Settings"),width());
ComboAlgo->insertItem(0,tr("AES(Rijndael): 256 Bit (default)"));
ComboAlgo->insertItem(1,tr("Twofish: 256 Bit"));
ComboAlgo->setCurrentIndex(database->cryptAlgorithm()); //Achtung: AlgoID muss gleich dem ComboBox Index sein!

@ -41,6 +41,7 @@
#include "SelectIconDlg.h"
#include "PasswordGenDlg.h"
#include "EditEntryDlg.h"
#include "CalendarDlg.h"
@ -52,10 +53,8 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
entry=_entry;
db=_db;
setupUi(this);
//not sure if this createBanner is still needed
createBanner(&BannerPixmap,Icon_Key32x32,tr("Edit Entry"),width());
//end
ModFlag=false;
QMenu *ExpirePresetsMenu=new QMenu();
connect(Edit_Password_w, SIGNAL(editingFinished()), this, SLOT(OnPasswordwLostFocus()));
connect(Edit_Password_w, SIGNAL(textChanged(const QString&)), this, SLOT( OnPasswordwTextChanged(const QString&)));
connect(Edit_Password, SIGNAL(textChanged(const QString&)), this, SLOT( OnPasswordTextChanged(const QString&)));
@ -68,10 +67,28 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
connect(buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()),this,SLOT(OnButtonOK()));
connect(CheckBox_ExpiresNever,SIGNAL(stateChanged(int)),this,SLOT(OnCheckBoxExpiresNeverChanged(int)));
connect(Button_CustomIcons,SIGNAL(clicked()),this,SLOT(OnCustomIcons()));
ButtonOpenAttachment->setIcon(*Icon_FileOpen);
ButtonDeleteAttachment->setIcon(*Icon_EditDelete);
ButtonSaveAttachment->setIcon(*Icon_FileSave);
connect(ExpirePresetsMenu,SIGNAL(triggered(QAction*)),this,SLOT(OnExpirePreset(QAction*)));
connect(ButtonExpirePresets,SIGNAL(triggered(QAction*)),this,SLOT(OnCalendar(QAction*)));
// QAction::data() contains the time until expiration in days.
ExpirePresetsMenu->addAction(tr("Today"))->setData(0);
ExpirePresetsMenu->addSeparator();
ExpirePresetsMenu->addAction(tr("1 Week"))->setData(7);
ExpirePresetsMenu->addAction(tr("2 Weeks"))->setData(14);
ExpirePresetsMenu->addAction(tr("3 Weeks"))->setData(21);
ExpirePresetsMenu->addSeparator();
ExpirePresetsMenu->addAction(tr("1 Month"))->setData(30);
ExpirePresetsMenu->addAction(tr("3 Months"))->setData(60);
ExpirePresetsMenu->addAction(tr("6 Months"))->setData(180);
ExpirePresetsMenu->addSeparator();
ExpirePresetsMenu->addAction(tr("1 Year"))->setData(365);
ButtonExpirePresets->setMenu(ExpirePresetsMenu);
ButtonExpirePresets->setDefaultAction(new QAction(tr("Calendar..."),ButtonExpirePresets));
ButtonOpenAttachment->setIcon(getIcon("fileopen"));
ButtonDeleteAttachment->setIcon(getIcon("filedelete"));
ButtonSaveAttachment->setIcon(getIcon("filesave"));
ButtonExpirePresets->setIcon(getIcon("clock"));
setWindowTitle(entry->title());
@ -136,9 +153,8 @@ if(event->spontaneous()==false){
}
}
//Added resize event
void CEditEntryDlg::resizeEvent(QResizeEvent *event){
createBanner(&BannerPixmap,Icon_Key32x32,tr("Test 2"),width());
createBanner(&BannerPixmap,getPixmap("keepassx_large"),tr("Test 2"),width());
QDialog::resizeEvent(event);
}
@ -382,14 +398,11 @@ void CEditEntryDlg::OnButtonGenPw()
void CEditEntryDlg::OnCheckBoxExpiresNeverChanged(int state){
if(state==Qt::Unchecked){
if(state==Qt::Unchecked)
DateTime_Expire->setDisabled(false);
}
else
{
DateTime_Expire->setDisabled(true);
}
}
void CEditEntryDlg::OnCustomIcons(){
CSelectIconDlg dlg(db,Combo_IconPicker->currentIndex(),this);
@ -402,3 +415,18 @@ if(r!=-1){
}
}
void CEditEntryDlg::OnExpirePreset(QAction* action){
CheckBox_ExpiresNever->setChecked(false);
DateTime_Expire->setDate(QDate::fromJulianDay(QDate::currentDate().toJulianDay()+action->data().toInt()));
DateTime_Expire->setTime(QTime(0,0,0));
}
void CEditEntryDlg::OnCalendar(QAction* action){
CalendarDialog dlg(this);
if(dlg.exec()==QDialog::Accepted){
CheckBox_ExpiresNever->setChecked(false);
DateTime_Expire->setDate(dlg.calendarWidget->selectedDate());
DateTime_Expire->setTime(QTime(0,0,0));
}
}

@ -1,6 +1,6 @@
/***************************************************************************
* Copyright (C) 2005 by Tarek Saidi *
* tarek@linux *
* Copyright (C) 2005-2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* 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 *
@ -56,15 +56,14 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
void OnCheckBoxExpiresNeverChanged(int state);
void OnCustomIcons();
void OnButtonOK();
void OnExpirePreset(QAction*);
void OnCalendar(QAction*);
private:
virtual void showEvent(QShowEvent *);
virtual void paintEvent(QPaintEvent*);
// Added resizeEvent
virtual void resizeEvent(QResizeEvent *);
};
#endif

@ -0,0 +1,63 @@
/***************************************************************************
* Copyright (C) 2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* 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 *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <QTreeWidget>
#include <QPainter>
#include <QPaintEvent>
#include <QResizeEvent>
#include "main.h"
#include "ExpiredEntriesDlg.h"
ExpiredEntriesDialog::ExpiredEntriesDialog(QWidget* parent,IDatabase* database,const QList<IEntryHandle*>& ExpiredEntries):QDialog(parent){
setupUi(this);
Entries=ExpiredEntries;
for(int i=0;i<Entries.size();i++){
QTreeWidgetItem* item=new QTreeWidgetItem(treeWidget);
item->setData(0,Qt::UserRole,i);
item->setText(0,Entries[i]->group()->title());
item->setText(1,Entries[i]->title());
item->setText(2,Entries[i]->username());
item->setText(3,Entries[i]->expire().dateToString(Qt::LocalDate));
item->setIcon(0,database->icon(Entries[i]->group()->image()));
item->setIcon(1,database->icon(Entries[i]->image()));
}
connect(treeWidget,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(OnItemDoubleClicked(QTreeWidgetItem*,int)));
}
void ExpiredEntriesDialog::paintEvent(QPaintEvent* event){
QDialog::paintEvent(event);
QPainter painter(this);
painter.setClipRegion(event->region());
painter.drawPixmap(QPoint(0,0),BannerPixmap);
}
void ExpiredEntriesDialog::resizeEvent(QResizeEvent* event){
createBanner(&BannerPixmap,getPixmap("alarmclock"),tr("Expried Entries of the Database"),width());
QDialog::resizeEvent(event);
}
void ExpiredEntriesDialog::OnItemDoubleClicked(QTreeWidgetItem* item, int column){
SelectedEntry=Entries[item->data(0,Qt::UserRole).toInt()];
accept();
}
///TODO 0.2.3 locale aware string/date compare for correct sorting

@ -0,0 +1,47 @@
/***************************************************************************
* Copyright (C) 2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* 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 *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _EXP_ENTRIES_DLG_
#define _EXP_ENTRIES_DLG_
#include <QList>
#include <QPixmap>
#include "ui_ExpiredEntriesDlg.h"
#include "Database.h"
class ExpiredEntriesDialog:public QDialog, public Ui_ExpiredEntriesDialog{
Q_OBJECT
public:
ExpiredEntriesDialog(QWidget* parent,IDatabase* database,const QList<IEntryHandle*>& Entries);
IEntryHandle* SelectedEntry;
private:
QList<IEntryHandle*> Entries;
QPixmap BannerPixmap;
virtual void paintEvent(QPaintEvent*);
virtual void resizeEvent(QResizeEvent *);
private slots:
void OnItemDoubleClicked(QTreeWidgetItem*,int);
};
#endif

@ -1,6 +1,6 @@
/***************************************************************************
* Copyright (C) 2005-2006 by Tarek Saidi *
* tarek@linux *
* tarek.saidi@arcor.de *
* *
* 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 *
@ -38,7 +38,7 @@ CPasswordDialog::CPasswordDialog(QWidget* parent,IDatabase* DB,bool ShowExitButt
: QDialog(parent)
{
setupUi(this);
createBanner(Banner,Icon_Key32x32,tr("Database Key"));
createBanner(Banner,getPixmap("key"),tr("Database Key"));
db=DB;
QDir media(config.MountDir);
if(media.exists()){

@ -37,7 +37,7 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl)
: QDialog(parent,fl)
{
setupUi(this);
createBanner(&BannerPixmap,Icon_Key32x32,tr("Password Generator"),width());
createBanner(&BannerPixmap,getPixmap("dice"),tr("Password Generator"),width());
connect(ButtonGenerate,SIGNAL(clicked()),this,SLOT(OnGeneratePw()));
connect(Radio_1,SIGNAL(toggled(bool)),this,SLOT(OnRadio1StateChanged(bool)));

@ -23,20 +23,20 @@
#include <QCheckBox>
#include <QRegExp>
#include <QMessageBox>
#include <QPainter>
#include "main.h"
#include "PwmConfig.h"
#include "SearchDlg.h"
CSearchDlg::CSearchDlg(IDatabase* database,IGroupHandle* Group,QWidget* parent, bool modal, Qt::WFlags fl)
: QDialog(parent,fl)
SearchDialog::SearchDialog(IDatabase* database,IGroupHandle* Group,QWidget* parent):QDialog(parent)
{
setupUi(this);
connect( Button_Search, SIGNAL( clicked() ), this, SLOT( OnSearch() ) );
connect( Button_Close, SIGNAL( clicked() ), this, SLOT( OnClose() ) );
db=database;
group=Group;
createBanner(Banner,Icon_Search32x32,tr("Search"));
createBanner(&BannerPixmap,getPixmap("search"),tr("Search"),width());
checkBox_Cs->setChecked(config.SearchOptions[0]);
checkBox_regExp->setChecked(config.SearchOptions[1]);
checkBox_Title->setChecked(config.SearchOptions[2]);
@ -49,10 +49,11 @@ if(group)
checkBox_Recursive->setChecked(config.SearchOptions[8]);
else{
checkBox_Recursive->setChecked(false);
checkBox_Recursive->setEnabled(false);}
checkBox_Recursive->setEnabled(false);
}
}
CSearchDlg::~CSearchDlg()
SearchDialog::~SearchDialog()
{
config.SearchOptions[0]=checkBox_Cs->isChecked();
config.SearchOptions[1]=checkBox_regExp->isChecked();
@ -65,12 +66,12 @@ config.SearchOptions[7]=checkBox_Attachment->isChecked();
if(group) config.SearchOptions[8]=checkBox_Recursive->isChecked();
}
void CSearchDlg::OnClose()
void SearchDialog::OnClose()
{
done(0);
}
void CSearchDlg::OnSearch()
void SearchDialog::OnSearch()
{
bool Fields[6];
Fields[0]=checkBox_Title->isChecked();
@ -83,6 +84,12 @@ void CSearchDlg::OnSearch()
done(1);
}
void SearchDialog::paintEvent(QPaintEvent *event){
QDialog::paintEvent(event);
QPainter painter(this);
painter.setClipRegion(event->region());
painter.drawPixmap(QPoint(0,0),BannerPixmap);
}

@ -19,16 +19,19 @@
***************************************************************************/
#ifndef SEARCHDLG_H
#define SEARCHDLG_H
#include <QPaintEvent>
#include <QPixmap>
#include "ui_SearchDlg.h"
#include "main.h"
#include "Database.h"
class CSearchDlg : public QDialog, public Ui_Search_Dlg
class SearchDialog : public QDialog, public Ui_Search_Dlg
{
Q_OBJECT
public:
CSearchDlg(IDatabase* database, IGroupHandle* group=NULL,QWidget* parent = 0, bool modal = true, Qt::WFlags fl = 0 );
~CSearchDlg();
SearchDialog(IDatabase* database, IGroupHandle* group,QWidget* parent);
~SearchDialog();
QList<IEntryHandle*> Result;
public slots:
@ -36,8 +39,10 @@ public slots:
virtual void OnSearch();
private:
QPixmap BannerPixmap;
IGroupHandle* group;
IDatabase* db;
virtual void paintEvent(QPaintEvent*);
};
#endif

@ -34,8 +34,8 @@ CSelectIconDlg::CSelectIconDlg(IDatabase* database,int CurrentId,QWidget* parent
db=database;
Id=CurrentId;
CtxMenu=new QMenu(this);
ReplaceAction=CtxMenu->addAction(*Icon_Swap,tr("Replace..."));
DeleteAction=CtxMenu->addAction(*Icon_EditDelete,tr("Delete"));
ReplaceAction=CtxMenu->addAction(getIcon("swap"),tr("Replace..."));
DeleteAction=CtxMenu->addAction(getIcon("delete"),tr("Delete"));
connect(Button_AddIcon, SIGNAL(clicked()), this, SLOT(OnAddIcon()));
connect(Button_PickIcon, SIGNAL(clicked()), this, SLOT(OnPickIcon()));
connect(Button_Cancel, SIGNAL(clicked()), this, SLOT(OnCancel()));

@ -29,6 +29,7 @@
#include <QDir>
#include <QPainter>
#include "SettingsDlg.h"
#include "CustomizeDetailViewDlg.h"
bool CSettingsDlg::PluginsModified=false;
@ -51,9 +52,10 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
connect(Radio_IntPlugin_Kde,SIGNAL(toggled(bool)),this,SLOT(OnIntPluginKde(bool)));
connect(CheckBox_BrowserDefault,SIGNAL(stateChanged(int)),this,SLOT(OnCheckBoxBrowserDefaultChanged(int)));
connect(Button_CustomizeEntryDetails,SIGNAL(clicked()),this,SLOT(OnCustomizeEntryDetails()));
createBanner(&BannerPixmap,Icon_Settings32x32,tr("Settings"),width());
createBanner(&BannerPixmap,getPixmap("appsettings"),tr("Settings"),width());
//General
CheckBox_OpenLast->setChecked(settings->value("OpenLastFile",true).toBool());
@ -161,12 +163,12 @@ void CSettingsDlg::OnCheckBoxBrowserDefaultChanged(int state){
void CSettingsDlg::OnOK()
{
apply();
close();
accept();
}
void CSettingsDlg::OnCancel()
{
close();
reject();
}
void CSettingsDlg::OnOtherButton(QAbstractButton* button){
@ -227,7 +229,7 @@ void CSettingsDlg::OnTextColor()
px->fill(c);
pixmTextColor->clear();
pixmTextColor->setPixmap(*px);
createBanner(&BannerPixmap,Icon_Settings32x32,tr("Settings"),width(),color1,color2,textcolor);
createBanner(&BannerPixmap,getPixmap("appsettings"),tr("Settings"),width(),color1,color2,textcolor);
}
}
@ -241,7 +243,7 @@ void CSettingsDlg::OnColor2()
px->fill(c);
pixmColor2->clear();
pixmColor2->setPixmap(*px);
createBanner(&BannerPixmap,Icon_Settings32x32,tr("Settings"),width(),color1,color2,textcolor);
createBanner(&BannerPixmap,getPixmap("appsettings"),tr("Settings"),width(),color1,color2,textcolor);
}
}
@ -255,7 +257,7 @@ void CSettingsDlg::OnColor1()
px->fill(c);
pixmColor1->clear();
pixmColor1->setPixmap(*px);
createBanner(&BannerPixmap,Icon_Settings32x32,tr("Settings"),width(),color1,color2,textcolor);
createBanner(&BannerPixmap,getPixmap("appsettings"),tr("Settings"),width(),color1,color2,textcolor);
}
}
@ -286,3 +288,9 @@ void CSettingsDlg::OnIntPluginGnome(bool toggled){
void CSettingsDlg::OnIntPluginKde(bool toggled){
Label_IntPlugin_Info->show();
}
void CSettingsDlg::OnCustomizeEntryDetails(){
CustomizeDetailViewDialog dlg(this);
dlg.exec();
}

@ -48,6 +48,7 @@ class CSettingsDlg : public QDialog, public Ui_SettingsDialog
void OnCheckBoxOpenLastChanged(int state);
void OnCheckBoxBrowserDefaultChanged(int state);
void OnMountDirBrowse();
void OnCustomizeEntryDetails();
private:
virtual void paintEvent(QPaintEvent*);

@ -1,7 +1,4 @@
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>AboutDlg</class>
<widget class="QDialog" name="AboutDlg" >
<property name="geometry" >
@ -23,84 +20,98 @@
<property name="minimumSize" >
<size>
<width>419</width>
<height>211</height>
<height>268</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>211</width>
<width>419</width>
<height>268</height>
</size>
</property>
<property name="windowTitle" >
<string>About</string>
</property>
<widget class="QLabel" name="Banner" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>420</width>
<height>50</height>
</rect>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="pixmap" >
<pixmap/>
<property name="spacing" >
<number>6</number>
</property>
<property name="scaledContents" >
<bool>true</bool>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
</widget>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>50</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QTabWidget" name="tabWidget" >
<property name="geometry" >
<rect>
<x>10</x>
<y>60</y>
<width>401</width>
<height>201</height>
</rect>
<property name="currentIndex" >
<number>0</number>
</property>
<widget class="QWidget" name="tab" >
<attribute name="title" >
<string>About</string>
</attribute>
<widget class="QLabel" name="label" >
<property name="geometry" >
<rect>
<x>20</x>
<y>20</y>
<width>351</width>
<height>17</height>
</rect>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:12pt; font-weight:600;">KeePassX&lt;/span> - Cross Platform Password Manager&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
<widget class="QLabel" name="label_4" >
<property name="geometry" >
<rect>
<x>30</x>
<y>110</y>
<width>341</width>
<height>51</height>
</rect>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="text" >
<string>Copyright (C) 2005 - 2006 Tarek Saidi
KeePassX is distributed under the terms of the
General Public License (GPL) version 2.</string>
<property name="spacing" >
<number>6</number>
</property>
</widget>
<widget class="LinkLabel" name="label_2" >
<property name="geometry" >
<rect>
<x>30</x>
<y>50</y>
<width>351</width>
<height>17</height>
</rect>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>12</number>
</property>
<item>
<widget class="LinkLabel" name="label_2" >
<property name="text" >
<string>http://keepassx.sourceforge.net</string>
</property>
@ -108,85 +119,99 @@ General Public License (GPL) version 2.</string>
<cstring></cstring>
</property>
</widget>
</item>
<item>
<widget class="LinkLabel" name="label_3" >
<property name="geometry" >
<rect>
<x>30</x>
<y>80</y>
<width>351</width>
<height>17</height>
</rect>
</property>
<property name="text" >
<string>keepassx@gmail.com</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Copyright (C) 2005 - 2006 Tarek Saidi
KeePassX is distributed under the terms of the
General Public License (GPL) version 2 or later.</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2" >
<attribute name="title" >
<string>Credits</string>
</attribute>
<widget class="QTextEdit" name="Edit_Thanks" >
<property name="geometry" >
<rect>
<x>3</x>
<y>3</y>
<width>390</width>
<height>166</height>
</rect>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QTextEdit" name="Edit_Thanks" >
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_4" >
<attribute name="title" >
<string>Translation</string>
</attribute>
<widget class="QTextEdit" name="Edit_Translation" >
<property name="geometry" >
<rect>
<x>3</x>
<y>3</y>
<width>390</width>
<height>167</height>
</rect>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QTextEdit" name="Edit_Translation" >
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3" >
<attribute name="title" >
<string>License</string>
</attribute>
<widget class="QTextEdit" name="Edit_License" >
<property name="geometry" >
<rect>
<x>3</x>
<y>3</y>
<width>391</width>
<height>167</height>
</rect>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QTextEdit" name="Edit_License" >
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<customwidgets>
<customwidget>
<class>LinkLabel</class>
<extends>QLabel</extends>
<header>../../src/lib/UrlLabel.h</header>
<container>0</container>
<pixmap></pixmap>
</customwidget>
</customwidgets>
<resources/>

@ -0,0 +1,72 @@
<ui version="4.0" >
<class>CalendarDialog</class>
<widget class="QDialog" name="CalendarDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>334</width>
<height>238</height>
</rect>
</property>
<property name="windowTitle" >
<string>Calendar</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QCalendarWidget" name="calendarWidget" />
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>CalendarDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel" >
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>CalendarDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel" >
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

@ -0,0 +1,368 @@
<ui version="4.0" >
<class>CustomizeDetailViewDialog</class>
<widget class="QDialog" name="CustomizeDetailViewDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>531</width>
<height>402</height>
</rect>
</property>
<property name="windowTitle" >
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QTabWidget" name="TabWidget" >
<property name="currentIndex" >
<number>0</number>
</property>
<widget class="QWidget" name="tab" >
<attribute name="title" >
<string>Rich Text Editor</string>
</attribute>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QToolButton" name="BtnBold" >
<property name="toolTip" >
<string>Bold</string>
</property>
<property name="text" >
<string>B</string>
</property>
<property name="iconSize" >
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="BtnItalic" >
<property name="toolTip" >
<string>Italic</string>
</property>
<property name="text" >
<string>I</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="BtnUnderline" >
<property name="toolTip" >
<string>Underlined</string>
</property>
<property name="text" >
<string>U</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="BtnAlignLeft" >
<property name="toolTip" >
<string>Left-Aligned</string>
</property>
<property name="text" >
<string>L</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="BtnAlignCenter" >
<property name="toolTip" >
<string>Centered</string>
</property>
<property name="text" >
<string>C</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="BtnAlignRight" >
<property name="toolTip" >
<string>Right-Aligned</string>
</property>
<property name="text" >
<string>R</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="BtnAlignBlock" >
<property name="toolTip" >
<string>Justified</string>
</property>
<property name="text" >
<string>B</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="BtnColor" >
<property name="toolTip" >
<string>Text Color</string>
</property>
<property name="text" >
<string>C</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="FontSize" >
<property name="toolTip" >
<string>Font Size</string>
</property>
<property name="editable" >
<bool>true</bool>
</property>
<item>
<property name="text" >
<string>6</string>
</property>
</item>
<item>
<property name="text" >
<string>7</string>
</property>
</item>
<item>
<property name="text" >
<string>8</string>
</property>
</item>
<item>
<property name="text" >
<string>9</string>
</property>
</item>
<item>
<property name="text" >
<string>10</string>
</property>
</item>
<item>
<property name="text" >
<string>11</string>
</property>
</item>
<item>
<property name="text" >
<string>12</string>
</property>
</item>
<item>
<property name="text" >
<string>14</string>
</property>
</item>
<item>
<property name="text" >
<string>16</string>
</property>
</item>
<item>
<property name="text" >
<string>18</string>
</property>
</item>
<item>
<property name="text" >
<string>20</string>
</property>
</item>
<item>
<property name="text" >
<string>22</string>
</property>
</item>
<item>
<property name="text" >
<string>24</string>
</property>
</item>
<item>
<property name="text" >
<string>26</string>
</property>
</item>
<item>
<property name="text" >
<string>28</string>
</property>
</item>
<item>
<property name="text" >
<string>36</string>
</property>
</item>
<item>
<property name="text" >
<string>42</string>
</property>
</item>
<item>
<property name="text" >
<string>78</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QToolButton" name="BtnTemplates" >
<property name="toolTip" >
<string>Templates</string>
</property>
<property name="text" >
<string>T</string>
</property>
<property name="popupMode" >
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="arrowType" >
<enum>Qt::NoArrow</enum>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QTextEdit" name="RichEdit" />
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2" >
<attribute name="title" >
<string>HTML</string>
</attribute>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QTextEdit" name="HtmlEdit" >
<property name="acceptRichText" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="ButtonRestore" >
<property name="text" >
<string>Restore Default</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="ButtonSave" >
<property name="text" >
<string>Save</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonCancel" >
<property name="text" >
<string>Cancel</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -361,6 +361,16 @@
<item>
<widget class="QDateTimeEdit" name="DateTime_Expire" />
</item>
<item>
<widget class="QToolButton" name="ButtonExpirePresets" >
<property name="text" >
<string>...</string>
</property>
<property name="popupMode" >
<enum>QToolButton::MenuButtonPopup</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="CheckBox_ExpiresNever" >
<property name="text" >

@ -0,0 +1,131 @@
<ui version="4.0" >
<class>ExpiredEntriesDialog</class>
<widget class="QDialog" name="ExpiredEntriesDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>588</width>
<height>408</height>
</rect>
</property>
<property name="windowTitle" >
<string>Expired Entries</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>50</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Double click on an entry to jump to it.</string>
</property>
</widget>
</item>
<item>
<widget class="QTreeWidget" name="treeWidget" >
<property name="rootIsDecorated" >
<bool>false</bool>
</property>
<property name="uniformRowHeights" >
<bool>true</bool>
</property>
<property name="itemsExpandable" >
<bool>false</bool>
</property>
<property name="sortingEnabled" >
<bool>true</bool>
</property>
<property name="allColumnsShowFocus" >
<bool>true</bool>
</property>
<column>
<property name="text" >
<string>Group</string>
</property>
</column>
<column>
<property name="text" >
<string>Title</string>
</property>
</column>
<column>
<property name="text" >
<string>Username</string>
</property>
</column>
<column>
<property name="text" >
<string>Expired</string>
</property>
</column>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>ExpiredEntriesDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel" >
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ExpiredEntriesDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel" >
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

@ -25,7 +25,11 @@
<number>6</number>
</property>
<item>
<widget class="QSplitter" name="splitter" >
<widget class="QSplitter" name="HSplitter" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<widget class="QSplitter" name="VSplitter" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
@ -79,8 +83,6 @@
</property>
</widget>
</widget>
</item>
<item>
<widget class="QTextEdit" name="DetailView" >
<property name="enabled" >
<bool>false</bool>
@ -88,21 +90,22 @@
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>4</vsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>10</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<property name="minimumSize" >
<size>
<width>16777215</width>
<height>60</height>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
@ -123,13 +126,6 @@
<addaction name="separator" />
<addaction name="HelpAboutAction" />
</widget>
<widget class="QMenu" name="menuExtras" >
<property name="title" >
<string>E&amp;xtras</string>
</property>
<addaction name="ExtrasSettingsAction" />
<addaction name="ExtrasPasswordGenAction" />
</widget>
<widget class="QMenu" name="menuDatei" >
<property name="title" >
<string>&amp;File</string>
@ -220,6 +216,14 @@
<addaction name="menuColumns" />
<addaction name="menuTool_Button_Sizes" />
</widget>
<widget class="QMenu" name="menuExtras" >
<property name="title" >
<string>E&amp;xtras</string>
</property>
<addaction name="ExtrasSettingsAction" />
<addaction name="ExtrasShowExpiredEntriesAction" />
<addaction name="ExtrasPasswordGenAction" />
</widget>
<addaction name="menuDatei" />
<addaction name="menuBearbeiten" />
<addaction name="ViewMenu" />
@ -518,17 +522,28 @@
<string>Group (search results only)</string>
</property>
</action>
<action name="ExtrasShowExpiredEntriesAction" >
<property name="text" >
<string>Show Expired Entries...</string>
</property>
<property name="iconText" >
<string>Show Expired Entries...</string>
</property>
<property name="toolTip" >
<string>Show Expired Entries</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>KeepassGroupView</class>
<class>KeepassEntryView</class>
<extends>QTreeWidget</extends>
<header>../../src/lib/GroupView.h</header>
<header>../../src/lib/EntryView.h</header>
</customwidget>
<customwidget>
<class>KeepassEntryView</class>
<class>KeepassGroupView</class>
<extends>QTreeWidget</extends>
<header>../../src/lib/EntryView.h</header>
<header>../../src/lib/GroupView.h</header>
</customwidget>
</customwidgets>
<resources/>

@ -1,7 +1,4 @@
<ui version="4.0" >
<author/>
<comment/>
<exportmacro/>
<class>Search_Dlg</class>
<widget class="QDialog" name="Search_Dlg" >
<property name="geometry" >
@ -9,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>390</width>
<height>260</height>
<height>280</height>
</rect>
</property>
<property name="sizePolicy" >
@ -23,142 +20,109 @@
<property name="minimumSize" >
<size>
<width>390</width>
<height>260</height>
<height>280</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>390</width>
<height>260</height>
<height>280</height>
</size>
</property>
<property name="windowTitle" >
<string>Search...</string>
</property>
<widget class="QLabel" name="textLabel1" >
<property name="geometry" >
<rect>
<x>10</x>
<y>60</y>
<width>90</width>
<height>20</height>
</rect>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="text" >
<string>Search For:</string>
<property name="spacing" >
<number>6</number>
</property>
</widget>
<widget class="QLineEdit" name="Edit_Search" >
<property name="geometry" >
<rect>
<x>110</x>
<y>60</y>
<width>270</width>
<height>21</height>
</rect>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_regExp" >
<property name="geometry" >
<rect>
<x>110</x>
<y>110</y>
<width>170</width>
<height>20</height>
</rect>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="text" >
<string>Regular E&amp;xpression</string>
<property name="sizeHint" >
<size>
<width>20</width>
<height>50</height>
</size>
</property>
<property name="shortcut" >
<string>Alt+X</string>
</spacer>
</item>
<item>
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_Cs" >
<property name="geometry" >
<rect>
<x>110</x>
<y>90</y>
<width>250</width>
<height>20</height>
</rect>
<property name="spacing" >
<number>4</number>
</property>
<property name="text" >
<string>&amp;Case Sensitive</string>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="shortcut" >
<string>Alt+C</string>
<property name="sizeType" >
<enum>QSizePolicy::Maximum</enum>
</property>
</widget>
<widget class="QLabel" name="Banner" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>390</width>
<height>50</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</widget>
</spacer>
</item>
<item row="2" column="0" colspan="2" >
<widget class="QGroupBox" name="groupBox1" >
<property name="geometry" >
<rect>
<x>10</x>
<y>150</y>
<width>370</width>
<height>70</height>
</rect>
</property>
<property name="title" >
<string>Include:</string>
</property>
<widget class="QCheckBox" name="checkBox_Title" >
<property name="geometry" >
<rect>
<x>20</x>
<y>20</y>
<width>110</width>
<height>20</height>
</rect>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="1" >
<widget class="QCheckBox" name="checkBox_Password" >
<property name="text" >
<string>&amp;Titles</string>
<string>Pass&amp;words</string>
</property>
<property name="shortcut" >
<string>Alt+T</string>
<string>Alt+W</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_Username" >
<property name="geometry" >
<rect>
<x>20</x>
<y>40</y>
<width>110</width>
<height>20</height>
</rect>
</item>
<item row="1" column="2" >
<widget class="QCheckBox" name="checkBox_Attachment" >
<property name="text" >
<string>A&amp;nhang</string>
</property>
<property name="shortcut" >
<string>Alt+N</string>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QCheckBox" name="checkBox_URL" >
<property name="text" >
<string>&amp;Usernames</string>
<string>U&amp;RLs</string>
</property>
<property name="shortcut" >
<string>Alt+U</string>
<string>Alt+R</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QCheckBox" name="checkBox_Comment" >
<property name="geometry" >
<rect>
<x>140</x>
<y>40</y>
<width>120</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>C&amp;omments</string>
</property>
@ -166,64 +130,115 @@
<string>Alt+O</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_URL" >
<property name="geometry" >
<rect>
<x>260</x>
<y>20</y>
<width>100</width>
<height>20</height>
</rect>
</item>
<item row="1" column="0" >
<widget class="QCheckBox" name="checkBox_Username" >
<property name="text" >
<string>&amp;Usernames</string>
</property>
<property name="shortcut" >
<string>Alt+U</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QCheckBox" name="checkBox_Title" >
<property name="text" >
<string>U&amp;RLs</string>
<string>&amp;Titles</string>
</property>
<property name="shortcut" >
<string>Alt+R</string>
<string>Alt+T</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_Attachment" >
<property name="geometry" >
<rect>
<x>260</x>
<y>40</y>
<width>100</width>
<height>20</height>
</rect>
</item>
</layout>
</widget>
</item>
<item row="1" column="1" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="checkBox_Cs" >
<property name="text" >
<string>A&amp;nhang</string>
<string>&amp;Case Sensitive</string>
</property>
<property name="shortcut" >
<string>Alt+N</string>
<string>Alt+C</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_Password" >
<property name="geometry" >
<rect>
<x>140</x>
<y>20</y>
<width>110</width>
<height>20</height>
</rect>
</property>
</item>
<item>
<widget class="QCheckBox" name="checkBox_regExp" >
<property name="text" >
<string>Pass&amp;words</string>
<string>Regular E&amp;xpression</string>
</property>
<property name="shortcut" >
<string>Alt+W</string>
<string>Alt+X</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_Recursive" >
<property name="text" >
<string>Include Subgroups (recursive)</string>
</property>
</widget>
<widget class="QPushButton" name="Button_Search" >
<property name="geometry" >
<rect>
<x>170</x>
<y>230</y>
<width>97</width>
<height>23</height>
</rect>
</item>
</layout>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="Edit_Search" />
</item>
<item row="0" column="0" >
<widget class="QLabel" name="textLabel1" >
<property name="text" >
<string>Search For:</string>
</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>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="Button_Search" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
@ -236,15 +251,9 @@
<string>Search</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="Button_Close" >
<property name="geometry" >
<rect>
<x>280</x>
<y>230</y>
<width>97</width>
<height>23</height>
</rect>
</property>
<property name="text" >
<string>Clo&amp;se</string>
</property>
@ -252,22 +261,12 @@
<string>Alt+S</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_Recursive" >
<property name="geometry" >
<rect>
<x>110</x>
<y>130</y>
<width>271</width>
<height>22</height>
</rect>
</property>
<property name="text" >
<string>Include Subgroups (recursive)</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction/>
<tabstops>
<tabstop>Edit_Search</tabstop>
<tabstop>checkBox_Cs</tabstop>

@ -52,9 +52,6 @@
</item>
<item>
<widget class="QTabWidget" name="tabWidget4" >
<property name="whatsThis" >
<string>The integration plugins provide features like usage of the native file dialogs and message boxes of the particular desktop environments.</string>
</property>
<property name="tabPosition" >
<enum>QTabWidget::North</enum>
</property>
@ -62,9 +59,12 @@
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex" >
<number>4</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab" >
<property name="whatsThis" >
<string>The integration plugins provide features like usage of the native file dialogs and message boxes of the particular desktop environments.</string>
</property>
<attribute name="title" >
<string>General</string>
</attribute>
@ -593,6 +593,43 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox" >
<property name="text" >
<string>Unified Title and Toolbar</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="Button_CustomizeEntryDetails" >
<property name="text" >
<string>Customize Entry Detail View...</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
@ -894,12 +931,19 @@
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="Edit_MountDir" />
<widget class="QLineEdit" name="Edit_MountDir" >
<property name="whatsThis" >
<string>The directory where storage devices like CDs and memory sticks are normally mounted.</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Mounting Root:</string>
<string>Media Root:</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
@ -908,6 +952,9 @@
<property name="text" >
<string>Browser Command:</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1" >
@ -946,10 +993,87 @@
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3" >
<property name="title" >
<string>Auto-Type Fine Tuning</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="1" >
<widget class="QSpinBox" name="spinBox_PreGap" >
<property name="whatsThis" >
<string>Time between the activation of an auto-type action by the user and the first simulated key stroke.</string>
</property>
<property name="suffix" >
<string>ms</string>
</property>
<property name="maximum" >
<number>10000</number>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Pre-Gap:</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_5" >
<property name="text" >
<string>Key Stroke Delay:</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QSpinBox" name="spinBox_KeyStrokeDelay" >
<property name="whatsThis" >
<string>Delay between two simulated key strokes. Increase this if Auto-Type is randomly skipping characters.</string>
</property>
<property name="suffix" >
<string>ms</string>
</property>
<property name="maximum" >
<number>10000</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="CheckBox_SaveRelativePaths" >
<property name="whatsThis" >
<string>Enable this if you want to use your bookmarks and the last opened file independet from their absolute paths. This is especially useful when using KeePassX portably and therefore with changing mount points in the file system.</string>
</property>
<property name="text" >
<string>Save relative paths</string>
<string>Save relative paths (bookmarks and last file)</string>
</property>
</widget>
</item>

@ -461,6 +461,11 @@ void KeepassEntryView::updateColumns(){
resizeColumns();
}
void KeepassEntryView::refreshItems(){
for (int i=0;i<Items.size();i++)
updateEntry(Items.at(i));
}
void KeepassEntryView::OnColumnMoved(int LogIndex,int OldVisIndex,int NewVisIndex){
for(int i=0;i<header()->count();i++){
ColumnOrder[columnListIndex(header()->logicalIndex(i))]=i;
@ -643,3 +648,13 @@ bool EntryViewItem::operator<(const QTreeWidgetItem& other)const{
}
return DateThis < DateOther;
}
void KeepassEntryView::setCurrentEntry(IEntryHandle* entry){
bool found=false;
int i=0;
for(i;i<Items.size();i++)
if(Items[i]->EntryHandle==entry){found=true; break;}
if(!found)return;
setCurrentItem(Items[i]);
}

@ -43,12 +43,14 @@ class KeepassEntryView:public QTreeWidget{
void showSearchResults();
void showGroup(IGroupHandle* group);
void updateColumns();
void refreshItems();
int columnListIndex(int LogicalIndex);
IDatabase* db;
QList<EntryViewItem*>Items;
QList<IEntryHandle*> SearchResults;
QMenu *ContextMenu;
QVarLengthArray<bool>Columns;
void setCurrentEntry(IEntryHandle* entry);
private:
void setEntry(IEntryHandle* entry);
void updateEntry(EntryViewItem*);

@ -172,8 +172,14 @@ void KeepassGroupView::OnCurrentGroupChanged(QTreeWidgetItem* cur,QTreeWidgetIte
}
void KeepassGroupView::setCurrentGroup(IGroupHandle* group){
bool found=false;
int i=0;
for(i;i<Items.size();i++)
if(Items[i]->GroupHandle==group){found=true; break;}
if(!found)return;
setCurrentItem(Items[i]);
}
void KeepassGroupView::dragEnterEvent ( QDragEnterEvent * event ){
LastHoverItem=NULL;

@ -38,6 +38,7 @@ class KeepassGroupView:public QTreeWidget{
GroupViewItem* SearchResultItem;
void createItems();
void showSearchResults();
void setCurrentGroup(IGroupHandle* group);
private:
virtual void dragEnterEvent(QDragEnterEvent* event);

@ -58,37 +58,17 @@ using namespace std;
#define CSTR(x)(x.toUtf8().data())
QHash<QString,QPixmap*>PixmapCache;
QHash<QString,QIcon*>IconCache;
CConfig config;
QSettings* settings;
QString AppDir;
QString PluginLoadError;
bool TrActive;
QPixmap *Icon_Key32x32;
QPixmap *Icon_Settings32x32;
QPixmap *Icon_Search32x32;
QPixmap *Icon_I18n32x32;
QPixmap *Icon_Ok16x16;
QString DetailViewTemplate;
QPixmap* EntryIcons;
QIcon *Icon_FileNew;
QIcon *Icon_FileOpen;
QIcon *Icon_FileClose;
QIcon *Icon_FileSave;
QIcon *Icon_FileSaveAs;
QIcon *Icon_Exit;
QIcon *Icon_File_Export;
QIcon *Icon_EditDelete;
QIcon *Icon_EditAdd;
QIcon *Icon_EditEdit;
QIcon *Icon_EditUsernameToCb;
QIcon *Icon_EditPasswordToCb;
QIcon *Icon_EditClone;
QIcon *Icon_EditOpenUrl;
QIcon *Icon_EditSearch;
QIcon *Icon_Configure;
QIcon *Icon_Help;
QIcon *Icon_AutoType;
QIcon *Icon_Swap;
QIcon *Icon_FileSaveDisabled;
inline void loadImages();
inline void parseCmdLineArgs(int argc, char** argv,QString &ArgFile,QString& ArgCfg,QString& ArgLang);
@ -176,7 +156,7 @@ int main(int argc, char **argv)
if(loadTranslation(translator,"keepass-",loc.name(),QStringList()
<< app->applicationDirPath()+"/../share/keepass/i18n/"
<< QDir::homePath()+"/.keepass/" ))
<< QDir::homePath()+"/.keepassx/" ))
{app->installTranslator(translator);
TrActive=true;}
else{
@ -201,6 +181,14 @@ int main(int argc, char **argv)
delete qtTranslator;
}
QFile templ(QDir::homePath()+"/.keepassx/detailview-template.html"); ///FIXME ArgCfg
if(templ.open(QIODevice::ReadOnly)){
DetailViewTemplate=QString::fromUtf8(templ.readAll());
templ.close();
}
else loadDefaultDetailViewTemplate();
loadImages();
initYarrow(); //init random number generator
SecString::generateSessionKey();
@ -217,6 +205,15 @@ int main(int argc, char **argv)
QObject::tr("Could not save configuration file.\nMake sure you have write access to '~/.keepass'."),
QObject::tr("OK"),"","",0.0);
if(templ.open(QIODevice::WriteOnly)){
templ.write(DetailViewTemplate.toUtf8());
templ.close();
}
else{
qWarning("Failed to save detail view template: %s",decodeFileError(templ.error()).toUtf8().data());
}
fileDlgHistory.save();
delete app;
delete settings;
@ -224,9 +221,25 @@ int main(int argc, char **argv)
}
void loadDefaultDetailViewTemplate(){
QFile templ(":/default-detailview.html");
templ.open(QIODevice::ReadOnly);
DetailViewTemplate=QString::fromUtf8(templ.readAll());
templ.close();
DetailViewTemplate.replace("Group",QCoreApplication::translate("DetailViewTemplate","Group"));
DetailViewTemplate.replace("Title",QCoreApplication::translate("DetailViewTemplate","Title"));
DetailViewTemplate.replace("Username",QCoreApplication::translate("DetailViewTemplate","Username"));
DetailViewTemplate.replace("Password",QCoreApplication::translate("DetailViewTemplate","Password"));
DetailViewTemplate.replace("URL",QCoreApplication::translate("DetailViewTemplate","URL"));
DetailViewTemplate.replace("Creation",QCoreApplication::translate("DetailViewTemplate","Creation"));
DetailViewTemplate.replace("Last Access",QCoreApplication::translate("DetailViewTemplate","Last Access"));
DetailViewTemplate.replace("Last Modification",QCoreApplication::translate("DetailViewTemplate","Last Modification"));
DetailViewTemplate.replace("Expiration",QCoreApplication::translate("DetailViewTemplate","Expiration"));
DetailViewTemplate.replace("Comment",QCoreApplication::translate("DetailViewTemplate","Comment"));
}
void createBanner(QLabel *Banner,QPixmap* symbol,QString text){
//obsolete
void createBanner(QLabel *Banner,const QPixmap* symbol,QString text){
QPixmap Pixmap;
createBanner(&Pixmap,symbol,text
,Banner->width()
@ -236,11 +249,11 @@ void createBanner(QLabel *Banner,QPixmap* symbol,QString text){
Banner->setPixmap(Pixmap);
}
void createBanner(QPixmap* Pixmap, 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);
}
void createBanner(QPixmap* Pixmap, QPixmap* IconAlpha,const QString& Text,int Width, QColor Color1, QColor Color2, QColor TextColor){
void createBanner(QPixmap* Pixmap,const QPixmap* IconAlpha,const QString& Text,int Width, QColor Color1, QColor Color2, QColor TextColor){
*Pixmap=QPixmap(Width,50);
QPainter painter(Pixmap);
QLinearGradient grad(0,0,Width,0);
@ -296,7 +309,7 @@ void openBrowser(QString UrlString){
}
}
///TODO 0.2.3 remove
void loadImg(QString name,QPixmap& Img){
if(Img.load(AppDir+"/../share/keepass/icons/"+name)==false){
if(Img.load(AppDir+"/share/"+name)==false){
@ -307,66 +320,44 @@ if(Img.load(AppDir+"/../share/keepass/icons/"+name)==false){
}
#define _loadIcon(Icon,PATH)\
Icon=new QIcon(ThemeDir+PATH);
///TODO 0.2.3 remove
void loadImages(){
bool small=true;
QString ThemeDir=AppDir+"/../share/keepass/icons/nuvola/32x32";
QPixmap tmpImg;
//-----------------------
loadImg("clientic.png",tmpImg);
EntryIcons=new QPixmap[BUILTIN_ICONS];
for(int i=0;i<BUILTIN_ICONS;i++){
EntryIcons[i]=tmpImg.copy(i*16,0,16,16);}
//--------------------------
loadImg("key.png",tmpImg);
Icon_Key32x32=new QPixmap;
*Icon_Key32x32=tmpImg;
//--------------------------
loadImg("settings.png",tmpImg);
Icon_Settings32x32=new QPixmap;
*Icon_Settings32x32=tmpImg;
//--------------------------
loadImg("i18n.png",tmpImg);
Icon_I18n32x32=new QPixmap;
*Icon_I18n32x32=tmpImg;
//--------------------------
loadImg("ok.png",tmpImg);
Icon_Ok16x16=new QPixmap;
*Icon_Ok16x16=tmpImg;
//--------------------------
loadImg("search.png",tmpImg);
Icon_Search32x32=new QPixmap;
*Icon_Search32x32=tmpImg;
//--------------------------
_loadIcon(Icon_FileNew,"/actions/filenew.png");
_loadIcon(Icon_FileOpen,"/actions/fileopen.png");
_loadIcon(Icon_FileSave,"/actions/filesave.png");
_loadIcon(Icon_FileSaveAs,"/actions/filesaveas.png");
_loadIcon(Icon_FileClose,"/actions/fileclose.png");
_loadIcon(Icon_Exit,"/actions/exit.png");
_loadIcon(Icon_EditDelete,"/actions/editdelete.png");
_loadIcon(Icon_EditAdd,"/actions/edit_add.png");
_loadIcon(Icon_EditEdit,"/actions/edit.png");
_loadIcon(Icon_EditUsernameToCb,"/actions/identity.png");
_loadIcon(Icon_EditPasswordToCb,"/actions/klipper_dock.png");
_loadIcon(Icon_EditClone,"/actions/editcopy.png");
_loadIcon(Icon_EditOpenUrl,"/actions/run.png");
_loadIcon(Icon_EditSearch,"/actions/find.png");
_loadIcon(Icon_Configure,"/actions/configure.png");
_loadIcon(Icon_Help,"/actions/help.png");
_loadIcon(Icon_AutoType,"/apps/ktouch.png");
_loadIcon(Icon_Swap,"/actions/reload.png");
Icon_FileSaveDisabled=new QIcon(Icon_FileSave->pixmap(32,32,QIcon::Disabled));
}
const QIcon& getIcon(const QString& name){
QIcon* CachedIcon=IconCache.value(name);
if(CachedIcon)
return *CachedIcon;
QFileInfo IconFile(AppDir+"/../share/keepass/icons/"+name+".png");
if(!IconFile.isFile() || !IconFile.exists() || !IconFile.isReadable()){
//ERROR
qWarning("%s",CSTR(name));
}
QIcon* NewIcon=new QIcon(AppDir+"/../share/keepass/icons/"+name+".png");
IconCache.insert(name,NewIcon);
return *NewIcon;
}
const QPixmap* getPixmap(const QString& name){
QPixmap* CachedPixmap=PixmapCache.value(name);
if(CachedPixmap)
return CachedPixmap;
QImage img;
if(!img.load(AppDir+"/../share/keepass/icons/"+name+".png")){
//ERROR
qWarning("%s",CSTR(name));
}
QPixmap* NewPixmap=new QPixmap(QPixmap::fromImage(img));
PixmapCache.insert(name,NewPixmap);
return NewPixmap;
}

@ -34,47 +34,25 @@
typedef enum tKeyType {PASSWORD=0,KEYFILE=1,BOTH=2};
class CConfig;
void createBanner(QLabel *Banner,QPixmap* symbol,QString text);
void createBanner(QPixmap* Pixmap, QPixmap* IconAlpha,const QString& Text,int Width);
void createBanner(QPixmap* Pixmap, QPixmap* IconAlpha,const QString& Text,int Width, QColor Color1, QColor Color2, QColor TextColor);
void createBanner(QLabel *Banner,const QPixmap* symbol,QString text);
void createBanner(QPixmap* Pixmap, const QPixmap* IconAlpha,const QString& Text,int Width);
void createBanner(QPixmap* Pixmap, const QPixmap* IconAlpha,const QString& Text,int Width, QColor Color1, QColor Color2, QColor TextColor);
void openBrowser(QString url);
void showErrMsg(const QString& msg,QWidget* parent=NULL);
const QIcon& getIcon(const QString& name);
const QPixmap* getPixmap(const QString& name);
QString decodeFileError(QFile::FileError Code);
QString findPlugin(const QString& filename);
QString makePathRelative(const QString& Abs,const QString& Cur);
void loadDefaultDetailViewTemplate();
extern QString PluginLoadError;
extern CConfig config;
extern QSettings *settings;
extern QString AppDir;
extern bool TrActive;
extern QString DetailViewTemplate;
extern QPixmap *EntryIcons;
extern QPixmap *Icon_Key32x32;
extern QPixmap *Icon_Settings32x32;
extern QPixmap *Icon_Search32x32;
extern QPixmap *Icon_I18n32x32;
extern QPixmap *Icon_Ok16x16;
extern QIcon *Icon_FileNew;
extern QIcon *Icon_FileOpen;
extern QIcon *Icon_FileClose;
extern QIcon *Icon_FileSave;
extern QIcon *Icon_FileSaveAs;
extern QIcon *Icon_Exit;
extern QIcon *Icon_File_Export;
extern QIcon *Icon_EditDelete;
extern QIcon *Icon_EditAdd;
extern QIcon *Icon_EditEdit;
extern QIcon *Icon_EditDelete;
extern QIcon *Icon_EditUsernameToCb;
extern QIcon *Icon_EditPasswordToCb;
extern QIcon *Icon_EditClone;
extern QIcon *Icon_EditOpenUrl;
extern QIcon *Icon_EditSearch;
extern QIcon *Icon_Configure;
extern QIcon *Icon_Help;
extern QIcon *Icon_AutoType;
extern QIcon *Icon_Swap;
extern QIcon *Icon_FileSaveDisabled;
#endif

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2005-2006 by Tarek Saidi *
* Copyright (C) 2005-2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* This program is free software; you can redistribute it and/or modify *
@ -57,6 +57,8 @@
#include "dialogs/SimplePasswordDlg.h"
#include "dialogs/PasswordGenDlg.h"
#include "dialogs/CollectEntropyDlg.h"
#include "dialogs/CustomizeDetailViewDlg.h"
#include "dialogs/ExpiredEntriesDlg.h"
#include <QtDBus/QtDBus>
#include <iostream>
@ -77,7 +79,8 @@ KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,QWidget *parent, Qt:
setupUi(this);
AutoType::MainWin=this;
setGeometry(settings->value("Ui/MainWindowGeometry",QVariant(geometry())).toRect());
splitter->restoreState(settings->value("Ui/SplitterPos").toByteArray());
VSplitter->restoreState(settings->value("Ui/VSplitterPos").toByteArray());
HSplitter->restoreState(settings->value("Ui/HSplitterPos").toByteArray());
SysTray=new QSystemTrayIcon(this);
setupToolbar();
setupIcons();
@ -89,6 +92,7 @@ KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,QWidget *parent, Qt:
statusBar()->addWidget(StatusBarSelection,85);
statusBar()->setVisible(config.ShowStatusbar);
setupConnections();
FileOpen=false;
if(ArgFile!=QString())
openDatabase(QDir::cleanPath(QDir::current().absoluteFilePath(ArgFile)),false);
@ -100,6 +104,7 @@ KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,QWidget *parent, Qt:
settings->setValue("LastFile","");
}
// DBus Server of Qt 4.2 does not work - 4.3 snapshot seems to work fine
/*
//dbusServer=new QDBusServer("unix:path=/tmp/KpxBus",this);
//qDebug("DBUS: %s",dbusServer->lastError().message().toAscii().data());
@ -155,6 +160,7 @@ void KeepassMainWindow::setupConnections(){
connect(ExtrasSettingsAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasSettings()));
connect(ExtrasPasswordGenAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasPasswordGen()));
connect(ExtrasShowExpiredEntriesAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasShowExpiredEntries()));
connect(HelpHandbookAction,SIGNAL(triggered()),this,SLOT(OnHelpHandbook()));
connect(HelpAboutAction,SIGNAL(triggered()),this,SLOT(OnHelpAbout()));
@ -197,31 +203,34 @@ void KeepassMainWindow::setupToolbar(){
}
void KeepassMainWindow::setupIcons(){
setWindowIcon(QIcon(AppDir+"/../share/keepass/icons/keepassx.png"));
FileNewAction->setIcon(*Icon_FileNew);
FileOpenAction->setIcon(*Icon_FileOpen);
FileSaveAction->setIcon(*Icon_FileSave);
FileSaveAsAction->setIcon(*Icon_FileSaveAs);
FileCloseAction->setIcon(*Icon_FileClose);
FileSettingsAction->setIcon(*Icon_Configure);
FileExitAction->setIcon(*Icon_Exit);
EditNewEntryAction->setIcon(*Icon_EditAdd);
EditEditEntryAction->setIcon(*Icon_EditEdit);
EditDeleteEntryAction->setIcon(*Icon_EditDelete);
EditPasswordToClipboardAction->setIcon(*Icon_EditPasswordToCb);
EditUsernameToClipboardAction->setIcon(*Icon_EditUsernameToCb);
EditCloneEntryAction->setIcon(*Icon_EditClone);
EditOpenUrlAction->setIcon(*Icon_EditOpenUrl);
EditSaveAttachmentAction->setIcon(*Icon_FileSave);
EditNewGroupAction->setIcon(*Icon_EditAdd);
EditEditGroupAction->setIcon(*Icon_EditEdit);
EditDeleteGroupAction->setIcon(*Icon_EditDelete);
EditSearchAction->setIcon(*Icon_EditSearch);
EditGroupSearchAction->setIcon(*Icon_EditSearch);
ExtrasSettingsAction->setIcon(*Icon_Configure);
EditAutoTypeAction->setIcon(*Icon_AutoType);
HelpHandbookAction->setIcon(*Icon_Help);
SysTray->setIcon(QIcon(AppDir+"/../share/keepass/icons/keepassx_large.png"));
setWindowIcon(getIcon("keepassx"));
FileNewAction->setIcon(getIcon("filenew"));
FileOpenAction->setIcon(getIcon("fileopen"));
FileSaveAction->setIcon(getIcon("filesave"));
FileSaveAsAction->setIcon(getIcon("filesaveas"));
FileCloseAction->setIcon(getIcon("fileclose"));
FileSettingsAction->setIcon(getIcon("dbsettings"));
FileExitAction->setIcon(getIcon("exit"));
EditNewEntryAction->setIcon(getIcon("newentry"));
EditEditEntryAction->setIcon(getIcon("editentry"));
EditDeleteEntryAction->setIcon(getIcon("deleteentry"));
EditPasswordToClipboardAction->setIcon(getIcon("copypwd"));
EditUsernameToClipboardAction->setIcon(getIcon("copyusername"));
EditCloneEntryAction->setIcon(getIcon("cloneentry"));
EditOpenUrlAction->setIcon(getIcon("openurl"));
EditSaveAttachmentAction->setIcon(getIcon("filesave"));
EditNewGroupAction->setIcon(getIcon("newgroup"));
EditEditGroupAction->setIcon(getIcon("editgroup"));
EditDeleteGroupAction->setIcon(getIcon("deletegroup"));
EditSearchAction->setIcon(getIcon("dbsearch"));
EditGroupSearchAction->setIcon(getIcon("groupsearch"));
ExtrasSettingsAction->setIcon(getIcon("appsettings"));
ExtrasShowExpiredEntriesAction->setIcon(getIcon("expired"));
ExtrasPasswordGenAction->setIcon(getIcon("generator"));
EditAutoTypeAction->setIcon(getIcon("autotype"));
HelpHandbookAction->setIcon(getIcon("manual"));
HelpAboutAction->setIcon(getIcon("help"));
SysTray->setIcon(getIcon("keepassx_large"));
if(config.ShowSysTrayIcon)
SysTray->show();
}
@ -328,7 +337,7 @@ void KeepassMainWindow::openDatabase(QString filename,bool IsAuto){
if(!IsAuto){
config.LastKeyLocation=QString();
config.LastKeyType=PASSWORD;}
db=dynamic_cast<IDatabase*>(new StandardDatabase());
db=dynamic_cast<IDatabase*>(new Kdb3Database());
CPasswordDialog PasswordDlg(this,db,IsAuto,false);
PasswordDlg.setWindowTitle(filename);
switch(PasswordDlg.exec()){
@ -392,7 +401,7 @@ bool KeepassMainWindow::closeDatabase(){
void KeepassMainWindow::OnFileNewKdb(){
IDatabase* db_new=dynamic_cast<IDatabase*>(new StandardDatabase());
IDatabase* db_new=dynamic_cast<IDatabase*>(new Kdb3Database());
db_new->create();
CPasswordDialog dlg(this,db_new,false,true);
dlg.setWindowTitle(tr("New Database"));
@ -451,12 +460,13 @@ FileSaveAsAction->setEnabled(IsOpen);
FileCloseAction->setEnabled(IsOpen);
FileSettingsAction->setEnabled(IsOpen);
FileChangeKeyAction->setEnabled(IsOpen);
EditSearchAction->setEnabled(IsOpen);
GroupView->setEnabled(IsOpen);
EntryView->setEnabled(IsOpen);
DetailView->setEnabled(IsOpen);
QuickSearchEdit->setEnabled(IsOpen);
ExtrasShowExpiredEntriesAction->setEnabled(IsOpen);
if(!IsOpen){
EditNewGroupAction->setEnabled(false);
EditEditGroupAction->setEnabled(false);
@ -482,14 +492,14 @@ else{
void KeepassMainWindow::setStateFileModified(bool mod){
if(!FileOpen){
FileSaveAction->setIcon(*Icon_FileSave);
FileSaveAction->setIcon(getIcon("filesave"));
return;
}
ModFlag=mod;
if(mod)
FileSaveAction->setIcon(*Icon_FileSave);
FileSaveAction->setIcon(getIcon("filesave"));
else
FileSaveAction->setIcon(*Icon_FileSaveDisabled);
FileSaveAction->setIcon(getIcon("filesavedisabled"));
}
void KeepassMainWindow::setStateGroupSelected(SelectionState s){
@ -526,28 +536,75 @@ void KeepassMainWindow::updateDetailView(){
return;
}
QString templ=DetailViewTemplate;
IEntryHandle* entry=((EntryViewItem*)(EntryView->selectedItems()[0]))->EntryHandle;
QString str=tr("<B>Group: </B>%1 <B>Title: </B>%2 <B>Username: </B>%3 <B>URL: </B><a href=%4>%4</a> <B>Password: </B>%5 <B>Creation: </B>%6 <B>Last Change: </B>%7 <B>LastAccess: </B>%8 <B>Expires: </B>%9");
str=str.arg(entry->group()->title()).arg(entry->title());
if(!config.ListView_HideUsernames) str=str.arg(entry->username());
else str=str.arg("****");
str=str.arg(entry->url());
templ.replace("%group%",entry->group()->title());
templ.replace("%title%",entry->title());
if(config.ListView_HideUsernames)templ.replace("%username%","****");
else templ.replace("%username%",entry->username());
if(!config.ListView_HidePasswords){
SecString password=entry->password();
password.unlock();
str=str.arg(password.string());
templ.replace("%password%",password.string());
}
else templ.replace("%password%","****");
templ.replace("%url%",entry->url());
templ.replace("%creation%",entry->creation().toString(Qt::LocalDate));
templ.replace("%lastmod%",entry->lastMod().toString(Qt::LocalDate));
templ.replace("%lastaccess%",entry->lastAccess().toString(Qt::LocalDate));
templ.replace("%expire%",entry->expire().toString(Qt::LocalDate));
templ.replace("%comment%",entry->comment());
templ.replace("%attachment%",entry->binaryDesc());
if(entry->expire()!=Date_Never){
int secs=QDateTime::currentDateTime().secsTo(entry->expire());
if(secs < 0)
templ.replace("%expire-timeleft%",tr("expired"));
else{
int years=0;
int months=0;
int days=0;
years=secs/(86400*365);
secs-=years*(86400*365);
months=secs/(86400*30);
secs-=months*(86400*30);
days=secs/86400;
QString out;
if(months==1)
out=tr("1 Month");
if(months>1)
out=tr("%1 Months").arg(months);
if(years){
if(out!=QString())
out.prepend(tr(", "));
if(years==1)
out.prepend(tr("1 Year"));
if(years>1)
out.prepend(tr("%1 Years").arg(years));
}
else if(days){
if(out!=QString())
out.append(tr(", "));
if(days==1)
out.append(tr("1 Day"));
if(days>1)
out.append(tr("%1 Days").arg(days));
}
else str=str.arg("****");
str=str .arg(entry->creation().toString(Qt::LocalDate))
.arg(entry->lastMod().toString(Qt::LocalDate))
.arg(entry->lastAccess().toString(Qt::LocalDate))
.arg(entry->expire().toString(Qt::LocalDate));
DetailView->setHtml(str);
if(!days && !years && !months)
out=tr("less than 1 day");
templ.replace("%expire-timeleft%",out);
}
}
else
templ.replace("%expire-timeleft%","-");
DetailView->setHtml(templ);
}
@ -688,7 +745,7 @@ void KeepassMainWindow::OnExport(QAction* action){
void KeepassMainWindow::OnImport(QAction* action){
if(FileOpen)
if(!closeDatabase())return;
IDatabase* tmpdb=dynamic_cast<IDatabase*>(new StandardDatabase());
IDatabase* tmpdb=dynamic_cast<IDatabase*>(new Kdb3Database());
tmpdb->create();
if(dynamic_cast<IImport*>(action->data().value<QObject*>())->importDatabase(this,tmpdb)){
CPasswordDialog dlg(this,tmpdb,false,true);
@ -726,7 +783,7 @@ for(int i=0; i<SearchResults.size();i++){
void KeepassMainWindow::search(IGroupHandle* group){
CSearchDlg dlg(db,group,this,"SearchDialog",false);
SearchDialog dlg(db,group,this);
if(dlg.exec()){
EntryView->SearchResults=dlg.Result;
GroupView->showSearchResults();
@ -766,7 +823,7 @@ void KeepassMainWindow::OnColumnVisibilityChanged(QAction* action){
void KeepassMainWindow::OnUsernPasswVisibilityChanged(bool value){
config.ListView_HidePasswords=ViewHidePasswordsAction->isChecked();
config.ListView_HideUsernames=ViewHideUsernamesAction->isChecked();
//EntryView->refreshItems();
EntryView->refreshItems();
}
void KeepassMainWindow::OnFileModified(){
@ -781,7 +838,8 @@ void KeepassMainWindow::closeEvent(QCloseEvent* e){
}
settings->setValue("Ui/MainWindowGeometry",QVariant(geometry()));
settings->setValue("Ui/SplitterPos",splitter->saveState());
settings->setValue("Ui/VSplitterPos",VSplitter->saveState());
settings->setValue("Ui/HSplitterPos",HSplitter->saveState());
config.ShowStatusbar=statusBar()->isVisible();
if(FileOpen){
@ -800,14 +858,14 @@ void KeepassMainWindow::closeEvent(QCloseEvent* e){
void KeepassMainWindow::OnExtrasSettings(){
CSettingsDlg dlg(this);
if(dlg.exec()==1){
if(dlg.exec()==QDialog::Accepted){
EntryView->setAlternatingRowColors(config.AlternatingRowColors);
SysTray->setVisible(config.ShowSysTrayIcon);
}
}
void KeepassMainWindow::OnHelpAbout(){
CAboutDialog dlg(this);
AboutDialog dlg(this);
dlg.exec();
}
@ -897,3 +955,12 @@ void KeepassMainWindow::saveLastFilename(const QString& filename){
settings->setValue("LastFile",filename);
}
}
void KeepassMainWindow::OnExtrasShowExpiredEntries(){
ExpiredEntriesDialog dlg(this,db,db->expiredEntries());
if(dlg.exec()==QDialog::Accepted){
GroupView->setCurrentGroup(dlg.SelectedEntry->group());
EntryView->setCurrentEntry(dlg.SelectedEntry);
}
}

@ -81,6 +81,7 @@ class KeepassMainWindow : public QMainWindow, public Ui_MainWindow{
void OnFileModified();
void OnExtrasSettings();
void OnExtrasPasswordGen();
void OnExtrasShowExpiredEntries();
void OnHelpAbout();
void OnHelpHandbook();
void OnItemExpanded(QTreeWidgetItem*);

@ -8,7 +8,8 @@ DEPENDPATH += "crypto \
forms \
import \
lib \
translations"
translations \
res"
INSTALLS += target data
data.files += ../share/keepass/*
TARGET = ../bin/keepassx
@ -47,7 +48,10 @@ FORMS += forms/EditGroupDlg.ui \
forms/EditEntryDlg.ui \
forms/PasswordGenDlg.ui \
forms/SelectIconDlg.ui \
forms/CollectEntropyDlg.ui
forms/CollectEntropyDlg.ui \
forms/CustomizeDetailViewDlg.ui \
forms/CalendarDlg.ui \
forms/ExpiredEntriesDlg.ui
TRANSLATIONS += translations/keepass-de_DE.ts \
translations/keepass-ru_RU.ts \
translations/keepass-es_ES.ts \
@ -80,6 +84,9 @@ HEADERS += lib/IniReader.h \
dialogs/PasswordGenDlg.h \
dialogs/SelectIconDlg.h \
dialogs/CollectEntropyDlg.h \
dialogs/CustomizeDetailViewDlg.h \
dialogs/CalendarDlg.h \
dialogs/ExpiredEntriesDlg.h \
lib/random.h \
Database.h \
lib/KdePlugin.h \
@ -135,6 +142,9 @@ SOURCES += lib/IniReader.cpp \
dialogs/PasswordGenDlg.cpp \
dialogs/SelectIconDlg.cpp \
dialogs/CollectEntropyDlg.cpp \
dialogs/CustomizeDetailViewDlg.cpp \
dialogs/CalendarDlg.cpp \
dialogs/ExpiredEntriesDlg.cpp \
lib/random.cpp \
Database.cpp \
lib/KdePlugin.cpp \
@ -151,9 +161,11 @@ SOURCES += lib/IniReader.cpp \
crypto/yarrow.cpp \
lib/WaitAnimationWidget.cpp \
KpxFirefox.cpp
RESOURCES += res/resources.qrc
MOC_DIR = ../build/moc
UI_DIR = ../build/ui
OBJECTS_DIR = ../build/
RCC_DIR = ../build/rcc
CONFIG += debug \
qt \
thread \