Добавил диалог 'Сохранить как'
All checks were successful
Build and Release / build (push) Successful in 24s

This commit is contained in:
svk
2026-01-30 13:47:05 +03:00
parent c4923c5871
commit e86b600cd9
6 changed files with 33 additions and 4 deletions

1
debian/changelog vendored
View File

@@ -1,5 +1,6 @@
projman (2.0.0-beta3) stable; urgency=medium
* Добавил диалог вменю "Сохранить как"
* Вынес код связанный с обработкой подсказок при вводе переменных и процедур в отдельный модуль.
* Исправил работу со списком переменных из всплывающего окна. Теперь там можно выбрать из списка стрелками и вставить по Enter. Исправил обработку клавиш Вверх Вниз Ввод Отмена в окне со списком вариантов.

View File

@@ -745,6 +745,8 @@ namespace eval Editor {
}
bind $txt <Control-r> "Editor::SplitEditorForExecute $w $fileType $nb "
bind $txt <Control-Cyrillic_ka> "Editor::SplitEditorForExecute $w $fileType $nb "
# bind $txt <Shift-Control-s> FileOper::Close
# bind $txt <Shift-Control-Cyrillic_es> "FileOper::Close saveas"
# bind $txt.t <KeyRelease> "Editor::ReleaseKey %K $txt.t $fileType"
# bind $txt.t <KeyPress> "Editor::PressKey %K $txt.t"

View File

@@ -383,6 +383,8 @@ namespace eval FileOper {
set filePath [Tree::GetItemID $tree $treeItem]
}
set editedText [$nbEditorItem.frmText.t get 0.0 end]
if {$type eq "saveas"} {set filePath [FileOper::SaveDialog]}
DebugPuts "FileOper::Save $filePath"
set f [open $filePath "w+"]
puts -nonewline $f $editedText
# puts "$f was saved"
@@ -397,7 +399,7 @@ namespace eval FileOper {
Tools::GetMenu .popup.tools
Tools::GetMenu .frmMenu.mnuTools.m
}
if [string match "*untitled*" $nbEditorItem] {
if {[string match "*untitled*" $nbEditorItem] || $type eq "saveas"} {
FileOper::Close
if {$type ne "close"} {
FileOper::Edit $filePath
@@ -628,4 +630,27 @@ namespace eval FileOper {
# puts [$txt get [$txt tag ranges sel]]
# }
proc SaveDialog {} {
global env project activeProject
if [info exists activeProject] {
set dir $activeProject
} else {
set dir $env(HOME)
}
set fileName [tk_getSaveFile -initialdir $dir -filetypes $::types -parent .]
set fullPath [file join $dir $fileName]
set file [string range $fullPath [expr [string last "/" $fullPath]+1] end]
DebugPuts "FileOper::SaveDialog $fullPath"
regsub -all "." $file "_" node
set dir [file dirname $fullPath]
set file [file tail $fullPath]
set name [file rootname $file]
set ext [string range [file extension $file] 1 end]
if {$fullPath != ""} {
# puts $fullPath
return $fullPath
} else {
return
}
}
}

View File

@@ -337,4 +337,3 @@ namespace eval Helper {
puts "DEBUG: $msg"
}
}

View File

@@ -20,6 +20,8 @@ proc GetFileMenu {m} {
}
$m add command -label [::msgcat::mc "Save file"] -command {FileOper::Save}\
-accelerator "Ctrl+S"
$m add command -label [::msgcat::mc "Save as"] -command {FileOper::Save saveas}\
-accelerator "Shift+Ctrl+S"
$m add command -label [::msgcat::mc "Close file"] -command {FileOper::Close}\
-accelerator "Ctrl+w"
$m add command -label [::msgcat::mc "Close all"] -command {FileOper::CloseAll}

View File

@@ -10,7 +10,7 @@ exec wish8.6 "$0" -- "$@"
######################################################
# Version: 2.0.0
# Release: beta3
# Build: 29012026155729
# Build: 30012026134326
######################################################
# определим текущую версию, релиз и т.д.