Drag&Drop for Entries, some other UI work

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@53 b624d157-de02-0410-bad0-e51aec6abb33
master
tariq 18 years ago
parent 60d342201d
commit 853747bce1
  1. BIN
      share/keepass/icons/nuvola/32x32/actions/help.png
  2. 6
      src/PwManager.cpp
  3. 1
      src/PwManager.h
  4. 4
      src/PwmConfig.cpp
  5. 2
      src/PwmConfig.h
  6. 5
      src/crypto/twofish.cpp
  7. 2
      src/dialogs/AboutDlg.cpp
  8. 8
      src/dialogs/EditEntryDlg.cpp
  9. 21
      src/dialogs/PasswordDlg.cpp
  10. 12
      src/dialogs/PasswordDlg.h
  11. 2
      src/dialogs/SettingsDlg.cpp
  12. 8
      src/dialogs/SimplePasswordDlg.cpp
  13. 2
      src/dialogs/SimplePasswordDlg.h
  14. 4
      src/forms/AboutDlg.ui
  15. 86
      src/forms/MainWindow.ui
  16. 7
      src/forms/PasswordDlg.ui
  17. 859
      src/forms/SettingsDlg.ui
  18. 80
      src/lib/EntryView.cpp
  19. 9
      src/lib/EntryView.h
  20. 124
      src/lib/GroupView.cpp
  21. 2
      src/lib/GroupView.h
  22. 85
      src/main.cpp
  23. 2
      src/main.h
  24. 115
      src/mainwindow.cpp
  25. 5
      src/mainwindow.h
  26. 6
      src/src.pro
  27. 413
      src/translations/keepass-de_DE.ts
  28. 1489
      src/translations/keepass-ru_RU.ts
  29. 348
      src/translations/keepass-xx_XX.ts

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

