Add a button for CSV import option

This commit is contained in:
seatedscribe 2017-03-19 22:04:03 +01:00
parent 99036ec151
commit 9307834ef0
5 changed files with 23 additions and 6 deletions

View File

@ -301,6 +301,7 @@ MainWindow::MainWindow()
connect(m_ui->welcomeWidget, SIGNAL(openDatabase()), SLOT(switchToOpenDatabase()));
connect(m_ui->welcomeWidget, SIGNAL(openDatabaseFile(QString)), SLOT(switchToDatabaseFile(QString)));
connect(m_ui->welcomeWidget, SIGNAL(importKeePass1Database()), SLOT(switchToKeePass1Database()));
connect(m_ui->welcomeWidget, SIGNAL(importCsv()), SLOT(switchToCsvImport()));
connect(m_ui->actionAbout, SIGNAL(triggered()), SLOT(showAboutDialog()));
@ -605,6 +606,12 @@ void MainWindow::switchToKeePass1Database()
switchToDatabases();
}
void MainWindow::switchToCsvImport()
{
m_ui->tabWidget->importCsv();
switchToDatabases();
}
void MainWindow::databaseStatusChanged(DatabaseWidget *)
{
updateTrayIcon();

View File

@ -65,6 +65,7 @@ private slots:
void switchToOpenDatabase();
void switchToDatabaseFile(QString file);
void switchToKeePass1Database();
void switchToCsvImport();
void closePasswordGen();
void databaseStatusChanged(DatabaseWidget *dbWidget);
void databaseTabChanged(int tabIndex);

View File

@ -51,6 +51,7 @@ WelcomeWidget::WelcomeWidget(QWidget* parent)
connect(m_ui->buttonNewDatabase, SIGNAL(clicked()), SIGNAL(newDatabase()));
connect(m_ui->buttonOpenDatabase, SIGNAL(clicked()), SIGNAL(openDatabase()));
connect(m_ui->buttonImportKeePass1, SIGNAL(clicked()), SIGNAL(importKeePass1Database()));
connect(m_ui->buttonImportCSV, SIGNAL(clicked()), SIGNAL(importCsv()));
connect(m_ui->recentListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this,
SLOT(openDatabaseFromFile(QListWidgetItem*)));
}
@ -65,4 +66,4 @@ void WelcomeWidget::openDatabaseFromFile(QListWidgetItem* item)
return;
}
emit openDatabaseFile(item->text());
}
}

View File

@ -34,13 +34,14 @@ public:
~WelcomeWidget();
signals:
void newDatabase();
void openDatabase();
void openDatabaseFile(QString);
void importKeePass1Database();
void newDatabase();
void openDatabase();
void openDatabaseFile(QString);
void importKeePass1Database();
void importCsv();
private slots:
void openDatabaseFromFile(QListWidgetItem* item);
void openDatabaseFromFile(QListWidgetItem* item);
private:
const QScopedPointer<Ui::WelcomeWidget> m_ui;

View File

@ -127,6 +127,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonImportCSV">
<property name="text">
<string>Import from plain text CSV file</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">