Implement import of databases in CSV (Comma Separated Values) format (i.e. from other password managers)

This commit is contained in:
seatedscribe 2017-01-09 01:33:21 +01:00
parent 1e1428c73d
commit afdf02b4be
20 changed files with 2209 additions and 9 deletions

View file

@ -212,6 +212,23 @@ void DatabaseTabWidget::openDatabase(const QString& fileName, const QString& pw,
Q_EMIT messageDismissGlobal();
}
void DatabaseTabWidget::importCsv()
{
QString fileName = fileDialog()->getOpenFileName(this, tr("Open CSV file"), QString(),
tr("CSV file") + " (*.csv);;" + tr("All files (*)"));
if (fileName.isEmpty()) {
return;
}
Database* db = new Database();
DatabaseManagerStruct dbStruct;
dbStruct.dbWidget = new DatabaseWidget(db, this);
insertDatabase(db, dbStruct);
dbStruct.dbWidget->switchToImportCsv(fileName);
}
void DatabaseTabWidget::mergeDatabase()
{
QString filter = QString("%1 (*.kdbx);;%2 (*)").arg(tr("KeePass 2 Database"), tr("All files"));