@ -1,6 +1,6 @@
/***************************************************************************
* Copyright (C) 2005 by Tarek Saidi *
* tarek@linux *
* Copyright (C) 2005-2006 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@ -148,7 +148,7 @@ sha256_finish(&sha32,(unsigned char *)FinalKey);
if(memcmp(ContentsHash, FinalKey, 32) != 0)
{
err=tr("Hash test failed.\nThe key is wrong or the file is damaged");
err=tr("Hash test failed.\nThe key is wrong or the file is damaged.");
return false;}

@ -75,7 +75,6 @@ public:
QString getErrors(); //get all errors in a \n seperated String
private:
bool IsMetaStream(CEntry& Entry);
bool parseMetaStream(const CEntry& Entry);

@ -52,6 +52,8 @@ MainWinWidth=ini.GetValueI("UI","MainWinWidth",900);
MainWinSplit1=ini.GetValueI("UI","MainWinSplit1",100);
MainWinSplit2=ini.GetValueI("UI","MainWinSplit2",300);
ParseIntString(ini.GetValue("UI","ColumnSizes","15,10,10,10,10,10,10,10,10,10").c_str(),ColumnSizes,10);
ShowStatusbar=ini.GetValueB("UI","ShowStatusbar",true);
AlternatingRowColors=ini.GetValueB("Options","AlternatingRowColors",true);
return true;
}
@ -81,6 +83,8 @@ ini.SetValueI("UI","MainWinWidth",MainWinWidth);
ini.SetValueI("UI","MainWinSplit1",MainWinSplit1);
ini.SetValueI("UI","MainWinSplit2",MainWinSplit2);
ini.SetValue("UI","ColumnSizes",(const char*)CreateIntString(ColumnSizes,10),true);
ini.SetValueB("UI","ShowStatusbar",ShowStatusbar);
ini.SetValueB("Options","AlternatingRowColors",AlternatingRowColors);
if(!ini.WriteFile())return false;
else return true;
}

@ -51,6 +51,8 @@ public:
int MainWinSplit1;
int MainWinSplit2;
int ColumnSizes[10];
bool ShowStatusbar;
bool AlternatingRowColors;
bool loadFromIni(QString filename);
bool saveToIni(QString filename);

@ -474,9 +474,10 @@
#endif
#include <qmessagebox.h>
void Twofish_fatal(char* msg){
QMessageBox::critical(0,"Interner Fehler",msg,"OK","Cancel",0,2,1);
qCritical("Twofish: Fatal Error");
exit(1);
}

@ -55,7 +55,7 @@ return;
}
if(!gpl.open(QIODevice::ReadOnly)){
QMessageBox::critical(this,tr("Fehler"),tr("Could not open file '%1'")
QMessageBox::critical(this,tr("Error"),tr("Could not open file '%1'")
.arg("'license.txt'")+tr("The following error occured:\n%1").arg(gpl.errorString())
,tr("OK"),0,0,2,1);
return;

@ -1,6 +1,6 @@
/***************************************************************************
* Copyright (C) 2005 by Tarek Saidi *
* tarek@linux *
* Copyright (C) 2005-2006 by Tarek Saidi *
* tarek.saidi@arcor.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@ -51,7 +51,7 @@ Q_ASSERT(_entry);
entry=_entry;
db=_db;
setupUi(this);
createBanner(Banner,Icon_Key32x32,tr("Eintrag bearbeiten"));
createBanner(Banner,Icon_Key32x32,tr("Edit Entry"));
ModFlag=false;
connect(Edit_Password_w, SIGNAL(editingFinished()), this, SLOT(OnPasswordwLostFocus()));
connect(Edit_Password_w, SIGNAL(textChanged(const QString&)), this, SLOT( OnPasswordwTextChanged(const QString&)));
@ -257,7 +257,7 @@ if(filename=="")return;
QFile file(filename);
if(file.open(QIODevice::ReadOnly)==false){
file.close();
QMessageBox::warning(NULL,tr("Fehler"),tr("Datei konnte nicht geöffnet werden."),"OK");
QMessageBox::warning(NULL,tr("Error"),tr("Could not open file."),tr("OK"));
return;
}
ModFlag=true;

@ -33,12 +33,13 @@
CPasswordDialog::CPasswordDialog(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
CPasswordDialog::CPasswordDialog(QWidget* parent, const char* name, bool modal, bool ShowExitButton, Qt::WFlags fl)
: QDialog(parent,name, modal,fl)
{
setupUi(this);
createBanner(Banner,Icon_Key32x32,tr("Datenbank öffnen"));
Label_select=new LinkLabel((QWidget*)groupframe,"Select",tr("Datei manuell wählen..."),410,100);
ButtonExit->setVisible(ShowExitButton);
createBanner(Banner,Icon_Key32x32,tr("Open Database"));
Label_select=new LinkLabel((QWidget*)groupframe,"Select",tr("Select File Manually..."),410,100);
connect( Combo_Dirs, SIGNAL( activated(int) ), this, SLOT( OnComboSelectionChanged(int) ) );
connect( ButtonBrowse, SIGNAL( clicked() ), this, SLOT( OnButtonBrowse() ) );
connect( ButtonOK, SIGNAL( clicked() ), this, SLOT( OnOK() ) );
@ -47,7 +48,7 @@ connect( Edit_Password, SIGNAL( textChanged(const QString&) ), this, SLOT( OnPas
connect( CheckBox_Both, SIGNAL( stateChanged(int) ), this, SLOT( OnCheckBox_BothChanged(int) ) );
connect( ButtonChangeEchoMode, SIGNAL( clicked() ), this, SLOT( ChangeEchoMode() ) );
connect( Edit_Password, SIGNAL( returnPressed() ), this, SLOT( OnOK() ) );
connect( ButtonExit, SIGNAL( clicked()),this,SLOT(OnButtonExit()));
QDir media("/media");
if(media.exists()){
@ -58,7 +59,7 @@ Paths.erase(Paths.begin()); // delete ".."
for(int i=0;i<Paths.count();i++){
Paths[i]="/media/"+Paths[i];
}
Paths.prepend(tr("< keiner >"));
Paths.prepend(tr("< none >"));
}
for(int i=0;i<Paths.count();i++){
Combo_Dirs->insertItem(0,Paths[i]);
@ -208,11 +209,7 @@ Edit_Password->setEchoMode(QLineEdit::Normal);
}
/*$SPECIALIZATION$*/
//#include "passworddialog.moc"
void CPasswordDialog::OnButtonExit(){
done(2);
}

