work on Auto-Type feature,

the save attachment file dialog now adopts the entry.BinaryDesc string as default filename

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@74 b624d157-de02-0410-bad0-e51aec6abb33
master
tariq 19 years ago
parent ca29e4a7bb
commit e281b7c514
  1. 4
      changelog
  2. 11
      src/dialogs/EditEntryDlg.cpp
  3. 21
      src/lib/AutoType.cpp

@ -1,7 +1,9 @@
---------------
0.2.1
---------------
-Auto-Type
-Custom Icons Extension
-when saving an attachment the original filename is adopted by the file dialog
---------------
0.2.0
---------------

@ -32,7 +32,7 @@
#include <qcombobox.h>
#include <qpainter.h>
#include <qpen.h>
#include <q3filedialog.h>
#include <QFileDialog>
#include <qmessagebox.h>
#include <qtoolbutton.h>
//Added by qt3to4:
@ -260,7 +260,7 @@ Edit_Password_w->setPaletteBackgroundColor(QColor(255,255,255)); ///@FIXME Stand
void CEditEntryDlg::OnNewAttachment()
{
QString filename=Q3FileDialog::getOpenFileName(QDir::homeDirPath(),"",this,QString::fromUtf8("Anhang hinzufügen..."));
QString filename=QFileDialog::getOpenFileName(this,tr("Add Attachment..."),QDir::homeDirPath());
if(filename=="")return;
QFile file(filename);
if(file.open(QIODevice::ReadOnly)==false){
@ -294,8 +294,11 @@ saveAttachment(entry,this);
void CEditEntryDlg::saveAttachment(CEntry* pEntry, QWidget* ParentWidget)
{
QString filename=Q3FileDialog::getSaveFileName(QDir::homeDirPath(),"",ParentWidget,tr("Save Attachment..."));
if(filename=="")return;
QFileDialog FileDlg(ParentWidget,tr("Save Attachment..."),QDir::homeDirPath());
FileDlg.selectFile(pEntry->BinaryDesc);
FileDlg.setAcceptMode(QFileDialog::AcceptSave);
if(!FileDlg.exec())return;
QString filename=FileDlg.selectedFiles()[0];
QFile file(filename);
if(file.exists()){
int r=QMessageBox::warning(ParentWidget,tr("Overwrite?"),tr("A file with this name already exists.\nDo you want to replace it?"),tr("Yes"),tr("No"),NULL,1,1);

@ -79,6 +79,27 @@ if(c==1){
else
str="{USERNAME}{TAB}{PASSWORD}{ENTER}";
/*
KeePass/Win template compatibility:
only supported syntax is:{TEMPLATE-NAME}
%TEMPLATE-NAME% syntax is not supported!
*/
str.replace("{TITLE}",entry->Title,Qt::CaseInsensitive);
str.replace("{USERNAME}",entry->UserName,Qt::CaseInsensitive);
entry->Password.unlock();
str.replace("{PASSWORD}",entry->Password.string(),Qt::CaseInsensitive);
entry->Password.lock();
str.replace("{URL}",entry->URL,Qt::CaseInsensitive);
str.replace("{SPACE}",QString(" "),Qt::CaseInsensitive);
str.replace("{ADD}",QString("+"),Qt::CaseInsensitive);
str.replace("{SUBTRACT}",QString("-"),Qt::CaseInsensitive);
str.replace("{DIVIDE}",QString("/"),Qt::CaseInsensitive);
str.replace("{MULTIPLY}",QString("*"),Qt::CaseInsensitive);
str.replace("{PLUS}",QString("+"),Qt::CaseInsensitive);
QList<Q_UINT16> Keys;
for(int i=0;i<str.length();i++){
Keys << getKeysym(str.at(i));