lot of changes

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@140 b624d157-de02-0410-bad0-e51aec6abb33
master
myxelf 18 years ago
parent ebf0ff087b
commit 57416c61d2
  1. BIN
      share/keepass/icons/exit.png
  2. BIN
      share/keepass/icons/keepassx.png
  3. BIN
      share/keepass/icons/keepassx_locked.png
  4. BIN
      share/keepass/icons/lock.png
  5. BIN
      share/keepass/icons/pwd_hide.png
  6. BIN
      share/keepass/icons/pwd_show.png
  7. 88
      src/dialogs/EditEntryDlg.cpp
  8. 6
      src/dialogs/EditEntryDlg.h
  9. 2
      src/dialogs/ExpiredEntriesDlg.cpp
  10. 88
      src/forms/EditEntryDlg.ui
  11. 26
      src/forms/MainWindow.ui
  12. 2
      src/main.h
  13. 34
      src/mainwindow.cpp
  14. 5
      src/res/default-detailview-classic.html
  15. 67
      src/res/default-detailview.html

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 898 B

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

@ -55,6 +55,8 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
setupUi(this); setupUi(this);
ModFlag=false; ModFlag=false;
QMenu *ExpirePresetsMenu=new QMenu(); QMenu *ExpirePresetsMenu=new QMenu();
connect(Edit_Title, SIGNAL(textChanged(const QString&)), this, SLOT( OnTitleTextChanged(const QString&)));
connect(Edit_Password_w, SIGNAL(editingFinished()), this, SLOT(OnPasswordwLostFocus())); connect(Edit_Password_w, SIGNAL(editingFinished()), this, SLOT(OnPasswordwLostFocus()));
connect(Edit_Password_w, SIGNAL(textChanged(const QString&)), this, SLOT( OnPasswordwTextChanged(const QString&))); connect(Edit_Password_w, SIGNAL(textChanged(const QString&)), this, SLOT( OnPasswordwTextChanged(const QString&)));
connect(Edit_Password, SIGNAL(textChanged(const QString&)), this, SLOT( OnPasswordTextChanged(const QString&))); connect(Edit_Password, SIGNAL(textChanged(const QString&)), this, SLOT( OnPasswordTextChanged(const QString&)));
@ -66,7 +68,7 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
connect(ButtonGenPw, SIGNAL(clicked()), this, SLOT( OnButtonGenPw())); connect(ButtonGenPw, SIGNAL(clicked()), this, SLOT( OnButtonGenPw()));
connect(buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()),this,SLOT(OnButtonOK())); connect(buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()),this,SLOT(OnButtonOK()));
connect(CheckBox_ExpiresNever,SIGNAL(stateChanged(int)),this,SLOT(OnCheckBoxExpiresNeverChanged(int))); connect(CheckBox_ExpiresNever,SIGNAL(stateChanged(int)),this,SLOT(OnCheckBoxExpiresNeverChanged(int)));
connect(Button_CustomIcons,SIGNAL(clicked()),this,SLOT(OnCustomIcons())); connect(Button_Icons,SIGNAL(clicked()),this,SLOT(OnButtonIcons()));
connect(ExpirePresetsMenu,SIGNAL(triggered(QAction*)),this,SLOT(OnExpirePreset(QAction*))); connect(ExpirePresetsMenu,SIGNAL(triggered(QAction*)),this,SLOT(OnExpirePreset(QAction*)));
connect(ButtonExpirePresets,SIGNAL(triggered(QAction*)),this,SLOT(OnCalendar(QAction*))); connect(ButtonExpirePresets,SIGNAL(triggered(QAction*)),this,SLOT(OnCalendar(QAction*)));
@ -78,21 +80,23 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
ExpirePresetsMenu->addAction(tr("3 Weeks"))->setData(21); ExpirePresetsMenu->addAction(tr("3 Weeks"))->setData(21);
ExpirePresetsMenu->addSeparator(); ExpirePresetsMenu->addSeparator();
ExpirePresetsMenu->addAction(tr("1 Month"))->setData(30); ExpirePresetsMenu->addAction(tr("1 Month"))->setData(30);
ExpirePresetsMenu->addAction(tr("3 Months"))->setData(60); ExpirePresetsMenu->addAction(tr("3 Months"))->setData(90);
ExpirePresetsMenu->addAction(tr("6 Months"))->setData(180); ExpirePresetsMenu->addAction(tr("6 Months"))->setData(180);
ExpirePresetsMenu->addSeparator(); ExpirePresetsMenu->addSeparator();
ExpirePresetsMenu->addAction(tr("1 Year"))->setData(365); ExpirePresetsMenu->addAction(tr("1 Year"))->setData(365);
ButtonExpirePresets->setMenu(ExpirePresetsMenu); ButtonExpirePresets->setMenu(ExpirePresetsMenu);
ButtonExpirePresets->setDefaultAction(new QAction(tr("Calendar..."),ButtonExpirePresets)); ButtonExpirePresets->setDefaultAction(new QAction(tr("Calendar..."),ButtonExpirePresets));
IconIndex = entry->image();
Button_Icons->setIcon(db->icon(IconIndex));
ButtonOpenAttachment->setIcon(getIcon("fileopen")); ButtonOpenAttachment->setIcon(getIcon("fileopen"));
ButtonDeleteAttachment->setIcon(getIcon("filedelete")); ButtonDeleteAttachment->setIcon(getIcon("filedelete"));
ButtonSaveAttachment->setIcon(getIcon("filesave")); ButtonSaveAttachment->setIcon(getIcon("filesave"));
ButtonExpirePresets->setIcon(getIcon("clock")); ButtonExpirePresets->setIcon(getIcon("clock"));
OnTitleTextChanged(entry->title());
setWindowTitle(entry->title()); setWindowIcon(db->icon(IconIndex));
setWindowIcon(db->icon(entry->image()));
Edit_Title->setText(entry->title()); Edit_Title->setText(entry->title());
Edit_UserName->setText(entry->username()); Edit_UserName->setText(entry->username());
Edit_URL->setText(entry->url()); Edit_URL->setText(entry->url());
@ -103,6 +107,10 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
Password.lock(); Password.lock();
if(!config->showPasswords()) if(!config->showPasswords())
ChangeEchoMode(); ChangeEchoMode();
else
ButtonEchoMode->setIcon(getIcon("pwd_show"));
// MX-COMMENT: This call is not needed. Both Passwords fields will always have the same value
OnPasswordwLostFocus(); OnPasswordwLostFocus();
int bits=(Password.length()*8); int bits=(Password.length()*8);
Label_Bits->setText(tr("%1 Bit").arg(QString::number(bits))); Label_Bits->setText(tr("%1 Bit").arg(QString::number(bits)));
@ -112,7 +120,10 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
Edit_Attachment->setText(entry->binaryDesc()); Edit_Attachment->setText(entry->binaryDesc());
Edit_Comment->setPlainText(entry->comment()); Edit_Comment->setPlainText(entry->comment());
InitGroupComboBox(); InitGroupComboBox();
/* MX-TO-DO: After approval, remove this invokation
InitIconComboBox(); InitIconComboBox();
*/
if(!entry->binarySize()){ if(!entry->binarySize()){
ButtonSaveAttachment->setDisabled(true); ButtonSaveAttachment->setDisabled(true);
@ -154,7 +165,7 @@ if(event->spontaneous()==false){
} }
void CEditEntryDlg::resizeEvent(QResizeEvent *event){ void CEditEntryDlg::resizeEvent(QResizeEvent *event){
createBanner(&BannerPixmap,getPixmap("keepassx_large"),tr("Test 2"),width()); createBanner(&BannerPixmap,getPixmap("keepassx_large"),tr("Edit Entry"),width());
QDialog::resizeEvent(event); QDialog::resizeEvent(event);
} }
@ -167,19 +178,21 @@ void CEditEntryDlg::paintEvent(QPaintEvent *event){
painter.drawPixmap(QPoint(0,0),BannerPixmap); painter.drawPixmap(QPoint(0,0),BannerPixmap);
} }
/* MX-TO-DO: After approval, remove this implementation
void CEditEntryDlg::InitIconComboBox(){ void CEditEntryDlg::InitIconComboBox(){
for(int i=0;i<db->numIcons();i++){ for(int i=0;i<db->numIcons();i++){
Combo_IconPicker->insertItem(i,db->icon(i),""); Combo_IconPicker->insertItem(i,db->icon(i),"");
} }
Combo_IconPicker->setCurrentIndex(entry->image()); Combo_IconPicker->setCurrentIndex(entry->image());
} }
*/
void CEditEntryDlg::InitGroupComboBox(){ void CEditEntryDlg::InitGroupComboBox(){
QString Space; QString Space;
groups=db->sortedGroups(); groups=db->sortedGroups();
for(int i=0;i<groups.size();i++){ for(int i=0;i<groups.size();i++){
Space.fill(' ',2*groups[i]->level()); Space.fill(' ', 2 * (groups[i]->level() - 1));
Combo_Group->insertItem(i,db->icon(groups[i]->image()),Space+groups[i]->title()); Combo_Group->insertItem(i,db->icon(groups[i]->image()),Space+groups[i]->title());
if(groups[i]==entry->group()){ if(groups[i]==entry->group()){
Combo_Group->setCurrentIndex(i); Combo_Group->setCurrentIndex(i);
@ -217,7 +230,7 @@ void CEditEntryDlg::OnButtonOK()
ModFlag=true; ModFlag=true;
pw.lock(); pw.lock();
password.fill('X'); password.fill('X');
if(entry->image()!=Combo_IconPicker->currentIndex()) if(entry->image()!=IconIndex)
ModFlag=true; ModFlag=true;
if(ModFlag){ if(ModFlag){
@ -237,7 +250,8 @@ void CEditEntryDlg::OnButtonOK()
db->moveEntry(entry,groups[Combo_Group->currentIndex()]); db->moveEntry(entry,groups[Combo_Group->currentIndex()]);
EntryMoved=true; ModFlag=true; EntryMoved=true; ModFlag=true;
} }
entry->setImage(Combo_IconPicker->currentIndex()); // MX-COMMENT: Should not this line go inside the if(Modflag) block?
entry->setImage(IconIndex);
if(ModFlag&&EntryMoved)done(2); if(ModFlag&&EntryMoved)done(2);
else if(ModFlag)done(1); else if(ModFlag)done(1);
@ -256,16 +270,23 @@ void CEditEntryDlg::ChangeEchoMode()
if(Edit_Password->echoMode()==QLineEdit::Normal){ if(Edit_Password->echoMode()==QLineEdit::Normal){
Edit_Password->setEchoMode(QLineEdit::Password); Edit_Password->setEchoMode(QLineEdit::Password);
Edit_Password_w->setEchoMode(QLineEdit::Password); Edit_Password_w->setEchoMode(QLineEdit::Password);
ButtonEchoMode->setIcon(getIcon("pwd_hide"));
} }
else else
{ {
Edit_Password->setEchoMode(QLineEdit::Normal); Edit_Password->setEchoMode(QLineEdit::Normal);
Edit_Password_w->setEchoMode(QLineEdit::Normal); Edit_Password_w->setEchoMode(QLineEdit::Normal);
ButtonEchoMode->setIcon(getIcon("pwd_show"));
} }
} }
void CEditEntryDlg::OnTitleTextChanged(const QString& txt)
{
setWindowTitle((txt=="") ? tr("[Untitled Entry]") : txt);
}
void CEditEntryDlg::OnPasswordTextChanged(const QString& txt) void CEditEntryDlg::OnPasswordTextChanged(const QString& txt)
{ {
Edit_Password_w->setText(QString()); Edit_Password_w->setText(QString());
@ -323,13 +344,35 @@ void CEditEntryDlg::OnNewAttachment()
entry->setBinaryDesc(info.fileName()); entry->setBinaryDesc(info.fileName());
Edit_Attachment->setText(entry->binaryDesc()); Edit_Attachment->setText(entry->binaryDesc());
QString unit; QString unit;
int faktor; uint faktor;
int prec; int prec;
if(entry->binarySize()<1000){unit=" Byte";faktor=1;prec=0;} if (entry->binarySize() < 1024)
else {if(entry->binarySize()<1000000){unit=" kB";faktor=1000;prec=1;} {
else{unit=" MB";faktor=1000000;prec=1;} unit = "Bytes";
faktor = 1;
prec = 0;
} }
Label_AttachmentSize->setText(QString::number((float)entry->binarySize()/(float)faktor,'f',prec)+unit); else
{
if (entry->binarySize() < 1048576)
{
unit = "kB";
faktor = 1024;
}
else
if (entry->binarySize() < 1073741824)
{
unit = "MB";
faktor = 1048576;
}
else
{
unit = "GB";
faktor = 1073741824;
}
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);
@ -404,14 +447,15 @@ void CEditEntryDlg::OnCheckBoxExpiresNeverChanged(int state){
DateTime_Expire->setDisabled(true); DateTime_Expire->setDisabled(true);
} }
void CEditEntryDlg::OnCustomIcons(){ void CEditEntryDlg::OnButtonIcons(){
CSelectIconDlg dlg(db,Combo_IconPicker->currentIndex(),this); // CSelectIconDlg dlg(db,Combo_IconPicker->currentIndex(),this);
CSelectIconDlg dlg(db, IconIndex, this);
int r=dlg.exec(); int r=dlg.exec();
if(r!=-1){ if (r!=-1)
Combo_IconPicker->clear(); {
for(int i=0;i<db->numIcons();i++) IconIndex=r;
Combo_IconPicker->insertItem(i,db->icon(i),""); Button_Icons->setIcon(db->icon(IconIndex));
Combo_IconPicker->setCurrentIndex(r); setWindowIcon(db->icon(IconIndex));
} }
} }

@ -33,7 +33,9 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* parent = 0, bool modal = FALSE, Qt::WFlags fl = 0); CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* parent = 0, bool modal = FALSE, Qt::WFlags fl = 0);
~CEditEntryDlg(); ~CEditEntryDlg();
void InitGroupComboBox(); void InitGroupComboBox();
/* MX-TO-DO: Remove this declaration
void InitIconComboBox(); void InitIconComboBox();
*/
static void saveAttachment(IEntryHandle* pEntry, QWidget* ParentWidget=NULL); static void saveAttachment(IEntryHandle* pEntry, QWidget* ParentWidget=NULL);
IEntryHandle* entry; IEntryHandle* entry;
@ -44,6 +46,7 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
QPixmap BannerPixmap; QPixmap BannerPixmap;
public slots: public slots:
void OnTitleTextChanged(const QString&);
void OnPasswordwLostFocus(); void OnPasswordwLostFocus();
void OnPasswordwTextChanged(const QString&); void OnPasswordwTextChanged(const QString&);
void OnPasswordTextChanged(const QString&); void OnPasswordTextChanged(const QString&);
@ -54,7 +57,7 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
void OnSaveAttachment(); void OnSaveAttachment();
void OnButtonGenPw(); void OnButtonGenPw();
void OnCheckBoxExpiresNeverChanged(int state); void OnCheckBoxExpiresNeverChanged(int state);
void OnCustomIcons(); void OnButtonIcons();
void OnButtonOK(); void OnButtonOK();
void OnExpirePreset(QAction*); void OnExpirePreset(QAction*);
void OnCalendar(QAction*); void OnCalendar(QAction*);
@ -64,6 +67,7 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
virtual void paintEvent(QPaintEvent*); virtual void paintEvent(QPaintEvent*);
virtual void resizeEvent(QResizeEvent *); virtual void resizeEvent(QResizeEvent *);
int IconIndex;
}; };
#endif #endif

@ -51,7 +51,7 @@ void ExpiredEntriesDialog::paintEvent(QPaintEvent* event){
} }
void ExpiredEntriesDialog::resizeEvent(QResizeEvent* event){ void ExpiredEntriesDialog::resizeEvent(QResizeEvent* event){
createBanner(&BannerPixmap,getPixmap("alarmclock"),tr("Expried Entries of the Database"),width()); createBanner(&BannerPixmap,getPixmap("alarmclock"),tr("Expired Entries in the Database"),width());
QDialog::resizeEvent(event); QDialog::resizeEvent(event);
} }

