mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Adjust title when settings widget is active.
This commit is contained in:
parent
b0280e9d93
commit
a77c426b2d
@ -131,6 +131,7 @@ MainWindow::MainWindow()
|
|||||||
connect(m_ui->tabWidget, SIGNAL(currentChanged(int)),
|
connect(m_ui->tabWidget, SIGNAL(currentChanged(int)),
|
||||||
SLOT(setMenuActionState()));
|
SLOT(setMenuActionState()));
|
||||||
connect(m_ui->stackedWidget, SIGNAL(currentChanged(int)), SLOT(setMenuActionState()));
|
connect(m_ui->stackedWidget, SIGNAL(currentChanged(int)), SLOT(setMenuActionState()));
|
||||||
|
connect(m_ui->stackedWidget, SIGNAL(currentChanged(int)), SLOT(updateWindowTitle()));
|
||||||
connect(m_ui->settingsWidget, SIGNAL(editFinished(bool)), SLOT(switchToDatabases()));
|
connect(m_ui->settingsWidget, SIGNAL(editFinished(bool)), SLOT(switchToDatabases()));
|
||||||
|
|
||||||
connect(m_ui->actionDatabaseNew, SIGNAL(triggered()), m_ui->tabWidget,
|
connect(m_ui->actionDatabaseNew, SIGNAL(triggered()), m_ui->tabWidget,
|
||||||
@ -334,17 +335,26 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)
|
|||||||
|
|
||||||
void MainWindow::updateWindowTitle()
|
void MainWindow::updateWindowTitle()
|
||||||
{
|
{
|
||||||
int index = m_ui->tabWidget->currentIndex();
|
QString windowTitle;
|
||||||
if (index == -1) {
|
int stackedWidgetIndex = m_ui->stackedWidget->currentIndex();
|
||||||
setWindowTitle(BaseWindowTitle);
|
if (stackedWidgetIndex == 0) {
|
||||||
}
|
int tabWidgetIndex = m_ui->tabWidget->currentIndex();
|
||||||
else {
|
if (tabWidgetIndex == -1) {
|
||||||
QString windowTitle = m_ui->tabWidget->tabText(index);
|
windowTitle = BaseWindowTitle;
|
||||||
if (m_ui->tabWidget->readOnly(index)) {
|
} else {
|
||||||
windowTitle.append(" [").append(tr("read-only")).append("]");
|
windowTitle = m_ui->tabWidget->tabText(tabWidgetIndex);
|
||||||
|
if (m_ui->tabWidget->readOnly(tabWidgetIndex)) {
|
||||||
|
windowTitle.append(" [").append(tr("read-only")).append("]");
|
||||||
|
}
|
||||||
|
windowTitle.append(" - ").append(BaseWindowTitle);
|
||||||
}
|
}
|
||||||
setWindowTitle(windowTitle.append(" - ").append(BaseWindowTitle));
|
} else if (stackedWidgetIndex == 1) {
|
||||||
|
windowTitle = QString("%1 - %2").arg(tr("Settings")).arg(BaseWindowTitle);
|
||||||
|
} else {
|
||||||
|
windowTitle = BaseWindowTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setWindowTitle(windowTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showAboutDialog()
|
void MainWindow::showAboutDialog()
|
||||||
|
Loading…
Reference in New Issue
Block a user