lot of changes

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@140 b624d157-de02-0410-bad0-e51aec6abb33
master
myxelf 17 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. 94
      src/dialogs/EditEntryDlg.cpp
  8. 6
      src/dialogs/EditEntryDlg.h
  9. 10
      src/dialogs/ExpiredEntriesDlg.cpp
  10. 88
      src/forms/EditEntryDlg.ui
  11. 26
      src/forms/MainWindow.ui
  12. 2
      src/main.h
  13. 82
      src/mainwindow.cpp
  14. 2
      src/mainwindow.h
  15. 5
      src/res/default-detailview-classic.html
  16. 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);
ModFlag=false;
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(textChanged(const QString&)), this, SLOT( OnPasswordwTextChanged(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(buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()),this,SLOT(OnButtonOK()));
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(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->addSeparator();
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->addSeparator();
ExpirePresetsMenu->addAction(tr("1 Year"))->setData(365);
ButtonExpirePresets->setMenu(ExpirePresetsMenu);
ButtonExpirePresets->setDefaultAction(new QAction(tr("Calendar..."),ButtonExpirePresets));
IconIndex = entry->image();
Button_Icons->setIcon(db->icon(IconIndex));
ButtonOpenAttachment->setIcon(getIcon("fileopen"));
ButtonDeleteAttachment->setIcon(getIcon("filedelete"));
ButtonSaveAttachment->setIcon(getIcon("filesave"));
ButtonExpirePresets->setIcon(getIcon("clock"));
setWindowTitle(entry->title());
setWindowIcon(db->icon(entry->image()));
OnTitleTextChanged(entry->title());
setWindowIcon(db->icon(IconIndex));
Edit_Title->setText(entry->title());
Edit_UserName->setText(entry->username());
Edit_URL->setText(entry->url());
@ -103,7 +107,11 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
Password.lock();
if(!config->showPasswords())
ChangeEchoMode();
OnPasswordwLostFocus();
else
ButtonEchoMode->setIcon(getIcon("pwd_show"));
// MX-COMMENT: This call is not needed. Both Passwords fields will always have the same value
OnPasswordwLostFocus();
int bits=(Password.length()*8);
Label_Bits->setText(tr("%1 Bit").arg(QString::number(bits)));
if(bits>128)
@ -112,7 +120,10 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
Edit_Attachment->setText(entry->binaryDesc());
Edit_Comment->setPlainText(entry->comment());
InitGroupComboBox();
/* MX-TO-DO: After approval, remove this invokation
InitIconComboBox();
*/
if(!entry->binarySize()){
ButtonSaveAttachment->setDisabled(true);
@ -154,7 +165,7 @@ if(event->spontaneous()==false){
}
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);
}
@ -167,19 +178,21 @@ void CEditEntryDlg::paintEvent(QPaintEvent *event){
painter.drawPixmap(QPoint(0,0),BannerPixmap);
}
/* MX-TO-DO: After approval, remove this implementation
void CEditEntryDlg::InitIconComboBox(){
for(int i=0;i<db->numIcons();i++){
Combo_IconPicker->insertItem(i,db->icon(i),"");
}
Combo_IconPicker->setCurrentIndex(entry->image());
}
*/
void CEditEntryDlg::InitGroupComboBox(){
QString Space;
groups=db->sortedGroups();
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());
if(groups[i]==entry->group()){
Combo_Group->setCurrentIndex(i);
@ -217,7 +230,7 @@ void CEditEntryDlg::OnButtonOK()
ModFlag=true;
pw.lock();
password.fill('X');
if(entry->image()!=Combo_IconPicker->currentIndex())
if(entry->image()!=IconIndex)
ModFlag=true;
if(ModFlag){
@ -237,7 +250,8 @@ void CEditEntryDlg::OnButtonOK()
db->moveEntry(entry,groups[Combo_Group->currentIndex()]);
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);
else if(ModFlag)done(1);
@ -256,16 +270,23 @@ void CEditEntryDlg::ChangeEchoMode()
if(Edit_Password->echoMode()==QLineEdit::Normal){
Edit_Password->setEchoMode(QLineEdit::Password);
Edit_Password_w->setEchoMode(QLineEdit::Password);
ButtonEchoMode->setIcon(getIcon("pwd_hide"));
}
else
{
Edit_Password->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)
{
Edit_Password_w->setText(QString());
@ -279,7 +300,7 @@ void CEditEntryDlg::OnPasswordwTextChanged(const QString& w)
{
if(QString::compare(Edit_Password_w->text(),Edit_Password->text().mid(0,(Edit_Password_w->text().length())))!=0){
QPalette palette;
QPalette palette;
palette.setColor(Edit_Password_w->backgroundRole(),QColor(255,125,125));
Edit_Password_w->setPalette(palette);
}else
@ -323,13 +344,35 @@ void CEditEntryDlg::OnNewAttachment()
entry->setBinaryDesc(info.fileName());
Edit_Attachment->setText(entry->binaryDesc());
QString unit;
int faktor;
uint faktor;
int prec;
if(entry->binarySize()<1000){unit=" Byte";faktor=1;prec=0;}
else {if(entry->binarySize()<1000000){unit=" kB";faktor=1000;prec=1;}
else{unit=" MB";faktor=1000000;prec=1;}
}
Label_AttachmentSize->setText(QString::number((float)entry->binarySize()/(float)faktor,'f',prec)+unit);
if (entry->binarySize() < 1024)
{
unit = "Bytes";
faktor = 1;
prec = 0;
}
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);
ButtonSaveAttachment->setEnabled(true);
ButtonDeleteAttachment->setEnabled(true);
@ -404,14 +447,15 @@ void CEditEntryDlg::OnCheckBoxExpiresNeverChanged(int state){
DateTime_Expire->setDisabled(true);
}
void CEditEntryDlg::OnCustomIcons(){
CSelectIconDlg dlg(db,Combo_IconPicker->currentIndex(),this);
void CEditEntryDlg::OnButtonIcons(){
// CSelectIconDlg dlg(db,Combo_IconPicker->currentIndex(),this);
CSelectIconDlg dlg(db, IconIndex, this);
int r=dlg.exec();
if(r!=-1){
Combo_IconPicker->clear();
for(int i=0;i<db->numIcons();i++)
Combo_IconPicker->insertItem(i,db->icon(i),"");
Combo_IconPicker->setCurrentIndex(r);
if (r!=-1)
{
IconIndex=r;
Button_Icons->setIcon(db->icon(IconIndex));
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();
void InitGroupComboBox();
/* MX-TO-DO: Remove this declaration
void InitIconComboBox();
*/
static void saveAttachment(IEntryHandle* pEntry, QWidget* ParentWidget=NULL);
IEntryHandle* entry;
@ -44,6 +46,7 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
QPixmap BannerPixmap;
public slots:
void OnTitleTextChanged(const QString&);
void OnPasswordwLostFocus();
void OnPasswordwTextChanged(const QString&);
void OnPasswordTextChanged(const QString&);
@ -54,7 +57,7 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
void OnSaveAttachment();
void OnButtonGenPw();
void OnCheckBoxExpiresNeverChanged(int state);
void OnCustomIcons();
void OnButtonIcons();
void OnButtonOK();
void OnExpirePreset(QAction*);
void OnCalendar(QAction*);
@ -64,6 +67,7 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
virtual void paintEvent(QPaintEvent*);
virtual void resizeEvent(QResizeEvent *);
int IconIndex;
};
#endif

@ -17,7 +17,7 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <QTreeWidget>
#include <QPainter>
#include <QPaintEvent>
@ -37,7 +37,7 @@ ExpiredEntriesDialog::ExpiredEntriesDialog(QWidget* parent,IDatabase* database,c
item->setText(3,Entries[i]->expire().dateToString(Qt::LocalDate));
item->setIcon(0,database->icon(Entries[i]->group()->image()));
item->setIcon(1,database->icon(Entries[i]->image()));
}
connect(treeWidget,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(OnItemDoubleClicked(QTreeWidgetItem*,int)));
}
@ -51,12 +51,12 @@ void ExpiredEntriesDialog::paintEvent(QPaintEvent* event){
}
void ExpiredEntriesDialog::resizeEvent(QResizeEvent* event){
createBanner(&BannerPixmap,getPixmap("alarmclock"),tr("Expried Entries of the Database"),width());
QDialog::resizeEvent(event);
createBanner(&BannerPixmap,getPixmap("alarmclock"),tr("Expired Entries in the Database"),width());
QDialog::resizeEvent(event);
}
void ExpiredEntriesDialog::OnItemDoubleClicked(QTreeWidgetItem* item, int column){
SelectedEntry=Entries[item->data(0,Qt::UserRole).toInt()];
SelectedEntry=Entries[item->data(0,Qt::UserRole).toInt()];
accept();
}

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

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

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

@ -77,7 +77,8 @@ Export_KeePassX_Xml export_KeePassX_Xml;
KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,QWidget *parent, Qt::WFlags flags):QMainWindow(parent,flags){
Start=true;
ShutingDown=false;
setupUi(this);
IsLocked=false;
setupUi(this);
#ifdef QT_WS_MAC
setUnifiedTitleAndToolBarOnMac(true);
#endif
@ -95,13 +96,12 @@ KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,QWidget *parent, Qt:
statusBar()->addWidget(StatusBarGeneral,15);
statusBar()->addWidget(StatusBarSelection,85);
statusBar()->setVisible(config->showStatusbar());
NormalCentralWidget=QMainWindow::centralWidget();
LockedCentralWidget=new QWidget(this);
WorkspaceLockedWidget.setupUi(LockedCentralWidget);
LockedCentralWidget->setVisible(false);
IsLocked=false;
setupConnections();
FileOpen=false;
@ -160,26 +160,26 @@ void KeepassMainWindow::setupConnections(){
connect(EditSearchAction, SIGNAL(triggered()), this, SLOT(OnSearch()));
connect(EditGroupSearchAction, SIGNAL(triggered()), this, SLOT(OnGroupSearch()));
connect(EditAutoTypeAction,SIGNAL(triggered()),EntryView,SLOT(OnAutoType()));
connect(ViewShowToolbarAction,SIGNAL(toggled(bool)),this,SLOT(OnViewShowToolbar(bool)));
connect(ViewShowEntryDetailsAction,SIGNAL(toggled(bool)),this,SLOT(OnViewShowEntryDetails(bool)));
connect(ViewHidePasswordsAction,SIGNAL(toggled(bool)), this, SLOT(OnUsernPasswVisibilityChanged(bool)));
connect(ViewHideUsernamesAction,SIGNAL(toggled(bool)), this, SLOT(OnUsernPasswVisibilityChanged(bool)));
connect(menuColumns,SIGNAL(triggered(QAction*)),this,SLOT(OnColumnVisibilityChanged(QAction*)));
connect(ViewToolButtonSize16Action,SIGNAL(toggled(bool)), this, SLOT(OnViewToolbarIconSize16(bool)));
connect(ViewToolButtonSize22Action,SIGNAL(toggled(bool)), this, SLOT(OnViewToolbarIconSize22(bool)));
connect(ViewToolButtonSize28Action,SIGNAL(toggled(bool)), this, SLOT(OnViewToolbarIconSize28(bool)));
connect(ViewShowStatusbarAction,SIGNAL(toggled(bool)),statusBar(),SLOT(setVisible(bool)));
connect(ExtrasSettingsAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasSettings()));
connect(ExtrasPasswordGenAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasPasswordGen()));
connect(ExtrasShowExpiredEntriesAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasShowExpiredEntries()));
connect(ExtrasTrashCanAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasTrashCan()));
connect(HelpHandbookAction,SIGNAL(triggered()),this,SLOT(OnHelpHandbook()));
connect(HelpAboutAction,SIGNAL(triggered()),this,SLOT(OnHelpAbout()));
connect(EntryView,SIGNAL(itemActivated(QTreeWidgetItem*,int)),EntryView,SLOT(OnEntryActivated(QTreeWidgetItem*,int)));
connect(QuickSearchEdit,SIGNAL(returnPressed()), this, SLOT(OnQuickSearch()));
connect(GroupView,SIGNAL(groupChanged(IGroupHandle*)),EntryView,SLOT(OnGroupChanged(IGroupHandle*)));
@ -211,10 +211,12 @@ void KeepassMainWindow::setupToolbar(){
toolBar->addAction(EditEditEntryAction);
toolBar->addAction(EditDeleteEntryAction);
toolBar->addSeparator();
toolBar->addAction(EditPasswordToClipboardAction);
toolBar->addAction(EditUsernameToClipboardAction);
toolBar->addSeparator();
QuickSearchEdit=new QLineEdit(toolBar);
toolBar->addAction(EditPasswordToClipboardAction);
toolBar->addSeparator();
toolBar->addAction(FileUnLockWorkspaceAction);
toolBar->addSeparator();
QuickSearchEdit=new QLineEdit(toolBar);
QuickSearchEdit->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
toolBar->addWidget(QuickSearchEdit);
}
@ -227,13 +229,14 @@ void KeepassMainWindow::setupIcons(){
FileSaveAsAction->setIcon(getIcon("filesaveas"));
FileCloseAction->setIcon(getIcon("fileclose"));
FileSettingsAction->setIcon(getIcon("dbsettings"));
FileUnLockWorkspaceAction->setIcon(getIcon("lock"));
FileExitAction->setIcon(getIcon("exit"));
EditNewEntryAction->setIcon(getIcon("newentry"));
EditEditEntryAction->setIcon(getIcon("editentry"));
EditDeleteEntryAction->setIcon(getIcon("deleteentry"));
EditPasswordToClipboardAction->setIcon(getIcon("copypwd"));
EditUsernameToClipboardAction->setIcon(getIcon("copyusername"));
EditCloneEntryAction->setIcon(getIcon("cloneentry"));
EditPasswordToClipboardAction->setIcon(getIcon("copypwd"));
EditCloneEntryAction->setIcon(getIcon("cloneentry"));
EditOpenUrlAction->setIcon(getIcon("openurl"));
EditSaveAttachmentAction->setIcon(getIcon("filesave"));
EditNewGroupAction->setIcon(getIcon("newgroup"));
@ -241,11 +244,11 @@ void KeepassMainWindow::setupIcons(){
EditDeleteGroupAction->setIcon(getIcon("deletegroup"));
EditSearchAction->setIcon(getIcon("dbsearch"));
EditGroupSearchAction->setIcon(getIcon("groupsearch"));
ExtrasSettingsAction->setIcon(getIcon("appsettings"));
ExtrasShowExpiredEntriesAction->setIcon(getIcon("expired"));
ExtrasPasswordGenAction->setIcon(getIcon("generator"));
ExtrasTrashCanAction->setIcon(getIcon("trashcan"));
EditAutoTypeAction->setIcon(getIcon("autotype"));
ExtrasSettingsAction->setIcon(getIcon("appsettings"));
EditAutoTypeAction->setIcon(getIcon("autotype"));
HelpHandbookAction->setIcon(getIcon("manual"));
HelpAboutAction->setIcon(getIcon("help"));
SysTray->setIcon(getIcon("keepassx_large"));
@ -263,9 +266,9 @@ void KeepassMainWindow::setupMenus(){
GroupView->ContextMenu->addAction(EditGroupSearchAction);
GroupView->ContextMenuSearchGroup->addAction(HideSearchResultsAction);
EntryView->ContextMenu->addAction(EditPasswordToClipboardAction);
EntryView->ContextMenu->addAction(EditUsernameToClipboardAction);
EntryView->ContextMenu->addAction(EditOpenUrlAction);
EntryView->ContextMenu->addAction(EditPasswordToClipboardAction);
EntryView->ContextMenu->addAction(EditOpenUrlAction);
EntryView->ContextMenu->addAction(EditSaveAttachmentAction);
EntryView->ContextMenu->addAction(EditAutoTypeAction);
EntryView->ContextMenu->addSeparator();
@ -300,8 +303,11 @@ void KeepassMainWindow::setupMenus(){
}
SysTrayMenu = new QMenu(tr("KeePassX"),this);
SysTrayMenu->addAction(FileUnLockWorkspaceAction);
SysTrayMenu->addSeparator();
SysTrayMenu->addAction(FileExitAction);
SysTray->setContextMenu(SysTrayMenu);
SysTray->setToolTip(tr("%1 %2").arg(APP_NAME, APP_FUNC) + " - " + tr((IsLocked) ? "Locked" : "Unlocked"));
#define _add_import(name){\
QAction* import=new QAction(this);\
@ -324,7 +330,9 @@ void KeepassMainWindow::setupMenus(){
//FileNewMenu->setShortcut(tr("Ctrl+N"));
FileOpenAction->setShortcut(tr("Ctrl+O"));
FileSaveAction->setShortcut(tr("Ctrl+S"));
EditNewGroupAction->setShortcut(tr("Ctrl+G"));
FileUnLockWorkspaceAction->setShortcut(tr("Ctrl+L"));
FileExitAction->setShortcut(tr("Ctrl+X"));
EditNewGroupAction->setShortcut(tr("Ctrl+G"));
EditPasswordToClipboardAction->setShortcut(tr("Ctrl+C"));
EditUsernameToClipboardAction->setShortcut(tr("Ctrl+B"));
EditOpenUrlAction->setShortcut(tr("Ctrl+U"));
@ -339,7 +347,7 @@ void KeepassMainWindow::setupMenus(){
FileSaveAsAction->setShortcut(tr("Shift+Ctrl+S"));
EditGroupSearchAction->setShortcut(tr("Shift+Ctrl+F"));
#endif
ExtrasTrashCanAction->setVisible(false); //For KP 2.x only
}
@ -580,7 +588,7 @@ void KeepassMainWindow::updateDetailView(){
if(entry->expire()!=Date_Never){
int secs=QDateTime::currentDateTime().secsTo(entry->expire());
if(secs < 0)
templ.replace("%expire-timeleft%",tr("expired"));
templ.replace("%expire-timeleft%",tr("Expired"));
else{
int years=0;
int months=0;
@ -618,7 +626,7 @@ void KeepassMainWindow::updateDetailView(){
if(!days && !years && !months)
out=tr("less than 1 day");
templ.replace("%expire-timeleft%",out);
templ.replace("%expire-timeleft%","in " + out);
}
}
else
@ -673,8 +681,8 @@ switch(EntrySelection){
else if(GroupSelection == SEARCHGROUP)
switch(EntrySelection){
case NONE:
EditPasswordToClipboardAction->setEnabled(false);
EditUsernameToClipboardAction->setEnabled(false);
EditPasswordToClipboardAction->setEnabled(false);
EditOpenUrlAction->setEnabled(false);
EditSaveAttachmentAction->setEnabled(false);
EditEditEntryAction->setEnabled(false);
@ -685,8 +693,8 @@ switch(EntrySelection){
EditAutoTypeAction->setEnabled(false);
break;
case SINGLE:
EditPasswordToClipboardAction->setEnabled(true);
EditUsernameToClipboardAction->setEnabled(true);
EditPasswordToClipboardAction->setEnabled(true);
EditOpenUrlAction->setEnabled(true);
EditSaveAttachmentAction->setEnabled(true);
EditEditEntryAction->setEnabled(true);
@ -697,8 +705,8 @@ switch(EntrySelection){
EditAutoTypeAction->setEnabled(true);
break;
case MULTIPLE:
EditPasswordToClipboardAction->setEnabled(false);
EditUsernameToClipboardAction->setEnabled(false);
EditPasswordToClipboardAction->setEnabled(false);
EditOpenUrlAction->setEnabled(false);
EditSaveAttachmentAction->setEnabled(false);
EditEditEntryAction->setEnabled(false);
@ -834,7 +842,7 @@ void KeepassMainWindow::OnColumnVisibilityChanged(QAction* action){
EntryView->Columns[6]=ViewColumnsCreationAction->isChecked();
EntryView->Columns[7]=ViewColumnsLastChangeAction->isChecked();
EntryView->Columns[8]=ViewColumnsLastAccessAction->isChecked();
EntryView->Columns[9]=ViewColumnsAttachmentAction->isChecked();
EntryView->Columns[9]=ViewColumnsAttachmentAction->isChecked();
EntryView->Columns[10]=ViewColumnsGroupAction->isChecked();
EntryView->updateColumns();
if(FileOpen) EntryView->refreshItems();
@ -891,8 +899,8 @@ dlg.exec();
void KeepassMainWindow::OnHelpHandbook(){
HelpBrowser->openAssistant();
}
void KeepassMainWindow::OnViewShowToolbar(bool show){
@ -990,27 +998,33 @@ void KeepassMainWindow::OnExtrasShowExpiredEntries(){
void KeepassMainWindow::OnExtrasTrashCan(){
TrashCanDialog dlg(this,db,db->expiredEntries());
if(dlg.exec()==QDialog::Accepted){
}
}
void KeepassMainWindow::OnDetailViewUrlClicked(const QUrl& url){
openBrowser(url.toString());
openBrowser(url.toString());
}
void KeepassMainWindow::OnUnLockWorkspace(){
if(IsLocked){
LockedCentralWidget->setVisible(false);
LockedCentralWidget->setVisible(false);
LockedCentralWidget->setParent(NULL);
setCentralWidget(NormalCentralWidget);
NormalCentralWidget->setVisible(true);
IsLocked=false;
SysTray->setIcon(getIcon("keepassx_large"));
SysTray->setToolTip(tr("%1 %2").arg(APP_NAME, APP_FUNC) + " - " + tr("Unlocked"));
FileUnLockWorkspaceAction->setText(tr("&Lock Workspace"));
IsLocked=false;
} else {
NormalCentralWidget->setVisible(false);
NormalCentralWidget->setVisible(false);
NormalCentralWidget->setParent(NULL);
setCentralWidget(LockedCentralWidget);
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;
}
}

@ -55,7 +55,7 @@ class KeepassMainWindow : public QMainWindow, public Ui_MainWindow{
public:
KeepassMainWindow (const QString& ArgFile,QWidget *parent=0, Qt::WFlags flags=0);
IDatabase* db;
bool Start;
bool Start;
signals:
void entryChanged();

@ -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">
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>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<style type="text/css">
.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>