@ -86,6 +86,12 @@
</item> </item>
<item row="0" column="1" > <item row="0" column="1" >
<widget class="QToolButton" name="ButtonEchoMode" > <widget class="QToolButton" name="ButtonEchoMode" >
<property name="iconSize" >
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy>
<hsizetype>1</hsizetype> <hsizetype>1</hsizetype>
@ -106,9 +112,6 @@
<height>23</height> <height>23</height>
</size> </size>
</property> </property>
<property name="text" >
<string>...</string>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="0" > <item row="0" column="0" >
@ -280,7 +283,11 @@
</widget> </widget>
</item> </item>
<item row="8" column="1" > <item row="8" column="1" >
<widget class="QTextEdit" name="Edit_Comment" /> <widget class="QTextEdit" name="Edit_Comment" >
<property name="tabChangesFocus" >
<bool>true</bool>
</property>
</widget>
</item> </item>
<item row="12" column="0" colspan="2" > <item row="12" column="0" colspan="2" >
<widget class="Line" name="line1" > <widget class="Line" name="line1" >
@ -326,6 +333,12 @@
<property name="icon" > <property name="icon" >
<iconset/> <iconset/>
</property> </property>
<property name="iconSize" >
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -336,6 +349,12 @@
<property name="icon" > <property name="icon" >
<iconset/> <iconset/>
</property> </property>
<property name="iconSize" >
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -346,6 +365,12 @@
<property name="icon" > <property name="icon" >
<iconset/> <iconset/>
</property> </property>
<property name="iconSize" >
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -364,7 +389,13 @@
<item> <item>
<widget class="QToolButton" name="ButtonExpirePresets" > <widget class="QToolButton" name="ButtonExpirePresets" >
<property name="text" > <property name="text" >
<string>...</string> <string/>
</property>
<property name="iconSize" >
<size>
<width>16</width>
<height>16</height>
</size>
</property> </property>
<property name="popupMode" > <property name="popupMode" >
<enum>QToolButton::MenuButtonPopup</enum> <enum>QToolButton::MenuButtonPopup</enum>
@ -434,7 +465,32 @@
<number>6</number> <number>6</number>
</property> </property>
<item> <item>
<widget class="QComboBox" name="Combo_Group" /> <widget class="QComboBox" name="Combo_Group" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>100</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
<item> <item>
<widget class="QLabel" name="textLabel1" > <widget class="QLabel" name="textLabel1" >
@ -447,12 +503,12 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="Combo_IconPicker" /> <widget class="QToolButton" name="Button_Icons" >
</item> <property name="iconSize" >
<item> <size>
<widget class="QToolButton" name="Button_CustomIcons" > <width>16</width>
<property name="text" > <height>16</height>
<string>></string> </size>
</property> </property>
</widget> </widget>
</item> </item>
@ -488,20 +544,24 @@
</widget> </widget>
<layoutdefault spacing="6" margin="11" /> <layoutdefault spacing="6" margin="11" />
<tabstops> <tabstops>
<tabstop>Combo_Group</tabstop>
<tabstop>Combo_IconPicker</tabstop>
<tabstop>Edit_Title</tabstop> <tabstop>Edit_Title</tabstop>
<tabstop>Edit_UserName</tabstop> <tabstop>Edit_UserName</tabstop>
<tabstop>Edit_URL</tabstop> <tabstop>Edit_URL</tabstop>
<tabstop>Edit_Password</tabstop> <tabstop>Edit_Password</tabstop>
<tabstop>Edit_Password_w</tabstop> <tabstop>Edit_Password_w</tabstop>
<tabstop>Edit_Comment</tabstop> <tabstop>Edit_Comment</tabstop>
<tabstop>DateTime_Expire</tabstop>
<tabstop>ButtonExpirePresets</tabstop>
<tabstop>CheckBox_ExpiresNever</tabstop>
<tabstop>Edit_Attachment</tabstop> <tabstop>Edit_Attachment</tabstop>
<tabstop>ButtonOpenAttachment</tabstop> <tabstop>ButtonOpenAttachment</tabstop>
<tabstop>ButtonSaveAttachment</tabstop> <tabstop>ButtonSaveAttachment</tabstop>
<tabstop>ButtonDeleteAttachment</tabstop> <tabstop>ButtonDeleteAttachment</tabstop>
<tabstop>ButtonEchoMode</tabstop> <tabstop>ButtonEchoMode</tabstop>
<tabstop>ButtonGenPw</tabstop> <tabstop>ButtonGenPw</tabstop>
<tabstop>buttonBox</tabstop>
<tabstop>Combo_Group</tabstop>
<tabstop>Button_Icons</tabstop>
</tabstops> </tabstops>
<resources/> <resources/>
<connections/> <connections/>

