removed all old Qt3 depedencies, Qt3Support is not longer needed

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@92 b624d157-de02-0410-bad0-e51aec6abb33
master
tarek_saidi 19 years ago
parent aabc0db11d
commit 438e27ae1e
  1. 84
      src/PwManager.cpp
  2. 38
      src/PwmConfig.cpp
  3. 12
      src/dialogs/AboutDlg.cpp
  4. 2
      src/dialogs/AboutDlg.h
  5. 12
      src/dialogs/DatabaseSettingsDlg.cpp
  6. 2
      src/dialogs/DatabaseSettingsDlg.h
  7. 71
      src/dialogs/EditEntryDlg.cpp
  8. 2
      src/dialogs/EditEntryDlg.h
  9. 14
      src/dialogs/EditGroupDlg.cpp
  10. 2
      src/dialogs/EditGroupDlg.h
  11. 12
      src/dialogs/PasswordDlg.cpp
  12. 2
      src/dialogs/PasswordDlg.h
  13. 9
      src/dialogs/PasswordGenDlg.cpp
  14. 2
      src/dialogs/PasswordGenDlg.h
  15. 8
      src/dialogs/SearchDlg.cpp
  16. 2
      src/dialogs/SearchDlg.h
  17. 4
      src/dialogs/SelectIconDlg.cpp
  18. 4
      src/dialogs/SelectIconDlg.h
  19. 4
      src/dialogs/SimplePasswordDlg.cpp
  20. 2
      src/dialogs/SimplePasswordDlg.h
  21. 4
      src/export/Export_Txt.cpp
  22. 2
      src/forms/DatabaseSettingsDlg.ui
  23. 11
      src/forms/EditEntryDlg.ui
  24. 14
      src/forms/PasswordDlg.ui
  25. 4
      src/forms/PasswordGenDlg.ui
  26. 14
      src/forms/SearchDlg.ui
  27. 11
      src/forms/SettingsDlg.ui
  28. 6
      src/import/Import_KWalletXml.cpp
  29. 8
      src/import/Import_PwManager.cpp
  30. 2
      src/lib/AutoType_X11.cpp
  31. 2
      src/lib/EntryView.cpp
  32. 2
      src/lib/GroupView.cpp
  33. 15
      src/lib/UrlLabel.cpp
  34. 5
      src/lib/UrlLabel.h
  35. 14
      src/main.cpp
  36. 46
      src/mainwindow.cpp
  37. 2
      src/src.pro

