most changes are details
git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@147 b624d157-de02-0410-bad0-e51aec6abb33
| 
		 Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 2.0 KiB  | 
| 
		 Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB  | 
| 
		 After Width: | Height: | Size: 2.1 KiB  | 
| 
		 Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.3 KiB  | 
| 
		 After Width: | Height: | Size: 2.3 KiB  | 
| 
						 | 
					@ -147,6 +147,7 @@ public:
 | 
				
			||||||
	virtual KpxDateTime expire()=0;
 | 
						virtual KpxDateTime expire()=0;
 | 
				
			||||||
	virtual QByteArray binary()=0;
 | 
						virtual QByteArray binary()=0;
 | 
				
			||||||
	virtual quint32 binarySize()=0;
 | 
						virtual quint32 binarySize()=0;
 | 
				
			||||||
 | 
					    virtual QString friendlySize()=0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	//! \return the index of the entry amongst the entries of its group. The index of the first entry is 0.
 | 
						//! \return the index of the entry amongst the entries of its group. The index of the first entry is 0.
 | 
				
			||||||
	virtual int visualIndex()const=0;
 | 
						virtual int visualIndex()const=0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -962,6 +962,43 @@ KpxDateTime	Kdb3Database::EntryHandle::lastAccess(){return Entry->LastAccess;}
 | 
				
			||||||
KpxDateTime	Kdb3Database::EntryHandle::expire(){return Entry->Expire;}
 | 
					KpxDateTime	Kdb3Database::EntryHandle::expire(){return Entry->Expire;}
 | 
				
			||||||
QByteArray Kdb3Database::EntryHandle::binary(){return Entry->Binary;}
 | 
					QByteArray Kdb3Database::EntryHandle::binary(){return Entry->Binary;}
 | 
				
			||||||
quint32 Kdb3Database::EntryHandle::binarySize(){return Entry->Binary.size();}
 | 
					quint32 Kdb3Database::EntryHandle::binarySize(){return Entry->Binary.size();}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QString Kdb3Database::EntryHandle::friendlySize()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    quint32 binsize = binarySize();
 | 
				
			||||||
 | 
					    QString unit;
 | 
				
			||||||
 | 
					    uint    faktor;
 | 
				
			||||||
 | 
					    int     prec;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (binsize < 1024)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        unit = tr("Bytes");
 | 
				
			||||||
 | 
					        faktor = 1;
 | 
				
			||||||
 | 
					        prec = 0;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        if (binsize < 1048576)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            unit = tr("KiB");
 | 
				
			||||||
 | 
					            faktor = 1024;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            if (binsize < 1073741824)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                unit = tr("MiB");
 | 
				
			||||||
 | 
					                faktor = 1048576;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                unit = tr("GiB");
 | 
				
			||||||
 | 
					                faktor = 1073741824;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        prec = 1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return (QString::number((float)binsize / (float)faktor, 'f', prec) + " " + unit);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int Kdb3Database::EntryHandle::visualIndex()const{return Entry->Index;}
 | 
					int Kdb3Database::EntryHandle::visualIndex()const{return Entry->Index;}
 | 
				
			||||||
void Kdb3Database::EntryHandle::setVisualIndexDirectly(int i){Entry->Index=i;}
 | 
					void Kdb3Database::EntryHandle::setVisualIndexDirectly(int i){Entry->Index=i;}
 | 
				
			||||||
bool Kdb3Database::EntryHandle::isValid()const{return valid;}
 | 
					bool Kdb3Database::EntryHandle::isValid()const{return valid;}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -91,6 +91,7 @@ public:
 | 
				
			||||||
			virtual KpxDateTime expire();
 | 
								virtual KpxDateTime expire();
 | 
				
			||||||
			virtual QByteArray binary();
 | 
								virtual QByteArray binary();
 | 
				
			||||||
			virtual quint32 binarySize();
 | 
								virtual quint32 binarySize();
 | 
				
			||||||
 | 
					            virtual QString friendlySize();
 | 
				
			||||||
			virtual bool isValid() const;
 | 
								virtual bool isValid() const;
 | 
				
			||||||
		private:
 | 
							private:
 | 
				
			||||||
			void invalidate(){valid=false;}
 | 
								void invalidate(){valid=false;}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,20 +18,20 @@
 | 
				
			||||||
 ***************************************************************************/
 | 
					 ***************************************************************************/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <qmessagebox.h>
 | 
					#include <qmessagebox.h>
 | 
				
			||||||
#include <qlabel.h>
 | 
					 | 
				
			||||||
#include <qdialog.h>
 | 
					 | 
				
			||||||
#include <qfile.h>
 | 
					 | 
				
			||||||
#include <QPainter>
 | 
					#include <QPainter>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "main.h"
 | 
					 | 
				
			||||||