@ -168,8 +168,8 @@
<addaction name="EditEditGroupAction" /> <addaction name="EditEditGroupAction" />
<addaction name="EditDeleteGroupAction" /> <addaction name="EditDeleteGroupAction" />
<addaction name="separator" /> <addaction name="separator" />
<addaction name="EditPasswordToClipboardAction" />
<addaction name="EditUsernameToClipboardAction" /> <addaction name="EditUsernameToClipboardAction" />
<addaction name="EditPasswordToClipboardAction" />
<addaction name="EditOpenUrlAction" /> <addaction name="EditOpenUrlAction" />
<addaction name="EditSaveAttachmentAction" /> <addaction name="EditSaveAttachmentAction" />
<addaction name="separator" /> <addaction name="separator" />
@ -225,11 +225,11 @@
<property name="title" > <property name="title" >
<string>E&amp;xtras</string> <string>E&amp;xtras</string>
</property> </property>
<addaction name="ExtrasSettingsAction" />
<addaction name="ExtrasPasswordGenAction" /> <addaction name="ExtrasPasswordGenAction" />
<addaction name="separator" />
<addaction name="ExtrasShowExpiredEntriesAction" /> <addaction name="ExtrasShowExpiredEntriesAction" />
<addaction name="ExtrasTrashCanAction" /> <addaction name="ExtrasTrashCanAction" />
<addaction name="separator" />
<addaction name="ExtrasSettingsAction" />
</widget> </widget>
<addaction name="menuDatei" /> <addaction name="menuDatei" />
<addaction name="menuBearbeiten" /> <addaction name="menuBearbeiten" />
@ -267,6 +267,11 @@
<string>Change &amp;Master Key...</string> <string>Change &amp;Master Key...</string>
</property> </property>
</action> </action>
<action name="FileUnLockWorkspaceAction" >
<property name="text" >
<string>&amp;Lock Workspace</string>
</property>
</action>
<action name="FileExitAction" > <action name="FileExitAction" >
<property name="text" > <property name="text" >
<string>E&amp;xit</string> <string>E&amp;xit</string>
@ -329,12 +334,12 @@
</action> </action>
<action name="EditSearchAction" > <action name="EditSearchAction" >
<property name="text" > <property name="text" >
<string>Search In Database...</string> <string>Search in Database...</string>
</property> </property>
</action> </action>
<action name="EditGroupSearchAction" > <action name="EditGroupSearchAction" >
<property name="text" > <property name="text" >
<string>Search in this group...</string> <string>Search in this Group...</string>
</property> </property>
</action> </action>
<action name="ViewShowEntryDetailsAction" > <action name="ViewShowEntryDetailsAction" >
@ -533,23 +538,12 @@
<property name="text" > <property name="text" >
<string>Show Expired Entries...</string> <string>Show Expired Entries...</string>
</property> </property>
<property name="iconText" >
<string>Show Expired Entries...</string>
</property>
<property name="toolTip" >
<string>Show Expired Entries</string>
</property>
</action> </action>
<action name="ExtrasTrashCanAction" > <action name="ExtrasTrashCanAction" >
<property name="text" > <property name="text" >
<string>Recycle Bin...</string> <string>Recycle Bin...</string>
</property> </property>
</action> </action>
<action name="FileUnLockWorkspaceAction" >
<property name="text" >
<string>Lock Workspace</string>
</property>
</action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>

