mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-26 22:36:59 -05:00
Switch to DatabaseTabWidget when the current tab changed and the welcome widget is shown.
This commit is contained in:
parent
a8ab3a5ca1
commit
f145cb69de
@ -76,13 +76,13 @@ MainWindow::MainWindow()
|
||||
SLOT(updateWindowTitle()));
|
||||
connect(m_ui->tabWidget, SIGNAL(currentChanged(int)),
|
||||
SLOT(updateWindowTitle()));
|
||||
connect(m_ui->tabWidget, SIGNAL(currentChanged(int)),
|
||||
SLOT(databaseTabChanged(int)));
|
||||
connect(m_ui->stackedWidget, SIGNAL(currentChanged(int)), SLOT(setMenuActionState()));
|
||||
connect(m_ui->settingsWidget, SIGNAL(editFinished(bool)), SLOT(switchToDatabases()));
|
||||
|
||||
connect(m_ui->actionDatabaseNew, SIGNAL(triggered()), SLOT(switchToDatabases()));
|
||||
connect(m_ui->actionDatabaseNew, SIGNAL(triggered()), m_ui->tabWidget,
|
||||
SLOT(newDatabase()));
|
||||
connect(m_ui->actionDatabaseOpen, SIGNAL(triggered()), SLOT(switchToDatabases()));
|
||||
connect(m_ui->actionDatabaseOpen, SIGNAL(triggered()), m_ui->tabWidget,
|
||||
SLOT(openDatabase()));
|
||||
connect(m_ui->actionDatabaseSave, SIGNAL(triggered()), m_ui->tabWidget,
|
||||
@ -95,7 +95,6 @@ MainWindow::MainWindow()
|
||||
SLOT(changeMasterKey()));
|
||||
connect(m_ui->actionChangeDatabaseSettings, SIGNAL(triggered()), m_ui->tabWidget,
|
||||
SLOT(changeDatabaseSettings()));
|
||||
connect(m_ui->actionImportKeePass1, SIGNAL(triggered()), SLOT(switchToDatabases()));
|
||||
connect(m_ui->actionImportKeePass1, SIGNAL(triggered()), m_ui->tabWidget,
|
||||
SLOT(importKeePass1Database()));
|
||||
connect(m_ui->actionQuit, SIGNAL(triggered()), SLOT(close()));
|
||||
@ -247,6 +246,13 @@ void MainWindow::switchToSettings()
|
||||
m_ui->stackedWidget->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
void MainWindow::databaseTabChanged(int tabIndex)
|
||||
{
|
||||
if (tabIndex != -1 && m_ui->stackedWidget->currentIndex() == 2) {
|
||||
switchToDatabases();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent* event) {
|
||||
if (!m_ui->tabWidget->closeAllDatabases()) {
|
||||
event->ignore();
|
||||
|
@ -47,6 +47,7 @@ private Q_SLOTS:
|
||||
void showAboutDialog();
|
||||
void switchToDatabases();
|
||||
void switchToSettings();
|
||||
void databaseTabChanged(int tabIndex);
|
||||
|
||||
private:
|
||||
static void setShortcut(QAction* action, QKeySequence::StandardKey standard, int fallback = 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user