95c03040c7
- FileStore: защита от выхода за пределы хранилища (isInsideVault), валидация имён (запрет скрытых, зарезервированных, управляющих символов), проверка destDir, лимит watcher, dailyNote валидация, openVault проверка isDir - DocumentManager: лимит 10МБ, кламп автосейва 0.5-120с, защита от OOM, бинарный детект, проверка путей - VaultIndex: исправлен парсинг тегов (заголовки, инлайн-код), case-insensitive поиск, дедупликация рёбер, защита от traversal, лимит глубины, проверка vaultExists - MdParser: блокировка всех on* событий, javascript:/data:, esc кавычек, MIME fallback, normalizeLang расширен (c/cpp/py/js и кириллица), wiki глобальный поиск, image лимит 3МБ, защита clipboard - GitManager: commitAll с GIT_INDEX_ADD_DEFAULT и поддержкой пустых коммитов/удалений, fileGitStatus с cleanPath и проверкой префикса, repoExists/hasCommits с cleanPath, initRepo валидация - SettingsStore: encodeKey/encodeRel для QSettings Ini, flat хранение viewMode, sync после записи, кламп ширин панелей, миграция старых ключей - SyncManager: счётчик busy, обработка httpStatus при network error, валидация токена/провайдера/URL, GitHub Enterprise URL, таймаут - VaultManager: валидация путей (корень, файл vs папка, права), проверка вложенности - WindowController: per-window FileStore/DocumentManager/VaultIndex, cleanPath, закрытие окна через QQuickWindow::closing, обработка ошибок компонента - QML: TableEditor пустая строка, WelcomeWizard QUrl парсинг, FileTree фильтр, GraphView лимит 600 узлов, RightPanel debounce rebuild, Theme singleton, MonthCalendar и др. - Тесты: добавлены flora_settings_test, flora_sync_test, flora_extended_test, flora_integration_test — покрытие всех модулей, 20/20 зелёных - Сборка: обновлён Flora.app (4.6М бинарь -> 173М бандл, ad-hoc подпись, проверен offscreen запуск, версия 0.0.1 + cmark 0.29 + libgit2 1.9) - .gitignore: добавлены Testing/, coverage, gcda/gcov, __pycache__, .tmp, test-vault и др.
77 lines
2.3 KiB
QML
77 lines
2.3 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import Flora
|
|
|
|
Dialog {
|
|
id: root
|
|
|
|
property string dialogTitle: qsTr("Имя")
|
|
property string actionLabel: qsTr("OK")
|
|
property string initialText: ""
|
|
property string errorText: ""
|
|
|
|
signal confirmed(string text)
|
|
|
|
title: dialogTitle
|
|
modal: true
|
|
width: 400
|
|
anchors.centerIn: parent
|
|
closePolicy: Dialog.NoAutoClose
|
|
standardButtons: Dialog.NoButton
|
|
background: Rectangle { color: Theme.surface; border.color: Theme.borderStrong; radius: 10 }
|
|
|
|
ColumnLayout {
|
|
anchors.fill: parent
|
|
spacing: 12
|
|
|
|
Label { text: dialogTitle; font.bold: true; color: Theme.text; font.pixelSize: 14 }
|
|
|
|
TextField {
|
|
id: nameField
|
|
Layout.fillWidth: true
|
|
placeholderText: qsTr("Введите имя…")
|
|
placeholderTextColor: Theme.textFaint
|
|
color: Theme.text
|
|
text: root.initialText
|
|
selectByMouse: true
|
|
inputMethodHints: Qt.ImhNoPredictiveText
|
|
background: Rectangle { color: Theme.bgAlt; border.color: nameField.activeFocus ? Theme.accent : Theme.border; radius: 6 }
|
|
Component.onCompleted: { forceActiveFocus(); selectAll() }
|
|
onAccepted: root.tryConfirm()
|
|
onTextChanged: root.errorText = ""
|
|
}
|
|
|
|
Label {
|
|
id: errorLabel
|
|
Layout.fillWidth: true
|
|
visible: root.errorText.length > 0
|
|
color: Theme.errorText
|
|
wrapMode: Text.Wrap
|
|
text: root.errorText
|
|
font.pixelSize: 11
|
|
padding: 6
|
|
background: Rectangle { visible: root.errorText.length>0; color: Theme.errorBg; radius: 6 }
|
|
}
|
|
|
|
RowLayout {
|
|
Layout.fillWidth: true
|
|
Item { Layout.fillWidth: true }
|
|
Button { text: qsTr("Отмена"); onClicked: root.reject() }
|
|
Button {
|
|
text: root.actionLabel
|
|
enabled: nameField.text.trim().length > 0
|
|
highlighted: true
|
|
onClicked: root.tryConfirm()
|
|
}
|
|
}
|
|
}
|
|
|
|
function tryConfirm() {
|
|
const n = nameField.text.trim()
|
|
if (n.length === 0) { root.errorText = qsTr("Имя не может быть пустым."); return }
|
|
root.confirmed(n)
|
|
root.accept()
|
|
}
|
|
}
|