@ -87,7 +87,7 @@ if(!file->open(QIODevice::ReadWrite)){
} }
total_size=file->size(); total_size=file->size();
char* buffer = new char[total_size]; char* buffer = new char[total_size];
file->readBlock(buffer,total_size); file->read(buffer,total_size);
if(total_size < DB_HEADER_SIZE){ if(total_size < DB_HEADER_SIZE){
err=tr("Unexpected file size (DB_TOTAL_SIZE < DB_HEADER_SIZE)"); err=tr("Unexpected file size (DB_TOTAL_SIZE < DB_HEADER_SIZE)");
@ -418,7 +418,7 @@ if(Password == QString::null) return false;
paKey = new char[Password.length() + 1]; paKey = new char[Password.length() + 1];
if(paKey == NULL) return false; if(paKey == NULL) return false;
strcpy(paKey, Password); strcpy(paKey, Password.toUtf8());
@ -447,13 +447,13 @@ if(file.open(QIODevice::ReadOnly) == false) return false;
unsigned long FileSize=file.size(); unsigned long FileSize=file.size();
if(FileSize == 32){ if(FileSize == 32){
if(file.readBlock((char*)MasterKey,32) != 32){ if(file.read((char*)MasterKey,32) != 32){
file.close(); file.close();
return false;} return false;}
} }
else if(FileSize == 64){ else if(FileSize == 64){
char hex[64]; char hex[64];
if(file.readBlock(hex,64) != 64){ if(file.read(hex,64) != 64){
file.close(); file.close();
return false;} return false;}
file.close(); file.close();
@ -467,7 +467,7 @@ sha256_starts(&sha32);
unsigned char* buffer = new unsigned char[2048]; unsigned char* buffer = new unsigned char[2048];
while(1) while(1)
{ {
unsigned long read=file.readBlock((char*)buffer,2048); unsigned long read=file.read((char*)buffer,2048);
if(read == 0) break; if(read == 0) break;
sha256_update(&sha32,buffer,read); sha256_update(&sha32,buffer,read);
if(read != 2048) break; if(read != 2048) break;
@ -535,13 +535,13 @@ QFile file(filename);
if(file.open(QIODevice::ReadOnly) == false) return false; if(file.open(QIODevice::ReadOnly) == false) return false;
unsigned long FileSize=file.size(); unsigned long FileSize=file.size();
if(FileSize == 32){ if(FileSize == 32){
if(file.readBlock((char*)FileKey,32) != 32){ if(file.read((char*)FileKey,32) != 32){
file.close(); file.close();
return false;} return false;}
} }
else if(FileSize == 64){ else if(FileSize == 64){
char hex[64]; char hex[64];
if(file.readBlock(hex,64) != 64){ if(file.read(hex,64) != 64){
file.close(); file.close();
return false;} return false;}
file.close(); file.close();
@ -552,7 +552,7 @@ sha256_starts(&sha32);
unsigned char* buffer = new unsigned char[2048]; unsigned char* buffer = new unsigned char[2048];
while(1) while(1)
{ {
unsigned long read=file.readBlock((char*)buffer,2048); unsigned long read=file.read((char*)buffer,2048);
if(read == 0) break; if(read == 0) break;
sha256_update(&sha32,buffer,read); sha256_update(&sha32,buffer,read);
if(read != 2048) break; if(read != 2048) break;
@ -569,7 +569,7 @@ char *paKey = NULL;
if(Password == QString::null) return false; if(Password == QString::null) return false;
paKey = new char[Password.length() + 1]; paKey = new char[Password.length() + 1];
if(paKey == NULL) return false; if(paKey == NULL) return false;
strcpy(paKey, Password); strcpy(paKey, Password.toUtf8());
if(paKey == NULL) return false; if(paKey == NULL) return false;
KeyLen = strlen(paKey); KeyLen = strlen(paKey);
if(KeyLen == 0) { if(KeyLen == 0) {
@ -796,23 +796,23 @@ MetaStreams << &CustomIconsMetaStream;
FileSize=DB_HEADER_SIZE; FileSize=DB_HEADER_SIZE;
// Get the size of all groups (94 Byte + length of the name string) // Get the size of all groups (94 Byte + length of the name string)
for(int i = 0; i < Groups.size(); i++){ for(int i = 0; i < Groups.size(); i++){
FileSize += 94 + Groups[i].Name.utf8().length()+1; FileSize += 94 + Groups[i].Name.toUtf8().length()+1;
} }
// Get the size of all entries // Get the size of all entries
for(int i = 0; i < Entries.size(); i++){ for(int i = 0; i < Entries.size(); i++){
FileSize += 134 FileSize += 134
+Entries[i].Title.utf8().length()+1 +Entries[i].Title.toUtf8().length()+1
+Entries[i].UserName.utf8().length()+1 +Entries[i].UserName.toUtf8().length()+1
+Entries[i].URL.utf8().length()+1 +Entries[i].URL.toUtf8().length()+1
+Entries[i].Password.length()+1 +Entries[i].Password.length()+1
+Entries[i].Additional.utf8().length()+1 +Entries[i].Additional.toUtf8().length()+1
+Entries[i].BinaryDesc.utf8().length()+1 +Entries[i].BinaryDesc.toUtf8().length()+1
+Entries[i].BinaryData.length(); +Entries[i].BinaryData.length();
} }
for(int i=0; i < MetaStreams.size(); i++){ for(int i=0; i < MetaStreams.size(); i++){
FileSize +=164 FileSize +=164
+MetaStreams[i]->Additional.utf8().length()+1 +MetaStreams[i]->Additional.toUtf8().length()+1
+MetaStreams[i]->BinaryData.length(); +MetaStreams[i]->BinaryData.length();
} }
@ -845,10 +845,10 @@ for(int i=0; i < Groups.size(); i++){
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4; memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
memcpyToLEnd32(buffer+pos, &Groups[i].ID); pos += 4; memcpyToLEnd32(buffer+pos, &Groups[i].ID); pos += 4;
FieldType = 0x0002; FieldSize = Groups[i].Name.utf8().length() + 1; FieldType = 0x0002; FieldSize = Groups[i].Name.toUtf8().length() + 1;
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4; memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
memcpy(buffer+pos, Groups[i].Name.utf8(),FieldSize); pos += FieldSize; memcpy(buffer+pos, Groups[i].Name.toUtf8(),FieldSize); pos += FieldSize;
FieldType = 0x0003; FieldSize = 5; FieldType = 0x0003; FieldSize = 5;
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
@ -908,36 +908,36 @@ for(int i = 0; i < Entries.size(); i++){
FieldType = 0x0004; FieldType = 0x0004;
FieldSize = Entries[i].Title.utf8().length() + 1; // Add terminating NULL character space FieldSize = Entries[i].Title.toUtf8().length() + 1; // Add terminating NULL character space
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4; memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
memcpy(buffer+pos, Entries[i].Title.utf8(),FieldSize); pos += FieldSize; memcpy(buffer+pos, Entries[i].Title.toUtf8(),FieldSize); pos += FieldSize;
FieldType = 0x0005; FieldType = 0x0005;
FieldSize = Entries[i].URL.utf8().length() + 1; // Add terminating NULL character space FieldSize = Entries[i].URL.toUtf8().length() + 1; // Add terminating NULL character space
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4; memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
memcpy(buffer+pos, Entries[i].URL.utf8(),FieldSize); pos += FieldSize; memcpy(buffer+pos, Entries[i].URL.toUtf8(),FieldSize); pos += FieldSize;
FieldType = 0x0006; FieldType = 0x0006;
FieldSize = Entries[i].UserName.utf8().length() + 1; // Add terminating NULL character space FieldSize = Entries[i].UserName.toUtf8().length() + 1; // Add terminating NULL character space
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4; memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
memcpy(buffer+pos, Entries[i].UserName.utf8(),FieldSize); pos += FieldSize; memcpy(buffer+pos, Entries[i].UserName.toUtf8(),FieldSize); pos += FieldSize;
FieldType = 0x0007; FieldType = 0x0007;
FieldSize = Entries[i].Password.length() + 1; // Add terminating NULL character space FieldSize = Entries[i].Password.length() + 1; // Add terminating NULL character space
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4; memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
Entries[i].Password.unlock(); Entries[i].Password.unlock();
memcpy(buffer+pos, Entries[i].Password.string(),FieldSize); pos += FieldSize; memcpy(buffer+pos, Entries[i].Password.string().toUtf8(),FieldSize); pos += FieldSize;
Entries[i].Password.lock(); Entries[i].Password.lock();
FieldType = 0x0008; FieldType = 0x0008;
FieldSize = Entries[i].Additional.utf8().length() + 1; // Add terminating NULL character space FieldSize = Entries[i].Additional.toUtf8().length() + 1; // Add terminating NULL character space
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4; memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
memcpy(buffer+pos, Entries[i].Additional.utf8(),FieldSize); pos += FieldSize; memcpy(buffer+pos, Entries[i].Additional.toUtf8(),FieldSize); pos += FieldSize;
FieldType = 0x0009; FieldSize = 5; FieldType = 0x0009; FieldSize = 5;
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
@ -961,10 +961,10 @@ for(int i = 0; i < Entries.size(); i++){
dateToPackedStruct5(Entries[i].Expire,(unsigned char*)buffer+pos); pos+=5; dateToPackedStruct5(Entries[i].Expire,(unsigned char*)buffer+pos); pos+=5;
FieldType = 0x000D; FieldType = 0x000D;
FieldSize = Entries[i].BinaryDesc.utf8().length() + 1; // Add terminating NULL character space FieldSize = Entries[i].BinaryDesc.toUtf8().length() + 1; // Add terminating NULL character space
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4; memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
memcpy(buffer+pos, Entries[i].BinaryDesc.utf8(),FieldSize); pos += FieldSize; memcpy(buffer+pos, Entries[i].BinaryDesc.toUtf8(),FieldSize); pos += FieldSize;
FieldType = 0x000E; FieldSize = Entries[i].BinaryData.length(); FieldType = 0x000E; FieldSize = Entries[i].BinaryData.length();
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
@ -996,36 +996,36 @@ for(int i = 0; i < MetaStreams.size(); i++){
FieldType = 0x0004; FieldType = 0x0004;
FieldSize = MetaStreams[i]->Title.utf8().length() + 1; // Add terminating NULL character space FieldSize = MetaStreams[i]->Title.toUtf8().length() + 1; // Add terminating NULL character space
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4; memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
memcpy(buffer+pos, MetaStreams[i]->Title.utf8(),FieldSize); pos += FieldSize; memcpy(buffer+pos, MetaStreams[i]->Title.toUtf8(),FieldSize); pos += FieldSize;
FieldType = 0x0005; FieldType = 0x0005;
FieldSize = MetaStreams[i]->URL.utf8().length() + 1; // Add terminating NULL character space FieldSize = MetaStreams[i]->URL.toUtf8().length() + 1; // Add terminating NULL character space
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4; memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
memcpy(buffer+pos, MetaStreams[i]->URL.utf8(),FieldSize); pos += FieldSize; memcpy(buffer+pos, MetaStreams[i]->URL.toUtf8(),FieldSize); pos += FieldSize;
FieldType = 0x0006; FieldType = 0x0006;
FieldSize = MetaStreams[i]->UserName.utf8().length() + 1; // Add terminating NULL character space FieldSize = MetaStreams[i]->UserName.toUtf8().length() + 1; // Add terminating NULL character space
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4; memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
memcpy(buffer+pos, MetaStreams[i]->UserName.utf8(),FieldSize); pos += FieldSize; memcpy(buffer+pos, MetaStreams[i]->UserName.toUtf8(),FieldSize); pos += FieldSize;
FieldType = 0x0007; FieldType = 0x0007;
FieldSize = MetaStreams[i]->Password.length() + 1; // Add terminating NULL character space FieldSize = MetaStreams[i]->Password.length() + 1; // Add terminating NULL character space
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4; memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
MetaStreams[i]->Password.unlock(); MetaStreams[i]->Password.unlock();
memcpy(buffer+pos, MetaStreams[i]->Password.string(),FieldSize); pos += FieldSize; memcpy(buffer+pos, MetaStreams[i]->Password.string().toUtf8(),FieldSize); pos += FieldSize;
MetaStreams[i]->Password.lock(); MetaStreams[i]->Password.lock();
FieldType = 0x0008; FieldType = 0x0008;
FieldSize = MetaStreams[i]->Additional.utf8().length() + 1; // Add terminating NULL character space FieldSize = MetaStreams[i]->Additional.toUtf8().length() + 1; // Add terminating NULL character space
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4; memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
memcpy(buffer+pos, MetaStreams[i]->Additional.utf8(),FieldSize); pos += FieldSize; memcpy(buffer+pos, MetaStreams[i]->Additional.toUtf8(),FieldSize); pos += FieldSize;
FieldType = 0x0009; FieldSize = 5; FieldType = 0x0009; FieldSize = 5;
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
@ -1049,10 +1049,10 @@ for(int i = 0; i < MetaStreams.size(); i++){
dateToPackedStruct5(MetaStreams[i]->Expire,(unsigned char*)buffer+pos); pos+=5; dateToPackedStruct5(MetaStreams[i]->Expire,(unsigned char*)buffer+pos); pos+=5;
FieldType = 0x000D; FieldType = 0x000D;
FieldSize = MetaStreams[i]->BinaryDesc.utf8().length() + 1; // Add terminating NULL character space FieldSize = MetaStreams[i]->BinaryDesc.toUtf8().length() + 1; // Add terminating NULL character space
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4; memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
memcpy(buffer+pos, MetaStreams[i]->BinaryDesc.utf8(),FieldSize); pos += FieldSize; memcpy(buffer+pos, MetaStreams[i]->BinaryDesc.toUtf8(),FieldSize); pos += FieldSize;
FieldType = 0x000E; FieldSize = MetaStreams[i]->BinaryData.length(); FieldType = 0x000E; FieldSize = MetaStreams[i]->BinaryData.length();
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2; memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
@ -1117,7 +1117,7 @@ return false;
} }
file->resize(0); //truncate file->resize(0); //truncate
if(file->writeBlock(buffer,EncryptedPartSize+DB_HEADER_SIZE)!=EncryptedPartSize+DB_HEADER_SIZE){ if(file->write(buffer,EncryptedPartSize+DB_HEADER_SIZE)!=EncryptedPartSize+DB_HEADER_SIZE){
delete [] buffer; delete [] buffer;
return false; return false;
} }
@ -1648,7 +1648,7 @@ bool testDatabase(){
bool loadedDB = cloneDatabase.openDatabase(dbPath, err); bool loadedDB = cloneDatabase.openDatabase(dbPath, err);
if (!loadedDB){ if (!loadedDB){
kp_assert(results, loadedDB); kp_assert(results, loadedDB);
cout << err.ascii() << endl; qWarning((err+QString('\n')).toAscii());
} }
assertDatabasesEq(results, &database, &cloneDatabase); assertDatabasesEq(results, &database, &cloneDatabase);

@ -38,7 +38,7 @@ using namespace std;
bool CConfig::loadFromIni(QString filename){ bool CConfig::loadFromIni(QString filename){
QString defaultSearchOptions = "001101111"; QString defaultSearchOptions = "001101111";
QString defaultPwGenOptions = "1111100001"; QString defaultPwGenOptions = "1111100001";
ini.SetPath((const char*)filename); ini.SetPath((const char*)filename.toUtf8());
ini.ReadFile(); ini.ReadFile();
ClipboardTimeOut=ini.GetValueI("Options","ClipboardTimeOut",20); ClipboardTimeOut=ini.GetValueI("Options","ClipboardTimeOut",20);
Toolbar=ini.GetValueB("UI","ShowToolbar",true); Toolbar=ini.GetValueB("UI","ShowToolbar",true);
@ -52,10 +52,10 @@ BannerTextColor=ParseColorString(ini.GetValue("Options","BannerTextColor","222,2
ShowPasswords=ini.GetValueB("Options","ShowPasswords",false); ShowPasswords=ini.GetValueB("Options","ShowPasswords",false);
OpenUrlCommand=ini.GetValue("Options","UrlCmd","kfmclient openURL %1").c_str(); OpenUrlCommand=ini.GetValue("Options","UrlCmd","kfmclient openURL %1").c_str();
Language=ini.GetValue("Options","LangFile","").c_str(); Language=ini.GetValue("Options","LangFile","").c_str();
ParseBoolString(ini.GetValue("Options","SearchOptions",defaultSearchOptions.ascii()).c_str(),defaultSearchOptions,SearchOptions,9); ParseBoolString(ini.GetValue("Options","SearchOptions",(const char*)defaultSearchOptions.toUtf8()).c_str(),defaultSearchOptions,SearchOptions,9);
ListView_HidePasswords=ini.GetValueB("UI","HidePasswords",true); ListView_HidePasswords=ini.GetValueB("UI","HidePasswords",true);
ListView_HideUsernames=ini.GetValueB("UI","HideUsernames",false); ListView_HideUsernames=ini.GetValueB("UI","HideUsernames",false);
ParseBoolString(ini.GetValue("Options","PwGenOptions",defaultPwGenOptions.ascii()).c_str(),defaultPwGenOptions,PwGenOptions,10); ParseBoolString(ini.GetValue("Options","PwGenOptions",(const char*)defaultPwGenOptions.toUtf8()).c_str(),defaultPwGenOptions,PwGenOptions,10);
PwGenLength=ini.GetValueI("Options","PwGenLength",25); PwGenLength=ini.GetValueI("Options","PwGenLength",25);
PwGenCharList=ini.GetValue("Options","PwGenCharList","").c_str(); PwGenCharList=ini.GetValue("Options","PwGenCharList","").c_str();
ExpandGroupTree=ini.GetValueB("Options","ExpandGroupTree",true); ExpandGroupTree=ini.GetValueB("Options","ExpandGroupTree",true);
@ -81,34 +81,34 @@ ini.SetValueI("Options","ClipboardTimeOut",ClipboardTimeOut);
ini.SetValueB("UI","ShowToolbar",Toolbar); ini.SetValueB("UI","ShowToolbar",Toolbar);
ini.SetValueB("UI","ShowEntryDetails",EntryDetails); ini.SetValueB("UI","ShowEntryDetails",EntryDetails);
ini.SetValueB("Options","RememberLastFile",OpenLast); ini.SetValueB("Options","RememberLastFile",OpenLast);
if(OpenLast)ini.SetValue("Options","LastFile",(const char*)LastFile); if(OpenLast)ini.SetValue("Options","LastFile",(const char*)LastFile.toUtf8());
else ini.SetValue("Options","LastFile",""); else ini.SetValue("Options","LastFile","");
ini.SetValue("UI","Columns",(const char*)CreateColumnString(),true); ini.SetValue("UI","Columns",(const char*)CreateColumnString().toUtf8(),true);
ini.SetValue("Options","BannerColor1",(const char*)CreateColorString(BannerColor1),true); ini.SetValue("Options","BannerColor1",(const char*)CreateColorString(BannerColor1).toUtf8(),true);
ini.SetValue("Options","BannerColor2",(const char*)CreateColorString(BannerColor2),true); ini.SetValue("Options","BannerColor2",(const char*)CreateColorString(BannerColor2).toUtf8(),true);
ini.SetValue("Options","BannerTextColor",(const char*)CreateColorString(BannerTextColor),true); ini.SetValue("Options","BannerTextColor",(const char*)CreateColorString(BannerTextColor).toUtf8(),true);
ini.SetValueB("Options","ShowPasswords",ShowPasswords,true); ini.SetValueB("Options","ShowPasswords",ShowPasswords,true);
ini.SetValue("Options","UrlCmd",(const char*)OpenUrlCommand,true); ini.SetValue("Options","UrlCmd",(const char*)OpenUrlCommand.toUtf8(),true);
ini.SetValue("Options","LangFile",(const char*)Language,true); ini.SetValue("Options","LangFile",(const char*)Language.toUtf8(),true);
ini.SetValue("Options","SearchOptions",(const char*)CreateBoolString(SearchOptions,9),true); ini.SetValue("Options","SearchOptions",(const char*)CreateBoolString(SearchOptions,9).toUtf8(),true);
ini.SetValueB("UI","HidePasswords",ListView_HidePasswords); ini.SetValueB("UI","HidePasswords",ListView_HidePasswords);
ini.SetValueB("UI","HideUsernames",ListView_HideUsernames); ini.SetValueB("UI","HideUsernames",ListView_HideUsernames);
ini.SetValue("Options","PwGenOptions",(const char*)CreateBoolString(PwGenOptions,10),true); ini.SetValue("Options","PwGenOptions",(const char*)CreateBoolString(PwGenOptions,10).toUtf8(),true);
ini.SetValueI("Options","PwGenLength",PwGenLength,true); ini.SetValueI("Options","PwGenLength",PwGenLength,true);
ini.SetValue("Options","PwGenCharList",(const char*)PwGenCharList,true); ini.SetValue("Options","PwGenCharList",(const char*)PwGenCharList.toUtf8(),true);
ini.SetValueB("Options","ExpandGroupTree",ExpandGroupTree,true); ini.SetValueB("Options","ExpandGroupTree",ExpandGroupTree,true);
ini.SetValueB("KDE Plugin","Enabled",EnableKdePlugin,true); ini.SetValueB("KDE Plugin","Enabled",EnableKdePlugin,true);
ini.SetValueI("UI","MainWinHeight",MainWinHeight); ini.SetValueI("UI","MainWinHeight",MainWinHeight);
ini.SetValueI("UI","MainWinWidth",MainWinWidth); ini.SetValueI("UI","MainWinWidth",MainWinWidth);
ini.SetValueI("UI","MainWinSplit1",MainWinSplit1); ini.SetValueI("UI","MainWinSplit1",MainWinSplit1);
ini.SetValueI("UI","MainWinSplit2",MainWinSplit2); ini.SetValueI("UI","MainWinSplit2",MainWinSplit2);
ini.SetValue("UI","ColumnSizes",(const char*)CreateIntString(ColumnSizes,10),true); ini.SetValue("UI","ColumnSizes",(const char*)CreateIntString(ColumnSizes,10).toUtf8(),true);
ini.SetValueB("UI","ShowStatusbar",ShowStatusbar); ini.SetValueB("UI","ShowStatusbar",ShowStatusbar);
ini.SetValueB("Options","AlternatingRowColors",AlternatingRowColors); ini.SetValueB("Options","AlternatingRowColors",AlternatingRowColors);
ini.SetValue("Options","MountDir",(const char*)MountDir); ini.SetValue("Options","MountDir",(const char*)MountDir.toUtf8());
ini.SetValueB("Options","RememberLastKey",RememberLastKey); ini.SetValueB("Options","RememberLastKey",RememberLastKey);
if(RememberLastKey){ if(RememberLastKey){
ini.SetValue("Options","LastKeyLocation",(const char*)LastKeyLocation); ini.SetValue("Options","LastKeyLocation",(const char*)LastKeyLocation.toUtf8());
ini.SetValueI("Options","LastKeyType",LastKeyType);} ini.SetValueI("Options","LastKeyType",LastKeyType);}
else{ else{
ini.SetValue("Options","LastKeyLocation",""); ini.SetValue("Options","LastKeyLocation","");
@ -142,16 +142,16 @@ return str;
} }
QColor CConfig::ParseColorString(QString str){ QColor CConfig::ParseColorString(QString str){
QStringList lst=QStringList::split(',',str); QStringList lst=str.split(',');
if(lst.size()!=3){ if(lst.size()!=3){
qWarning(QObject::tr("Warning:")+" CConfig::ParseColorString(QString):"+QObject::tr("Invalid RGB color value.\n")); qWarning((QObject::tr("Warning:")+" CConfig::ParseColorString(QString):"+QObject::tr("Invalid RGB color value.\n")).toUtf8());
return QColor(0,0,0);} return QColor(0,0,0);}
bool err[3]; bool err[3];
int r=lst[0].toUInt(err); int r=lst[0].toUInt(err);
int g=lst[1].toUInt(err+1); int g=lst[1].toUInt(err+1);
int b=lst[2].toUInt(err+2); int b=lst[2].toUInt(err+2);
if(!err[0] || !err[1] || !err[2]){ if(!err[0] || !err[1] || !err[2]){
qWarning(QObject::tr("Warning:")+" CConfig::ParseColorString(QString):"+QObject::tr("Invalid RGB color value.\n")); qWarning((QObject::tr("Warning:")+" CConfig::ParseColorString(QString):"+QObject::tr("Invalid RGB color value.\n")).toUtf8());
return QColor(0,0,0);} return QColor(0,0,0);}
return QColor(r,g,b); return QColor(r,g,b);
} }

@ -26,8 +26,8 @@
#include "main.h" #include "main.h"
#include "AboutDlg.h" #include "AboutDlg.h"
CAboutDialog::CAboutDialog(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) CAboutDialog::CAboutDialog(QWidget* parent,bool modal, Qt::WFlags fl)
: QDialog(parent,name, modal,fl) : QDialog(parent,fl)
{ {
setupUi(this); setupUi(this);
createBanner(Banner,Icon_Key32x32,tr("KeePassX %1").arg(KEEPASS_VERSION)); createBanner(Banner,Icon_Key32x32,tr("KeePassX %1").arg(KEEPASS_VERSION));
@ -42,7 +42,7 @@ if(TrActive){
} }
AboutTr+="<br>"; AboutTr+="<br>";
} }
Edit_Translation->setText(AboutTr+tr("\ Edit_Translation->setHtml(AboutTr+tr("\
Information on how to translate KeePassX can be found under:\n\ Information on how to translate KeePassX can be found under:\n\
http://keepass.berlios.de/")); http://keepass.berlios.de/"));
QString str; QString str;
@ -55,7 +55,7 @@ str+="</div><br><div style='margin-left:0px;'>";
str+="<b>"+tr("Thanks To")+"</b>"; str+="<b>"+tr("Thanks To")+"</b>";
str+="</div><div style='margin-left:10px;'>"; str+="</div><div style='margin-left:10px;'>";
str+="<u>"+tr("Matthias Miller")+"</u><br>"+tr("Patches for better MacOS X support")+"<br>"+tr("www.outofhanwell.com")+"<br></div>"; str+="<u>"+tr("Matthias Miller")+"</u><br>"+tr("Patches for better MacOS X support")+"<br>"+tr("www.outofhanwell.com")+"<br></div>";
Edit_Thanks->setText(str); Edit_Thanks->setHtml(str);
} }
CAboutDialog::~CAboutDialog() CAboutDialog::~CAboutDialog()
@ -86,9 +86,9 @@ return;
} }
char* buffer=new char[gpl.size()]; char* buffer=new char[gpl.size()];
long l=gpl.readBlock(buffer,gpl.size()); long l=gpl.read(buffer,gpl.size());
gpl.close(); gpl.close();
Edit_License->setText(QString::fromUtf8(buffer,l)); Edit_License->setHtml(QString::fromUtf8(buffer,l));
delete buffer; delete buffer;
} }

@ -29,7 +29,7 @@ class CAboutDialog : public QDialog, public Ui_AboutDlg
{ {
Q_OBJECT Q_OBJECT
public: public:
CAboutDialog(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); CAboutDialog(QWidget* parent = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
~CAboutDialog(); ~CAboutDialog();
public slots: public slots:

@ -26,8 +26,8 @@
#include "DatabaseSettingsDlg.h" #include "DatabaseSettingsDlg.h"
CDbSettingsDlg::CDbSettingsDlg(QWidget* parent,Database* db, const char* name, bool modal, Qt::WFlags fl) CDbSettingsDlg::CDbSettingsDlg(QWidget* parent,Database* db, bool modal, Qt::WFlags fl)
: QDialog(parent,name, modal,fl) : QDialog(parent,fl)
{ {
setupUi(this); setupUi(this);
database=db; database=db;
@ -42,9 +42,9 @@ CDbSettingsDlg::~CDbSettingsDlg()
void CDbSettingsDlg::showEvent(QShowEvent *event){ void CDbSettingsDlg::showEvent(QShowEvent *event){
if(event->spontaneous()==false){ if(event->spontaneous()==false){
createBanner(Banner,Icon_Settings32x32,tr("Settings")); createBanner(Banner,Icon_Settings32x32,tr("Settings"));
ComboAlgo->insertItem(tr("AES(Rijndael): 256 Bit (default)"),0); ComboAlgo->insertItem(0,tr("AES(Rijndael): 256 Bit (default)"));
ComboAlgo->insertItem(tr("Twofish: 256 Bit"),1); ComboAlgo->insertItem(1,tr("Twofish: 256 Bit"));
ComboAlgo->setCurrentItem(database->CryptoAlgorithmus); //Achtung: AlgoID muss gleich dem ComboBox Index sein! ComboAlgo->setCurrentIndex(database->CryptoAlgorithmus); //Achtung: AlgoID muss gleich dem ComboBox Index sein!
EditRounds->setText(QString::number(database->KeyEncRounds)); EditRounds->setText(QString::number(database->KeyEncRounds));
} }
@ -73,7 +73,7 @@ QMessageBox::warning(NULL,tr("Error"),tr("The number of encryption rounds have t
return; return;
} }
database->KeyEncRounds=rounds; database->KeyEncRounds=rounds;
database->CryptoAlgorithmus=ComboAlgo->currentItem(); database->CryptoAlgorithmus=ComboAlgo->currentIndex();
done(1); done(1);
} }

@ -30,7 +30,7 @@ class CDbSettingsDlg : public QDialog, public Ui_dbsettingdlg_base
Q_OBJECT Q_OBJECT
public: public:
CDbSettingsDlg(QWidget* parent,Database* db,const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); CDbSettingsDlg(QWidget* parent,Database* db, bool modal = FALSE, Qt::WFlags fl = 0 );
~CDbSettingsDlg(); ~CDbSettingsDlg();
virtual void showEvent(QShowEvent *); virtual void showEvent(QShowEvent *);
/*$PUBLIC_FUNCTIONS$*/ /*$PUBLIC_FUNCTIONS$*/

@ -25,8 +25,8 @@
#include <qfont.h> #include <qfont.h>
#include <qlineedit.h> #include <qlineedit.h>
#include <qlabel.h> #include <qlabel.h>
#include <q3progressbar.h> #include <QProgressBar>
#include <q3textedit.h> #include <QTextEdit>
#include <qpixmap.h> #include <qpixmap.h>
#include <qcolor.h> #include <qcolor.h>
#include <qcombobox.h> #include <qcombobox.h>
@ -35,7 +35,6 @@
#include <QFileDialog> #include <QFileDialog>
#include <qmessagebox.h> #include <qmessagebox.h>
#include <qtoolbutton.h> #include <qtoolbutton.h>
//Added by qt3to4:
#include <QShowEvent> #include <QShowEvent>
#include "SelectIconDlg.h" #include "SelectIconDlg.h"
@ -44,8 +43,8 @@
CEditEntryDlg::CEditEntryDlg(Database* _db, CEntry* _entry,QWidget* parent, const char* name, bool modal, Qt::WFlags fl) CEditEntryDlg::CEditEntryDlg(Database* _db, CEntry* _entry,QWidget* parent, bool modal, Qt::WFlags fl)
: QDialog(parent,name, modal,fl) : QDialog(parent,fl)
{ {
Q_ASSERT(_db); Q_ASSERT(_db);
Q_ASSERT(_entry); Q_ASSERT(_entry);
@ -74,8 +73,8 @@ ButtonSaveAttachment->setIcon(*Icon_FileSave);
if(entry->BinaryData.isNull()){ if(entry->BinaryData.isNull()){
ButtonSaveAttachment->setDisabled(true); ButtonSaveAttachment->setDisabled(true);
ButtonDeleteAttachment->setDisabled(true);} ButtonDeleteAttachment->setDisabled(true);}
setCaption(entry->Title); setWindowTitle(entry->Title);
setIcon(db->icon(entry->ImageID)); setWindowIcon(db->icon(entry->ImageID));
Edit_Title->setText(entry->Title); Edit_Title->setText(entry->Title);
Edit_UserName->setText(entry->UserName); Edit_UserName->setText(entry->UserName);
Edit_URL->setText(entry->URL); Edit_URL->setText(entry->URL);
@ -92,7 +91,7 @@ if(bits>128)
bits=128; bits=128;
Progress_Quali->setValue(100*bits/128); Progress_Quali->setValue(100*bits/128);
Edit_Attachment->setText(entry->BinaryDesc); Edit_Attachment->setText(entry->BinaryDesc);
Edit_Comment->setText(entry->Additional); Edit_Comment->setPlainText(entry->Additional);
InitGroupComboBox(); InitGroupComboBox();
InitIconComboBox(); InitIconComboBox();
if(entry->BinaryData.length()==0) if(entry->BinaryData.length()==0)
@ -136,9 +135,9 @@ if(event->spontaneous()==false){
void CEditEntryDlg::InitIconComboBox(){ void CEditEntryDlg::InitIconComboBox(){
for(int i=0;i<db->numIcons();i++){ for(int i=0;i<db->numIcons();i++){
Combo_IconPicker->insertItem(db->icon(i),"",i); Combo_IconPicker->insertItem(i,db->icon(i),"");
} }
Combo_IconPicker->setCurrentItem(entry->ImageID); Combo_IconPicker->setCurrentIndex(entry->ImageID);
} }
@ -148,10 +147,10 @@ int i;
for(i=0;i!=db->numGroups();i++){ for(i=0;i!=db->numGroups();i++){
tmp=""; tmp="";
for(int j=0;j<db->group(i).Level;j++)tmp+=" "; for(int j=0;j<db->group(i).Level;j++)tmp+=" ";
Combo_Group->insertItem(db->icon(db->group(i).ImageID), Combo_Group->insertItem(i,db->icon(db->group(i).ImageID),
tmp+db->group(i).Name,i); tmp+db->group(i).Name);
} }
Combo_Group->setCurrentItem(db->getGroupIndex(entry->GroupID)); Combo_Group->setCurrentIndex(db->getGroupIndex(entry->GroupID));
} }
void CEditEntryDlg::OnButtonOK() void CEditEntryDlg::OnButtonOK()
@ -162,7 +161,7 @@ QMessageBox::warning(NULL,tr("Warning"),tr("Password and password repetition are
return; return;
} }
if(CheckBox_ExpiresNever->state()==Qt::Checked){ if(CheckBox_ExpiresNever->checkState()==Qt::Checked){
DateTime_Expire->setDateTime(Date_Never);} DateTime_Expire->setDateTime(Date_Never);}
if(DateTime_Expire->dateTime()!=entry->Expire) if(DateTime_Expire->dateTime()!=entry->Expire)
@ -173,13 +172,13 @@ if(entry->UserName!=Edit_UserName->text())
ModFlag=true; ModFlag=true;
if(entry->URL!=Edit_URL->text()) if(entry->URL!=Edit_URL->text())
ModFlag=true; ModFlag=true;
if(entry->Additional!=Edit_Comment->text()) if(entry->Additional!=Edit_Comment->toPlainText())
ModFlag=true; ModFlag=true;
entry->Password.unlock(); entry->Password.unlock();
if(entry->Password.string()!=Edit_Password->text()) if(entry->Password.string()!=Edit_Password->text())
ModFlag=true; ModFlag=true;
entry->Password.lock(); entry->Password.lock();
if(entry->ImageID!=Combo_IconPicker->currentItem()) if(entry->ImageID!=Combo_IconPicker->currentIndex())
ModFlag=true; ModFlag=true;
entry->Expire=DateTime_Expire->dateTime(); entry->Expire=DateTime_Expire->dateTime();
@ -190,14 +189,14 @@ entry->UserName=Edit_UserName->text();
entry->URL=Edit_URL->text(); entry->URL=Edit_URL->text();
QString s=Edit_Password->text(); QString s=Edit_Password->text();
entry->Password.setString(s,true); entry->Password.setString(s,true);
entry->Additional=Edit_Comment->text(); entry->Additional=Edit_Comment->toPlainText();
if(Combo_Group->currentItem()!=db->getGroupIndex(entry->GroupID)){ if(Combo_Group->currentIndex()!=db->getGroupIndex(entry->GroupID)){
db->moveEntry(entry,&db->group(Combo_Group->currentItem())); db->moveEntry(entry,&db->group(Combo_Group->currentIndex()));
EntryMoved=true; ModFlag=true; EntryMoved=true; ModFlag=true;
} }
if(entry->ImageID<BUILTIN_ICONS && Combo_IconPicker->currentItem()>=BUILTIN_ICONS) if(entry->ImageID<BUILTIN_ICONS && Combo_IconPicker->currentIndex()>=BUILTIN_ICONS)
entry->OldImgID=entry->ImageID; entry->OldImgID=entry->ImageID;
entry->ImageID=Combo_IconPicker->currentItem(); entry->ImageID=Combo_IconPicker->currentIndex();
if(ModFlag&&EntryMoved)done(2); if(ModFlag&&EntryMoved)done(2);
else if(ModFlag)done(1); else if(ModFlag)done(1);
@ -238,10 +237,15 @@ void CEditEntryDlg::OnPasswordwTextChanged(const QString& w)
{ {
if(QString::compare(Edit_Password_w->text(),Edit_Password->text().mid(0,(Edit_Password_w->text().length())))!=0){ if(QString::compare(Edit_Password_w->text(),Edit_Password->text().mid(0,(Edit_Password_w->text().length())))!=0){
Edit_Password_w->setPaletteBackgroundColor(QColor(255,125,125)); QPalette palette;
palette.setColor(Edit_Password_w->foregroundRole(),QColor(255,125,125));
Edit_Password_w->setPalette(palette);
}else }else
{ {
Edit_Password_w->setPaletteBackgroundColor(QColor(255,255,255)); ///@FIXME Standard-Hintergrundfarbe nicht weiß ///@FIXME should set correct background color... it's not always white!
QPalette palette;
palette.setColor(Edit_Password_w->foregroundRole(),QColor(255,255,255));
Edit_Password_w->setPalette(palette);
} }
@ -251,11 +255,16 @@ Edit_Password_w->setPaletteBackgroundColor(QColor(255,255,255)); ///@FIXME Stand
void CEditEntryDlg::OnPasswordwLostFocus() void CEditEntryDlg::OnPasswordwLostFocus()
{ {
if(QString::compare(Edit_Password_w->text(),Edit_Password->text())!=0){ if(QString::compare(Edit_Password_w->text(),Edit_Password->text())!=0){
Edit_Password_w->setPaletteBackgroundColor(QColor(255,125,125)); QPalette palette;
palette.setColor(Edit_Password_w->foregroundRole(),QColor(255,125,125));
Edit_Password_w->setPalette(palette);
} }
else else
{ {
Edit_Password_w->setPaletteBackgroundColor(QColor(255,255,255)); ///@FIXME Standard-Hintergrundfarbe nicht weiß ///@FIXME should set correct background color... it's not always white!
QPalette palette;
palette.setColor(Edit_Password_w->foregroundRole(),QColor(255,255,255));
Edit_Password_w->setPalette(palette);
} }
@ -263,7 +272,7 @@ Edit_Password_w->setPaletteBackgroundColor(QColor(255,255,255)); ///@FIXME Stand
void CEditEntryDlg::OnNewAttachment() void CEditEntryDlg::OnNewAttachment()
{ {
QString filename=QFileDialog::getOpenFileName(this,tr("Add Attachment..."),QDir::homeDirPath()); QString filename=QFileDialog::getOpenFileName(this,tr("Add Attachment..."),QDir::homePath());
if(filename=="")return; if(filename=="")return;
QFile file(filename); QFile file(filename);
if(file.open(QIODevice::ReadOnly)==false){ if(file.open(QIODevice::ReadOnly)==false){
@ -297,7 +306,7 @@ saveAttachment(entry,this);
void CEditEntryDlg::saveAttachment(CEntry* pEntry, QWidget* ParentWidget) void CEditEntryDlg::saveAttachment(CEntry* pEntry, QWidget* ParentWidget)
{ {
QFileDialog FileDlg(ParentWidget,tr("Save Attachment..."),QDir::homeDirPath()); QFileDialog FileDlg(ParentWidget,tr("Save Attachment..."),QDir::homePath());
FileDlg.selectFile(pEntry->BinaryDesc); FileDlg.selectFile(pEntry->BinaryDesc);
FileDlg.setAcceptMode(QFileDialog::AcceptSave); FileDlg.setAcceptMode(QFileDialog::AcceptSave);
if(!FileDlg.exec())return; if(!FileDlg.exec())return;
@ -347,7 +356,7 @@ ButtonDeleteAttachment->setDisabled(true);
void CEditEntryDlg::OnButtonGenPw() void CEditEntryDlg::OnButtonGenPw()
{ {
CGenPwDialog* pDlg=new CGenPwDialog(this,0,true); CGenPwDialog* pDlg=new CGenPwDialog(this,true);
pDlg->show(); pDlg->show();
} }
@ -363,13 +372,13 @@ else
} }
void CEditEntryDlg::OnCustomIcons(){ void CEditEntryDlg::OnCustomIcons(){
CSelectIconDlg dlg(db,Combo_IconPicker->currentItem(),this); CSelectIconDlg dlg(db,Combo_IconPicker->currentIndex(),this);
int r=dlg.exec(); int r=dlg.exec();
if(r!=-1){ if(r!=-1){
Combo_IconPicker->clear(); Combo_IconPicker->clear();
for(int i=0;i<db->numIcons();i++) for(int i=0;i<db->numIcons();i++)
Combo_IconPicker->insertItem(db->icon(i),"",i); Combo_IconPicker->insertItem(i,db->icon(i),"");
Combo_IconPicker->setCurrentItem(r); Combo_IconPicker->setCurrentIndex(r);
} }
} }

@ -31,7 +31,7 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
Q_OBJECT Q_OBJECT
public: public:
CEditEntryDlg(Database* _db, CEntry* _entry,QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0); CEditEntryDlg(Database* _db, CEntry* _entry,QWidget* parent = 0, bool modal = FALSE, Qt::WFlags fl = 0);
~CEditEntryDlg(); ~CEditEntryDlg();
virtual void showEvent(QShowEvent *); virtual void showEvent(QShowEvent *);
/*$PUBLIC_FUNCTIONS$*/ /*$PUBLIC_FUNCTIONS$*/

@ -27,8 +27,8 @@
#include "SelectIconDlg.h" #include "SelectIconDlg.h"
CEditGroupDialog::CEditGroupDialog(Database* database,QWidget* parent, const char* name, bool modal, Qt::WFlags fl) CEditGroupDialog::CEditGroupDialog(Database* database,QWidget* parent, bool modal, Qt::WFlags fl)
: QDialog(parent,name, modal,fl) : QDialog(parent,fl)
{ {
setupUi(this); setupUi(this);
db=database; db=database;
@ -47,16 +47,16 @@ void CEditGroupDialog::showEvent(QShowEvent *event){
if(event->spontaneous()==false){ if(event->spontaneous()==false){
EditTitle->setText(GroupName); EditTitle->setText(GroupName);
for(int i=0;i<db->numIcons();i++){ for(int i=0;i<db->numIcons();i++){
ComboIconPicker->insertItem(db->icon(i),"",i); ComboIconPicker->insertItem(i,db->icon(i),"");
} }
ComboIconPicker->setCurrentItem(IconID); ComboIconPicker->setCurrentIndex(IconID);
} }
} }
void CEditGroupDialog::OnOK() void CEditGroupDialog::OnOK()
{ {
GroupName=EditTitle->text(); GroupName=EditTitle->text();
IconID=ComboIconPicker->currentItem(); IconID=ComboIconPicker->currentIndex();
done(1); done(1);
} }
@ -72,8 +72,8 @@ int r=dlg.exec();
if(r!=-1){ if(r!=-1){
ComboIconPicker->clear(); ComboIconPicker->clear();
for(int i=0;i<db->numIcons();i++) for(int i=0;i<db->numIcons();i++)
ComboIconPicker->insertItem(db->icon(i),"",i); ComboIconPicker->insertItem(i,db->icon(i),"");
IconID=r; IconID=r;
ComboIconPicker->setCurrentItem(IconID); ComboIconPicker->setCurrentIndex(IconID);
} }
} }

@ -31,7 +31,7 @@ class CEditGroupDialog : public QDialog, public Ui_EditGroupDialog
Q_OBJECT Q_OBJECT
public: public:
CEditGroupDialog(Database*,QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); CEditGroupDialog(Database*,QWidget* parent = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
~CEditGroupDialog(); ~CEditGroupDialog();
bool ModFlag; bool ModFlag;
virtual void showEvent(QShowEvent *event); virtual void showEvent(QShowEvent *event);

@ -31,15 +31,15 @@
#include <QMessageBox> #include <QMessageBox>
CPasswordDialog::CPasswordDialog(QWidget* parent, const char* name, bool modal, bool ShowExitButton,bool ChangeKeyMode, Qt::WFlags fl) CPasswordDialog::CPasswordDialog(QWidget* parent, bool modal, bool ShowExitButton,bool ChangeKeyMode, Qt::WFlags fl)
: QDialog(parent,name, modal,fl) : QDialog(parent,fl)
{ {
setupUi(this); setupUi(this);
createBanner(Banner,Icon_Key32x32,tr("Database Key")); createBanner(Banner,Icon_Key32x32,tr("Database Key"));
QDir media(config.MountDir); QDir media(config.MountDir);
if(media.exists()){ if(media.exists()){
QStringList Paths; QStringList Paths;
Paths=media.entryList("*",QDir::Dirs); Paths=media.entryList(QStringList()<<"*",QDir::Dirs);
Paths.erase(Paths.begin()); // delete "." Paths.erase(Paths.begin()); // delete "."
Paths.erase(Paths.begin()); // delete ".." Paths.erase(Paths.begin()); // delete ".."
for(int i=0;i<Paths.count();i++) for(int i=0;i<Paths.count();i++)
@ -124,7 +124,7 @@ KeyType=BOTH;
void CPasswordDialog::OnButtonBrowse() void CPasswordDialog::OnButtonBrowse()
{ {
QString filename=QFileDialog::getOpenFileName(this,tr("Select a Key File"),QDir::homeDirPath(),tr("*.key")); QString filename=QFileDialog::getOpenFileName(this,tr("Select a Key File"),QDir::homePath(),tr("*.key"));
if(filename=="")return; if(filename=="")return;
QFile file(filename); QFile file(filename);
if(file.exists()){ if(file.exists()){
@ -136,7 +136,7 @@ QMessageBox::warning(this,tr("Error"),tr("Unexpected Error: File does not exist.
void CPasswordDialog::OnButtonBrowse_Set() void CPasswordDialog::OnButtonBrowse_Set()
{ {
QString filename=QFileDialog::getSaveFileName(this,tr("Select a Key File"),QDir::homeDirPath(),tr("*.key")); QString filename=QFileDialog::getSaveFileName(this,tr("Select a Key File"),QDir::homePath(),tr("*.key"));
if(filename=="")return; if(filename=="")return;
Combo_Dirs->setEditText(filename); Combo_Dirs->setEditText(filename);
} }
@ -179,7 +179,7 @@ if(KeyType==BOTH || KeyType==KEYFILE){
if(!file.exists()){ if(!file.exists()){
QDir dir(keyfile); QDir dir(keyfile);
QStringList files; QStringList files;
files=dir.entryList("*.key",QDir::Files); files=dir.entryList(QStringList()<<"*.key",QDir::Files);
if(!files.size()){ if(!files.size()){
QMessageBox::warning(this,tr("Error"),tr("The given directory does not contain any key files."),tr("OK"),"","",0,0); QMessageBox::warning(this,tr("Error"),tr("The given directory does not contain any key files."),tr("OK"),"","",0,0);
return;} return;}

@ -38,7 +38,7 @@ QString keyfile;
QString password; QString password;
tKeyType KeyType; tKeyType KeyType;
CPasswordDialog(QWidget* parent = 0, const char* name = 0, bool modal = false, CPasswordDialog(QWidget* parent = 0, bool modal = false,
bool ShowExitButton = false, bool KeyMode_Set=false, Qt::WFlags fl = 0 ); bool ShowExitButton = false, bool KeyMode_Set=false, Qt::WFlags fl = 0 );
public slots: public slots:

@ -27,8 +27,8 @@
#include <qcheckbox.h> #include <qcheckbox.h>
#include <QProgressBar> #include <QProgressBar>
CGenPwDialog::CGenPwDialog(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) CGenPwDialog::CGenPwDialog(QWidget* parent, bool modal, Qt::WFlags fl)
: QDialog(parent,name, modal,fl) : QDialog(parent,fl)
{ {
setupUi(this); setupUi(this);
createBanner(Banner,Icon_Key32x32,tr("Password Generator")); createBanner(Banner,Icon_Key32x32,tr("Password Generator"));
@ -187,8 +187,9 @@ if(checkBox8->isChecked())bits=length*8;
else bits=length*7; else bits=length*7;
Label_Bits->setText(tr("%1 Bit").arg(QString::number(bits))); Label_Bits->setText(tr("%1 Bit").arg(QString::number(bits)));
if(bits>128)bits=128; if(bits>128)bits=128;
Progress_Quali->setProgress(bits,128); Progress_Quali->setRange(0,128);
Progress_Quali->setPercentageVisible(false); Progress_Quali->setValue(bits);
Progress_Quali->setTextVisible(false);
} }
int CGenPwDialog::AddToAssoctable(char* table,int start,int end,int pos){ int CGenPwDialog::AddToAssoctable(char* table,int start,int end,int pos){

@ -32,7 +32,7 @@ private:
int AddToAssoctable(char* table,int start,int end,int pos); int AddToAssoctable(char* table,int start,int end,int pos);
bool trim(unsigned char &value,int range); bool trim(unsigned char &value,int range);
public: public:
CGenPwDialog(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); CGenPwDialog(QWidget* parent = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
~CGenPwDialog(); ~CGenPwDialog();
/*$PUBLIC_FUNCTIONS$*/ /*$PUBLIC_FUNCTIONS$*/

@ -27,8 +27,8 @@
#include <qregexp.h> #include <qregexp.h>
#include <qmessagebox.h> #include <qmessagebox.h>
CSearchDlg::CSearchDlg(Database* _db,CGroup* pGroup,QWidget* parent, const char* name, bool modal, Qt::WFlags fl) CSearchDlg::CSearchDlg(Database* _db,CGroup* pGroup,QWidget* parent, bool modal, Qt::WFlags fl)
: QDialog(parent,name, modal,fl) : QDialog(parent,fl)
{ {
setupUi(this); setupUi(this);
connect( Button_Search, SIGNAL( clicked() ), this, SLOT( OnButtonSearch() ) ); connect( Button_Search, SIGNAL( clicked() ), this, SLOT( OnButtonSearch() ) );
@ -114,10 +114,10 @@ done(1);
bool CSearchDlg::search(const QString& str){ bool CSearchDlg::search(const QString& str){
if(regexp){ if(regexp){
QRegExp exp(txt,checkBox_Cs->isChecked()); QRegExp exp(txt,checkBox_Cs->isChecked() ? Qt::CaseSensitive : Qt::CaseInsensitive);
if(str.contains(exp)==0)return false;} if(str.contains(exp)==0)return false;}
else{ else{
if(str.contains(txt,checkBox_Cs->isChecked())==0)return false;} if(str.contains(txt,checkBox_Cs->isChecked() ? Qt::CaseSensitive : Qt::CaseInsensitive)==0)return false;}
return true; return true;
} }

@ -27,7 +27,7 @@ class CSearchDlg : public QDialog, public Ui_Search_Dlg
{ {
Q_OBJECT Q_OBJECT
public: public:
CSearchDlg(Database* _db, CGroup* pGroup=NULL,QWidget* parent = 0, const char* name = 0, CSearchDlg(Database* _db, CGroup* pGroup=NULL,QWidget* parent = 0,
bool modal = FALSE, Qt::WFlags fl = 0 ); bool modal = FALSE, Qt::WFlags fl = 0 );
~CSearchDlg(); ~CSearchDlg();
QList<quint32> Hits; QList<quint32> Hits;

@ -28,7 +28,7 @@
CSelectIconDlg::CSelectIconDlg(Database* database,int CurrentID,QWidget* parent,const char* name, bool modal, Qt::WFlags fl):QDialog(parent,name,modal,fl){ CSelectIconDlg::CSelectIconDlg(Database* database,int CurrentID,QWidget* parent, bool modal, Qt::WFlags fl):QDialog(parent,fl){
setupUi(this); setupUi(this);
db=database; db=database;
CtxMenu=new QMenu(this); CtxMenu=new QMenu(this);
@ -122,4 +122,4 @@ done(-1);
void CSelectIconDlg::OnSelectionChanged(QListWidgetItem* cur,QListWidgetItem* prev){ void CSelectIconDlg::OnSelectionChanged(QListWidgetItem* cur,QListWidgetItem* prev){
Button_PickIcon->setEnabled(cur); Button_PickIcon->setEnabled(cur);
} }

@ -31,7 +31,7 @@
class CSelectIconDlg:public QDialog, public Ui_SelectIconDlg{ class CSelectIconDlg:public QDialog, public Ui_SelectIconDlg{
Q_OBJECT Q_OBJECT
public: public:
CSelectIconDlg(Database* db,int,QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); CSelectIconDlg(Database* db,int,QWidget* parent = 0, bool modal = false, Qt::WFlags fl = 0);
public slots: public slots:
void OnAddIcon(); void OnAddIcon();
@ -54,4 +54,4 @@ protected:
}; };
#endif #endif

@ -24,8 +24,8 @@
#include "PwmConfig.h" #include "PwmConfig.h"
#include "SimplePasswordDlg.h" #include "SimplePasswordDlg.h"
CSimplePasswordDialog::CSimplePasswordDialog(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) CSimplePasswordDialog::CSimplePasswordDialog(QWidget* parent, bool modal, Qt::WFlags fl)
: QDialog(parent,name, modal,fl) : QDialog(parent,fl)
{ {
setupUi(this); setupUi(this);
if(!config.ShowPasswords)Button_HidePassword->toggle(); if(!config.ShowPasswords)Button_HidePassword->toggle();

@ -28,7 +28,7 @@ class CSimplePasswordDialog : public QDialog, public Ui_SimplePasswordDialog
Q_OBJECT Q_OBJECT
public: public:
CSimplePasswordDialog(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); CSimplePasswordDialog(QWidget* parent = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
~CSimplePasswordDialog(); ~CSimplePasswordDialog();
/*$PUBLIC_FUNCTIONS$*/ /*$PUBLIC_FUNCTIONS$*/

@ -44,7 +44,7 @@ if(!file.open(QIODevice::Truncate | QIODevice::WriteOnly)){
} }
for(int g=0;g<db->numGroups();g++){ for(int g=0;g<db->numGroups();g++){
file.write(GroupTemplate.arg(db->group(g).Name).utf8()); file.write(GroupTemplate.arg(db->group(g).Name).toUtf8());
for(int e=0;e<db->numEntries();e++){ for(int e=0;e<db->numEntries();e++){
if(db->group(g).ID==db->entry(e).GroupID){ if(db->group(g).ID==db->entry(e).GroupID){
db->entry(e).Password.unlock(); db->entry(e).Password.unlock();
@ -53,7 +53,7 @@ for(int g=0;g<db->numGroups();g++){
.arg(db->entry(e).URL) .arg(db->entry(e).URL)
.arg(db->entry(e).Password.string()) .arg(db->entry(e).Password.string())
.arg(db->entry(e).Additional.replace('\n',"\n ")) .arg(db->entry(e).Additional.replace('\n',"\n "))
.utf8()); .toUtf8());
db->entry(e).Password.lock(); db->entry(e).Password.lock();
} }
} }

@ -35,7 +35,7 @@
<property name="windowTitle" > <property name="windowTitle" >
<string>Database Settings</string> <string>Database Settings</string>
</property> </property>
<widget class="Q3GroupBox" name="groupBox1" > <widget class="QGroupBox" name="groupBox1" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>10</x> <x>10</x>

@ -275,7 +275,7 @@
</widget> </widget>
</item> </item>
<item row="7" column="1" colspan="5" > <item row="7" column="1" colspan="5" >
<widget class="Q3TextEdit" name="Edit_Comment" /> <widget class="QTextEdit" name="Edit_Comment" />
</item> </item>
<item row="11" column="0" colspan="6" > <item row="11" column="0" colspan="6" >
<widget class="Line" name="line1" > <widget class="Line" name="line1" >
@ -394,15 +394,6 @@
</widget> </widget>
<layoutdefault spacing="6" margin="11" /> <layoutdefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction> <pixmapfunction></pixmapfunction>
<customwidgets>
<customwidget>
<class>Q3TextEdit</class>
<extends></extends>
<header>q3textedit.h</header>
<container>0</container>
<pixmap></pixmap>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>Combo_Group</tabstop> <tabstop>Combo_Group</tabstop>
<tabstop>Combo_IconPicker</tabstop> <tabstop>Combo_IconPicker</tabstop>

@ -114,7 +114,7 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="Q3GroupBox" name="groupframe" > <widget class="QGroupBox" name="groupframe" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>10</x> <x>10</x>
@ -134,9 +134,6 @@
<property name="title" > <property name="title" >
<string>Key</string> <string>Key</string>
</property> </property>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<widget class="QWidget" name="layoutWidget" > <widget class="QWidget" name="layoutWidget" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
@ -321,15 +318,6 @@
</widget> </widget>
<layoutdefault spacing="6" margin="11" /> <layoutdefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction> <pixmapfunction></pixmapfunction>
<customwidgets>
<customwidget>
<class>Q3GroupBox</class>
<extends></extends>
<header>Qt3Support/Q3GroupBox</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>Edit_Password</tabstop> <tabstop>Edit_Password</tabstop>
<tabstop>Edit_PasswordRep</tabstop> <tabstop>Edit_PasswordRep</tabstop>

@ -35,7 +35,7 @@
<property name="windowTitle" > <property name="windowTitle" >
<string>Password Generator</string> <string>Password Generator</string>
</property> </property>
<widget class="Q3ProgressBar" name="Progress_Quali" > <widget class="QProgressBar" name="Progress_Quali" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>130</x> <x>130</x>
@ -165,7 +165,7 @@
<enum>QFrame::Sunken</enum> <enum>QFrame::Sunken</enum>
</property> </property>
</widget> </widget>
<widget class="Q3GroupBox" name="groupBox1" > <widget class="QGroupBox" name="groupBox1" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>10</x> <x>10</x>

@ -106,7 +106,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="Q3GroupBox" name="groupBox1" > <widget class="QGroupBox" name="groupBox1" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>10</x> <x>10</x>
@ -118,9 +118,6 @@
<property name="title" > <property name="title" >
<string>Include:</string> <string>Include:</string>
</property> </property>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<widget class="QCheckBox" name="checkBox_Title" > <widget class="QCheckBox" name="checkBox_Title" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
@ -271,15 +268,6 @@
</widget> </widget>
<layoutdefault spacing="6" margin="11" /> <layoutdefault spacing="6" margin="11" />
<pixmapfunction/> <pixmapfunction/>
<customwidgets>
<customwidget>
<class>Q3GroupBox</class>
<extends/>
<header>Qt3Support/Q3GroupBox</header>
<container>1</container>
<pixmap/>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>Edit_Search</tabstop> <tabstop>Edit_Search</tabstop>
<tabstop>checkBox_Cs</tabstop> <tabstop>checkBox_Cs</tabstop>

@ -176,7 +176,7 @@
<attribute name="title" > <attribute name="title" >
<string>Appea&amp;rance</string> <string>Appea&amp;rance</string>
</attribute> </attribute>
<widget class="Q3GroupBox" name="groupBox1" > <widget class="QGroupBox" name="groupBox1" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>20</x> <x>20</x>
@ -578,15 +578,6 @@
</widget> </widget>
<layoutdefault spacing="6" margin="11" /> <layoutdefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction> <pixmapfunction></pixmapfunction>
<customwidgets>
<customwidget>
<class>Q3GroupBox</class>
<extends></extends>
<header>Qt3Support/Q3GroupBox</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>tabWidget4</tabstop> <tabstop>tabWidget4</tabstop>
<tabstop>SpinBox_ClipboardTime</tabstop> <tabstop>SpinBox_ClipboardTime</tabstop>

@ -38,14 +38,14 @@ if(len==0){
err+=QObject::tr("File is empty."); err+=QObject::tr("File is empty.");
return false;} return false;}
quint8* buffer=new quint8[len]; quint8* buffer=new quint8[len];
file.readBlock((char*)buffer,len); file.read((char*)buffer,len);
file.close(); file.close();
QDomDocument doc; QDomDocument doc;
QString xmlerr; QString xmlerr;
int col,line; int col,line;
if(!doc.setContent(QString::fromUtf8((char*)buffer,len),false,&xmlerr,&line,&col)){ if(!doc.setContent(QString::fromUtf8((char*)buffer,len),false,&xmlerr,&line,&col)){
cout << "Import_PwManager::parseXmlContent():" << endl; qWarning("Import_PwManager::parseXmlContent():\n");
cout << (xmlerr+" (Line:%1 Column:%2)").arg(line).arg(col).ascii() << endl; qWarning(((xmlerr+" (Line:%1 Column:%2)").arg(line).arg(col)+QString('\n')).toAscii());
err+=QObject::tr("Invalid XML file (see stdout for details)."); err+=QObject::tr("Invalid XML file (see stdout for details).");
delete [] buffer; delete [] buffer;
return false;} return false;}

@ -37,7 +37,7 @@ if(!file.exists()){err+=QObject::tr("File not found."); return false;}
if(!file.open(QIODevice::ReadOnly)){err+=QObject::tr("Could not open file."); return false;} if(!file.open(QIODevice::ReadOnly)){err+=QObject::tr("Could not open file."); return false;}
if(len=file.size()) buffer=new char[len]; if(len=file.size()) buffer=new char[len];
else {err+=QObject::tr("File is empty."); return false;} else {err+=QObject::tr("File is empty."); return false;}
file.readBlock(buffer,len); file.read(buffer,len);
file.close(); file.close();
if(QString::fromAscii(buffer,17)!="PWM_PASSWORD_FILE") if(QString::fromAscii(buffer,17)!="PWM_PASSWORD_FILE")
{err+=QObject::tr("File is no valid PwManager file."); return false;} {err+=QObject::tr("File is no valid PwManager file."); return false;}
@ -76,7 +76,7 @@ int pwlen=password.length();
byte* Key=new byte[pwlen]; byte* Key=new byte[pwlen];
byte* xml=new byte[len-offset+1]; byte* xml=new byte[len-offset+1];
xml[len-offset]=0; xml[len-offset]=0;
memcpy(Key,password.ascii(),pwlen); memcpy(Key,password.toAscii(),pwlen);
char* key_hash=new char[20]; char* key_hash=new char[20];
CSHA1 sha; CSHA1 sha;
sha.Update(Key,pwlen); sha.Update(Key,pwlen);
@ -116,8 +116,8 @@ QDomDocument db;
QString err; QString err;
int col,line; int col,line;
if(!db.setContent(QString::fromUtf8(content,strlen(content)-1),false,&err,&line,&col)){ if(!db.setContent(QString::fromUtf8(content,strlen(content)-1),false,&err,&line,&col)){
cout << "Import_PwManager::parseXmlContent():" << endl; qWarning("Import_PwManager::parseXmlContent():\n");
cout << (err+" (Line:%1 Column:%2)").arg(line).arg(col).ascii() << endl; qWarning(((err+" (Line:%1 Column:%2)").arg(line).arg(col)+QString('\n')).toAscii());
return false;} return false;}
QDomElement root=db.documentElement(); QDomElement root=db.documentElement();
if(root.tagName()!="P")return false; if(root.tagName()!="P")return false;

@ -97,7 +97,7 @@ for(int i=0;i<str.size();i++){
Found '{' without closing '}'").arg(i+10); Found '{' without closing '}'").arg(i+10);
return; return;
} }
templateToKeysyms(tmpl.lower(),Keys,entry); templateToKeysyms(tmpl.toLower(),Keys,entry);
continue; continue;
} }
else else

@ -357,7 +357,7 @@ DragPixmap.fill(QColor(255,255,255));
QPainter painter(&DragPixmap); QPainter painter(&DragPixmap);
painter.setPen(QColor(0,0,0)); painter.setPen(QColor(0,0,0));
painter.setFont(DragItems[0]->font(0)); painter.setFont(DragItems[0]->font(0));
painter.drawPixmap(0,0,DragItems[0]->icon(0).pixmap()); painter.drawPixmap(0,0,DragItems[0]->icon(0).pixmap(QSize(16,16)));
painter.drawText(19,DragPixmHeight-fontmet.strikeOutPos(),DragText); painter.drawText(19,DragPixmHeight-fontmet.strikeOutPos(),DragText);
QMimeData *mimeData = new QMimeData; QMimeData *mimeData = new QMimeData;
void* pDragItems=&DragItems; void* pDragItems=&DragItems;

@ -196,7 +196,7 @@ void KeepassGroupView::mouseMoveEvent(QMouseEvent *event){
QPainter painter(&DragPixmap); QPainter painter(&DragPixmap);
painter.setPen(QColor(0,0,0)); painter.setPen(QColor(0,0,0));
painter.setFont(DragItem->font(0)); painter.setFont(DragItem->font(0));
painter.drawPixmap(0,0,DragItem->icon(0).pixmap()); painter.drawPixmap(0,0,DragItem->icon(0).pixmap(QSize(16,16)));
painter.drawText(19,DragPixmHeight-fontmet.strikeOutPos(),DragItem->text(0)); painter.drawText(19,DragPixmHeight-fontmet.strikeOutPos(),DragItem->text(0));
QMimeData *mimeData = new QMimeData; QMimeData *mimeData = new QMimeData;
mimeData->setData("keepass/group",QByteArray((char*)&(DragItem->pGroup),sizeof(void*))); mimeData->setData("keepass/group",QByteArray((char*)&(DragItem->pGroup),sizeof(void*)));

@ -21,17 +21,20 @@
#include "UrlLabel.h" #include "UrlLabel.h"
#include "main.h" #include "main.h"
#include <qfont.h> #include <QFont>
#include <qcolor.h> #include <QColor>
#include <qcursor.h> #include <QCursor>
#include <qfontmetrics.h> #include <QFontMetrics>
#include <QMouseEvent> #include <QMouseEvent>
#include <QLabel> #include <QLabel>
#include <QPalette>
LinkLabel::LinkLabel(QWidget *parent, const char* name,const QString& text, int x, int y,Qt::WFlags f) : QLabel(parent,name,f){ LinkLabel::LinkLabel(QWidget *parent,const QString& text, int x, int y,Qt::WFlags f) : QLabel(parent,f){
QFont font(parentWidget()->font()); font.setUnderline(true); QFont font(parentWidget()->font()); font.setUnderline(true);
setFont(font); setFont(font);
setPaletteForegroundColor(QColor(20,20,255)); QPalette palette;
palette.setColor(foregroundRole(),QColor(20,20,255));
setPalette(palette);
setCursor(Qt::PointingHandCursor); setCursor(Qt::PointingHandCursor);
setText(text); setText(text);
setPos(x,y); setPos(x,y);

@ -20,14 +20,13 @@
#ifndef _LINKLABEL_H_ #ifndef _LINKLABEL_H_
#define _LINKLABEL_H_ #define _LINKLABEL_H_
#include <qlabel.h> #include <QLabel>
#include <q3signal.h>
#include <QMouseEvent> #include <QMouseEvent>
class LinkLabel : public QLabel{ class LinkLabel : public QLabel{
Q_OBJECT Q_OBJECT
public: public:
LinkLabel(QWidget *parent, const char* name = 0,const QString& text=QString::null, int x=0, int y=0,Qt::WFlags f=0); LinkLabel(QWidget *parent,const QString& text=QString::null, int x=0, int y=0,Qt::WFlags f=0);
~LinkLabel(); ~LinkLabel();
void setPos(int x,int y); void setPos(int x,int y);
QString url(); QString url();

@ -88,12 +88,12 @@ parseCmdLineArgs(argc,argv,ArgFile,ArgCfg,ArgLang);
AppDir=app->applicationDirPath(); AppDir=app->applicationDirPath();
//Load Config //Load Config
if(ArgCfg==QString()){ if(ArgCfg==QString()){
if(!QDir(QDir::homeDirPath()+"/.keepass").exists()){ if(!QDir(QDir::homePath()+"/.keepass").exists()){
QDir conf(QDir::homeDirPath()); QDir conf(QDir::homePath());
if(!conf.mkdir(".keepass")){ if(!conf.mkdir(".keepass")){
cout << "Warning: Could not create directory '~/.keepass'." << endl;} cout << "Warning: Could not create directory '~/.keepass'." << endl;}
} }
IniFilename=QDir::homeDirPath()+"/.keepass/config"; IniFilename=QDir::homePath()+"/.keepass/config";
config.loadFromIni(IniFilename); config.loadFromIni(IniFilename);
} }
else{ else{
@ -117,11 +117,11 @@ bool TrFound=true;
QString locname; QString locname;
if(!translator->load("keepass-"+loc.name(),app->applicationDirPath()+"/../share/keepass/i18n/")){ if(!translator->load("keepass-"+loc.name(),app->applicationDirPath()+"/../share/keepass/i18n/")){
if(!translator->load("keepass-"+loc.name(),QDir::homeDirPath()+"/.keepass/")){ if(!translator->load("keepass-"+loc.name(),QDir::homePath()+"/.keepass/")){
if(loc.name()!="en_US") if(loc.name()!="en_US")
qWarning(QString("KeePassX: No Translation found language '%1 (%2)' using 'English (UnitedStates)'") qWarning(QString("KeePassX: No Translation found language '%1 (%2)' using 'English (UnitedStates)'")
.arg(QLocale::languageToString(loc.language())) .arg(QLocale::languageToString(loc.language()))
.arg(QLocale::countryToString(loc.country()))); .arg(QLocale::countryToString(loc.country())).toAscii());
TrFound=false; TrFound=false;
} }
} }
@ -136,7 +136,7 @@ if(!qtTranslator->load("qt_"+loc.name().left(2),QLibraryInfo::location(QLibraryI
if(loc.name()!="en_US") if(loc.name()!="en_US")
qWarning(QString("Qt: No Translation found for '%1 (%2)'using 'English (UnitedStates)'") qWarning(QString("Qt: No Translation found for '%1 (%2)'using 'English (UnitedStates)'")
.arg(QLocale::languageToString(loc.language())) .arg(QLocale::languageToString(loc.language()))
.arg(QLocale::countryToString(loc.country()))); .arg(QLocale::countryToString(loc.country())).toAscii());
delete qtTranslator; delete qtTranslator;
}else{ }else{
app->installTranslator(qtTranslator); app->installTranslator(qtTranslator);
@ -218,7 +218,7 @@ Banner->setPixmap(*banner_pixmap);
void openBrowser(QString url){ void openBrowser(QString url){
QProcess browser; QProcess browser;
QStringList args=QStringList::split(' ',config.OpenUrlCommand.arg(url)); QStringList args=config.OpenUrlCommand.arg(url).split(' ');
QString cmd=args.takeFirst(); QString cmd=args.takeFirst();
browser.startDetached(cmd,args); browser.startDetached(cmd,args);
} }

@ -278,8 +278,8 @@ Q_ASSERT(!FileOpen);
if(!IsAuto){ if(!IsAuto){
config.LastKeyLocation=QString(); config.LastKeyLocation=QString();
config.LastKeyType=PASSWORD;} config.LastKeyType=PASSWORD;}
CPasswordDialog PasswordDlg(this,"Password Dialog",true,IsAuto); CPasswordDialog PasswordDlg(this,true,IsAuto);
PasswordDlg.setCaption(filename); PasswordDlg.setWindowTitle(filename);
int r=PasswordDlg.exec(); int r=PasswordDlg.exec();
if(r==0) return; if(r==0) return;
if(r==2) {Start=false; return;} if(r==2) {Start=false; return;}
@ -299,7 +299,7 @@ StatusBarGeneral->setText(tr("Loading Database..."));
if(db->openDatabase(filename,err)==true){ if(db->openDatabase(filename,err)==true){
//SUCCESS //SUCCESS
if(config.OpenLast)config.LastFile=filename; if(config.OpenLast)config.LastFile=filename;
setCaption(tr("KeePassX - %1").arg(filename)); setWindowTitle(tr("KeePassX - %1").arg(filename));
GroupView->updateItems(); GroupView->updateItems();
EntryView->updateItems(0); EntryView->updateItems(0);
setStateFileOpen(true); setStateFileOpen(true);
@ -338,14 +338,14 @@ GroupView->Items.clear();
SearchResults.clear(); SearchResults.clear();
GroupView->ShowSearchGroup=false; GroupView->ShowSearchGroup=false;
setStateFileOpen(false); setStateFileOpen(false);
setCaption("KeePassX Password Manager"); setWindowTitle("KeePassX Password Manager");
return true; return true;
} }
void KeepassMainWindow::OnFileNew(){ void KeepassMainWindow::OnFileNew(){
CPasswordDialog dlg(this,"PasswordDlg",true,false,true); CPasswordDialog dlg(this,true,false,true);
dlg.setCaption("New Database"); dlg.setWindowTitle("New Database");
if(dlg.exec()==1){ if(dlg.exec()==1){
if(FileOpen) if(FileOpen)
if(!closeDatabase())return; if(!closeDatabase())return;
@ -364,7 +364,7 @@ if(dlg.exec()==1){
db->CalcMasterKeyByFile(dlg.keyfile); db->CalcMasterKeyByFile(dlg.keyfile);
if(dlg.password!="" && dlg.keyfile!="") if(dlg.password!="" && dlg.keyfile!="")
db->CalcMasterKeyByFileAndPw(dlg.keyfile,dlg.password); db->CalcMasterKeyByFileAndPw(dlg.keyfile,dlg.password);
setCaption(tr("KeePassX - %1").arg(tr("[new]"))); setWindowTitle(tr("KeePassX - %1").arg(tr("[new]")));
GroupView->db=db; GroupView->db=db;
EntryView->db=db; EntryView->db=db;
GroupView->updateItems(); GroupView->updateItems();
@ -427,7 +427,7 @@ else{
} }
void KeepassMainWindow::editEntry(CEntry* pEntry){ void KeepassMainWindow::editEntry(CEntry* pEntry){
CEditEntryDlg dlg(db,pEntry,this,"EditEntryDialog",true); CEditEntryDlg dlg(db,pEntry,this,true);
switch(dlg.exec()){ switch(dlg.exec()){
case 0: //canceled or no changes case 0: //canceled or no changes
break; break;
@ -480,7 +480,7 @@ default: Q_ASSERT(false);
void KeepassMainWindow::updateDetailView(){ void KeepassMainWindow::updateDetailView(){
if(EntryView->selectedItems().size()!=1){ if(EntryView->selectedItems().size()!=1){
DetailView->setText(""); DetailView->setPlainText("");
return;} return;}
CEntry& entry=*((EntryViewItem*)(EntryView->selectedItems()[0]))->pEntry; CEntry& entry=*((EntryViewItem*)(EntryView->selectedItems()[0]))->pEntry;
@ -614,18 +614,18 @@ Q_ASSERT(db->file);
if(db->file->isOpen()) db->file->close(); if(db->file->isOpen()) db->file->close();
db->file->setFileName(filename); db->file->setFileName(filename);
setCaption(tr("KeePassX - %1").arg(filename)); setWindowTitle(tr("KeePassX - %1").arg(filename));
return OnFileSave(); return OnFileSave();
} }
void KeepassMainWindow::OnFileSettings(){ void KeepassMainWindow::OnFileSettings(){
CDbSettingsDlg dlg(this,db,"DatabaseSettingsDlg"); CDbSettingsDlg dlg(this,db);
if(dlg.exec())setStateFileModified(true); if(dlg.exec())setStateFileModified(true);
} }
void KeepassMainWindow::OnFileChangeKey(){ void KeepassMainWindow::OnFileChangeKey(){
CPasswordDialog dlg(this,"PasswordDlg",true,false,true); CPasswordDialog dlg(this,true,false,true);
dlg.setCaption(db->file->fileName()); dlg.setWindowTitle(db->file->fileName());
if(dlg.exec()==1){ if(dlg.exec()==1){
if(dlg.KeyType==BOTH || dlg.KeyType==KEYFILE){ if(dlg.KeyType==BOTH || dlg.KeyType==KEYFILE){
if(!db->createKeyFile(dlg.keyfile)){ if(!db->createKeyFile(dlg.keyfile)){
@ -664,7 +664,7 @@ if(filename!=QString::null){
Q_ASSERT(!FileOpen); Q_ASSERT(!FileOpen);
db = new PwDatabase(); db = new PwDatabase();
db->newDatabase(); db->newDatabase();
CSimplePasswordDialog dlg(this,"SimplePasswordDlg",true); CSimplePasswordDialog dlg(this,true);
if(!dlg.exec()){ if(!dlg.exec()){
delete db; delete db;
db=NULL; db=NULL;
@ -677,7 +677,7 @@ if(filename!=QString::null){
Import_PwManager import; Import_PwManager import;
if(import.importFile(filename,dlg.password,db,err)==true){ if(import.importFile(filename,dlg.password,db,err)==true){
//SUCCESS //SUCCESS
setCaption(tr("KeePassX [new]")); setWindowTitle(tr("KeePassX [new]"));
GroupView->updateItems(); GroupView->updateItems();
EntryView->updateItems(0); EntryView->updateItems(0);
setStateFileOpen(true); setStateFileOpen(true);
@ -711,7 +711,7 @@ if(filename!=QString::null){
Import_KWalletXml import; Import_KWalletXml import;
if(import.importFile(filename,db,err)==true){ if(import.importFile(filename,db,err)==true){
//SUCCESS //SUCCESS
setCaption(tr("KeePassX [new]")); setWindowTitle(tr("KeePassX [new]"));
GroupView->updateItems(); GroupView->updateItems();
EntryView->updateItems(0); EntryView->updateItems(0);
setStateFileOpen(true); setStateFileOpen(true);
@ -792,7 +792,7 @@ if(GroupView->selectedItems().size())
pNew=db->addGroup(static_cast<GroupViewItem*>(GroupView->selectedItems()[0])->pGroup); pNew=db->addGroup(static_cast<GroupViewItem*>(GroupView->selectedItems()[0])->pGroup);
else else
pNew=db->addGroup(NULL); pNew=db->addGroup(NULL);
CEditGroupDialog dlg(db,this,"EditGroupDlg",true); CEditGroupDialog dlg(db,this,true);
if(!dlg.exec()){ if(!dlg.exec()){
db->deleteGroup(pNew); db->deleteGroup(pNew);
return; return;
@ -806,7 +806,7 @@ GroupView->updateItems();
void KeepassMainWindow::OnEditEditGroup(){ void KeepassMainWindow::OnEditEditGroup(){
Q_ASSERT(GroupView->selectedItems().size()); Q_ASSERT(GroupView->selectedItems().size());
CGroup *pGroup=static_cast<GroupViewItem*>(GroupView->selectedItems()[0])->pGroup; CGroup *pGroup=static_cast<GroupViewItem*>(GroupView->selectedItems()[0])->pGroup;
CEditGroupDialog dlg(db,this,"EditGroupDlg",true); CEditGroupDialog dlg(db,this,true);
dlg.GroupName=pGroup->Name; dlg.GroupName=pGroup->Name;
dlg.IconID=pGroup->ImageID; dlg.IconID=pGroup->ImageID;
if(!dlg.exec())return; if(!dlg.exec())return;
@ -831,7 +831,7 @@ setStateFileModified(true);
void KeepassMainWindow::OnEditNewEntry(){ void KeepassMainWindow::OnEditNewEntry(){
CEntry NewEntry; CEntry NewEntry;
NewEntry.GroupID=currentGroup()->ID; NewEntry.GroupID=currentGroup()->ID;
CEditEntryDlg dlg(db,&NewEntry,this,"EditEntryDialog",true); CEditEntryDlg dlg(db,&NewEntry,this,true);
if(dlg.exec()){ if(dlg.exec()){
db->addEntry(&NewEntry); db->addEntry(&NewEntry);
EntryView->updateItems(currentGroup()->ID); EntryView->updateItems(currentGroup()->ID);
@ -879,13 +879,15 @@ for(int i=0; i<SearchResults.size();i++){
void KeepassMainWindow::OnEditUsernameToClipboard(){ void KeepassMainWindow::OnEditUsernameToClipboard(){
Clipboard->setText(currentEntry()->UserName, QClipboard::Clipboard); Clipboard->setText(currentEntry()->UserName, QClipboard::Clipboard);
ClipboardTimer.start(config.ClipboardTimeOut*1000,true); ClipboardTimer.setSingleShot(true);
ClipboardTimer.start(config.ClipboardTimeOut*1000);
} }
void KeepassMainWindow::OnEditPasswordToClipboard(){ void KeepassMainWindow::OnEditPasswordToClipboard(){
currentEntry()->Password.unlock(); currentEntry()->Password.unlock();
Clipboard->setText(currentEntry()->Password.string(),QClipboard::Clipboard); Clipboard->setText(currentEntry()->Password.string(),QClipboard::Clipboard);
ClipboardTimer.start(config.ClipboardTimeOut*1000,true); ClipboardTimer.setSingleShot(true);
ClipboardTimer.start(config.ClipboardTimeOut*1000);
currentEntry()->Password.lock(); currentEntry()->Password.lock();
} }
@ -1006,7 +1008,7 @@ CGroup::UI_ExpandByDefault=config.ExpandGroupTree;
} }
void KeepassMainWindow::OnHelpAbout(){ void KeepassMainWindow::OnHelpAbout(){
CAboutDialog dlg(this,"AboutDlg"); CAboutDialog dlg(this);
dlg.exec(); dlg.exec();
} }

@ -115,7 +115,7 @@ SOURCES += lib/IniReader.cpp \
lib/EntryView.cpp \ lib/EntryView.cpp \
crypto/arcfour.cpp \ crypto/arcfour.cpp \
lib/KpFileIconProvider.cpp lib/KpFileIconProvider.cpp
QT += xml qt3support QT += xml
MOC_DIR = ../build/moc MOC_DIR = ../build/moc
UI_DIR = ../build/ui UI_DIR = ../build/ui
OBJECTS_DIR = ../build/ OBJECTS_DIR = ../build/