diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 712566e5f..05071cc49 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -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(); diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h index cc7037959..388e1c8a4 100644 --- a/src/gui/MainWindow.h +++ b/src/gui/MainWindow.h @@ -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); diff --git a/src/gui/WelcomeWidget.cpp b/src/gui/WelcomeWidget.cpp index d327ea84c..4629ffa28 100644 --- a/src/gui/WelcomeWidget.cpp +++ b/src/gui/WelcomeWidget.cpp @@ -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()); -} \ No newline at end of file +} diff --git a/src/gui/WelcomeWidget.h b/src/gui/WelcomeWidget.h index 73c8c4f9b..98d87acaa 100644 --- a/src/gui/WelcomeWidget.h +++ b/src/gui/WelcomeWidget.h @@ -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 m_ui; diff --git a/src/gui/WelcomeWidget.ui b/src/gui/WelcomeWidget.ui index b08ec917e..4800ea3df 100644 --- a/src/gui/WelcomeWidget.ui +++ b/src/gui/WelcomeWidget.ui @@ -127,6 +127,13 @@ + + + + Import from plain text CSV file + + +