@ -44,26 +44,20 @@ QString password;
public:
CPasswordDialog(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
CPasswordDialog(QWidget* parent = 0, const char* name = 0, bool modal = false,
bool ShowExitButton = false, Qt::WFlags fl = 0 );
~CPasswordDialog();
/*$PUBLIC_FUNCTIONS$*/
public slots:
/*$PUBLIC_SLOTS$*/
virtual void OnOK();
virtual void OnCancel();
virtual void OnSelectClicked();
virtual void OnButtonBrowse();
virtual void OnButtonExit();
virtual void OnComboSelectionChanged(int);
virtual void OnPasswordChanged(const QString &txt);
virtual void OnCheckBox_BothChanged(int state);
virtual void ChangeEchoMode();
protected:
/*$PROTECTED_FUNCTIONS$*/
protected slots:
/*$PROTECTED_SLOTS$*/
};

@ -61,6 +61,7 @@ textcolor=config.BannerTextColor;
CheckBox_ShowPasswords->setChecked(config.ShowPasswords);
Edit_BrowserCmd->setText(config.OpenUrlCommand);
CheckBox_ExpandGroupTree->setChecked(config.ExpandGroupTree);
CheckBox_AlternatingRowColors->setChecked(config.AlternatingRowColors);
}
@ -78,6 +79,7 @@ config.BannerTextColor=textcolor;
config.ShowPasswords=CheckBox_ShowPasswords->isChecked();
config.OpenUrlCommand=Edit_BrowserCmd->text();
config.ExpandGroupTree=CheckBox_ExpandGroupTree->isChecked();
config.AlternatingRowColors=CheckBox_AlternatingRowColors->isChecked();
close();
}

