mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-10 03:38:33 -05:00
Fix setting window title as modified
This commit is contained in:
parent
dce34de875
commit
832340e209
@ -6218,6 +6218,10 @@ Expect some bugs and minor issues, this version is meant for testing purposes.</
|
|||||||
<source>Toggle Show Group Panel</source>
|
<source>Toggle Show Group Panel</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Password Generator</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ManageDatabase</name>
|
<name>ManageDatabase</name>
|
||||||
|
@ -1033,28 +1033,23 @@ void MainWindow::updateWindowTitle()
|
|||||||
|
|
||||||
if (stackedWidgetIndex == DatabaseTabScreen && tabWidgetIndex != -1) {
|
if (stackedWidgetIndex == DatabaseTabScreen && tabWidgetIndex != -1) {
|
||||||
customWindowTitlePart = m_ui->tabWidget->tabName(tabWidgetIndex);
|
customWindowTitlePart = m_ui->tabWidget->tabName(tabWidgetIndex);
|
||||||
if (isModified) {
|
if (isModified && customWindowTitlePart.endsWith("*")) {
|
||||||
// remove asterisk '*' from title
|
|
||||||
customWindowTitlePart.remove(customWindowTitlePart.size() - 1, 1);
|
customWindowTitlePart.remove(customWindowTitlePart.size() - 1, 1);
|
||||||
}
|
}
|
||||||
m_ui->actionDatabaseSave->setEnabled(m_ui->tabWidget->canSave(tabWidgetIndex));
|
m_ui->actionDatabaseSave->setEnabled(m_ui->tabWidget->canSave(tabWidgetIndex));
|
||||||
} else if (stackedWidgetIndex == 1) {
|
} else if (stackedWidgetIndex == StackedWidgetIndex::SettingsScreen) {
|
||||||
customWindowTitlePart = tr("Settings");
|
customWindowTitlePart = tr("Settings");
|
||||||
|
} else if (stackedWidgetIndex == StackedWidgetIndex::PasswordGeneratorScreen) {
|
||||||
|
customWindowTitlePart = tr("Password Generator");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString windowTitle;
|
QString windowTitle;
|
||||||
if (customWindowTitlePart.isEmpty()) {
|
if (customWindowTitlePart.isEmpty()) {
|
||||||
windowTitle = BaseWindowTitle;
|
windowTitle = QString("%1[*]").arg(BaseWindowTitle);
|
||||||
} else {
|
} else {
|
||||||
windowTitle = QString("%1[*] - %2").arg(customWindowTitlePart, BaseWindowTitle);
|
windowTitle = QString("%1[*] - %2").arg(customWindowTitlePart, BaseWindowTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (customWindowTitlePart.isEmpty() || stackedWidgetIndex == 1) {
|
|
||||||
setWindowFilePath("");
|
|
||||||
} else {
|
|
||||||
setWindowFilePath(m_ui->tabWidget->databaseWidgetFromIndex(tabWidgetIndex)->database()->filePath());
|
|
||||||
}
|
|
||||||
|
|
||||||
setWindowTitle(windowTitle);
|
setWindowTitle(windowTitle);
|
||||||
setWindowModified(isModified);
|
setWindowModified(isModified);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user