git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@146 b624d157-de02-0410-bad0-e51aec6abb33
master
tarek_saidi 18 years ago
parent 13c5615698
commit 65e5da4649
  1. BIN
      share/keepass/icons/bookmark.png
  2. BIN
      share/keepass/icons/bookmark_add.png
  3. BIN
      share/keepass/icons/bookmark_edit.png
  4. BIN
      share/keepass/icons/bookmark_folder.png
  5. BIN
      share/keepass/icons/document.png
  6. BIN
      share/keepass/icons/down.png
  7. BIN
      share/keepass/icons/up.png
  8. 3
      src/Kdb3Database.cpp
  9. 4
      src/KpxConfig.h
  10. 1
      src/crypto/arcfour.cpp
  11. 11
      src/dialogs/AboutDlg.cpp
  12. 58
      src/dialogs/AddBookmarkDlg.cpp
  13. 41
      src/dialogs/AddBookmarkDlg.h
  14. 17
      src/dialogs/EditEntryDlg.cpp
  15. 117
      src/dialogs/ManageBookmarksDlg.cpp
  16. 44
      src/dialogs/ManageBookmarksDlg.h
  17. 81
      src/dialogs/PasswordDlg.cpp
  18. 9
      src/dialogs/PasswordDlg.h
  19. 7
      src/dialogs/SettingsDlg.cpp
  20. 113
      src/forms/AboutDlg.ui
  21. 58
      src/forms/AddBookmarkDlg.ui
  22. 21
      src/forms/MainWindow.ui
  23. 69
      src/forms/ManageBookmarksDlg.ui
  24. 538
      src/forms/PasswordDlg.ui
  25. 2
      src/forms/SettingsDlg.ui
  26. 1
      src/lib/EntryView.cpp
  27. 127
      src/lib/bookmarks.cpp
  28. 49
      src/lib/bookmarks.h
  29. 2
      src/main.cpp
  30. 94
      src/mainwindow.cpp
  31. 2
      src/mainwindow.h
  32. 27
      src/src.pro

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -103,7 +103,7 @@ int Kdb3Database::numIcons(){
bool Kdb3Database::parseMetaStream(const StdEntry& entry){
qDebug("%s",entry.Comment.toUtf8().data());
qDebug("Found Metastream: %s",entry.Comment.toUtf8().data());
if(entry.Comment=="KPX_GROUP_TREE_STATE"){
parseGroupTreeStateMetaStream(entry.Binary);
@ -843,7 +843,6 @@ QList<IEntryHandle*> Kdb3Database::entries(IGroupHandle* group){
handles.append(&EntryHandles[i]);
}
qSort(handles.begin(),handles.end(),EntryHandleLessThan);
foreach(IEntryHandle* h,handles){qDebug("+ %s (%i)",h->title().toUtf8().data(),(int)h->isValid());}
return handles;
}

@ -56,7 +56,6 @@ public:
QBitArray columns(){return stringToBitArray(settings.value("UI/Columns","11111000000").toString(),11);}
QList<int> columnOrder(){return stringToIntArray(settings.value("UI/ColumnOrder","100,100,100,100,100,100,100,100,100,100,100").toString(),11);}
QList<int> columnSizes(){return stringToIntArray(settings.value("UI/ColumnSizes","15,10,10,10,10,10,10,10,10,10,10").toString(),11);}
bool enableBookmarkMenu(){return settings.value("Options/EnableBookmarkMenu",true).toBool();}
QStringList fileDlgHistory(unsigned index){return settings.value(QString("FileDlgHistory/ENTRY%1").arg(index)).toStringList();}
GrpTreeState groupTreeState(){return stringToGrpTreeState(settings.value("Options/GroupTreeState").toString());}
bool hidePasswords(){return settings.value("UI/HidePasswords",true).toBool();}
@ -90,6 +89,7 @@ public:
bool askBeforeDelete(){return settings.value("Options/AskBeforeDelete",true).toBool();}
int autoTypePreGap(){return settings.value("Options/AutoTypePreGap",500).toInt();}
int autoTypeKeyStrokeDelay(){return settings.value("Options/AutoTypeKeyStrokeDelay",0).toInt();}
bool featureBookmarks(){return settings.value("Features/Bookmarks",true).toBool();}
void setAlternatingRowColors(bool value){settings.setValue("Options/AlternatingRowColors",value);}
void setBannerColor1(const QColor& value){settings.setValue("Options/BannerColor1",colorToString(value));}
@ -99,7 +99,6 @@ public:
void setColumns(const QBitArray& value){settings.setValue("UI/Columns",bitArrayToString(value));}
void setColumnOrder(const QList<int>& value){settings.setValue("UI/ColumnOrder",intArrayToString(value));}
void setColumnSizes(const QList<int>& value){settings.setValue("UI/ColumnSizes",intArrayToString(value));}
void setEnableBookmarkMenu(bool value){settings.setValue("Options/EnableBookmarkMenu",value);}
void setFileDlgHistory(unsigned index,const QStringList& value){settings.setValue(QString("FileDlgHistory/ENTRY%1").arg(index), value);}
void setGroupTreeState(GrpTreeState value){settings.setValue("Options/GroupTreeState",grpTreeStateToString(value));}
void setHidePasswords(bool value){settings.setValue("UI/HidePasswords",value);}
@ -133,6 +132,7 @@ public:
void setAskBeforeDelete(bool value){settings.setValue("Options/AskBeforeDelete",value);}
void setAutoTypePreGap(int value){settings.setValue("Options/AutoTypePreGap",value);}
void setAutoTypeKeyStrokeDelay(int value){settings.setValue("Options/AutoTypeKeyStrokeDelay",value);}
void setFeatureBookmarks(bool value){settings.setValue("Features/Bookmarks",value);}
unsigned fileDlgHistorySize();
void clearFileDlgHistory(){settings.remove("FileDlgHistory");};

@ -58,7 +58,6 @@ void CArcFour::prepareKey(){
}
void CArcFour::encrypt(const byte* src, byte* dst,int length){
//qDebug("Key:%s",RawKey.data());
prepareKey();
unsigned char x;
unsigned char y;

@ -1,11 +1,10 @@
/***************************************************************************
* Copyright (C) 2005-2006 by Tarek Saidi *
* Copyright (C) 2005-2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
@ -48,18 +47,18 @@ AboutDialog::AboutDialog(QWidget* parent):QDialog(parent)
QString str;
str+="<b>"+tr("Team")+"</b><br>";
str+="<div style='margin-left:10px;'>";
str+="<u>"+tr("Tarek Saidi")+"</u><br>"+tr("Developer, Project Admin")+"<br>"+tr("tariq@users.berlios.de")+"<br>";
str+="<u>"+tr("Tarek Saidi")+"</u><br>"+tr("Developer, Project Admin")+"<br>"+tr("tarek_saidi@users.sf.net")+"<br>";
str+="<br>";
str+="<u>"+tr("Eugen Gorschenin")+"</u><br>"+tr("Web Designer")+"<br>"+tr("geugen@users.sf.de")+"<br>";
str+="<br>";
str+="<u>"+tr("Eugen Gorschenin")+"</u><br>"+tr("Web Designer")+"<br>"+tr("geugen@users.berlios.de")+"<br>";
str+="<u>"+tr("Jota Jota")+"</u><br>"+tr("Developer")+"<br>"+tr("myxself@users.sf.de")+"<br>";
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>";
str+="<br>";
str+="</div><div style='margin-left:10px;'>";
str+="<u>"+tr("James Nicholls")+"</u><br>"+tr("Main Application Icon")/*+"<br>"+tr("mailto:???")*/+"<br></div>";
str+="<br>";
str+="</div><div style='margin-left:10px;'>";
str+="<u>"+tr("Constantin Makshin")+"</u><br>"+tr("Various fixes and improvements")+"<br>"+tr("dinosaur-rus@users.sourceforge.net")+"<br></div>";
Edit_Thanks->setHtml(str);
}

@ -0,0 +1,58 @@
/***************************************************************************
* Copyright (C) 2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <QFileInfo>
#include "AddBookmarkDlg.h"
#include "lib/FileDialogs.h"
#include "lib/bookmarks.h"
AddBookmarkDlg::AddBookmarkDlg(QWidget* parent, QString DefaultFilename, int _ItemID):QDialog(parent)
{
setupUi(this);
ItemID=_ItemID;
connect(Button_Browse,SIGNAL(clicked()),this,SLOT(OnButtonBrowse()));
connect(buttonBox->button(QDialogButtonBox::Ok),SIGNAL(clicked()),this,SLOT(OnButtonOk()));
connect(buttonBox->button(QDialogButtonBox::Cancel),SIGNAL(clicked()),this,SLOT(reject()));
if(ItemID==-1){
if(DefaultFilename==QString())
OnButtonBrowse();
else
Edit_Filename->setText(DefaultFilename);
}
else {
Edit_Title->setText(KpxBookmarks::title(ItemID));
Edit_Filename->setText(KpxBookmarks::path(ItemID));
setWindowTitle(tr("Edit Bookmark"));
}
}
void AddBookmarkDlg::OnButtonBrowse(){
QString path=KpxFileDialogs::openExistingFile(this,"AddBookmarkDlg", tr("Add Bookmark"),
QStringList() << tr("KeePass Databases (*.kdb)") << tr("All Files (*)"));
if(path!=QString())
Edit_Filename->setText(path);
}
void AddBookmarkDlg::OnButtonOk(){
if(ItemID==-1)
ItemID=KpxBookmarks::add(Edit_Title->text(),Edit_Filename->text());
else
KpxBookmarks::edit(Edit_Title->text(),Edit_Filename->text(),ItemID);
accept();
}

@ -0,0 +1,41 @@
/***************************************************************************
* Copyright (C) 2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _ADDBOOKMARKDLG_H_
#define _ADDBOOKMARKDLG_H_
#include <QDialog>
#include "ui_AddBookmarkDlg.h"
class AddBookmarkDlg : public QDialog, private Ui::AddBookmarkDlg
{
Q_OBJECT
public:
AddBookmarkDlg (QWidget* parent=0, QString DefaultFilename=QString(), int ItemID=-1);
int ItemID;
private slots:
void OnButtonOk();
void OnButtonBrowse();
};
#endif

@ -37,6 +37,7 @@
#include <qtoolbutton.h>
#include <QShowEvent>
#include <QResizeEvent>
#include <math.h>
#include "SelectIconDlg.h"
#include "PasswordGenDlg.h"
@ -348,27 +349,27 @@ void CEditEntryDlg::OnNewAttachment()
int prec;
if (entry->binarySize() < 1024)
{
unit = "Bytes";
unit = tr("Bytes");
faktor = 1;
prec = 0;
}
else
{
if (entry->binarySize() < 1048576)
if (entry->binarySize() < pow(2,20))
{
unit = "kB";
unit = tr("kiB");
faktor = 1024;
}
else
if (entry->binarySize() < 1073741824)
if (entry->binarySize() < pow(2,30))
{
unit = "MB";
faktor = 1048576;
unit = tr("MiB");
faktor = pow(2,20);
}
else
{
unit = "GB";
faktor = 1073741824;
unit = tr("GiB");
faktor = pow(2,30);
}
prec = 1;
}

@ -0,0 +1,117 @@
/***************************************************************************
* Copyright (C) 2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <QListWidget>
#include "main.h"
#include "ManageBookmarksDlg.h"
#include "lib/bookmarks.h"
#include "dialogs/AddBookmarkDlg.h"
ManageBookmarksDlg::ManageBookmarksDlg(QWidget* parent):QDialog(parent)
{
setupUi(this);
for(int i=0;i<KpxBookmarks::count();i++){
QListWidgetItem* item=new QListWidgetItem(ListWidget);
item->setData(Qt::UserRole,i);
item->setText(KpxBookmarks::title(i));
}
connect(Button_Up,SIGNAL(clicked()),this,SLOT(OnButtonUp()));
connect(Button_Down,SIGNAL(clicked()),this,SLOT(OnButtonDown()));
connect(Button_Delete,SIGNAL(clicked()),this,SLOT(OnButtonDelete()));
connect(Button_Add,SIGNAL(clicked()),this,SLOT(OnButtonAdd()));
connect(Button_Edit,SIGNAL(clicked()),this,SLOT(OnButtonEdit()));
connect(ListWidget,SIGNAL(itemDoubleClicked(QListWidgetItem*)),this,SLOT(edit(QListWidgetItem*)));
connect(buttonBox->button(QDialogButtonBox::Close),SIGNAL(clicked()),this,SLOT(close()));
Button_Up->setIcon(getIcon("up"));
Button_Down->setIcon(getIcon("down"));
Button_Delete->setIcon(getIcon("delete"));
Button_Edit->setIcon(getIcon("bookmark_edit"));
Button_Add->setIcon(getIcon("bookmark_add"));
}
void ManageBookmarksDlg::OnButtonUp(){
int row=ListWidget->currentRow();
QListWidgetItem* item=ListWidget->currentItem();
if(row==-1 || !item || row==0)return;
ListWidget->takeItem(row);
row--;
ListWidget->insertItem(row,item);
ListWidget->setCurrentRow(row);
}
void ManageBookmarksDlg::OnButtonDown(){
int row=ListWidget->currentRow();
QListWidgetItem* item=ListWidget->currentItem();
if(row==-1 || !item || row==ListWidget->count()-1)return;
ListWidget->takeItem(row);
row++;
ListWidget->insertItem(row,item);
ListWidget->setCurrentRow(row);
}
void ManageBookmarksDlg::OnButtonDelete(){
QListWidgetItem* item=ListWidget->currentItem();
if(!item)return;
int index=item->data(Qt::UserRole).toInt();
KpxBookmarks::remove(index);
delete item;
for(int i=0;i<ListWidget->count();i++){
int itemindex=ListWidget->item(i)->data(Qt::UserRole).toInt();
if(itemindex>index)
ListWidget->item(i)->setData(Qt::UserRole,itemindex-1);
}
}
void ManageBookmarksDlg::OnButtonEdit(){
QListWidgetItem* item=ListWidget->currentItem();
if(!item)return;
edit(item);
}
void ManageBookmarksDlg::edit(QListWidgetItem* item){
int i=item->data(Qt::UserRole).toInt();
AddBookmarkDlg dlg(this,QString(),i);
dlg.exec();
item->setText(KpxBookmarks::title(i));
}
void ManageBookmarksDlg::OnButtonAdd(){
AddBookmarkDlg dlg(this);
if(dlg.exec()){
int i=dlg.ItemID;
QListWidgetItem* item=new QListWidgetItem(ListWidget);
item->setData(Qt::UserRole,i);
item->setText(KpxBookmarks::title(i));
}
return;
}
void ManageBookmarksDlg::closeEvent(QCloseEvent * event){
QList<int> Order;
// Creating a list with the new indices
// Order[OldIndex]==NewIndex
for(int i=0;i<KpxBookmarks::count();i++){
Order<<ListWidget->item(i)->data(Qt::UserRole).toInt();
}
KpxBookmarks::resort(Order);
event->accept();
}

@ -0,0 +1,44 @@
/***************************************************************************
* Copyright (C) 2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef MANAGEBOOKMARKSDLG_H
#define MANAGEBOOKMARKSDLG_H
#include <QDialog>
#include <QCloseEvent>
#include "ui_ManageBookmarksDlg.h"
class ManageBookmarksDlg : public QDialog, private Ui::ManageBookmarksDlg
{
Q_OBJECT
public:
ManageBookmarksDlg(QWidget* parent=0);
private:
virtual void closeEvent(QCloseEvent* event);
private slots:
void OnButtonUp();
void OnButtonDown();
void OnButtonDelete();
void OnButtonAdd();
void OnButtonEdit();
void edit(QListWidgetItem*);
};
#endif

@ -1,11 +1,10 @@
/***************************************************************************
* Copyright (C) 2005-2006 by Tarek Saidi *
* Copyright (C) 2005-2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
@ -27,26 +26,31 @@
#include <QPushButton>
#include <QMessageBox>
#include <QStringList>
#include <QPainter>
#include <QPalette>
#include <QMenu>
#include "main.h"
#include "KpxConfig.h"
#include "PasswordDlg.h"
#include "lib/FileDialogs.h"
#include "lib/bookmarks.h"
CPasswordDialog::CPasswordDialog(QWidget* parent,IDatabase* DB,bool ShowExitButton,bool ChangeKeyMode)
CPasswordDialog::CPasswordDialog(QWidget* parent,QString filename,IDatabase* DB,bool IsAuto,bool ChangeKeyMode)
: QDialog(parent)
{
setupUi(this);
createBanner(Banner,getPixmap("key"),tr("Database Key"));
createBanner(&BannerPixmap,getPixmap("key"),tr("Database Key"),width());
Button_Bookmarks->setIcon(getIcon("bookmark"));
db=DB;
LastFile=filename;
setWindowTitle(LastFile);
QString mountDir=config->mountDir();
QDir media(mountDir);
if(media.exists()){
QStringList Paths;
Paths=media.entryList(QStringList()<<"*",QDir::Dirs);
Paths.erase(Paths.begin()); // delete "."
Paths.erase(Paths.begin()); // delete ".."
Paths=media.entryList(QStringList()<<"*",QDir::Dirs | QDir::NoDotAndDotDot);
for(int i=0;i<Paths.count();i++)
Combo_Dirs->addItem(mountDir+Paths[i]);
}
@ -67,16 +71,46 @@ CPasswordDialog::CPasswordDialog(QWidget* parent,IDatabase* DB,bool ShowExitButt
// if(LastKeyType==Password){... is not required because it is already the default state.
}
connect( Combo_Dirs, SIGNAL( editTextChanged(const QString&) ),this, SLOT( OnComboTextChanged(const QString&)));
connect( ButtonCancel, SIGNAL( clicked() ), this, SLOT( OnCancel() ) );
connect( Edit_Password, SIGNAL( textChanged(const QString&) ), this, SLOT( OnPasswordChanged(const QString&) ) );
connect( CheckBox_Both, SIGNAL( stateChanged(int) ), this, SLOT( OnCheckBox_BothChanged(int) ) );
connect( ButtonChangeEchoMode, SIGNAL( clicked() ), this, SLOT( ChangeEchoModeDatabaseKey() ) );
connect( Edit_Password, SIGNAL( returnPressed() ), this, SLOT( OnOK() ) );
connect( Edit_PasswordRep, SIGNAL( returnPressed() ), this, SLOT( OnOK() ) );
connect( ButtonExit, SIGNAL( clicked()),this,SLOT(OnButtonExit()));
// Bookmarks //
QPalette palette=Button_Bookmarks->palette();
palette.setColor(QPalette::Active,QPalette::Button,config->bannerColor1());
palette.setColor(QPalette::Active,QPalette::Window,config->bannerColor2());
Button_Bookmarks->setPalette(palette);
palette=Label_Bookmark->palette();
palette.setColor(QPalette::Active,QPalette::WindowText,config->bannerTextColor());
Label_Bookmark->setPalette(palette);
QMenu* BookmarkMenu=new QMenu(this);
QAction* action=new QAction(this);
action->setData(QString());
action->setText(tr("Last File"));
action->setIcon(getIcon("document"));
BookmarkMenu->addAction(action);
BookmarkMenu->addSeparator();
for(int i=0;i<KpxBookmarks::count();i++){
QAction* action=new QAction(this);
action->setData(KpxBookmarks::path(i));
action->setText(KpxBookmarks::title(i));
action->setIcon(getIcon("document"));
BookmarkMenu->addAction(action);
}
Button_Bookmarks->setMenu(BookmarkMenu);
if(!IsAuto || !config->featureBookmarks()){
Button_Bookmarks->hide();
Label_Bookmark->hide();
}
ButtonExit->setVisible(ShowExitButton);
connect(Combo_Dirs, SIGNAL( editTextChanged(const QString&) ),this, SLOT( OnComboTextChanged(const QString&)));
connect(ButtonCancel, SIGNAL( clicked() ), this, SLOT( OnCancel() ) );
connect(Edit_Password, SIGNAL( textChanged(const QString&) ), this, SLOT( OnPasswordChanged(const QString&) ) );
connect(CheckBox_Both, SIGNAL( stateChanged(int) ), this, SLOT( OnCheckBox_BothChanged(int) ) );
connect(ButtonChangeEchoMode, SIGNAL( clicked() ), this, SLOT( ChangeEchoModeDatabaseKey() ) );
connect(Edit_Password, SIGNAL( returnPressed() ), this, SLOT( OnOK() ) );
connect(Edit_PasswordRep, SIGNAL( returnPressed() ), this, SLOT( OnOK() ) );
connect(ButtonExit, SIGNAL( clicked()),this,SLOT(OnButtonExit()));
connect(BookmarkMenu,SIGNAL(triggered(QAction*)),this,SLOT(OnBookmarkTriggered(QAction*)));
ButtonExit->setVisible(IsAuto);
Mode_Set=ChangeKeyMode;
if(!ChangeKeyMode){
Edit_PasswordRep->hide();
@ -342,3 +376,18 @@ void CPasswordDialog::OnButtonExit(){
done(2);
}
void CPasswordDialog::paintEvent(QPaintEvent* event){
QDialog::paintEvent(event);
QPainter painter(this);
painter.setClipRegion(event->region());
painter.drawPixmap(QPoint(0,0),BannerPixmap);
}
void CPasswordDialog::OnBookmarkTriggered(QAction* action){
BookmarkFilename=action->data().toString();
if(action->data().toString()==QString())
setWindowTitle(LastFile);
else
setWindowTitle(action->data().toString());
Label_Bookmark->setText(action->text());
}

@ -23,6 +23,8 @@
#include "main.h"
#include "lib/UrlLabel.h"
#include "Database.h"
#include <QPixmap>
#include <QPaintEvent>
class CPasswordDialog : public QDialog, public Ui_PasswordDlg
@ -32,17 +34,21 @@ class CPasswordDialog : public QDialog, public Ui_PasswordDlg
private:
bool Mode_Set; //true = Set, false = Get
IDatabase* db;
QPixmap BannerPixmap;
void setStatePasswordOnly();
void setStateKeyFileOnly();
void setStateBoth();
bool doAuth();
virtual void paintEvent(QPaintEvent*);
QString LastFile;
public:
QString keyfile;
QString password;
QString BookmarkFilename;
tKeyType KeyType;
bool OverwriteKeyFile;
CPasswordDialog(QWidget* parent,IDatabase* DB,bool ShowExitButton = false, bool KeyMode_Set=false);
CPasswordDialog(QWidget* parent,QString filename,IDatabase* DB,bool ShowExitButton = false, bool KeyMode_Set=false);
public slots:
void OnOK();
@ -55,6 +61,7 @@ class CPasswordDialog : public QDialog, public Ui_PasswordDlg
void OnCheckBox_BothChanged(int state);
void ChangeEchoModeDatabaseKey();
void OnComboTextChanged(const QString&);
void OnBookmarkTriggered(QAction* action);
};
#endif

@ -104,6 +104,9 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
CheckBox_ShowPasswords->setChecked(config->showPasswords());
CheckBox_ShowPasswords_PasswordDlg->setChecked(config->showPasswordsPasswordDlg());
//Features
CheckBox_FeatureBookmarks->setChecked(config->featureBookmarks());
//Desktop Integration
if(PluginLoadError==QString())
@ -186,7 +189,6 @@ void CSettingsDlg::apply(){
config->setShowSysTrayIcon(checkBox_ShowSysTrayIcon->isChecked());
config->setMinimizeToTray(checkBox_MinimizeToTray->isChecked());
config->setSaveFileDlgHistory(checkBox_SaveFileDlgHistory->isChecked());
config->setEnableBookmarkMenu(checkBox_EnableBookmarkMenu->isChecked());
if(Radio_GroupTreeRestore->isChecked())config->setGroupTreeState(KpxConfig::RestoreLast);
else if(Radio_GroupTreeExpand->isChecked())config->setGroupTreeState(KpxConfig::ExpandAll);
else config->setGroupTreeState(KpxConfig::DoNothing);
@ -205,6 +207,9 @@ void CSettingsDlg::apply(){
config->setShowPasswords(CheckBox_ShowPasswords->isChecked());
config->setShowPasswordsPasswordDlg(CheckBox_ShowPasswords_PasswordDlg->isChecked());
//Features
config->setFeatureBookmarks(CheckBox_FeatureBookmarks->isChecked());
//Desktop Integration
PluginsModified=Label_IntPlugin_Info->isVisible();
if(Radio_IntPlugin_Kde->isChecked())config->setIntegrPlugin(KpxConfig::KDE);

@ -10,9 +10,7 @@
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -33,12 +31,21 @@
<string>About</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
<spacer>
<property name="orientation" >
@ -65,12 +72,21 @@
<string>About</string>
</attribute>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
<widget class="QLabel" name="label" >
<property name="text" >
@ -80,12 +96,21 @@
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<spacer>
<property name="orientation" >
@ -104,12 +129,21 @@
</item>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>12</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="LinkLabel" name="label_2" >
<property name="text" >
@ -130,9 +164,9 @@
<item>
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Copyright (C) 2005 - 2006 Tarek Saidi
<string>Copyright (C) 2005 - 2007 KeePassX Team
KeePassX is distributed under the terms of the
General Public License (GPL) version 2 or later.</string>
General Public License (GPL) version 2.</string>
</property>
</widget>
</item>
@ -147,12 +181,21 @@ General Public License (GPL) version 2 or later.</string>
<string>Credits</string>
</attribute>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
<widget class="QTextEdit" name="Edit_Thanks" >
<property name="readOnly" >
@ -167,12 +210,21 @@ General Public License (GPL) version 2 or later.</string>
<string>Translation</string>
</attribute>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
<widget class="QTextEdit" name="Edit_Translation" >
<property name="readOnly" >
@ -187,12 +239,21 @@ General Public License (GPL) version 2 or later.</string>
<string>License</string>
</attribute>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
<widget class="QTextEdit" name="Edit_License" >
<property name="readOnly" >

@ -0,0 +1,58 @@
<ui version="4.0" >
<class>AddBookmarkDlg</class>
<widget class="QWidget" name="AddBookmarkDlg" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>497</width>
<height>148</height>
</rect>
</property>
<property name="windowTitle" >
<string>Add Bookmark</string>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>Title:</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="Edit_Title" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>File:</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="Edit_Filename" />
</item>
<item row="1" column="2" >
<widget class="QPushButton" name="Button_Browse" >
<property name="text" >
<string>Browse...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="standardButtons" >
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -143,9 +143,15 @@
<property name="title" >
<string>&amp;Import from...</string>
</property>
</widget>
<widget class="QMenu" name="menuBookmarks" >
<property name="title" >
<string>Bookmarks</string>
</property>
</widget>
<addaction name="FileNewAction" />
<addaction name="FileOpenAction" />
<addaction name="menuBookmarks" />
<addaction name="FileCloseAction" />
<addaction name="separator" />
<addaction name="FileSaveAction" />
@ -237,6 +243,11 @@
<addaction name="menuExtras" />
<addaction name="menuHilfe" />
</widget>
<action name="ManageBookmarksAction" >
<property name="text" >
<string>Manage Bookmarks...</string>
</property>
</action>
<action name="FileOpenAction" >
<property name="text" >
<string>&amp;Open Database...</string>
@ -544,6 +555,16 @@
<string>Recycle Bin...</string>
</property>
</action>
<action name="AddBookmarkAction" >
<property name="text" >
<string>Add Bookmark...</string>
</property>
</action>
<action name="AddThisAsBookmarkAction" >
<property name="text" >
<string>Bookmark this Database...</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

@ -0,0 +1,69 @@
<ui version="4.0" >
<class>ManageBookmarksDlg</class>
<widget class="QDialog" name="ManageBookmarksDlg" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>452</width>
<height>360</height>
</rect>
</property>
<property name="windowTitle" >
<string>Manage Bookmarks</string>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QListWidget" name="ListWidget" />
</item>
<item>
<layout class="QVBoxLayout" >
<item>
<widget class="QToolButton" name="Button_Add" />
</item>
<item>
<widget class="QToolButton" name="Button_Delete" />
</item>
<item>
<widget class="QToolButton" name="Button_Edit" />
</item>
<item>
<widget class="QToolButton" name="Button_Up" />
</item>
<item>
<widget class="QToolButton" name="Button_Down" />
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>161</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -1,7 +1,4 @@
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>PasswordDlg</class>
<widget class="QDialog" name="PasswordDlg" >
<property name="geometry" >
@ -13,9 +10,7 @@
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -41,293 +36,342 @@
<property name="modal" >
<bool>true</bool>
</property>
<widget class="QLabel" name="Banner" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>578</width>
<height>50</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>TextLabel</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget" >
<property name="geometry" >
<rect>
<x>10</x>
<y>240</y>
<width>561</width>
<height>31</height>
</rect>
</property>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>351</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="ButtonOK" >
<property name="text" >
<string>OK</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonCancel" >
<property name="text" >
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonExit" >
<property name="text" >
<string>Exit</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupframe" >
<property name="geometry" >
<rect>
<x>10</x>
<y>80</y>
<width>561</width>
<height>151</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string>Key</string>
</property>
<widget class="QWidget" name="layoutWidget" >
<property name="geometry" >
<rect>
<x>10</x>
<y>20</y>
<width>541</width>
<height>123</height>
</rect>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QHBoxLayout" >
<item>
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="spacing" >
<number>6</number>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>50</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<item row="1" column="0" >
<widget class="QLabel" name="Label_PasswordRep" >
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="Label_Bookmark" >
<property name="text" >
<string>Password Repet.:</string>
<string>Last File</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="Edit_Password" />
</item>
<item row="0" column="0" >
<widget class="QLabel" name="Label_Password" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QToolButton" name="Button_Bookmarks" >
<property name="popupMode" >
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="text" >
<string>Password:</string>
<property name="arrowType" >
<enum>Qt::NoArrow</enum>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QToolButton" name="ButtonChangeEchoMode" >
<property name="text" >
<string>...</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="Edit_PasswordRep" />
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
</layout>
</item>
<item>
<widget class="QLabel" name="textLabel1" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Maximum" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Enter a Password and/or choose a key file.</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupframe" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string>Key</string>
</property>
<widget class="QWidget" name="layoutWidget" >
<property name="geometry" >
<rect>
<x>10</x>
<y>20</y>
<width>541</width>
<height>124</height>
</rect>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QLabel" name="Label_KeyFile" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>0</number>
</property>
<property name="text" >
<string>Key file or directory:</string>
<property name="topMargin" >
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="Combo_Dirs" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="editable" >
<bool>true</bool>
<property name="bottomMargin" >
<number>0</number>
</property>
</widget>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number>
</property>
<item row="1" column="0" >
<widget class="QLabel" name="Label_PasswordRep" >
<property name="text" >
<string>Password Repet.:</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="Edit_Password" />
</item>
<item row="0" column="0" >
<widget class="QLabel" name="Label_Password" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Password:</string>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QToolButton" name="ButtonChangeEchoMode" >
<property name="text" >
<string>...</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="Edit_PasswordRep" />
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="ButtonBrowse" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="text" >
<string>&amp;Browse...</string>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="shortcut" >
<string>Alt+B</string>
<property name="topMargin" >
<number>0</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="CheckBox_Both" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="text" >
<string>Use Password AND Key File</string>
<property name="bottomMargin" >
<number>0</number>
</property>
</widget>
<item>
<widget class="QLabel" name="Label_KeyFile" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Key file or directory:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="Combo_Dirs" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonBrowse" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Browse...</string>
</property>
<property name="shortcut" >
<string>Alt+B</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
<property name="rightMargin" >
<number>0</number>
</property>
</spacer>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="CheckBox_Both" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Use Password AND Key File</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>351</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="ButtonOK" >
<property name="text" >
<string>OK</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonCancel" >
<property name="text" >
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonExit" >
<property name="text" >
<string>Exit</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QLabel" name="textLabel1" >
<property name="geometry" >
<rect>
<x>10</x>
<y>60</y>
<width>459</width>
<height>16</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>4</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Enter a Password and/or choose a key file.</string>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<tabstops>
<tabstop>Edit_Password</tabstop>
<tabstop>Edit_PasswordRep</tabstop>
<tabstop>Combo_Dirs</tabstop>
<tabstop>CheckBox_Both</tabstop>
<tabstop>ButtonChangeEchoMode</tabstop>
<tabstop>ButtonBrowse</tabstop>
<tabstop>CheckBox_Both</tabstop>
<tabstop>ButtonOK</tabstop>
<tabstop>ButtonCancel</tabstop>
<tabstop>ButtonExit</tabstop>
<tabstop>Button_Bookmarks</tabstop>
<tabstop>ButtonChangeEchoMode</tabstop>
</tabstops>
<resources/>
<connections/>

@ -846,7 +846,7 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_EnableBookmarkMenu" >
<widget class="QCheckBox" name="CheckBox_FeatureBookmarks" >
<property name="text" >
<string>Bookmarks</string>
</property>

@ -462,7 +462,6 @@ void KeepassEntryView::OnColumnMoved(int LogIndex,int OldVisIndex,int NewVisInde
}
int KeepassEntryView::logicalColIndex(int LstIndex){
qDebug("%i",LstIndex);
int c=-1;
for(int i=0;i<NUM_COLUMNS;i++){
if(Columns.at(i))c++;

@ -0,0 +1,127 @@
/***************************************************************************
* Copyright (C) 2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <QFile>
#include "bookmarks.h"
#include "main.h"
#define CSTR(x)(x.toUtf8().data())
QList<KpxBookmarks::BookmarkEntry> KpxBookmarks::Bookmarks;
QString KpxBookmarks::filename;
bool KpxBookmarks::load(const QString& _filename){
/*
Fileformat:
"Title1" "Path1"\n
"Title2" "Path2"\n
...
*/
filename=_filename;
QFile file(filename);
if(!file.exists()){
return true;
}
if(!file.open(QIODevice::ReadOnly)){
qWarning("Reading bookmarks failed: %s",CSTR(decodeFileError(file.error())));
return false;
}
QString content=QString::fromUtf8(file.readAll());
file.close();
content.replace("\r","");
QStringList lines=content.split("\n");
for(int i=0;i<lines.size();i++){
if(lines[i].simplified()==QString()) continue; //skip empty line
if(lines[i].count("\"")!=4){
qWarning("Bookmark parsing error: Skipping line %i.",i);
continue;
}
int a_title=lines[i].indexOf("\"");
int b_title=lines[i].indexOf("\"",a_title+1);
int a_path=lines[i].indexOf("\"",b_title+1);
int b_path=lines[i].indexOf("\"",a_path+1);
BookmarkEntry entry;
entry.Title=lines[i].mid(a_title+1,b_title-a_title-1);
entry.Path=lines[i].mid(a_path+1,b_path-a_path-1);
Bookmarks << entry;
}
return true;
}
int KpxBookmarks::count(){
return Bookmarks.size();
}
QString KpxBookmarks::title(int i){
return Bookmarks[i].Title;
}
QString KpxBookmarks::path(int i){
return Bookmarks[i].Path;
}
int KpxBookmarks::add(const QString& Title,const QString& Path){
BookmarkEntry entry;
entry.Title=Title;
entry.Path=Path;
entry.Index=Bookmarks.size();
Bookmarks<<entry;
save();
return Bookmarks.size()-1;
}
bool KpxBookmarks::save(){
QFile file(filename);
if(!file.exists()){
return false;
}
if(!file.open(QIODevice::WriteOnly | QIODevice::Truncate)){
qWarning("Writing bookmarks failed: %s",CSTR(decodeFileError(file.error())));
return false;
}
QString data;
for(int i=0;i<Bookmarks.size();i++){
data+=QString("\"%1\" \"%2\"\n").arg(Bookmarks[i].Title)
.arg(Bookmarks[i].Path);
}
file.write(data.toUtf8());
file.close();
}
void KpxBookmarks::remove(int index){
Bookmarks.removeAt(index);
save();
}
void KpxBookmarks::edit(const QString& Title,const QString& Path,int i){
Bookmarks[i].Title=Title;
Bookmarks[i].Path=Path;
save();
}
void KpxBookmarks::resort(QList<int> order){
QList<BookmarkEntry> NewList;
for(int i=0;i<order.size();i++){
NewList << Bookmarks[order[i]];
}
Bookmarks=NewList;
save();
}

@ -0,0 +1,49 @@
/***************************************************************************
* Copyright (C) 2007 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _BOOKMARKS_H_
#define _BOOKMARKS_H_
#include <QString>
#include <QList>
class KpxBookmarks {
public:
static bool load(const QString& file);
static int add(const QString& Title,const QString& Path);
static void remove(int id);
static void edit(const QString& Title,const QString& Path, int Index);
static int count();
static void resort(QList<int> order);
static QString title(int Index);
static QString path(int Index);
private:
static bool save();
class BookmarkEntry {
public:
QString Title;
QString Path;
int Index;
};
static QList<BookmarkEntry> Bookmarks;
static QString filename;
};
#endif

@ -43,6 +43,7 @@
#include "main.h"
#include "lib/FileDialogs.h"
#include "lib/bookmarks.h"
#include "KpxConfig.h"
#include "Kdb3Database.h"
#include "mainwindow.h"
@ -216,6 +217,7 @@ int main(int argc, char **_argv)
else loadDefaultDetailViewTemplate();
loadImages();
KpxBookmarks::load(QDir::homePath()+"/.keepassx/bookmarks");
initYarrow(); //init random number generator
SecString::generateSessionKey();

@ -42,6 +42,7 @@
#include "lib/random.h"
#include "lib/AutoType.h"
#include "lib/FileDialogs.h"
#include "lib/bookmarks.h"
#include "import/Import_PwManager.h"
#include "import/Import_KWalletXml.h"
#include "import/Import_KeePassX_Xml.h"
@ -59,13 +60,11 @@
#include "dialogs/CustomizeDetailViewDlg.h"
#include "dialogs/ExpiredEntriesDlg.h"
#include "dialogs/TrashCanDlg.h"
#include "dialogs/AddBookmarkDlg.h"
#include "dialogs/ManageBookmarksDlg.h"
//#include <QtDBus/QtDBus>
#include <iostream>
//QDBusServer* dbusServer;
//QDBusConnection* dbusCon;
Import_KeePassX_Xml import_KeePassX_Xml;
Import_PwManager import_PwManager;
Import_KWalletXml import_KWalletXml;
@ -117,20 +116,7 @@ KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,QWidget *parent, Qt:
HelpBrowser = new QAssistantClient(QString(),this);
HelpBrowser->setArguments(QStringList()<< "-profile" << "/home/tarek/Documents/KeePassX/share/keepass/doc/keepassx.adp");
// DBus Server of Qt 4.2 does not work - 4.3 snapshot seems to work fine
/*
//dbusServer=new QDBusServer("unix:path=/tmp/KpxBus",this);
//qDebug("DBUS: %s",dbusServer->lastError().message().toAscii().data());
//QDBusConnection::connectToBus("unix:path=/tmp/KpxBus","MyKpxConnection");
//qDebug("DBUS: %s",dbusCon->lastError().message().toAscii().data());
KpxFirefox* fox=new KpxFirefox(NULL);
new KpxFirefoxAdaptor(fox);
QDBusConnection::sessionBus().registerService("org.keepassx.firefoxservice");
QDBusConnection::sessionBus().registerObject("/KpxFirefox",fox);
qDebug("DBUS: %s",QDBusConnection::sessionBus().lastError().message().toAscii().data());
*/
createBookmarkActions();
}
void KeepassMainWindow::setupConnections(){
@ -145,6 +131,7 @@ void KeepassMainWindow::setupConnections(){
connect(FileUnLockWorkspaceAction,SIGNAL(triggered()), this, SLOT(OnUnLockWorkspace()));
connect(menuImport,SIGNAL(triggered(QAction*)),this,SLOT(OnImport(QAction*)));
connect(menuExport,SIGNAL(triggered(QAction*)),this,SLOT(OnExport(QAction*)));
connect(menuBookmarks,SIGNAL(triggered(QAction*)),this,SLOT(OnBookmarkTriggered(QAction*)));
connect(EditNewGroupAction, SIGNAL(triggered()), GroupView, SLOT(OnNewGroup()));
connect(EditEditGroupAction, SIGNAL(triggered()), GroupView, SLOT(OnEditGroup()));
@ -252,6 +239,10 @@ void KeepassMainWindow::setupIcons(){
EditAutoTypeAction->setIcon(getIcon("autotype"));
HelpHandbookAction->setIcon(getIcon("manual"));
HelpAboutAction->setIcon(getIcon("help"));
menuBookmarks->menuAction()->setIcon(getIcon("bookmark_folder"));
AddThisAsBookmarkAction->setIcon(getIcon("bookmark"));
AddBookmarkAction->setIcon(getIcon("bookmark_add"));
ManageBookmarksAction->setIcon(getIcon("bookmark_edit"));
SysTray->setIcon(getIcon("keepassx_large"));
if(config->showSysTrayIcon())
SysTray->show();
@ -350,6 +341,7 @@ void KeepassMainWindow::setupMenus(){
#endif
ExtrasTrashCanAction->setVisible(false); //For KP 2.x only
menuBookmarks->menuAction()->setVisible(config->featureBookmarks());
}
void KeepassMainWindow::setupDatabaseConnections(IDatabase* DB){
@ -367,12 +359,14 @@ void KeepassMainWindow::openDatabase(QString filename,bool IsAuto){
config->setLastKeyLocation(QString());
config->setLastKeyType(PASSWORD);}
db=dynamic_cast<IDatabase*>(new Kdb3Database());
CPasswordDialog PasswordDlg(this,db,IsAuto,false);
PasswordDlg.setWindowTitle(filename);
CPasswordDialog PasswordDlg(this,filename,db,IsAuto,false);
switch(PasswordDlg.exec()){
case 0: return;
case 2: Start=false; return;
}
if(PasswordDlg.BookmarkFilename!=QString())
filename=PasswordDlg.BookmarkFilename;
GroupView->db=db;
EntryView->db=db;
setupDatabaseConnections(db);
@ -432,7 +426,7 @@ bool KeepassMainWindow::closeDatabase(){
void KeepassMainWindow::OnFileNewKdb(){
IDatabase* db_new=dynamic_cast<IDatabase*>(new Kdb3Database());
db_new->create();
CPasswordDialog dlg(this,db_new,false,true);
CPasswordDialog dlg(this,QString(),db_new,false,true);
dlg.setWindowTitle(tr("New Database"));
if(dlg.exec()==1){
if(FileOpen)
@ -495,6 +489,7 @@ EntryView->setEnabled(IsOpen);
DetailView->setEnabled(IsOpen);
QuickSearchEdit->setEnabled(IsOpen);
ExtrasShowExpiredEntriesAction->setEnabled(IsOpen);
AddThisAsBookmarkAction->setEnabled(IsOpen);
if(!IsOpen){
EditNewGroupAction->setEnabled(false);
@ -756,7 +751,7 @@ if(dlg.exec())setStateFileModified(true);
}
void KeepassMainWindow::OnFileChangeKey(){
CPasswordDialog dlg(this,db,false,true);
CPasswordDialog dlg(this,QString(),db,false,true);
if(dlg.exec())
setStateFileModified(true);
}
@ -777,7 +772,7 @@ void KeepassMainWindow::OnImport(QAction* action){
IDatabase* tmpdb=dynamic_cast<IDatabase*>(new Kdb3Database());
tmpdb->create();
if(dynamic_cast<IImport*>(action->data().value<QObject*>())->importDatabase(this,tmpdb)){
CPasswordDialog dlg(this,tmpdb,false,true);
CPasswordDialog dlg(this,QString(),tmpdb,false,true);
dlg.setWindowTitle(tr("Set Master Key"));
if(!dlg.exec()){
delete tmpdb;
@ -890,6 +885,7 @@ void KeepassMainWindow::OnExtrasSettings(){
if(dlg.exec()==QDialog::Accepted){
EntryView->setAlternatingRowColors(config->alternatingRowColors());
SysTray->setVisible(config->showSysTrayIcon());
menuBookmarks->menuAction()->setVisible(config->featureBookmarks());
}
}
@ -1029,3 +1025,55 @@ void KeepassMainWindow::OnUnLockWorkspace(){
IsLocked=true;
}
}
void KeepassMainWindow::OnBookmarkTriggered(QAction* action){
if(action==AddBookmarkAction){
AddBookmarkDlg dlg(this);
if(dlg.exec()){
int id=dlg.ItemID;
QAction* action=new QAction(this);
action->setData(id);
action->setText(KpxBookmarks::title(id));
action->setIcon(getIcon("document"));
menuBookmarks->addAction(action);
}
return;
}
if(action==ManageBookmarksAction){
ManageBookmarksDlg dlg(this);
dlg.exec();
menuBookmarks->clear();
createBookmarkActions();
return;
}
if(action==AddThisAsBookmarkAction){
AddBookmarkDlg dlg(this,db->file()->fileName());
if(dlg.exec()){
int id=dlg.ItemID;
QAction* action=new QAction(this);
action->setData(id);
action->setText(KpxBookmarks::title(id));
action->setIcon(getIcon("document"));
menuBookmarks->addAction(action);
}
return;
}
openDatabase(KpxBookmarks::path(action->data().toInt()));
}
void KeepassMainWindow::createBookmarkActions(){
menuBookmarks->addAction(AddBookmarkAction);
menuBookmarks->addAction(AddThisAsBookmarkAction);
menuBookmarks->addAction(ManageBookmarksAction);
menuBookmarks->addSeparator();
for(int i=0;i<KpxBookmarks::count();i++){
QAction* action=new QAction(this);
action->setData(i);
action->setText(KpxBookmarks::title(i));
action->setIcon(getIcon("document"));
menuBookmarks->addAction(action);
}
}

@ -69,6 +69,7 @@ class KeepassMainWindow : public QMainWindow, public Ui_MainWindow{
void OnFileSettings();
void OnFileChangeKey();
void OnFileExit();
void OnBookmarkTriggered(QAction* action);
void OnSearch();
void OnGroupSearch();
void OnViewShowToolbar(bool);
@ -120,6 +121,7 @@ class KeepassMainWindow : public QMainWindow, public Ui_MainWindow{
void updateDetailView();
void exportDatabase(IExport* exporter,QStringList filters);
void saveLastFilename(const QString& filename);
void createBookmarkActions();
QLineEdit* QuickSearchEdit;
QLabel* StatusBarGeneral;
QLabel* StatusBarSelection;

@ -14,20 +14,24 @@ INSTALLS += target data
data.files += ../share/keepass/*
TARGET = ../bin/keepassx
unix: !macx{
isEmpty(PREFIX){
PREFIX = /usr
}
unix : !macx {
target.path = $${PREFIX}/bin
data.path = $${PREFIX}/share/keepass
LIBS += -lXtst -lQtDBus
SOURCES += lib/AutoType_X11.cpp
}
macx{
macx {
target.path = /Applications
data.path = /Applications/keepass.app/Contents/share/keepass
SOURCES += lib/AutoType_X11.cpp
}
win32{
win32 {
SOURCES += lib/AutoType_Win.cpp
TARGET = ../$$TARGET
QMAKE_LINK_OBJECT_SCRIPT = ../build/$$QMAKE_LINK_OBJECT_SCRIPT
@ -50,7 +54,9 @@ FORMS += forms/EditGroupDlg.ui \
forms/CalendarDlg.ui \
forms/TrashCanDlg.ui \
forms/ExpiredEntriesDlg.ui \
forms/WorkspaceLockedWidget.ui
forms/WorkspaceLockedWidget.ui \
forms/AddBookmarkDlg.ui \
forms/ManageBookmarksDlg.ui
TRANSLATIONS += translations/keepass-de_DE.ts \
translations/keepass-ru_RU.ts \
translations/keepass-es_ES.ts \
@ -113,7 +119,10 @@ HEADERS += lib/IniReader.h \
plugins/interfaces/IGnomeInit.h \
plugins/interfaces/IIconTheme.h \
KpxConfig.h \
KpxFirefox.h
KpxFirefox.h \
dialogs/AddBookmarkDlg.h \
lib/bookmarks.h \
dialogs/ManageBookmarksDlg.h
SOURCES += lib/UrlLabel.cpp \
main.cpp \
mainwindow.cpp \
@ -161,7 +170,10 @@ SOURCES += lib/UrlLabel.cpp \
crypto/yarrow.cpp \
lib/WaitAnimationWidget.cpp \
KpxConfig.cpp \
KpxFirefox.cpp
KpxFirefox.cpp \
dialogs/AddBookmarkDlg.cpp \
lib/bookmarks.cpp \
dialogs/ManageBookmarksDlg.cpp
RESOURCES += res/resources.qrc
MOC_DIR = ../build/moc
UI_DIR = ../build/ui
@ -171,9 +183,8 @@ CONFIG += debug \
qt \
thread \
warn_off \
dbus \
assistant
QT += dbus xml
QT += xml
TEMPLATE = app
INCLUDEPATH += . \
lib \