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
This commit is contained in:
tariq
2006-04-10 10:21:56 +00:00
parent ca29e4a7bb
commit e281b7c514
3 changed files with 31 additions and 5 deletions

View File

@@ -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);