@ -27,6 +27,8 @@
#include <QIcon> #include <QIcon>
#include <QFile> #include <QFile>
#define APP_NAME "KeePassX"
#define APP_FUNC "Password Manager"
#define KEEPASS_VERSION "0.2.3" #define KEEPASS_VERSION "0.2.3"
#define BUILTIN_ICONS 62 #define BUILTIN_ICONS 62

@ -77,6 +77,7 @@ Export_KeePassX_Xml export_KeePassX_Xml;
KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,QWidget *parent, Qt::WFlags flags):QMainWindow(parent,flags){ KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,QWidget *parent, Qt::WFlags flags):QMainWindow(parent,flags){
Start=true; Start=true;
ShutingDown=false; ShutingDown=false;
IsLocked=false;
setupUi(this); setupUi(this);
#ifdef QT_WS_MAC #ifdef QT_WS_MAC
setUnifiedTitleAndToolBarOnMac(true); setUnifiedTitleAndToolBarOnMac(true);
@ -100,7 +101,6 @@ KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,QWidget *parent, Qt:
LockedCentralWidget=new QWidget(this); LockedCentralWidget=new QWidget(this);
WorkspaceLockedWidget.setupUi(LockedCentralWidget); WorkspaceLockedWidget.setupUi(LockedCentralWidget);
LockedCentralWidget->setVisible(false); LockedCentralWidget->setVisible(false);
IsLocked=false;
setupConnections(); setupConnections();
@ -211,8 +211,10 @@ void KeepassMainWindow::setupToolbar(){
toolBar->addAction(EditEditEntryAction); toolBar->addAction(EditEditEntryAction);
toolBar->addAction(EditDeleteEntryAction); toolBar->addAction(EditDeleteEntryAction);
toolBar->addSeparator(); toolBar->addSeparator();
toolBar->addAction(EditPasswordToClipboardAction);
toolBar->addAction(EditUsernameToClipboardAction); toolBar->addAction(EditUsernameToClipboardAction);
toolBar->addAction(EditPasswordToClipboardAction);
toolBar->addSeparator();
toolBar->addAction(FileUnLockWorkspaceAction);
toolBar->addSeparator(); toolBar->addSeparator();
QuickSearchEdit=new QLineEdit(toolBar); QuickSearchEdit=new QLineEdit(toolBar);
QuickSearchEdit->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); QuickSearchEdit->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
@ -227,12 +229,13 @@ void KeepassMainWindow::setupIcons(){
FileSaveAsAction->setIcon(getIcon("filesaveas")); FileSaveAsAction->setIcon(getIcon("filesaveas"));
FileCloseAction->setIcon(getIcon("fileclose")); FileCloseAction->setIcon(getIcon("fileclose"));
FileSettingsAction->setIcon(getIcon("dbsettings")); FileSettingsAction->setIcon(getIcon("dbsettings"));
FileUnLockWorkspaceAction->setIcon(getIcon("lock"));
FileExitAction->setIcon(getIcon("exit")); FileExitAction->setIcon(getIcon("exit"));
EditNewEntryAction->setIcon(getIcon("newentry")); EditNewEntryAction->setIcon(getIcon("newentry"));
EditEditEntryAction->setIcon(getIcon("editentry")); EditEditEntryAction->setIcon(getIcon("editentry"));
EditDeleteEntryAction->setIcon(getIcon("deleteentry")); EditDeleteEntryAction->setIcon(getIcon("deleteentry"));
EditPasswordToClipboardAction->setIcon(getIcon("copypwd"));
EditUsernameToClipboardAction->setIcon(getIcon("copyusername")); EditUsernameToClipboardAction->setIcon(getIcon("copyusername"));
EditPasswordToClipboardAction->setIcon(getIcon("copypwd"));
EditCloneEntryAction->setIcon(getIcon("cloneentry")); EditCloneEntryAction->setIcon(getIcon("cloneentry"));
EditOpenUrlAction->setIcon(getIcon("openurl")); EditOpenUrlAction->setIcon(getIcon("openurl"));
EditSaveAttachmentAction->setIcon(getIcon("filesave")); EditSaveAttachmentAction->setIcon(getIcon("filesave"));
@ -241,10 +244,10 @@ void KeepassMainWindow::setupIcons(){
EditDeleteGroupAction->setIcon(getIcon("deletegroup")); EditDeleteGroupAction->setIcon(getIcon("deletegroup"));
EditSearchAction->setIcon(getIcon("dbsearch")); EditSearchAction->setIcon(getIcon("dbsearch"));
EditGroupSearchAction->setIcon(getIcon("groupsearch")); EditGroupSearchAction->setIcon(getIcon("groupsearch"));
ExtrasSettingsAction->setIcon(getIcon("appsettings"));
ExtrasShowExpiredEntriesAction->setIcon(getIcon("expired")); ExtrasShowExpiredEntriesAction->setIcon(getIcon("expired"));
ExtrasPasswordGenAction->setIcon(getIcon("generator")); ExtrasPasswordGenAction->setIcon(getIcon("generator"));
ExtrasTrashCanAction->setIcon(getIcon("trashcan")); ExtrasTrashCanAction->setIcon(getIcon("trashcan"));
ExtrasSettingsAction->setIcon(getIcon("appsettings"));
EditAutoTypeAction->setIcon(getIcon("autotype")); EditAutoTypeAction->setIcon(getIcon("autotype"));
HelpHandbookAction->setIcon(getIcon("manual")); HelpHandbookAction->setIcon(getIcon("manual"));
HelpAboutAction->setIcon(getIcon("help")); HelpAboutAction->setIcon(getIcon("help"));
@ -263,8 +266,8 @@ void KeepassMainWindow::setupMenus(){
GroupView->ContextMenu->addAction(EditGroupSearchAction); GroupView->ContextMenu->addAction(EditGroupSearchAction);
GroupView->ContextMenuSearchGroup->addAction(HideSearchResultsAction); GroupView->ContextMenuSearchGroup->addAction(HideSearchResultsAction);
EntryView->ContextMenu->addAction(EditPasswordToClipboardAction);
EntryView->ContextMenu->addAction(EditUsernameToClipboardAction); EntryView->ContextMenu->addAction(EditUsernameToClipboardAction);
EntryView->ContextMenu->addAction(EditPasswordToClipboardAction);
EntryView->ContextMenu->addAction(EditOpenUrlAction); EntryView->ContextMenu->addAction(EditOpenUrlAction);
EntryView->ContextMenu->addAction(EditSaveAttachmentAction); EntryView->ContextMenu->addAction(EditSaveAttachmentAction);
EntryView->ContextMenu->addAction(EditAutoTypeAction); EntryView->ContextMenu->addAction(EditAutoTypeAction);
@ -300,8 +303,11 @@ void KeepassMainWindow::setupMenus(){
} }
SysTrayMenu = new QMenu(tr("KeePassX"),this); SysTrayMenu = new QMenu(tr("KeePassX"),this);
SysTrayMenu->addAction(FileUnLockWorkspaceAction);
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"));
#define _add_import(name){\ #define _add_import(name){\
QAction* import=new QAction(this);\ QAction* import=new QAction(this);\
@ -324,6 +330,8 @@ void KeepassMainWindow::setupMenus(){
//FileNewMenu->setShortcut(tr("Ctrl+N")); //FileNewMenu->setShortcut(tr("Ctrl+N"));
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"));
FileExitAction->setShortcut(tr("Ctrl+X"));
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"));
@ -580,7 +588,7 @@ void KeepassMainWindow::updateDetailView(){
if(entry->expire()!=Date_Never){ if(entry->expire()!=Date_Never){
int secs=QDateTime::currentDateTime().secsTo(entry->expire()); int secs=QDateTime::currentDateTime().secsTo(entry->expire());
if(secs < 0) if(secs < 0)
templ.replace("%expire-timeleft%",tr("expired")); templ.replace("%expire-timeleft%",tr("Expired"));
else{ else{
int years=0; int years=0;
int months=0; int months=0;
@ -618,7 +626,7 @@ void KeepassMainWindow::updateDetailView(){
if(!days && !years && !months) if(!days && !years && !months)
out=tr("less than 1 day"); out=tr("less than 1 day");
templ.replace("%expire-timeleft%",out); templ.replace("%expire-timeleft%","in " + out);
} }
} }
else else
@ -673,8 +681,8 @@ switch(EntrySelection){
else if(GroupSelection == SEARCHGROUP) else if(GroupSelection == SEARCHGROUP)
switch(EntrySelection){ switch(EntrySelection){
case NONE: case NONE:
EditPasswordToClipboardAction->setEnabled(false);
EditUsernameToClipboardAction->setEnabled(false); EditUsernameToClipboardAction->setEnabled(false);
EditPasswordToClipboardAction->setEnabled(false);
EditOpenUrlAction->setEnabled(false); EditOpenUrlAction->setEnabled(false);
EditSaveAttachmentAction->setEnabled(false); EditSaveAttachmentAction->setEnabled(false);
EditEditEntryAction->setEnabled(false); EditEditEntryAction->setEnabled(false);
@ -685,8 +693,8 @@ switch(EntrySelection){
EditAutoTypeAction->setEnabled(false); EditAutoTypeAction->setEnabled(false);
break; break;
case SINGLE: case SINGLE:
EditPasswordToClipboardAction->setEnabled(true);
EditUsernameToClipboardAction->setEnabled(true); EditUsernameToClipboardAction->setEnabled(true);
EditPasswordToClipboardAction->setEnabled(true);
EditOpenUrlAction->setEnabled(true); EditOpenUrlAction->setEnabled(true);
EditSaveAttachmentAction->setEnabled(true); EditSaveAttachmentAction->setEnabled(true);
EditEditEntryAction->setEnabled(true); EditEditEntryAction->setEnabled(true);
@ -697,8 +705,8 @@ switch(EntrySelection){
EditAutoTypeAction->setEnabled(true); EditAutoTypeAction->setEnabled(true);
break; break;
case MULTIPLE: case MULTIPLE:
EditPasswordToClipboardAction->setEnabled(false);
EditUsernameToClipboardAction->setEnabled(false); EditUsernameToClipboardAction->setEnabled(false);
EditPasswordToClipboardAction->setEnabled(false);
EditOpenUrlAction->setEnabled(false); EditOpenUrlAction->setEnabled(false);
EditSaveAttachmentAction->setEnabled(false); EditSaveAttachmentAction->setEnabled(false);
EditEditEntryAction->setEnabled(false); EditEditEntryAction->setEnabled(false);
@ -1005,12 +1013,18 @@ void KeepassMainWindow::OnUnLockWorkspace(){
LockedCentralWidget->setParent(NULL); LockedCentralWidget->setParent(NULL);
setCentralWidget(NormalCentralWidget); setCentralWidget(NormalCentralWidget);
NormalCentralWidget->setVisible(true); NormalCentralWidget->setVisible(true);
SysTray->setIcon(getIcon("keepassx_large"));
SysTray->setToolTip(tr("%1 %2").arg(APP_NAME, APP_FUNC) + " - " + tr("Unlocked"));
FileUnLockWorkspaceAction->setText(tr("&Lock Workspace"));
IsLocked=false; IsLocked=false;
} else { } else {
NormalCentralWidget->setVisible(false); NormalCentralWidget->setVisible(false);
NormalCentralWidget->setParent(NULL); NormalCentralWidget->setParent(NULL);
setCentralWidget(LockedCentralWidget); setCentralWidget(LockedCentralWidget);
LockedCentralWidget->setVisible(true); LockedCentralWidget->setVisible(true);
SysTray->setIcon(getIcon("keepassx_locked"));
SysTray->setToolTip(tr("%1 %2").arg(APP_NAME, APP_FUNC) + " - " + tr("Locked"));
FileUnLockWorkspaceAction->setText(tr("Un&lock Workspace"));
IsLocked=true; IsLocked=true;
} }
} }

@ -0,0 +1,5 @@
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Verdana'; font-size:9pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Group:</span> %group% <span style=" font-weight:600;">Title:</span> %title% <span style=" font-weight:600;">Username:</span> %username% <span style=" font-weight:600;">Password:</span> %password% <span style=" font-weight:600;">URL:</span> %url% <span style=" font-weight:600; color:#000000;">Creation:</span> %creation% <span style=" font-weight:600;">Last Access:</span> %lastaccess% <span style=" font-weight:600;">Last Modification:</span> %lastmod% <span style=" font-weight:600;">Expiration:</span> %expire% <span style=" font-weight:600;"><br>Comment:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%comment%</p></body></html>

@ -1,5 +1,62 @@
<html><head><meta name="qrichtext" content="1" /><style type="text/css"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
p, li { white-space: pre-wrap; } <html>
</style></head><body style=" font-family:'Verdana'; font-size:9pt; font-weight:400; font-style:normal;"> <head>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Group:</span> %group% <span style=" font-weight:600;">Title:</span> %title% <span style=" font-weight:600;">Username:</span> %username% <span style=" font-weight:600;">Password:</span> %password% <span style=" font-weight:600;">URL:</span> %url% <span style=" font-weight:600; color:#000000;">Creation:</span> %creation% <span style=" font-weight:600;">Last Access:</span> %lastaccess% <span style=" font-weight:600;">Last Modification:</span> %lastmod% <span style=" font-weight:600;">Expiration:</span> %expire% <span style=" font-weight:600;"><br>Comment:</span></p> <style type="text/css">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%comment%</p></body></html> .headertitle {
color : #ffffff;
font-family : Tahoma, Verdana, Arial;
font-size : 14px;
font-weight : bold;
}
.fieldname {
font-family : Tahoma, Verdana, Arial;
font-size : 10px;
font-weight : bold;
}
.fieldvalue {
font-family : Tahoma, Verdana, Arial;
font-size : 10px;
}
</style>
</head>
<body>
<table width="100%" align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td bgcolor="#808080" class="headertitle">%title%</td></tr>
</table>
<table width="100%" align="left" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="10%" class="fieldname">Group:</td>
<td width="40%" class="fieldvalue">%group%</td>
<td width="10%" class="fieldname">Creation:</td>
<td width="40%" class="fieldvalue">%creation%</td>
</tr>
<tr>
<td width="10%" class="fieldname">Username:</td>
<td width="40%" class="fieldvalue">%username%</td>
<td width="10%" class="fieldname">Access:</td>
<td width="40%" class="fieldvalue">%lastaccess%</td>
</tr>
<tr>
<td width="10%" class="fieldname">Password:</td>
<td width="40%" class="fieldvalue">%password%</td>
<td width="10%" class="fieldname">Modification:</td>
<td width="40%" class="fieldvalue">%creation%</td>
</tr>
<tr>
<td width="10%" class="fieldname">Attachment:</td>
<td width="40%" class="fieldvalue">%attachment%</td>
<td width="10%" class="fieldname">Expiration:</td>
<td width="40%" class="fieldvalue">%expire% [%expire-timeleft%]</td>
</tr>
<tr>
<td width="10%" class="fieldname">URL:</td>
<td width="90%" colspan="3" class="fieldvalue"><a href="%url%">%url%</a></td>
</tr>
<tr>
<td width="10%" class="fieldname">Comment:</td>
<td width="90%" colspan="3" class="fieldvalue">%comment%</td>
</tr>
</table>
</body>
</html>