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. 2
      src/dialogs/SelectIconDlg.cpp
  18. 2
      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();
char* buffer = new char[total_size];
file->readBlock(buffer,total_size);
file->read(buffer,total_size);
if(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];
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();
if(FileSize == 32){
if(file.readBlock((char*)MasterKey,32) != 32){
if(file.read((char*)MasterKey,32) != 32){
file.close();
return false;}
}
else if(FileSize == 64){
char hex[64];
if(file.readBlock(hex,64) != 64){
if(file.read(hex,64) != 64){
file.close();
return false;}
file.close();
@ -467,7 +467,7 @@ sha256_starts(&sha32);
unsigned char* buffer = new unsigned char[2048];
while(1)
{
unsigned long read=file.readBlock((char*)buffer,2048);
unsigned long read=file.read((char*)buffer,2048);
if(read == 0) break;
sha256_update(&sha32,buffer,read);
if(read != 2048) break;
@ -535,13 +535,13 @@ QFile file(filename);
if(file.open(QIODevice::ReadOnly) == false) return false;
unsigned long FileSize=file.size();
if(FileSize == 32){
if(file.readBlock((char*)FileKey,32) != 32){
if(file.read((char*)FileKey,32) != 32){
file.close();
return false;}
}
else if(FileSize == 64){
char hex[64];
if(file.readBlock(hex,64) != 64){
if(file.read(hex,64) != 64){
file.close();
return false;}
file.close();
@ -552,7 +552,7 @@ sha256_starts(&sha32);
unsigned char* buffer = new unsigned char[2048];
while(1)
{
unsigned long read=file.readBlock((char*)buffer,2048);
unsigned long read=file.read((char*)buffer,2048);
if(read == 0) break;
sha256_update(&sha32,buffer,read);
if(read != 2048) break;
@ -569,7 +569,7 @@ char *paKey = NULL;
if(Password == QString::null) return false;
paKey = new char[Password.length() + 1];
if(paKey == NULL) return false;
strcpy(paKey, Password);
strcpy(paKey, Password.toUtf8());
if(paKey == NULL) return false;
KeyLen = strlen(paKey);
if(KeyLen == 0) {
@ -796,23 +796,23 @@ MetaStreams << &CustomIconsMetaStream;
FileSize=DB_HEADER_SIZE;
// Get the size of all groups (94 Byte + length of the name string)
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
for(int i = 0; i < Entries.size(); i++){
FileSize += 134
+Entries[i].Title.utf8().length()+1
+Entries[i].UserName.utf8().length()+1
+Entries[i].URL.utf8().length()+1
+Entries[i].Title.toUtf8().length()+1
+Entries[i].UserName.toUtf8().length()+1
+Entries[i].URL.toUtf8().length()+1
+Entries[i].Password.length()+1
+Entries[i].Additional.utf8().length()+1
+Entries[i].BinaryDesc.utf8().length()+1
+Entries[i].Additional.toUtf8().length()+1
+Entries[i].BinaryDesc.toUtf8().length()+1
+Entries[i].BinaryData.length();
}
for(int i=0; i < MetaStreams.size(); i++){
FileSize +=164
+MetaStreams[i]->Additional.utf8().length()+1
+MetaStreams[i]->Additional.toUtf8().length()+1
+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, &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;
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;
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
@ -908,36 +908,36 @@ for(int i = 0; i < Entries.size(); i++){
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;
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;
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;
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;
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;
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;
FieldSize = Entries[i].Password.length() + 1; // Add terminating NULL character space
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
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();
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;
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;
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;
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;
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();
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
@ -996,36 +996,36 @@ for(int i = 0; i < MetaStreams.size(); i++){
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;
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;
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;
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;
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;
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;
FieldSize = MetaStreams[i]->Password.length() + 1; // Add terminating NULL character space
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
memcpyToLEnd32(buffer+pos, &FieldSize); pos += 4;
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();
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;
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;
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;
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;
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();
memcpyToLEnd16(buffer+pos, &FieldType); pos += 2;
@ -1117,7 +1117,7 @@ return false;
}
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;
return false;
}
@ -1648,7 +1648,7 @@ bool testDatabase(){
bool loadedDB = cloneDatabase.openDatabase(dbPath, err);
if (!loadedDB){
kp_assert(results, loadedDB);
cout << err.ascii() << endl;
qWarning((err+QString('\n')).toAscii());
}
assertDatabasesEq(results, &database, &cloneDatabase);

@ -38,7 +38,7 @@ using namespace std;
bool CConfig::loadFromIni(QString filename){
QString defaultSearchOptions = "001101111";
QString defaultPwGenOptions = "1111100001";
ini.SetPath((const char*)filename);
ini.SetPath((const char*)filename.toUtf8());
ini.ReadFile();
ClipboardTimeOut=ini.GetValueI("Options","ClipboardTimeOut",20);
Toolbar=ini.GetValueB("UI","ShowToolbar",true);
@ -52,10 +52,10 @@ BannerTextColor=ParseColorString(ini.GetValue("Options","BannerTextColor","222,2
ShowPasswords=ini.GetValueB("Options","ShowPasswords",false);
OpenUrlCommand=ini.GetValue("Options","UrlCmd","kfmclient openURL %1").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_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);
PwGenCharList=ini.GetValue("Options","PwGenCharList","").c_str();
ExpandGroupTree=ini.GetValueB("Options","ExpandGroupTree",true);
@ -81,34 +81,34 @@ ini.SetValueI("Options","ClipboardTimeOut",ClipboardTimeOut);
ini.SetValueB("UI","ShowToolbar",Toolbar);
ini.SetValueB("UI","ShowEntryDetails",EntryDetails);
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","");
ini.SetValue("UI","Columns",(const char*)CreateColumnString(),true);
ini.SetValue("Options","BannerColor1",(const char*)CreateColorString(BannerColor1),true);
ini.SetValue("Options","BannerColor2",(const char*)CreateColorString(BannerColor2),true);
ini.SetValue("Options","BannerTextColor",(const char*)CreateColorString(BannerTextColor),true);
ini.SetValue("UI","Columns",(const char*)CreateColumnString().toUtf8(),true);
ini.SetValue("Options","BannerColor1",(const char*)CreateColorString(BannerColor1).toUtf8(),true);
ini.SetValue("Options","BannerColor2",(const char*)CreateColorString(BannerColor2).toUtf8(),true);
ini.SetValue("Options","BannerTextColor",(const char*)CreateColorString(BannerTextColor).toUtf8(),true);
ini.SetValueB("Options","ShowPasswords",ShowPasswords,true);
ini.SetValue("Options","UrlCmd",(const char*)OpenUrlCommand,true);
ini.SetValue("Options","LangFile",(const char*)Language,true);
ini.SetValue("Options","SearchOptions",(const char*)CreateBoolString(SearchOptions,9),true);
ini.SetValue("Options","UrlCmd",(const char*)OpenUrlCommand.toUtf8(),true);
ini.SetValue("Options","LangFile",(const char*)Language.toUtf8(),true);
ini.SetValue("Options","SearchOptions",(const char*)CreateBoolString(SearchOptions,9).toUtf8(),true);
ini.SetValueB("UI","HidePasswords",ListView_HidePasswords);
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.SetValue("Options","PwGenCharList",(const char*)PwGenCharList,true);
ini.SetValue("Options","PwGenCharList",(const char*)PwGenCharList.toUtf8(),true);
ini.SetValueB("Options","ExpandGroupTree",ExpandGroupTree,true);
ini.SetValueB("KDE Plugin","Enabled",EnableKdePlugin,true);
ini.SetValueI("UI","MainWinHeight",MainWinHeight);
ini.SetValueI("UI","MainWinWidth",MainWinWidth);
ini.SetValueI("UI","MainWinSplit1",MainWinSplit1);
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("Options","AlternatingRowColors",AlternatingRowColors);
ini.SetValue("Options","MountDir",(const char*)MountDir);
ini.SetValue("Options","MountDir",(const char*)MountDir.toUtf8());
ini.SetValueB("Options","RememberLastKey",RememberLastKey);
if(RememberLastKey){
ini.SetValue("Options","LastKeyLocation",(const char*)LastKeyLocation);
ini.SetValue("Options","LastKeyLocation",(const char*)LastKeyLocation.toUtf8());
ini.SetValueI("Options","LastKeyType",LastKeyType);}
else{
ini.SetValue("Options","LastKeyLocation","");
@ -142,16 +142,16 @@ return str;
}
QColor CConfig::ParseColorString(QString str){
QStringList lst=QStringList::split(',',str);
QStringList lst=str.split(',');
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);}
bool err[3];
int r=lst[0].toUInt(err);
int g=lst[1].toUInt(err+1);
int b=lst[2].toUInt(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(r,g,b);
}

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

@ -29,7 +29,7 @@ class CAboutDialog : public QDialog, public Ui_AboutDlg
{
Q_OBJECT
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();
public slots:

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

@ -30,7 +30,7 @@ class CDbSettingsDlg : public QDialog, public Ui_dbsettingdlg_base
Q_OBJECT
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();
virtual void showEvent(QShowEvent *);
/*$PUBLIC_FUNCTIONS$*/

@ -25,8 +25,8 @@
#include <qfont.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <q3progressbar.h>
#include <q3textedit.h>
#include <QProgressBar>
#include <QTextEdit>
#include <qpixmap.h>
#include <qcolor.h>
#include <qcombobox.h>
@ -35,7 +35,6 @@
#include <QFileDialog>
#include <qmessagebox.h>
#include <qtoolbutton.h>
//Added by qt3to4:
#include <QShowEvent>
#include "SelectIconDlg.h"
@ -44,8 +43,8 @@
CEditEntryDlg::CEditEntryDlg(Database* _db, CEntry* _entry,QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
: QDialog(parent,name, modal,fl)
CEditEntryDlg::CEditEntryDlg(Database* _db, CEntry* _entry,QWidget* parent, bool modal, Qt::WFlags fl)
: QDialog(parent,fl)
{
Q_ASSERT(_db);
Q_ASSERT(_entry);
@ -74,8 +73,8 @@ ButtonSaveAttachment->setIcon(*Icon_FileSave);
if(entry->BinaryData.isNull()){
ButtonSaveAttachment->setDisabled(true);
ButtonDeleteAttachment->setDisabled(true);}
setCaption(entry->Title);
setIcon(db->icon(entry->ImageID));
setWindowTitle(entry->Title);
setWindowIcon(db->icon(entry->ImageID));
Edit_Title->setText(entry->Title);
Edit_UserName->setText(entry->UserName);
Edit_URL->setText(entry->URL);
@ -92,7 +91,7 @@ if(bits>128)
bits=128;
Progress_Quali->setValue(100*bits/128);
Edit_Attachment->setText(entry->BinaryDesc);
Edit_Comment->setText(entry->Additional);
Edit_Comment->setPlainText(entry->Additional);
InitGroupComboBox();
InitIconComboBox();
if(entry->BinaryData.length()==0)
@ -136,9 +135,9 @@ if(event->spontaneous()==false){
void CEditEntryDlg::InitIconComboBox(){
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++){
tmp="";
for(int j=0;j<db->group(i).Level;j++)tmp+=" ";
Combo_Group->insertItem(db->icon(db->group(i).ImageID),
tmp+db->group(i).Name,i);
Combo_Group->insertItem(i,db->icon(db->group(i).ImageID),
tmp+db->group(i).Name);
}
Combo_Group->setCurrentItem(db->getGroupIndex(entry->GroupID));
Combo_Group->setCurrentIndex(db->getGroupIndex(entry->GroupID));
}
void CEditEntryDlg::OnButtonOK()
@ -162,7 +161,7 @@ QMessageBox::warning(NULL,tr("Warning"),tr("Password and password repetition are
return;
}
if(CheckBox_ExpiresNever->state()==Qt::Checked){
if(CheckBox_ExpiresNever->checkState()==Qt::Checked){
DateTime_Expire->setDateTime(Date_Never);}
if(DateTime_Expire->dateTime()!=entry->Expire)
@ -173,13 +172,13 @@ if(entry->UserName!=Edit_UserName->text())
ModFlag=true;
if(entry->URL!=Edit_URL->text())
ModFlag=true;
if(entry->Additional!=Edit_Comment->text())
if(entry->Additional!=Edit_Comment->toPlainText())
ModFlag=true;
entry->Password.unlock();
if(entry->Password.string()!=Edit_Password->text())
ModFlag=true;
entry->Password.lock();
if(entry->ImageID!=Combo_IconPicker->currentItem())
if(entry->ImageID!=Combo_IconPicker->currentIndex())
ModFlag=true;
entry->Expire=DateTime_Expire->dateTime();
@ -190,14 +189,14 @@ entry->UserName=Edit_UserName->text();
entry->URL=Edit_URL->text();
QString s=Edit_Password->text();
entry->Password.setString(s,true);
entry->Additional=Edit_Comment->text();
if(Combo_Group->currentItem()!=db->getGroupIndex(entry->GroupID)){
db->moveEntry(entry,&db->group(Combo_Group->currentItem()));
entry->Additional=Edit_Comment->toPlainText();
if(Combo_Group->currentIndex()!=db->getGroupIndex(entry->GroupID)){
db->moveEntry(entry,&db->group(Combo_Group->currentIndex()));
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->ImageID=Combo_IconPicker->currentItem();
entry->ImageID=Combo_IconPicker->currentIndex();
if(ModFlag&&EntryMoved)done(2);
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){
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
{
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()
{
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
{
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()
{
QString filename=QFileDialog::getOpenFileName(this,tr("Add Attachment..."),QDir::homeDirPath());
QString filename=QFileDialog::getOpenFileName(this,tr("Add Attachment..."),QDir::homePath());
if(filename=="")return;
QFile file(filename);
if(file.open(QIODevice::ReadOnly)==false){
@ -297,7 +306,7 @@ saveAttachment(entry,this);
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.setAcceptMode(QFileDialog::AcceptSave);
if(!FileDlg.exec())return;
@ -347,7 +356,7 @@ ButtonDeleteAttachment->setDisabled(true);
void CEditEntryDlg::OnButtonGenPw()
{
CGenPwDialog* pDlg=new CGenPwDialog(this,0,true);
CGenPwDialog* pDlg=new CGenPwDialog(this,true);
pDlg->show();
}
@ -363,13 +372,13 @@ else
}
void CEditEntryDlg::OnCustomIcons(){
CSelectIconDlg dlg(db,Combo_IconPicker->currentItem(),this);
CSelectIconDlg dlg(db,Combo_IconPicker->currentIndex(),this);
int r=dlg.exec();
if(r!=-1){
Combo_IconPicker->clear();
for(int i=0;i<db->numIcons();i++)
Combo_IconPicker->insertItem(db->icon(i),"",i);
Combo_IconPicker->setCurrentItem(r);
Combo_IconPicker->insertItem(i,db->icon(i),"");
Combo_IconPicker->setCurrentIndex(r);
}
}

@ -31,7 +31,7 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
Q_OBJECT
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();
virtual void showEvent(QShowEvent *);
/*$PUBLIC_FUNCTIONS$*/

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

@ -31,7 +31,7 @@ class CEditGroupDialog : public QDialog, public Ui_EditGroupDialog
Q_OBJECT
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();
bool ModFlag;
virtual void showEvent(QShowEvent *event);

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

@ -38,7 +38,7 @@ QString keyfile;
QString password;
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 );
public slots:

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

@ -27,8 +27,8 @@
#include <qregexp.h>
#include <qmessagebox.h>
CSearchDlg::CSearchDlg(Database* _db,CGroup* pGroup,QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
: QDialog(parent,name, modal,fl)
CSearchDlg::CSearchDlg(Database* _db,CGroup* pGroup,QWidget* parent, bool modal, Qt::WFlags fl)
: QDialog(parent,fl)
{
setupUi(this);
connect( Button_Search, SIGNAL( clicked() ), this, SLOT( OnButtonSearch() ) );
@ -114,10 +114,10 @@ done(1);
bool CSearchDlg::search(const QString& str){
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;}
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;
}

@ -27,7 +27,7 @@ class CSearchDlg : public QDialog, public Ui_Search_Dlg
{
Q_OBJECT
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 );
~CSearchDlg();
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);
db=database;
CtxMenu=new QMenu(this);

@ -31,7 +31,7 @@
class CSelectIconDlg:public QDialog, public Ui_SelectIconDlg{
Q_OBJECT
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:
void OnAddIcon();

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

@ -28,7 +28,7 @@ class CSimplePasswordDialog : public QDialog, public Ui_SimplePasswordDialog
Q_OBJECT
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();
/*$PUBLIC_FUNCTIONS$*/

@ -44,7 +44,7 @@ if(!file.open(QIODevice::Truncate | QIODevice::WriteOnly)){
}
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++){
if(db->group(g).ID==db->entry(e).GroupID){
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).Password.string())
.arg(db->entry(e).Additional.replace('\n',"\n "))
.utf8());
.toUtf8());
db->entry(e).Password.lock();
}
}

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

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

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

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

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

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

@ -38,14 +38,14 @@ if(len==0){
err+=QObject::tr("File is empty.");
return false;}
quint8* buffer=new quint8[len];
file.readBlock((char*)buffer,len);
file.read((char*)buffer,len);
file.close();
QDomDocument doc;
QString xmlerr;
int col,line;
if(!doc.setContent(QString::fromUtf8((char*)buffer,len),false,&xmlerr,&line,&col)){
cout << "Import_PwManager::parseXmlContent():" << endl;
cout << (xmlerr+" (Line:%1 Column:%2)").arg(line).arg(col).ascii() << endl;
qWarning("Import_PwManager::parseXmlContent():\n");
qWarning(((xmlerr+" (Line:%1 Column:%2)").arg(line).arg(col)+QString('\n')).toAscii());
err+=QObject::tr("Invalid XML file (see stdout for details).");
delete [] buffer;
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(len=file.size()) buffer=new char[len];
else {err+=QObject::tr("File is empty."); return false;}
file.readBlock(buffer,len);
file.read(buffer,len);
file.close();
if(QString::fromAscii(buffer,17)!="PWM_PASSWORD_FILE")
{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* xml=new byte[len-offset+1];
xml[len-offset]=0;
memcpy(Key,password.ascii(),pwlen);
memcpy(Key,password.toAscii(),pwlen);
char* key_hash=new char[20];
CSHA1 sha;
sha.Update(Key,pwlen);
@ -116,8 +116,8 @@ QDomDocument db;
QString err;
int col,line;
if(!db.setContent(QString::fromUtf8(content,strlen(content)-1),false,&err,&line,&col)){
cout << "Import_PwManager::parseXmlContent():" << endl;
cout << (err+" (Line:%1 Column:%2)").arg(line).arg(col).ascii() << endl;
qWarning("Import_PwManager::parseXmlContent():\n");
qWarning(((err+" (Line:%1 Column:%2)").arg(line).arg(col)+QString('\n')).toAscii());
return false;}
QDomElement root=db.documentElement();
if(root.tagName()!="P")return false;

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

@ -357,7 +357,7 @@ DragPixmap.fill(QColor(255,255,255));
QPainter painter(&DragPixmap);
painter.setPen(QColor(0,0,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);
QMimeData *mimeData = new QMimeData;
void* pDragItems=&DragItems;

@ -196,7 +196,7 @@ void KeepassGroupView::mouseMoveEvent(QMouseEvent *event){
QPainter painter(&DragPixmap);
painter.setPen(QColor(0,0,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));
QMimeData *mimeData = new QMimeData;
mimeData->setData("keepass/group",QByteArray((char*)&(DragItem->pGroup),sizeof(void*)));

@ -21,17 +21,20 @@
#include "UrlLabel.h"
#include "main.h"
#include <qfont.h>
#include <qcolor.h>
#include <qcursor.h>
#include <qfontmetrics.h>
#include <QFont>
#include <QColor>
#include <QCursor>
#include <QFontMetrics>
#include <QMouseEvent>
#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);
setFont(font);
setPaletteForegroundColor(QColor(20,20,255));
QPalette palette;
palette.setColor(foregroundRole(),QColor(20,20,255));
setPalette(palette);
setCursor(Qt::PointingHandCursor);
setText(text);
setPos(x,y);

@ -20,14 +20,13 @@
#ifndef _LINKLABEL_H_
#define _LINKLABEL_H_
#include <qlabel.h>
#include <q3signal.h>
#include <QLabel>
#include <QMouseEvent>
class LinkLabel : public QLabel{
Q_OBJECT
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();
void setPos(int x,int y);
QString url();

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

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

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