#include "AboutDlg.h"
 | 
					#include "AboutDlg.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AboutDialog::AboutDialog(QWidget* parent):QDialog(parent)
 | 
					AboutDialog::AboutDialog(QWidget* parent):QDialog(parent)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	setupUi(this);
 | 
						setupUi(this);
 | 
				
			||||||
	createBanner(&BannerPixmap,getPixmap("keepassx_large"),tr("KeePassX %1").arg(KEEPASS_VERSION),width());
 | 
						createBanner(&BannerPixmap,getPixmap("keepassx_large"),tr("%1 %2").arg(APP_DISPLAY_NAME, APP_VERSION),width());
 | 
				
			||||||
	loadLicFromFile();
 | 
						loadLicFromFile();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    labelAppName->setText(tr(APP_DISPLAY_NAME));
 | 
				
			||||||
 | 
					    labelAppFunc->setText(tr(" -  %1").arg(APP_LONG_FUNC));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QString AboutTr=tr("<b>Current Translation: None</b><br><br>","Please replace 'None' with the language of your translation");
 | 
						QString AboutTr=tr("<b>Current Translation: None</b><br><br>","Please replace 'None' with the language of your translation");
 | 
				
			||||||
	if(TrActive){
 | 
						if(TrActive){
 | 
				
			||||||
		AboutTr+=tr("<b>Author:</b> %1<br>").arg(tr("$TRANSLATION_AUTHOR"));
 | 
							AboutTr+=tr("<b>Author:</b> %1<br>").arg(tr("$TRANSLATION_AUTHOR"));
 | 
				
			||||||
| 
						 | 
					@ -51,9 +51,9 @@ AboutDialog::AboutDialog(QWidget* parent):QDialog(parent)
 | 
				
			||||||
	str+="<br>";
 | 
						str+="<br>";
 | 
				
			||||||
	str+="<u>"+tr("Eugen Gorschenin")+"</u><br>"+tr("Web Designer")+"<br>"+tr("geugen@users.sf.de")+"<br>";
 | 
						str+="<u>"+tr("Eugen Gorschenin")+"</u><br>"+tr("Web Designer")+"<br>"+tr("geugen@users.sf.de")+"<br>";
 | 
				
			||||||
	str+="<br>";
 | 
						str+="<br>";
 | 
				
			||||||
	str+="<u>"+tr("Jota Jota")+"</u><br>"+tr("Developer")+"<br>"+tr("myxself@users.sf.de")+"<br>";
 | 
						str+="<u>"+tr("Juan J González Cárdenas [Jota Jota]")+"</u><br>"+tr("Developer")+"<br>"+tr("myxelf@users.sf.net")+"<br>";
 | 
				
			||||||
	str+="</div><br><div style='margin-left:0px;'>";
 | 
						str+="</div><br><div style='margin-left:0px;'>";
 | 
				
			||||||
	str+="<b>"+tr("Thanks To")+"</b>";
 | 
					    str+="<b>"+tr("Thanks To")+"</b><br>";
 | 
				
			||||||
	str+="</div><div style='margin-left:10px;'>";
 | 
						str+="</div><div style='margin-left:10px;'>";
 | 
				
			||||||
	str+="<u>"+tr("Matthias Miller")+"</u><br>"+tr("Patches for better MacOS X support")+"<br>"+tr("www.outofhanwell.com")+"<br></div>";
 | 
						str+="<u>"+tr("Matthias Miller")+"</u><br>"+tr("Patches for better MacOS X support")+"<br>"+tr("www.outofhanwell.com")+"<br></div>";
 | 
				
			||||||
	str+="<br>";
 | 
						str+="<br>";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -21,9 +21,9 @@
 | 
				
			||||||
#define _ABOUTDIALOG_H_
 | 
					#define _ABOUTDIALOG_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QPaintEvent>
 | 
					#include <QPaintEvent>
 | 
				
			||||||
#include <QPixmap>
 | 
					 | 
				
			||||||
#include "ui_AboutDlg.h"
 | 
					#include "ui_AboutDlg.h"
 | 
				
			||||||
#include "lib/UrlLabel.h"
 | 
					#include "lib/UrlLabel.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "main.h"
 | 
					#include "main.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,10 +18,13 @@
 | 
				
			||||||
 ***************************************************************************/
 | 
					 ***************************************************************************/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QFileInfo>
 | 
					#include <QFileInfo>
 | 
				
			||||||
#include "AddBookmarkDlg.h"
 | 
					#include <QPainter>
 | 
				
			||||||
#include "lib/FileDialogs.h"
 | 
					#include "lib/FileDialogs.h"
 | 
				
			||||||
#include "lib/bookmarks.h"
 | 
					#include "lib/bookmarks.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "AddBookmarkDlg.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AddBookmarkDlg::AddBookmarkDlg(QWidget* parent, QString DefaultFilename, int _ItemID):QDialog(parent)
 | 
					AddBookmarkDlg::AddBookmarkDlg(QWidget* parent, QString DefaultFilename, int _ItemID):QDialog(parent)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	setupUi(this);
 | 
						setupUi(this);
 | 
				
			||||||
| 
						 | 
					@ -30,18 +33,29 @@ AddBookmarkDlg::AddBookmarkDlg(QWidget* parent, QString DefaultFilename, int _It
 | 
				
			||||||
	connect(buttonBox->button(QDialogButtonBox::Ok),SIGNAL(clicked()),this,SLOT(OnButtonOk()));
 | 
						connect(buttonBox->button(QDialogButtonBox::Ok),SIGNAL(clicked()),this,SLOT(OnButtonOk()));
 | 
				
			||||||
	connect(buttonBox->button(QDialogButtonBox::Cancel),SIGNAL(clicked()),this,SLOT(reject()));
 | 
						connect(buttonBox->button(QDialogButtonBox::Cancel),SIGNAL(clicked()),this,SLOT(reject()));
 | 
				
			||||||
	if(ItemID==-1){
 | 
						if(ItemID==-1){
 | 
				
			||||||
 | 
					        createBanner(&BannerPixmap,getPixmap("bookmark_add"),tr("Add Bookmark"),width());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if(DefaultFilename==QString())
 | 
							if(DefaultFilename==QString())
 | 
				
			||||||
			OnButtonBrowse();
 | 
								OnButtonBrowse();
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			Edit_Filename->setText(DefaultFilename);
 | 
								Edit_Filename->setText(DefaultFilename);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	else {
 | 
						else {
 | 
				
			||||||
 | 
					        createBanner(&BannerPixmap,getPixmap("bookmark_edit"),tr("Edit Bookmark"),width());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Edit_Title->setText(KpxBookmarks::title(ItemID));
 | 
					        Edit_Title->setText(KpxBookmarks::title(ItemID));
 | 
				
			||||||
		Edit_Filename->setText(KpxBookmarks::path(ItemID));
 | 
							Edit_Filename->setText(KpxBookmarks::path(ItemID));
 | 
				
			||||||
		setWindowTitle(tr("Edit Bookmark"));
 | 
							setWindowTitle(tr("Edit Bookmark"));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void AddBookmarkDlg::paintEvent(QPaintEvent *event){
 | 
				
			||||||
 | 
					    QDialog::paintEvent(event);
 | 
				
			||||||
 | 
					    QPainter painter(this);
 | 
				
			||||||
 | 
					    painter.setClipRegion(event->region());
 | 
				
			||||||
 | 
					    painter.drawPixmap(QPoint(0,0),BannerPixmap);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AddBookmarkDlg::OnButtonBrowse(){
 | 
					void AddBookmarkDlg::OnButtonBrowse(){
 | 
				
			||||||
	QString path=KpxFileDialogs::openExistingFile(this,"AddBookmarkDlg", tr("Add Bookmark"),
 | 
						QString path=KpxFileDialogs::openExistingFile(this,"AddBookmarkDlg", tr("Add Bookmark"),
 | 
				
			||||||
									              QStringList() << tr("KeePass Databases (*.kdb)") << tr("All Files (*)"));
 | 
														              QStringList() << tr("KeePass Databases (*.kdb)") << tr("All Files (*)"));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -21,8 +21,11 @@
 | 
				
			||||||
#define _ADDBOOKMARKDLG_H_
 | 
					#define _ADDBOOKMARKDLG_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QDialog>
 | 
					#include <QDialog>
 | 
				
			||||||
 | 
					#include <QPaintEvent>
 | 
				
			||||||
#include "ui_AddBookmarkDlg.h"
 | 
					#include "ui_AddBookmarkDlg.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "main.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class AddBookmarkDlg : public QDialog, private Ui::AddBookmarkDlg
 | 
					class AddBookmarkDlg : public QDialog, private Ui::AddBookmarkDlg
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
| 
						 | 
					@ -31,6 +34,10 @@ class AddBookmarkDlg : public QDialog, private Ui::AddBookmarkDlg
 | 
				
			||||||
		AddBookmarkDlg (QWidget* parent=0, QString DefaultFilename=QString(), int ItemID=-1);
 | 
							AddBookmarkDlg (QWidget* parent=0, QString DefaultFilename=QString(), int ItemID=-1);
 | 
				
			||||||
		int ItemID;
 | 
							int ItemID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private:
 | 
				
			||||||
 | 
					        QPixmap BannerPixmap;
 | 
				
			||||||
 | 
					        virtual void paintEvent(QPaintEvent*);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private slots:
 | 
					    private slots:
 | 
				
			||||||
		void OnButtonOk();
 | 
							void OnButtonOk();
 | 
				
			||||||
		void OnButtonBrowse();
 | 
							void OnButtonBrowse();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -21,8 +21,9 @@
 | 
				
			||||||
#include <QPainter>
 | 
					#include <QPainter>
 | 
				
			||||||
#include <QCursor>
 | 
					#include <QCursor>
 | 
				
			||||||
#include "crypto/yarrow.h"
 | 
					#include "crypto/yarrow.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "CollectEntropyDlg.h"
 | 
					#include "CollectEntropyDlg.h"
 | 
				
			||||||
#include "main.h"
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CollectEntropyDlg::CollectEntropyDlg(QWidget* parent):QDialog(parent){
 | 
					CollectEntropyDlg::CollectEntropyDlg(QWidget* parent):QDialog(parent){
 | 
				
			||||||
	setupUi(this);
 | 
						setupUi(this);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,6 +26,9 @@
 | 
				
			||||||
#include <QPaintEvent>
 | 
					#include <QPaintEvent>
 | 
				
			||||||
#include <QShowEvent>
 | 
					#include <QShowEvent>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "main.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class CollectEntropyDlg: public QDialog, public Ui_CollectEntropyDlg{
 | 
					class CollectEntropyDlg: public QDialog, public Ui_CollectEntropyDlg{
 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
	public:
 | 
						public:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -131,16 +131,9 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
 | 
				
			||||||
		ButtonDeleteAttachment->setDisabled(true);
 | 
							ButtonDeleteAttachment->setDisabled(true);
 | 
				
			||||||
		Label_AttachmentSize->setText("");
 | 
							Label_AttachmentSize->setText("");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	else{
 | 
					 | 
				
			||||||
		QString unit;
 | 
					 | 
				
			||||||
		int faktor;
 | 
					 | 
				
			||||||
		int prec;
 | 
					 | 
				
			||||||
		if(entry->binarySize()<1000){unit=" Byte";faktor=1;prec=0;}
 | 
					 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
			if(entry->binarySize()<1000000){unit=" kB";faktor=1000;prec=1;}
 | 
					        Label_AttachmentSize->setText(entry->friendlySize());
 | 
				
			||||||
		else{unit=" MB";faktor=1000000;prec=1;}
 | 
					
 | 
				
			||||||
		Label_AttachmentSize->setText(QString::number((float)entry->binarySize()/(float)faktor,'f',prec)+unit);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if(entry->expire()==Date_Never){
 | 
						if(entry->expire()==Date_Never){
 | 
				
			||||||
		DateTime_Expire->setDisabled(true);
 | 
							DateTime_Expire->setDisabled(true);
 | 
				
			||||||
		CheckBox_ExpiresNever->setChecked(true);
 | 
							CheckBox_ExpiresNever->setChecked(true);
 | 
				
			||||||
| 
						 | 
					@ -344,36 +337,7 @@ void CEditEntryDlg::OnNewAttachment()
 | 
				
			||||||
	QFileInfo info(filename);
 | 
						QFileInfo info(filename);
 | 
				
			||||||
	entry->setBinaryDesc(info.fileName());
 | 
						entry->setBinaryDesc(info.fileName());
 | 
				
			||||||
	Edit_Attachment->setText(entry->binaryDesc());
 | 
						Edit_Attachment->setText(entry->binaryDesc());
 | 
				
			||||||
	QString unit;
 | 
						Label_AttachmentSize->setText(entry->friendlySize());
 | 
				
			||||||
	uint faktor;
 | 
					 | 
				
			||||||
	int prec;
 | 
					 | 
				
			||||||
	if (entry->binarySize() < 1024)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        unit = tr("Bytes");
 | 
					 | 
				
			||||||
        faktor = 1;
 | 
					 | 
				
			||||||
        prec = 0;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (entry->binarySize() < pow(2,20))
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            unit = tr("kiB");
 | 
					 | 
				
			||||||
            faktor = 1024;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
            if (entry->binarySize() < pow(2,30))
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                unit = tr("MiB");
 | 
					 | 
				
			||||||
                faktor = pow(2,20);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                unit = tr("GiB");
 | 
					 | 
				
			||||||
                faktor = pow(2,30);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        prec = 1;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
	Label_AttachmentSize->setText(QString::number((float)entry->binarySize()/(float)faktor,'f',prec) + " " + unit);
 | 
					 | 
				
			||||||
	ButtonOpenAttachment->setEnabled(true);
 | 
						ButtonOpenAttachment->setEnabled(true);
 | 
				
			||||||
	ButtonSaveAttachment->setEnabled(true);
 | 
						ButtonSaveAttachment->setEnabled(true);
 | 
				
			||||||
	ButtonDeleteAttachment->setEnabled(true);
 | 
						ButtonDeleteAttachment->setEnabled(true);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@
 | 
				
			||||||
 ***************************************************************************/
 | 
					 ***************************************************************************/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QListWidget>
 | 
					#include <QListWidget>
 | 
				
			||||||
#include "main.h"
 | 
					#include <QPainter>
 | 
				
			||||||
#include "ManageBookmarksDlg.h"
 | 
					#include "ManageBookmarksDlg.h"
 | 
				
			||||||
#include "lib/bookmarks.h"
 | 
					#include "lib/bookmarks.h"
 | 
				
			||||||
#include "dialogs/AddBookmarkDlg.h"
 | 
					#include "dialogs/AddBookmarkDlg.h"
 | 
				
			||||||
| 
						 | 
					@ -26,24 +26,65 @@
 | 
				
			||||||
ManageBookmarksDlg::ManageBookmarksDlg(QWidget* parent):QDialog(parent)
 | 
					ManageBookmarksDlg::ManageBookmarksDlg(QWidget* parent):QDialog(parent)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	setupUi(this);
 | 
						setupUi(this);
 | 
				
			||||||
 | 
					    createBanner(&BannerPixmap,getPixmap("bookmark"),tr("Manage Bookmarks"),width());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for(int i=0;i<KpxBookmarks::count();i++){
 | 
						for(int i=0;i<KpxBookmarks::count();i++){
 | 
				
			||||||
		QListWidgetItem* item=new QListWidgetItem(ListWidget);
 | 
							QListWidgetItem* item=new QListWidgetItem(ListWidget);
 | 
				
			||||||
		item->setData(Qt::UserRole,i);
 | 
							item->setData(Qt::UserRole,i);
 | 
				
			||||||
		item->setText(KpxBookmarks::title(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_Add,SIGNAL(clicked()),this,SLOT(OnButtonAdd()));
 | 
				
			||||||
    connect(Button_Edit,SIGNAL(clicked()),this,SLOT(OnButtonEdit()));
 | 
					    connect(Button_Edit,SIGNAL(clicked()),this,SLOT(OnButtonEdit()));
 | 
				
			||||||
 | 
					    connect(Button_Delete,SIGNAL(clicked()),this,SLOT(OnButtonDelete()));
 | 
				
			||||||
 | 
					    connect(Button_Up,SIGNAL(clicked()),this,SLOT(OnButtonUp()));
 | 
				
			||||||
 | 
						connect(Button_Down,SIGNAL(clicked()),this,SLOT(OnButtonDown()));
 | 
				
			||||||
	connect(ListWidget,SIGNAL(itemDoubleClicked(QListWidgetItem*)),this,SLOT(edit(QListWidgetItem*)));
 | 
						connect(ListWidget,SIGNAL(itemDoubleClicked(QListWidgetItem*)),this,SLOT(edit(QListWidgetItem*)));
 | 
				
			||||||
	connect(buttonBox->button(QDialogButtonBox::Close),SIGNAL(clicked()),this,SLOT(close()));
 | 
						connect(buttonBox->button(QDialogButtonBox::Close),SIGNAL(clicked()),this,SLOT(close()));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Button_Add->setIcon(getIcon("bookmark_add"));
 | 
				
			||||||
 | 
						Button_Edit->setIcon(getIcon("bookmark_edit"));
 | 
				
			||||||
 | 
					    Button_Delete->setIcon(getIcon("bookmark_del"));
 | 
				
			||||||
    Button_Up->setIcon(getIcon("up"));
 | 
					    Button_Up->setIcon(getIcon("up"));
 | 
				
			||||||
    Button_Down->setIcon(getIcon("down"));
 | 
					    Button_Down->setIcon(getIcon("down"));
 | 
				
			||||||
	Button_Delete->setIcon(getIcon("delete"));
 | 
					}
 | 
				
			||||||
	Button_Edit->setIcon(getIcon("bookmark_edit"));
 | 
					
 | 
				
			||||||
	Button_Add->setIcon(getIcon("bookmark_add"));
 | 
					void ManageBookmarksDlg::paintEvent(QPaintEvent *event){
 | 
				
			||||||
 | 
					    QDialog::paintEvent(event);
 | 
				
			||||||
 | 
					    QPainter painter(this);
 | 
				
			||||||
 | 
					    painter.setClipRegion(event->region());
 | 
				
			||||||
 | 
					    painter.drawPixmap(QPoint(0,0),BannerPixmap);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					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::OnButtonEdit(){
 | 
				
			||||||
 | 
					    QListWidgetItem* item=ListWidget->currentItem();
 | 
				
			||||||
 | 
					    if(!item)return;
 | 
				
			||||||
 | 
					    edit(item);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					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);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -67,24 +108,7 @@ void ManageBookmarksDlg::OnButtonDown(){
 | 
				
			||||||
	ListWidget->setCurrentRow(row);
 | 
						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){
 | 
					void ManageBookmarksDlg::edit(QListWidgetItem* item){
 | 
				
			||||||
	int i=item->data(Qt::UserRole).toInt();
 | 
						int i=item->data(Qt::UserRole).toInt();
 | 
				
			||||||
| 
						 | 
					@ -94,16 +118,6 @@ void ManageBookmarksDlg::edit(QListWidgetItem* item){
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
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){
 | 
					void ManageBookmarksDlg::closeEvent(QCloseEvent * event){
 | 
				
			||||||
	QList<int> Order;
 | 
						QList<int> Order;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,21 +22,26 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QDialog>
 | 
					#include <QDialog>
 | 
				
			||||||
#include <QCloseEvent>
 | 
					#include <QCloseEvent>
 | 
				
			||||||
 | 
					#include <QPaintEvent>
 | 
				
			||||||
#include "ui_ManageBookmarksDlg.h"
 | 
					#include "ui_ManageBookmarksDlg.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "main.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ManageBookmarksDlg : public QDialog, private Ui::ManageBookmarksDlg
 | 
					class ManageBookmarksDlg : public QDialog, private Ui::ManageBookmarksDlg
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  	Q_OBJECT
 | 
					  	Q_OBJECT
 | 
				
			||||||
	public:
 | 
						public:
 | 
				
			||||||
		ManageBookmarksDlg(QWidget* parent=0);
 | 
							ManageBookmarksDlg(QWidget* parent=0);
 | 
				
			||||||
	private:
 | 
						private:
 | 
				
			||||||
 | 
					        QPixmap BannerPixmap;
 | 
				
			||||||
 | 
					        virtual void paintEvent(QPaintEvent*);
 | 
				
			||||||
		virtual void closeEvent(QCloseEvent* event);
 | 
							virtual void closeEvent(QCloseEvent* event);
 | 
				
			||||||
	private slots:
 | 
						private slots:
 | 
				
			||||||
		void OnButtonUp();
 | 
					 | 
				
			||||||
		void OnButtonDown();
 | 
					 | 
				
			||||||
		void OnButtonDelete();
 | 
					 | 
				
			||||||
        void OnButtonAdd();
 | 
					        void OnButtonAdd();
 | 
				
			||||||
        void OnButtonEdit();
 | 
					        void OnButtonEdit();
 | 
				
			||||||
 | 
					        void OnButtonDelete();
 | 
				
			||||||
 | 
					        void OnButtonUp();
 | 
				
			||||||
 | 
							void OnButtonDown();
 | 
				
			||||||
		void edit(QListWidgetItem*);
 | 
							void edit(QListWidgetItem*);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -88,12 +88,50 @@
 | 
				
			||||||
        <number>9</number>
 | 
					        <number>9</number>
 | 
				
			||||||
       </property>
 | 
					       </property>
 | 
				
			||||||
       <item>
 | 
					       <item>
 | 
				
			||||||
        <widget class="QLabel" name="label" >
 | 
					        <layout class="QHBoxLayout" >
 | 
				
			||||||
 | 
					         <item>
 | 
				
			||||||
 | 
					          <widget class="QLabel" name="labelAppName" >
 | 
				
			||||||
 | 
					           <property name="sizePolicy" >
 | 
				
			||||||
 | 
					            <sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
 | 
				
			||||||
 | 
					             <horstretch>0</horstretch>
 | 
				
			||||||
 | 
					             <verstretch>0</verstretch>
 | 
				
			||||||
 | 
					            </sizepolicy>
 | 
				
			||||||
 | 
					           </property>
 | 
				
			||||||
 | 
					           <property name="font" >
 | 
				
			||||||
 | 
					            <font>
 | 
				
			||||||
 | 
					             <pointsize>12</pointsize>
 | 
				
			||||||
 | 
					             <weight>75</weight>
 | 
				
			||||||
 | 
					             <bold>true</bold>
 | 
				
			||||||
 | 
					            </font>
 | 
				
			||||||
 | 
					           </property>
 | 
				
			||||||
           <property name="text" >
 | 
					           <property name="text" >
 | 
				
			||||||
          <string><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">KeePassX</span> - Cross Platform Password Manager</p></body></html></string>
 | 
					            <string>AppName</string>
 | 
				
			||||||
           </property>
 | 
					           </property>
 | 
				
			||||||
          </widget>
 | 
					          </widget>
 | 
				
			||||||
         </item>
 | 
					         </item>
 | 
				
			||||||
 | 
					         <item>
 | 
				
			||||||
 | 
					          <widget class="QLabel" name="labelAppFunc" >
 | 
				
			||||||
 | 
					           <property name="sizePolicy" >
 | 
				
			||||||
 | 
					            <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
 | 
				
			||||||
 | 
					             <horstretch>0</horstretch>
 | 
				
			||||||
 | 
					             <verstretch>0</verstretch>
 | 
				
			||||||
 | 
					            </sizepolicy>
 | 
				
			||||||
 | 
					           </property>
 | 
				
			||||||
 | 
					           <property name="font" >
 | 
				
			||||||
 | 
					            <font>
 | 
				
			||||||
 | 
					             <pointsize>9</pointsize>
 | 
				
			||||||
 | 
					            </font>
 | 
				
			||||||
 | 
					           </property>
 | 
				
			||||||
 | 
					           <property name="text" >
 | 
				
			||||||
 | 
					            <string>AppFunc</string>
 | 
				
			||||||
 | 
					           </property>
 | 
				
			||||||
 | 
					           <property name="alignment" >
 | 
				
			||||||
 | 
					            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
 | 
				
			||||||
 | 
					           </property>
 | 
				
			||||||
 | 
					          </widget>
 | 
				
			||||||
 | 
					         </item>
 | 
				
			||||||
 | 
					        </layout>
 | 
				
			||||||
 | 
					       </item>
 | 
				
			||||||
       <item>
 | 
					       <item>
 | 
				
			||||||
        <layout class="QHBoxLayout" >
 | 
					        <layout class="QHBoxLayout" >
 | 
				
			||||||
         <property name="spacing" >
 | 
					         <property name="spacing" >
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,18 +1,53 @@
 | 
				
			||||||
<ui version="4.0" >
 | 
					<ui version="4.0" >
 | 
				
			||||||
 | 
					 <author>Tarek Saidi</author>
 | 
				
			||||||
 <class>AddBookmarkDlg</class>
 | 
					 <class>AddBookmarkDlg</class>
 | 
				
			||||||
 <widget class="QWidget" name="AddBookmarkDlg" >
 | 
					 <widget class="QWidget" name="AddBookmarkDlg" >
 | 
				
			||||||
  <property name="geometry" >
 | 
					  <property name="geometry" >
 | 
				
			||||||
   <rect>
 | 
					   <rect>
 | 
				
			||||||
    <x>0</x>
 | 
					    <x>0</x>
 | 
				
			||||||
    <y>0</y>
 | 
					    <y>0</y>
 | 
				
			||||||
    <width>497</width>
 | 
					    <width>500</width>
 | 
				
			||||||
    <height>148</height>
 | 
					    <height>180</height>
 | 
				
			||||||
   </rect>
 | 
					   </rect>
 | 
				
			||||||
  </property>
 | 
					  </property>
 | 
				
			||||||
 | 
					  <property name="sizePolicy" >
 | 
				
			||||||
 | 
					   <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
 | 
				
			||||||
 | 
					    <horstretch>0</horstretch>
 | 
				
			||||||
 | 
					    <verstretch>0</verstretch>
 | 
				
			||||||
 | 
					   </sizepolicy>
 | 
				
			||||||
 | 
					  </property>
 | 
				
			||||||
 | 
					  <property name="minimumSize" >
 | 
				
			||||||
 | 
					   <size>
 | 
				
			||||||
 | 
					    <width>500</width>
 | 
				
			||||||
 | 
					    <height>180</height>
 | 
				
			||||||
 | 
					   </size>
 | 
				
			||||||
 | 
					  </property>
 | 
				
			||||||
 | 
					  <property name="maximumSize" >
 | 
				
			||||||
 | 
					   <size>
 | 
				
			||||||
 | 
					    <width>500</width>
 | 
				
			||||||
 | 
					    <height>180</height>
 | 
				
			||||||
 | 
					   </size>
 | 
				
			||||||
 | 
					  </property>
 | 
				
			||||||
  <property name="windowTitle" >
 | 
					  <property name="windowTitle" >
 | 
				
			||||||
   <string>Add Bookmark</string>
 | 
					   <string>Add Bookmark</string>
 | 
				
			||||||
  </property>
 | 
					  </property>
 | 
				
			||||||
  <layout class="QVBoxLayout" >
 | 
					  <layout class="QVBoxLayout" >
 | 
				
			||||||
 | 
					   <item>
 | 
				
			||||||
 | 
					    <spacer>
 | 
				
			||||||
 | 
					     <property name="orientation" >
 | 
				
			||||||
 | 
					      <enum>Qt::Vertical</enum>
 | 
				
			||||||
 | 
					     </property>
 | 
				
			||||||
 | 
					     <property name="sizeType" >
 | 
				
			||||||
 | 
					      <enum>QSizePolicy::Fixed</enum>
 | 
				
			||||||
 | 
					     </property>
 | 
				
			||||||
 | 
					     <property name="sizeHint" >
 | 
				
			||||||
 | 
					      <size>
 | 
				
			||||||
 | 
					       <width>20</width>
 | 
				
			||||||
 | 
					       <height>50</height>
 | 
				
			||||||
 | 
					      </size>
 | 
				
			||||||
 | 
					     </property>
 | 
				
			||||||
 | 
					    </spacer>
 | 
				
			||||||
 | 
					   </item>
 | 
				
			||||||
   <item>
 | 
					   <item>
 | 
				
			||||||
    <layout class="QGridLayout" >
 | 
					    <layout class="QGridLayout" >
 | 
				
			||||||
     <item row="0" column="0" >
 | 
					     <item row="0" column="0" >
 | 
				
			||||||
| 
						 | 
					@ -44,6 +79,13 @@
 | 
				
			||||||
     </item>
 | 
					     </item>
 | 
				
			||||||
    </layout>
 | 
					    </layout>
 | 
				
			||||||
   </item>
 | 
					   </item>
 | 
				
			||||||
 | 
					   <item>
 | 
				
			||||||
 | 
					    <widget class="Line" name="line" >
 | 
				
			||||||
 | 
					     <property name="orientation" >
 | 
				
			||||||
 | 
					      <enum>Qt::Horizontal</enum>
 | 
				
			||||||
 | 
					     </property>
 | 
				
			||||||
 | 
					    </widget>
 | 
				
			||||||
 | 
					   </item>
 | 
				
			||||||
   <item>
 | 
					   <item>
 | 
				
			||||||
    <widget class="QDialogButtonBox" name="buttonBox" >
 | 
					    <widget class="QDialogButtonBox" name="buttonBox" >
 | 
				
			||||||
     <property name="standardButtons" >
 | 
					     <property name="standardButtons" >
 | 
				
			||||||
| 
						 | 
					@ -53,6 +95,7 @@
 | 
				
			||||||
   </item>
 | 
					   </item>
 | 
				
			||||||
  </layout>
 | 
					  </layout>
 | 
				
			||||||
 </widget>
 | 
					 </widget>
 | 
				
			||||||
 | 
					 <includes/>
 | 
				
			||||||
 <resources/>
 | 
					 <resources/>
 | 
				
			||||||
 <connections/>
 | 
					 <connections/>
 | 
				
			||||||
</ui>
 | 
					</ui>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -285,7 +285,7 @@
 | 
				
			||||||
  </action>
 | 
					  </action>
 | 
				
			||||||
  <action name="FileExitAction" >
 | 
					  <action name="FileExitAction" >
 | 
				
			||||||
   <property name="text" >
 | 
					   <property name="text" >
 | 
				
			||||||
    <string>E&xit</string>
 | 
					    <string>Q&uit</string>
 | 
				
			||||||
   </property>
 | 
					   </property>
 | 
				
			||||||
  </action>
 | 
					  </action>
 | 
				
			||||||
  <action name="EditNewGroupAction" >
 | 
					  <action name="EditNewGroupAction" >
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,14 +5,36 @@
 | 
				
			||||||
   <rect>
 | 
					   <rect>
 | 
				
			||||||
    <x>0</x>
 | 
					    <x>0</x>
 | 
				
			||||||
    <y>0</y>
 | 
					    <y>0</y>
 | 
				
			||||||
    <width>452</width>
 | 
					    <width>280</width>
 | 
				
			||||||
    <height>360</height>
 | 
					    <height>360</height>
 | 
				
			||||||
   </rect>
 | 
					   </rect>
 | 
				
			||||||
  </property>
 | 
					  </property>
 | 
				
			||||||
 | 
					  <property name="minimumSize" >
 | 
				
			||||||
 | 
					   <size>
 | 
				
			||||||
 | 
					    <width>280</width>
 | 
				
			||||||
 | 
					    <height>300</height>
 | 
				
			||||||
 | 
					   </size>
 | 
				
			||||||
 | 
					  </property>
 | 
				
			||||||
  <property name="windowTitle" >
 | 
					  <property name="windowTitle" >
 | 
				
			||||||
   <string>Manage Bookmarks</string>
 | 
					   <string>Manage Bookmarks</string>
 | 
				
			||||||
  </property>
 | 
					  </property>
 | 
				
			||||||
  <layout class="QVBoxLayout" >
 | 
					  <layout class="QVBoxLayout" >
 | 
				
			||||||
 | 
					   <item>
 | 
				
			||||||
 | 
					    <spacer>
 | 
				
			||||||
 | 
					     <property name="orientation" >
 | 
				
			||||||
 | 
					      <enum>Qt::Vertical</enum>
 | 
				
			||||||
 | 
					     </property>
 | 
				
			||||||
 | 
					     <property name="sizeType" >
 | 
				
			||||||
 | 
					      <enum>QSizePolicy::Fixed</enum>
 | 
				
			||||||
 | 
					     </property>
 | 
				
			||||||
 | 
					     <property name="sizeHint" >
 | 
				
			||||||
 | 
					      <size>
 | 
				
			||||||
 | 
					       <width>20</width>
 | 
				
			||||||
 | 
					       <height>50</height>
 | 
				
			||||||
 | 
					      </size>
 | 
				
			||||||
 | 
					     </property>
 | 
				
			||||||
 | 
					    </spacer>
 | 
				
			||||||
 | 
					   </item>
 | 
				
			||||||
   <item>
 | 
					   <item>
 | 
				
			||||||
    <layout class="QHBoxLayout" >
 | 
					    <layout class="QHBoxLayout" >
 | 
				
			||||||
     <item>
 | 
					     <item>
 | 
				
			||||||
| 
						 | 
					@ -21,19 +43,70 @@
 | 
				
			||||||
     <item>
 | 
					     <item>
 | 
				
			||||||
      <layout class="QVBoxLayout" >
 | 
					      <layout class="QVBoxLayout" >
 | 
				
			||||||
       <item>
 | 
					       <item>
 | 
				
			||||||
        <widget class="QToolButton" name="Button_Add" />
 | 
					        <widget class="QToolButton" name="Button_Add" >
 | 
				
			||||||
 | 
					         <property name="iconSize" >
 | 
				
			||||||
 | 
					          <size>
 | 
				
			||||||
 | 
					           <width>16</width>
 | 
				
			||||||
 | 
					           <height>16</height>
 | 
				
			||||||
 | 
					          </size>
 | 
				
			||||||
 | 
					         </property>
 | 
				
			||||||
 | 
					        </widget>
 | 
				
			||||||
       </item>
 | 
					       </item>
 | 
				
			||||||
       <item>
 | 
					       <item>
 | 
				
			||||||
        <widget class="QToolButton" name="Button_Delete" />
 | 
					        <widget class="QToolButton" name="Button_Edit" >
 | 
				
			||||||
 | 
					         <property name="iconSize" >
 | 
				
			||||||
 | 
					          <size>
 | 
				
			||||||
 | 
					           <width>16</width>
 | 
				
			||||||
 | 
					           <height>16</height>
 | 
				
			||||||
 | 
					          </size>
 | 
				
			||||||
 | 
					         </property>
 | 
				
			||||||
 | 
					        </widget>
 | 
				
			||||||
       </item>
 | 
					       </item>
 | 
				
			||||||
       <item>
 | 
					       <item>
 | 
				
			||||||
        <widget class="QToolButton" name="Button_Edit" />
 | 
					        <widget class="QToolButton" name="Button_Delete" >
 | 
				
			||||||
 | 
					         <property name="iconSize" >
 | 
				
			||||||
 | 
					          <size>
 | 
				
			||||||
 | 
					           <width>16</width>
 | 
				
			||||||
 | 
					           <height>16</height>
 | 
				
			||||||
 | 
					          </size>
 | 
				
			||||||
 | 
					         </property>
 | 
				
			||||||
 | 
					        </widget>
 | 
				
			||||||
       </item>
 | 
					       </item>
 | 
				
			||||||
       <item>
 | 
					       <item>
 | 
				
			||||||
        <widget class="QToolButton" name="Button_Up" />
 | 
					        <spacer>
 | 
				
			||||||
 | 
					         <property name="orientation" >
 | 
				
			||||||
 | 
					          <enum>Qt::Vertical</enum>
 | 
				
			||||||
 | 
					         </property>
 | 
				
			||||||
 | 
					         <property name="sizeType" >
 | 
				
			||||||
 | 
					          <enum>QSizePolicy::Fixed</enum>
 | 
				
			||||||
 | 
					         </property>
 | 
				
			||||||
 | 
					         <property name="sizeHint" >
 | 
				
			||||||
 | 
					          <size>
 | 
				
			||||||
 | 
					           <width>20</width>
 | 
				
			||||||
 | 
					           <height>10</height>
 | 
				
			||||||
 | 
					          </size>
 | 
				
			||||||
 | 
					         </property>
 | 
				
			||||||
 | 
					        </spacer>
 | 
				
			||||||
       </item>
 | 
					       </item>
 | 
				
			||||||
       <item>
 | 
					       <item>
 | 
				
			||||||
        <widget class="QToolButton" name="Button_Down" />
 | 
					        <widget class="QToolButton" name="Button_Up" >
 | 
				
			||||||
 | 
					         <property name="iconSize" >
 | 
				
			||||||
 | 
					          <size>
 | 
				
			||||||
 | 
					           <width>16</width>
 | 
				
			||||||
 | 
					           <height>16</height>
 | 
				
			||||||
 | 
					          </size>
 | 
				
			||||||
 | 
					         </property>
 | 
				
			||||||
 | 
					        </widget>
 | 
				
			||||||
 | 
					       </item>
 | 
				
			||||||
 | 
					       <item>
 | 
				
			||||||
 | 
					        <widget class="QToolButton" name="Button_Down" >
 | 
				
			||||||
 | 
					         <property name="iconSize" >
 | 
				
			||||||
 | 
					          <size>
 | 
				
			||||||
 | 
					           <width>16</width>
 | 
				
			||||||
 | 
					           <height>16</height>
 | 
				
			||||||
 | 
					          </size>
 | 
				
			||||||
 | 
					         </property>
 | 
				
			||||||
 | 
					        </widget>
 | 
				
			||||||
       </item>
 | 
					       </item>
 | 
				
			||||||
       <item>
 | 
					       <item>
 | 
				
			||||||
        <spacer>
 | 
					        <spacer>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -423,7 +423,7 @@ int i=1;
 | 
				
			||||||
		i++; }
 | 
							i++; }
 | 
				
			||||||
	for(i; i<argc;i++){
 | 
						for(i; i<argc;i++){
 | 
				
			||||||
		if(QString(argv[i])=="-help"){
 | 
							if(QString(argv[i])=="-help"){
 | 
				
			||||||
			cout << "KeePassX" << KEEPASS_VERSION << endl;
 | 
								cout << "KeePassX" << APP_VERSION << endl;
 | 
				
			||||||
			cout << "Usage: keepass [Filename] [Options]" << endl;
 | 
								cout << "Usage: keepass [Filename] [Options]" << endl;
 | 
				
			||||||
			cout << "  -help             This Help" << endl;
 | 
								cout << "  -help             This Help" << endl;
 | 
				
			||||||
			cout << "  -cfg <CONFIG>     Use specified file for loading/saving the configuration." << endl;
 | 
								cout << "  -cfg <CONFIG>     Use specified file for loading/saving the configuration." << endl;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										11
									
								
								src/main.h
								
								
								
								
							
							
						
						| 
						 | 
					@ -27,9 +27,14 @@
 | 
				
			||||||
#include <QIcon>
 | 
					#include <QIcon>
 | 
				
			||||||
#include <QFile>
 | 
					#include <QFile>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define APP_NAME "KeePassX"
 | 
					#define APP_DISPLAY_NAME    "KeePassX"
 | 
				
			||||||
#define APP_FUNC "Password Manager"
 | 
					#define APP_CODE_NAME       "keepassx"
 | 
				
			||||||
#define KEEPASS_VERSION "0.2.3"
 | 
					
 | 
				
			||||||
 | 
					#define APP_SHORT_FUNC      "Password Manager"
 | 
				
			||||||
 | 
					#define APP_LONG_FUNC       "Cross Platform Password Manager"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define APP_VERSION         "0.2.3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define BUILTIN_ICONS 65
 | 
					#define BUILTIN_ICONS 65
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef enum tKeyType {PASSWORD=0,KEYFILE=1,BOTH=2};
 | 
					typedef enum tKeyType {PASSWORD=0,KEYFILE=1,BOTH=2};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -240,9 +240,9 @@ void KeepassMainWindow::setupIcons(){
 | 
				
			||||||
	HelpHandbookAction->setIcon(getIcon("manual"));
 | 
						HelpHandbookAction->setIcon(getIcon("manual"));
 | 
				
			||||||
	HelpAboutAction->setIcon(getIcon("help"));
 | 
						HelpAboutAction->setIcon(getIcon("help"));
 | 
				
			||||||
	menuBookmarks->menuAction()->setIcon(getIcon("bookmark_folder"));
 | 
						menuBookmarks->menuAction()->setIcon(getIcon("bookmark_folder"));
 | 
				
			||||||
	AddThisAsBookmarkAction->setIcon(getIcon("bookmark"));
 | 
						AddThisAsBookmarkAction->setIcon(getIcon("bookmark_this"));
 | 
				
			||||||
	AddBookmarkAction->setIcon(getIcon("bookmark_add"));
 | 
						AddBookmarkAction->setIcon(getIcon("bookmark_add"));
 | 
				
			||||||
	ManageBookmarksAction->setIcon(getIcon("bookmark_edit"));
 | 
						ManageBookmarksAction->setIcon(getIcon("bookmark"));
 | 
				
			||||||
	SysTray->setIcon(getIcon("keepassx_large"));
 | 
						SysTray->setIcon(getIcon("keepassx_large"));
 | 
				
			||||||
	if(config->showSysTrayIcon())
 | 
						if(config->showSysTrayIcon())
 | 
				
			||||||
		SysTray->show();
 | 
							SysTray->show();
 | 
				
			||||||
| 
						 | 
					@ -294,12 +294,12 @@ void KeepassMainWindow::setupMenus(){
 | 
				
			||||||
		case 28: ViewToolButtonSize28Action->setChecked(true); break;
 | 
							case 28: ViewToolButtonSize28Action->setChecked(true); break;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	SysTrayMenu = new QMenu(tr("KeePassX"),this);
 | 
						SysTrayMenu = new QMenu(tr(APP_DISPLAY_NAME),this);
 | 
				
			||||||
    SysTrayMenu->addAction(FileUnLockWorkspaceAction);
 | 
					    SysTrayMenu->addAction(FileUnLockWorkspaceAction);
 | 
				
			||||||
    SysTrayMenu->addSeparator();
 | 
					    SysTrayMenu->addSeparator();
 | 
				
			||||||
	SysTrayMenu->addAction(FileExitAction);
 | 
						SysTrayMenu->addAction(FileExitAction);
 | 
				
			||||||
	SysTray->setContextMenu(SysTrayMenu);
 | 
						SysTray->setContextMenu(SysTrayMenu);
 | 
				
			||||||
    SysTray->setToolTip(tr("%1 %2").arg(APP_NAME, APP_FUNC) + " - " + tr((IsLocked) ? "Locked" : "Unlocked"));
 | 
					    SysTray->setToolTip(tr("%1 %2").arg(APP_DISPLAY_NAME, APP_SHORT_FUNC) + " - " + tr((IsLocked) ? "Locked" : "Unlocked"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	#define _add_import(name){\
 | 
						#define _add_import(name){\
 | 
				
			||||||
	QAction* import=new QAction(this);\
 | 
						QAction* import=new QAction(this);\
 | 
				
			||||||
| 
						 | 
					@ -323,7 +323,7 @@ void KeepassMainWindow::setupMenus(){
 | 
				
			||||||
	FileOpenAction->setShortcut(tr("Ctrl+O"));
 | 
						FileOpenAction->setShortcut(tr("Ctrl+O"));
 | 
				
			||||||
	FileSaveAction->setShortcut(tr("Ctrl+S"));
 | 
						FileSaveAction->setShortcut(tr("Ctrl+S"));
 | 
				
			||||||
    FileUnLockWorkspaceAction->setShortcut(tr("Ctrl+L"));
 | 
					    FileUnLockWorkspaceAction->setShortcut(tr("Ctrl+L"));
 | 
				
			||||||
    FileExitAction->setShortcut(tr("Ctrl+X"));
 | 
					    FileExitAction->setShortcut(tr("Ctrl+Q"));
 | 
				
			||||||
    EditNewGroupAction->setShortcut(tr("Ctrl+G"));
 | 
					    EditNewGroupAction->setShortcut(tr("Ctrl+G"));
 | 
				
			||||||
	EditPasswordToClipboardAction->setShortcut(tr("Ctrl+C"));
 | 
						EditPasswordToClipboardAction->setShortcut(tr("Ctrl+C"));
 | 
				
			||||||
	EditUsernameToClipboardAction->setShortcut(tr("Ctrl+B"));
 | 
						EditUsernameToClipboardAction->setShortcut(tr("Ctrl+B"));
 | 
				
			||||||
| 
						 | 
					@ -1011,7 +1011,7 @@ void KeepassMainWindow::OnUnLockWorkspace(){
 | 
				
			||||||
		setCentralWidget(NormalCentralWidget);
 | 
							setCentralWidget(NormalCentralWidget);
 | 
				
			||||||
		NormalCentralWidget->setVisible(true);
 | 
							NormalCentralWidget->setVisible(true);
 | 
				
			||||||
        SysTray->setIcon(getIcon("keepassx_large"));
 | 
					        SysTray->setIcon(getIcon("keepassx_large"));
 | 
				
			||||||
        SysTray->setToolTip(tr("%1 %2").arg(APP_NAME, APP_FUNC) + " - " + tr("Unlocked"));
 | 
					        SysTray->setToolTip(tr("%1 %2").arg(APP_DISPLAY_NAME, APP_SHORT_FUNC) + " - " + tr("Unlocked"));
 | 
				
			||||||
        FileUnLockWorkspaceAction->setText(tr("&Lock Workspace"));
 | 
					        FileUnLockWorkspaceAction->setText(tr("&Lock Workspace"));
 | 
				
			||||||
		IsLocked=false;
 | 
							IsLocked=false;
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
| 
						 | 
					@ -1020,7 +1020,7 @@ void KeepassMainWindow::OnUnLockWorkspace(){
 | 
				
			||||||
		setCentralWidget(LockedCentralWidget);
 | 
							setCentralWidget(LockedCentralWidget);
 | 
				
			||||||
		LockedCentralWidget->setVisible(true);
 | 
							LockedCentralWidget->setVisible(true);
 | 
				
			||||||
        SysTray->setIcon(getIcon("keepassx_locked"));
 | 
					        SysTray->setIcon(getIcon("keepassx_locked"));
 | 
				
			||||||
        SysTray->setToolTip(tr("%1 %2").arg(APP_NAME, APP_FUNC) + " - " + tr("Locked"));
 | 
					        SysTray->setToolTip(tr("%1 %2").arg(APP_DISPLAY_NAME, APP_SHORT_FUNC) + " - " + tr("Locked"));
 | 
				
			||||||
        FileUnLockWorkspaceAction->setText(tr("Un&lock Workspace"));
 | 
					        FileUnLockWorkspaceAction->setText(tr("Un&lock Workspace"));
 | 
				
			||||||
		IsLocked=true;
 | 
							IsLocked=true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||