@ -18,16 +18,16 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "SimplePasswordDlg.h"
#include <qlineedit.h>
#include <qpushbutton.h>
#include "main.h"
#include "SimplePasswordDlg.h"
CSimplePasswordDialog::CSimplePasswordDialog(bool HidePw,QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
CSimplePasswordDialog::CSimplePasswordDialog(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
: QDialog(parent,name, modal,fl)
{
setupUi(this);
if(HidePw)Button_HidePassword->toggle();
if(!config.ShowPasswords)Button_HidePassword->toggle();
}
CSimplePasswordDialog::~CSimplePasswordDialog()

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

@ -131,13 +131,13 @@
</rect>
</property>
<property name="html" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Mattias Miller&lt;/span> (www.outofhanwell.com)&lt;/p>&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Mac OS X Support&lt;/p>&lt;/body>&lt;/html></string>
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</widget>
<widget class="QWidget" name="tab_4" >
<attribute name="title" >
<string>Übersetzung</string>
<string>Translation</string>
</attribute>
<widget class="QTextEdit" name="Edit_Translation" >
<property name="geometry" >

@ -114,31 +114,6 @@
<height>29</height>
</rect>
</property>
<widget class="QMenu" name="menuDatei" >
<property name="title" >
<string>File</string>
</property>
<widget class="QMenu" name="menuImportieren_aus" >
<property name="title" >
<string>Import from...</string>
</property>
<addaction name="FileImpPwmAction" />
<addaction name="FileImpKWalletXmlAction" />
</widget>
<addaction name="FileNewAction" />
<addaction name="FileOpenAction" />
<addaction name="FileCloseAction" />
<addaction name="separator" />
<addaction name="FileSaveAction" />
<addaction name="FileSaveAsAction" />
<addaction name="separator" />
<addaction name="FileSettingsAction" />
<addaction name="FileChangeKeyAction" />
<addaction name="separator" />
<addaction name="menuImportieren_aus" />
<addaction name="separator" />
<addaction name="FileExitAction" />
</widget>
<widget class="QMenu" name="menuBearbeiten" >
<property name="title" >
<string>Edit</string>
@ -182,12 +157,45 @@
</widget>
<addaction name="ViewShowToolbarAction" />
<addaction name="ViewShowEntryDetailsAction" />
<addaction name="ViewShowStatusbarAction" />
<addaction name="separator" />
<addaction name="ViewHideUsernamesAction" />
<addaction name="ViewHidePasswordsAction" />
<addaction name="separator" />
<addaction name="menuSpalten" />
</widget>
<widget class="QMenu" name="menuDatei" >
<property name="title" >
<string>File</string>
</property>
<widget class="QMenu" name="menuImportieren_aus" >
<property name="title" >
<string>Import from...</string>
</property>
<addaction name="FileImpPwmAction" />
<addaction name="FileImpKWalletXmlAction" />
</widget>
<widget class="QMenu" name="menuExport_to" >
<property name="title" >
<string>Export to...</string>
</property>
<addaction name="FileExpPlainTextAction" />
</widget>
<addaction name="FileNewAction" />
<addaction name="FileOpenAction" />
<addaction name="FileCloseAction" />
<addaction name="separator" />
<addaction name="FileSaveAction" />
<addaction name="FileSaveAsAction" />
<addaction name="separator" />
<addaction name="FileSettingsAction" />
<addaction name="FileChangeKeyAction" />
<addaction name="separator" />
<addaction name="menuImportieren_aus" />
<addaction name="menuExport_to" />
<addaction name="separator" />
<addaction name="FileExitAction" />
</widget>
<widget class="QMenu" name="menuExtras" >
<property name="title" >
<string>Extras</string>
@ -198,6 +206,8 @@
<property name="title" >
<string>Help</string>
</property>
<addaction name="HelpHandbookAction" />
<addaction name="separator" />
<addaction name="HelpAboutAction" />
</widget>
<addaction name="menuDatei" />
@ -477,20 +487,38 @@
<string>About...</string>
</property>
</action>
<action name="ViewShowStatusbarAction" >
<property name="checkable" >
<bool>true</bool>
</property>
<property name="text" >
<string>Show Statusbar</string>
</property>
</action>
<action name="HelpHandbookAction" >
<property name="text" >
<string>KeePassX Handbook...</string>
</property>
</action>
<action name="FileExpPlainTextAction" >
<property name="text" >
<string>Plain Text (*.txt)</string>
</property>
</action>
</widget>
<pixmapfunction></pixmapfunction>
<customwidgets>
<customwidget>
<class>KeepassEntryView</class>
<class>KeepassGroupView</class>
<extends>QTreeWidget</extends>
<header>../../src/lib/EntryView.h</header>
<header>../../src/lib/GroupView.h</header>
<container>0</container>
<pixmap></pixmap>
</customwidget>
<customwidget>
<class>KeepassGroupView</class>
<class>KeepassEntryView</class>
<extends>QTreeWidget</extends>
<header>../../src/lib/GroupView.h</header>
<header>../../src/lib/EntryView.h</header>
<container>0</container>
<pixmap></pixmap>
</customwidget>

@ -105,6 +105,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonExit" >
<property name="text" >
<string>Exit</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="textLabel1" >

@ -1,384 +1,523 @@
<ui version="4.0" >
<author/>
<comment/>
<exportmacro/>
<class>SettingsDialog</class>
<widget class="QDialog" name="SettingsDialog" >
<property name="geometry" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>SettingsDialog</class>
<widget class="QDialog" name="SettingsDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>571</width>
<height>341</height>
</rect>
</property>
<property name="minimumSize" >
<size>
<width>571</width>
<height>341</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>571</width>
<height>341</height>
</size>
</property>
<property name="windowTitle" >
<string>Settings</string>
</property>
<widget class="QPushButton" name="ButtonCancel" >
<property name="geometry" >
<rect>
<x>470</x>
<y>310</y>
<width>90</width>
<height>23</height>
</rect>
</property>
<property name="text" >
<string>&amp;Cancel</string>
</property>
<property name="shortcut" >
<string>Alt+C</string>
</property>
</widget>
<widget class="QLabel" name="Banner" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>570</width>
<height>50</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="ButtonOK" >
<property name="geometry" >
<rect>
<x>380</x>
<y>310</y>
<width>80</width>
<height>23</height>
</rect>
</property>
<property name="text" >
<string>O&amp;K</string>
</property>
<property name="shortcut" >
<string>Alt+K</string>
</property>
</widget>
<widget class="QTabWidget" name="tabWidget4" >
<property name="geometry" >
<rect>
<x>10</x>
<y>60</y>
<width>550</width>
<height>241</height>
</rect>
</property>
<widget class="QWidget" name="tab" >
<attribute name="title" >
<string>Securi&amp;try</string>
</attribute>
<widget class="QWidget" name="widget" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>571</width>
<height>341</height>
<x>10</x>
<y>20</y>
<width>531</width>
<height>25</height>
</rect>
</property>
<property name="minimumSize" >
<size>
<width>571</width>
<height>341</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>571</width>
<height>341</height>
</size>
</property>
<property name="windowTitle" >
<string>Settings</string>
</property>
<widget class="QLabel" name="Banner" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>570</width>
<height>50</height>
</rect>
</property>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="textLabel1" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Clear clipboard after:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="SpinBox_ClipboardTime" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="maximum" >
<number>50000</number>
</property>
<property name="value" >
<number>2</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="textLabel2" >
<property name="text" >
<string>Seconds</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QCheckBox" name="CheckBox_ShowPasswords" >
<property name="geometry" >
<rect>
<x>10</x>
<y>50</y>
<width>531</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>Sh&amp;ow passwords in plain text by default</string>
</property>
<property name="shortcut" >
<string>Alt+O</string>
</property>
</widget>
<widget class="QTabWidget" name="tabWidget4" >
</widget>
<widget class="QWidget" name="TabPage" >
<attribute name="title" >
<string>Appea&amp;rance</string>
</attribute>
<widget class="Q3GroupBox" name="groupBox1" >
<property name="geometry" >
<rect>
<x>20</x>
<y>10</y>
<width>520</width>
<height>90</height>
</rect>
</property>
<property name="title" >
<string>Banner Color</string>
</property>
<widget class="QWidget" name="widget" >
<property name="geometry" >
<rect>
<x>10</x>
<y>60</y>
<width>550</width>
<height>241</height>
</rect>
<rect>
<x>11</x>
<y>20</y>
<width>501</width>
<height>62</height>
</rect>
</property>
<widget class="QWidget" name="tab" >
<attribute name="title" >
<string>Securi&amp;try</string>
</attribute>
<widget class="QLabel" name="textLabel1" >
<property name="geometry" >
<rect>
<x>10</x>
<y>20</y>
<width>231</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>Clear clipboard after:</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="0" >
<widget class="QLabel" name="textLabel2_2" >
<property name="text" >
<string>Text Color:</string>
</property>
</widget>
<widget class="QSpinBox" name="SpinBox_ClipboardTime" >
<property name="geometry" >
<rect>
<x>250</x>
<y>20</y>
<width>80</width>
<height>20</height>
</rect>
</property>
</item>
<item row="0" column="3" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2" >
<widget class="QPushButton" name="ButtonTextColor" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Change...</string>
</property>
<property name="shortcut" >
<string/>
</property>
</widget>
<widget class="QLabel" name="textLabel2" >
<property name="geometry" >
<rect>
<x>340</x>
<y>20</y>
<width>100</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>Seconds</string>
</property>
</item>
<item row="0" column="4" >
<widget class="QLabel" name="textLabel3" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Color 2:</string>
</property>
</widget>
<widget class="QCheckBox" name="CheckBox_ShowPasswords" >
<property name="geometry" >
<rect>
<x>10</x>
<y>50</y>
<width>420</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>Sh&amp;ow passwords in plain text by default</string>
</property>
<property name="shortcut" >
<string>Alt+O</string>
</property>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="pixmColor1" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>23</width>
<height>23</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>23</width>
<height>23</height>
</size>
</property>
<property name="text" >
<string/>
</property>
</widget>
</widget>
<widget class="QWidget" name="TabPage" >
<attribute name="title" >
<string>Appea&amp;rance</string>
</attribute>
<widget class="Q3GroupBox" name="groupBox1" >
<property name="geometry" >
<rect>
<x>10</x>
<y>10</y>
<width>520</width>
<height>90</height>
</rect>
</property>
<property name="title" >
<string>Banner Color</string>
</property>
<widget class="QLabel" name="textLabel1_3" >
<property name="geometry" >
<rect>
<x>10</x>
<y>20</y>
<width>53</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>Color 1</string>
</property>
</widget>
<widget class="QLabel" name="pixmColor1" >
<property name="geometry" >
<rect>
<x>70</x>
<y>20</y>
<width>22</width>
<height>22</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="ButtonColor1" >
<property name="geometry" >
<rect>
<x>100</x>
<y>20</y>
<width>60</width>
<height>23</height>
</rect>
</property>
<property name="text" >
<string>C&amp;hange...</string>
</property>
<property name="shortcut" >
<string>Alt+H</string>
</property>
</widget>
<widget class="QLabel" name="textLabel3" >
<property name="geometry" >
<rect>
<x>190</x>
<y>20</y>
<width>60</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>Color 2</string>
</property>
</widget>
<widget class="QLabel" name="pixmTextColor" >
<property name="geometry" >
<rect>
<x>70</x>
<y>50</y>
<width>22</width>
<height>22</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="ButtonTextColor" >
<property name="geometry" >
<rect>
<x>100</x>
<y>50</y>
<width>60</width>
<height>23</height>
</rect>
</property>
<property name="text" >
<string>Change...</string>
</property>
<property name="shortcut" >
<string/>
</property>
</widget>
<widget class="QLabel" name="textLabel2_2" >
<property name="geometry" >
<rect>
<x>10</x>
<y>50</y>
<width>54</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>Text Color</string>
</property>
</widget>
<widget class="QLabel" name="pixmColor2" >
<property name="geometry" >
<rect>
<x>250</x>
<y>20</y>
<width>22</width>
<height>22</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="ButtonColor2" >
<property name="geometry" >
<rect>
<x>280</x>
<y>20</y>
<width>60</width>
<height>23</height>
</rect>
</property>
<property name="text" >
<string>Change...</string>
</property>
<property name="shortcut" >
<string/>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLabel" name="pixmTextColor" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>23</width>
<height>23</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>23</width>
<height>23</height>
</size>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
<widget class="QCheckBox" name="CheckBox_ExpandGroupTree" >
<property name="geometry" >
<rect>
<x>10</x>
<y>110</y>
<width>380</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>Expand group tree when opening a database</string>
</property>
<property name="shortcut" >
<string>Alt+Ö</string>
</property>
</item>
<item row="0" column="6" >
<widget class="QPushButton" name="ButtonColor2" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Change...</string>
</property>
<property name="shortcut" >
<string/>
</property>
</widget>
</widget>
<widget class="QWidget" name="tab" >
<attribute name="title" >
<string>&amp;Other</string>
</attribute>
<widget class="QCheckBox" name="CheckBox_OpenLast" >
<property name="geometry" >
<rect>
<x>10</x>
<y>20</y>
<width>380</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>Remember last opend file</string>
</property>
<property name="shortcut" >
<string>Alt+Ö</string>
</property>
</item>
<item row="0" column="5" >
<widget class="QLabel" name="pixmColor2" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>23</width>
<height>23</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>23</width>
<height>23</height>
</size>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="textLabel1_4" >
<property name="geometry" >
<rect>
<x>10</x>
<y>50</y>
<width>110</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>Browser Command:</string>
</property>
</item>
<item row="0" column="2" >
<widget class="QPushButton" name="ButtonColor1" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>C&amp;hange...</string>
</property>
<property name="shortcut" >
<string>Alt+H</string>
</property>
</widget>
<widget class="QLineEdit" name="Edit_BrowserCmd" >
<property name="geometry" >
<rect>
<x>120</x>
<y>50</y>
<width>190</width>
<height>21</height>
</rect>
</property>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="textLabel1_3" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Color 1:</string>
</property>
</widget>
</widget>
</item>
<item row="0" column="7" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<widget class="QPushButton" name="ButtonOK" >
<property name="geometry" >
<rect>
<x>380</x>
<y>310</y>
<width>80</width>
<height>23</height>
</rect>
</property>
<property name="text" >
<string>O&amp;K</string>
</property>
<property name="shortcut" >
<string>Alt+K</string>
</property>
<widget class="QCheckBox" name="CheckBox_ExpandGroupTree" >
<property name="geometry" >
<rect>
<x>10</x>
<y>110</y>
<width>521</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>Expand group tree when opening a database</string>
</property>
<property name="shortcut" >
<string>Alt+Ö</string>
</property>
</widget>
<widget class="QPushButton" name="ButtonCancel" >
<property name="geometry" >
<rect>
<x>470</x>
<y>310</y>
<width>90</width>
<height>23</height>
</rect>
</property>
<property name="text" >
<string>&amp;Cancel</string>
<widget class="QCheckBox" name="CheckBox_AlternatingRowColors" >
<property name="geometry" >
<rect>
<x>10</x>
<y>130</y>
<width>531</width>
<height>22</height>
</rect>
</property>
<property name="text" >
<string>Alternating Row Colors</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="tab" >
<attribute name="title" >
<string>&amp;Other</string>
</attribute>
<widget class="QCheckBox" name="CheckBox_OpenLast" >
<property name="geometry" >
<rect>
<x>10</x>
<y>20</y>
<width>380</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>Remember last opend file</string>
</property>
<property name="shortcut" >
<string>Alt+Ö</string>
</property>
</widget>
<widget class="QWidget" name="widget" >
<property name="geometry" >
<rect>
<x>10</x>
<y>50</y>
<width>531</width>
<height>25</height>
</rect>
</property>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="shortcut" >
<string>Alt+C</string>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="textLabel1_4" >
<property name="text" >
<string>Browser Command:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="Edit_BrowserCmd" />
</item>
</layout>
</widget>
</widget>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction/>
<customwidgets>
<customwidget>
<class>Q3GroupBox</class>
<extends/>
<header>Qt3Support/Q3GroupBox</header>
<container>1</container>
<pixmap/>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>tabWidget4</tabstop>
<tabstop>SpinBox_ClipboardTime</tabstop>
<tabstop>CheckBox_ShowPasswords</tabstop>
<tabstop>ButtonColor1</tabstop>
<tabstop>ButtonTextColor</tabstop>
<tabstop>ButtonColor2</tabstop>
<tabstop>CheckBox_OpenLast</tabstop>
<tabstop>Edit_BrowserCmd</tabstop>
<tabstop>ButtonOK</tabstop>
<tabstop>ButtonCancel</tabstop>
</tabstops>
<resources/>
<connections/>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<customwidgets>
<customwidget>
<class>Q3GroupBox</class>
<extends></extends>
<header>Qt3Support/Q3GroupBox</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>tabWidget4</tabstop>
<tabstop>SpinBox_ClipboardTime</tabstop>
<tabstop>CheckBox_ShowPasswords</tabstop>
<tabstop>ButtonColor1</tabstop>
<tabstop>ButtonTextColor</tabstop>
<tabstop>ButtonColor2</tabstop>
<tabstop>CheckBox_OpenLast</tabstop>
<tabstop>Edit_BrowserCmd</tabstop>
<tabstop>ButtonOK</tabstop>
<tabstop>ButtonCancel</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

@ -26,6 +26,8 @@
#include <QMouseEvent>
#include <QHeaderView>
#include <QTime>
#include <QApplication>
#include <QPainter>
#include "main.h"
#include "EntryView.h"
@ -45,7 +47,7 @@ header()->setResizeMode(QHeaderView::Interactive);
header()->setStretchLastSection(false);
connect(header(),SIGNAL(sectionResized(int,int,int)),this,SLOT(OnColumnResized(int,int,int)));
ContextMenu=new QMenu(this);
setAlternatingRowColors(config.AlternatingRowColors);
}
KeepassEntryView::~KeepassEntryView(){
@ -136,13 +138,13 @@ void KeepassEntryView::setEntry(CEntry* entry){
if(config.Columns[4]){
tmp->setText(j++,entry->Additional.section('\n',0,0));}
if(config.Columns[5]){
tmp->setText(j++,entry->Expire.toString(DateTimeFormat));}
tmp->setText(j++,entry->Expire.date().toString(Qt::LocalDate));}
if(config.Columns[6]){
tmp->setText(j++,entry->Creation.toString(DateTimeFormat));}
tmp->setText(j++,entry->Creation.date().toString(Qt::LocalDate));}
if(config.Columns[7]){
tmp->setText(j++,entry->LastMod.toString(DateTimeFormat));}
tmp->setText(j++,entry->LastMod.date().toString(Qt::LocalDate));}
if(config.Columns[8]){
tmp->setText(j++,entry->LastAccess.toString(DateTimeFormat));}
tmp->setText(j++,entry->LastAccess.date().toString(Qt::LocalDate));}
if(config.Columns[9]){
tmp->setText(j++,entry->BinaryDesc);}
Items.back()->setIcon(0,EntryIcons[entry->ImageID]);
@ -174,13 +176,13 @@ for(int i=0;i<Items.size();i++){
if(config.Columns[4]){
tmp->setText(j++,entry->Additional.section('\n',0,0));}
if(config.Columns[5]){
tmp->setText(j++,entry->Expire.toString(DateTimeFormat));}
tmp->setText(j++,entry->Expire.date().toString(Qt::LocalDate));}
if(config.Columns[6]){
tmp->setText(j++,entry->Creation.toString(DateTimeFormat));}
tmp->setText(j++,entry->Creation.date().toString(Qt::LocalDate));}
if(config.Columns[7]){
tmp->setText(j++,entry->LastMod.toString(DateTimeFormat));}
tmp->setText(j++,entry->LastMod.date().toString(Qt::LocalDate));}
if(config.Columns[8]){
tmp->setText(j++,entry->LastAccess.toString(DateTimeFormat));}
tmp->setText(j++,entry->LastAccess.date().toString(Qt::LocalDate));}
if(config.Columns[9]){
tmp->setText(j++,entry->BinaryDesc);}
tmp->setIcon(0,EntryIcons[entry->ImageID]);
@ -285,6 +287,66 @@ if(((ColumnSizes[j]-div)*w > 2)){
resizeColumns();
}
void KeepassEntryView::mousePressEvent(QMouseEvent *event){
//save event position - maybe this is the start of a drag
if (event->button() == Qt::LeftButton)
DragStartPos = event->pos();
//call base function
QTreeWidget::mousePressEvent(event);
}
void KeepassEntryView::mouseMoveEvent(QMouseEvent *event){
if (!(event->buttons() & Qt::LeftButton))
return;
if ((event->pos() - DragStartPos).manhattanLength() < QApplication::startDragDistance())
return;
DragItems.clear();
EntryViewItem* DragStartItem=(EntryViewItem*)itemAt(DragStartPos);
if(!DragStartItem){
while(selectedItems().size()){
setItemSelected(selectedItems()[0],false);}
return;
}
if(selectedItems().size()==0){
setItemSelected(DragStartItem,true);}
else{
bool AlreadySelected=false;
for(int i=0;i<selectedItems().size();i++){
if(selectedItems()[i]==DragStartItem){AlreadySelected=true; break;}
}
if(!AlreadySelected){
while(selectedItems().size()){
setItemSelected(selectedItems()[0],false);
}
setItemSelected(DragStartItem,true);
}
}
DragItems=selectedItems();
QDrag *drag = new QDrag(this);
QFontMetrics fontmet(DragStartItem->font(0));
int DragPixmHeight=16;
if(fontmet.height()>16)DragPixmHeight=fontmet.height();
QString DragText;
if(DragItems.size()>1)DragText=QString(tr("%1 items")).arg(DragItems.size());
else DragText=((EntryViewItem*)DragItems[0])->pEntry->Title;
DragPixmap = QPixmap(fontmet.width(DragText)+19,DragPixmHeight);
DragPixmap.fill(QColor(255,255,255));
QPainter painter(&DragPixmap);
painter.setPen(QColor(0,0,