Compare commits

...

10 Commits

Author SHA1 Message Date
Sergey Kalinin
eb6b2c6f53 Новая сборка
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 17s
2025-12-03 18:06:32 +03:00
Sergey Kalinin
aa9bb03cc2 Исправил ошибку 2025-12-03 18:02:13 +03:00
Sergey Kalinin
bcc3460e06 Исправил ошибку 2025-12-03 17:59:31 +03:00
Sergey Kalinin
1385c91255 Исправления после слияния 2025-12-03 17:33:06 +03:00
Sergey Kalinin
ead8267d61 Изменения перед слиянием
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-12-03 17:09:42 +03:00
Sergey Kalinin
e534b27407 Добавлены настройки путей к программам для выполнения редактируемых файлов для каждого поддержимаего типа. И использование этих настроек при выполнении файла.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-12-03 17:01:58 +03:00
Sergey Kalinin
45cbd7845b Добавил вывод информации о версиях tcl и tk
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-11-10 13:18:26 +03:00
Sergey Kalinin
b830838f8e Добавил вывод номера версии tcl/tl в О Программе
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-11-10 13:13:44 +03:00
Sergey Kalinin
ef87b88156 Незначительные изменения
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-11-10 13:00:43 +03:00
df1d9aa36d Добавил проверку пакета Img. И поправил проверку типов изображений
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m23s
2025-10-31 17:30:16 +03:00
9 changed files with 274 additions and 30 deletions

40
debian/changelog vendored
View File

@@ -1,8 +1,42 @@
projman (2.0.0-alpha21) stable; urgency=medium
* Исправил ошибку
* Добавлены настройки путей к программам для выполнения редактируемых файлов для каждого поддержимаего типа. И использование этих настроек при выполнении файла.
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 3 Dec 2025 17:59:31 +0300
projman (2.0.0-alpha20) stable; urgency=medium
* Исправил сохранение и закрытие нового файла. Теперь при сохранении файл будет переоткрыт под новым именем.
* Добавил вывод номера версии tcl/tl в О Программе
-- Sergey Kalinin <svk@nuk-svk.ru> Fri, 31 Oct 2025 18:56:38 +0300
-- Sergey Kalinin <svk@nuk-svk.ru> Mon, 03 Dec 2025 17:22:44 +0300
projman (2.0.0-alpha19) stable; urgency=medium
* Исправил сохранение и закрытие нового файла. Теперь при сохранении файл будет переоткрыт под новым именем.
* Добавил проверку пакета Img. И поправил проверку типов изображений
* Переделал сигналы и сочетания
* Небольшие исправления
* Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
* Добавлена передача сигналов для закрытия запущенного процесса
* Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f
* Добавлен диалог настроек
* Добавил псевдо-терминал
* Добавлен диалог при открытии файлов отличных от текстовых
* Поправил тему оформления
* Исправлена работа в windows
* Уменьшил колдичество выводимой отладочной информации
* Добавлено определение пути до git в зависимости от платформы.
* Исправлено создание файла конфигурации
* Исправлено создание файла конфигурации. Добавлены номера версий в вызов tclsh8.6 и wish8.6. Убрана зависимость на Threads.
* Исправлено чтение структуры проекта при открытии из меню 'Открыть недавнее'
* Bugfix release
* Bug fix with varhelper
* Added the "Open Recent" menu. The "recentlyEditedFolders" option in the configuration file contains a list of recently opened directories. The procedures for working with this list have also been added.
* Косметические изменения.
* Исправлены ошибки при вставке кавычек
-- Калинин Сергей Валерьевич <svk@nuk-svk.ru> Thu, 30 Jan 2025 12:19:56 +0300
projman (2.0.0-alpha19) stable; urgency=medium
@@ -397,3 +431,5 @@ projman (2.0.0-alfa0) stable; urgency=medium

View File

@@ -65,6 +65,16 @@ multilineComments=true
opened=
editedFiles=
recentFolder=
\[Executor\]
TCL=tclsh
GO=go
PY=python3
SH=bash
PL=perl
RB=ruby
HTM=firefox
HTML=firefox
LUA=lua
"
proc Config::create {dir} {
set cfgFile [open [file join $dir projman.ini] "w+"]

View File

@@ -1546,6 +1546,8 @@ namespace eval Editor {
}
set fileType [string toupper [string trimleft [file extension $fileFullPath] "."]]
if {$fileType eq ""} {set fileType "Unknown"}
ExecutorCommandPathSetting $fileType
ttk::frame $fr.header
set lblName "lbl[string range $itemName [expr [string last "." $itemName] +1] end]"

View File

@@ -9,12 +9,42 @@
namespace eval FileOper {
variable types
global packages
variable types
set ::types {
{"All files" *}
}
# Проверка поддерживаемых типов изображений
# в зависимости устновлен пакет или нет
proc SupportImageType {type} {
if {[PackagePresent Img] eq "true"} {
switch $type {
jpeg { return true }
png { return true }
gif { return true }
bmp { return true }
svg { return true }
ppm { return true }
pgm { return true }
tiff { return true }
xbm { return true }
xpm { return true }
default { return false}
}
} else {
switch $type {
png { return true }
gif { return true }
bmp { return true }
svg { return true }
ppm { return true }
pgm { return true }
default { return false}
}
}
}
proc GetFileMimeType {fileFullPath {opt ""}} {
global cfgVariables
# Проверям наличие программы в системе, если есть то добавляем опции
@@ -76,15 +106,15 @@ namespace eval FileOper {
if {$fBinaryType ne ""} {
switch $fBinaryType {
"graphic" {
if {$fBinaryInterp ne "png" && $fBinaryInterp ne "gif" && $fBinaryInterp ne "ppm" && $fBinaryInterp ne "pgm"} {
if {[SupportImageType $fBinaryInterp] eq "true"} {
return image
} else {
set answer [tk_messageBox -message [::msgcat::mc "The file looks like a image. Support not implemented yet."] -icon question -type ok]
switch $answer {
ok {
return false
}
}
} else {
return image
}
}
default {
@@ -99,14 +129,15 @@ namespace eval FileOper {
return text
}
"image" {
if {$fBinaryInterp ne "png" && $fBinaryInterp ne "gif" && $fBinaryInterp ne "ppm" && $fBinaryInterp ne "pgm" && $fBinaryInterp} {
if {[SupportImageType $fBinaryInterp] eq "true"} {
return image
} else {
set answer [tk_messageBox -message [::msgcat::mc "The file looks like a image. Support not implemented yet."] -icon question -type ok]
switch $answer {
ok {
return false
}
}
return image
}
}
"empty" {

View File

@@ -23,7 +23,7 @@ namespace eval Git {
}
if {[catch {exec {*}$cmd} git_path]} {
puts "Git не найден в системе"
set cfgVariables(gitCommand) "Git not found"
set cfgVariables(gitCommand) ""
return
}
set git_path [string trim $git_path]

View File

@@ -54,7 +54,7 @@ proc ImageBase64Encode {text} {
{"GIF" {.gif}}
{"JPEG" {.jpg}}
{"BMP" {.bmp}}
# {"SVG" {.svg}}
{"SVG" {.svg}}
{"All files" *}
}
set img [tk_getOpenFile -initialdir $env(HOME) -filetypes $types -parent .]

View File

@@ -254,11 +254,13 @@ proc FindImage {ext} {
namespace eval Help {
proc About {} {
global projman
global projman tcl_version tk_version
set msg "Tcl/Tk project Manager\n\n"
append msg "Version: " $projman(Version) "\n" \
"Release: " $projman(Release) "\n" \
"Build: " $projman(Build) "\n\n" \
"Build: " $projman(Build) "\n" \
"Tcl Version: " $tcl_version "\n" \
"Tk Version: " $tk_version "\n\n" \
"Author: " $projman(Author) "\n" \
"Home page: " $projman(Homepage)
# foreach name [array names projman] {
@@ -826,6 +828,44 @@ proc MakeTGZ {} {
}
}
# Процедура для проверки, находится ли редактирование в последней строке
proc IsLastLine {widget} {
set current_line [lindex [split [$widget index insert] .] 0]
set last_line [lindex [split [$widget index end-1c] .] 0]
return [expr {$current_line == $last_line}]
}
# Процедура для проверки выделения в последней строке
proc IsSelectionInLastLine {widget} {
if {![$widget tag ranges sel]} {
return 0
}
set last_line [lindex [split [$widget index end-1c] .] 0]
set sel_start_line [lindex [split [$widget index sel.first] .] 0]
set sel_end_line [lindex [split [$widget index sel.last] .] 0]
return [expr {$sel_start_line == $last_line && $sel_end_line == $last_line}]
}
# Процедура-обертка для проверки последней строки
proc CheckLastLineAndRun {txt w filePath} {
# Проверяем, находится ли курсор в последней строке
set current_line [lindex [split [$txt index insert] .] 0]
set last_line [lindex [split [$txt index end-1c] .] 0]
if {$current_line == $last_line} {
# Разрешаем выполнение в последней строке
$txt insert insert "\n"
Run $w $filePath
} else {
# Запрещаем в других строках
bell
$txt mark set insert end
}
}
## MAKE PROJ PROCEDURE (RUNNING PROJECT) ##
proc Execute {filePath w activeEditor} {
global activeProject cfgVariables
@@ -845,35 +885,109 @@ proc Execute {filePath w activeEditor} {
frame $w.frame -borderwidth 2 -relief ridge -background $cfgVariables(backGround)
pack $w.frame -side top -fill both -expand true
ctext $w.frame.text -yscrollcommand "$w.frame.yscroll set" \
set txt $w.frame.text
ctext $txt -yscrollcommand "$w.frame.yscroll set" -linemap 0 \
-bg $cfgVariables(backGround) -fg $cfgVariables(foreground) \
-relief sunken -wrap word -highlightthickness 0 -font $cfgVariables(font)\
-relief sunken -wrap word -highlightthickness 0 -font $cfgVariables(font) \
-selectborderwidth 0 -selectbackground $cfgVariables(selectbg) -width 10 -height 10
scrollbar $w.frame.yscroll -relief sunken -borderwidth {1} -width {10} -takefocus 0 \
-command "$w.frame.text yview" -background $cfgVariables(backGround)
Highlight::ExecuteColorized $w.frame.text
-command "$txt yview" -background $cfgVariables(backGround)
Highlight::ExecuteColorized $txt
pack $w.frame.text -side left -fill both -expand true
pack $txt -side left -fill both -expand true
pack $w.frame.yscroll -side left -fill y
bind $w.frame.text <Return> [list Run $w $filePath]
bind $w.frame.text <Control-r> [list CloseExecuteDialog $w $activeEditor]
bind $w.frame.text <Control-Cyrillic_er> [list CloseExecuteDialog $w $activeEditor]
bind $txt <Return> [list Run $w $filePath]
bind $txt <Control-r> [list CloseExecuteDialog $w $activeEditor]
bind $txt <Control-Cyrillic_er> [list CloseExecuteDialog $w $activeEditor]
# focus -force $w.frmBtn.btnOk
# $noteBook raise $node
# insert debug data into text widget #
$w.frame.text tag configure bold -font $cfgVariables(fontBold)
$w.frame.text tag configure error -font $cfgVariables(fontBold) -foreground red
$w.frame.text tag add bold 0.0 0.end
$txt tag configure bold -font $cfgVariables(fontBold)
$txt tag configure error -font $cfgVariables(fontBold) -foreground red
$txt tag add bold 0.0 0.end
$w.frame.text insert end "[::msgcat::mc "Enter command for execute file"] $filePath >\n"
$txt insert end "[::msgcat::mc "Enter command for execute file"] $filePath >\n"
set pos [$w.frame.text index insert]
set lineNum [lindex [split $pos "."] 0]
$w.frame.text insert 0.0 "======================================================================================\n"
# Added executor from config
set fileType [string toupper [string trimleft [file extension $filePath] "."]]
if {[info exists cfgVariables($fileType)] != 0 && $cfgVariables($fileType) ne ""} {
$w.frame.text insert end "$cfgVariables($fileType) %f"
}
unset fileType
# $w.frame.text insert end [string toupper [string trimleft [file extension $filePath] "."]]
# $w.frame.text insert end cfgVariables($fileType)
$w.frame.text tag add bold $lineNum.0 $lineNum.end
Highlight::ExecuteColorized $w.frame.text
# focus -force $w.frame.text
# Привязки событий для защиты от редактирования
# bind $txt <KeyPress> {
# if {![IsLastLine %W]} {
# break
# }
# }
# bind $txt <KeyPress-Return> {
# # Разрешаем Enter только в последней строке
# if {![IsLastLine %W]} {
# break
# } else {
# list Run $w $filePath
# }
# }
# bind $txt <KeyPress-Return> [list CheckLastLineAndRun $txt $w $filePath]
#
# bind $txt <BackSpace> {
# if {[%W tag ranges sel] ne ""} {
# if {![IsSelectionInLastLine %W]} {
# break
# }
# } else {
# if {![IsLastLine %W]} {
# break
# }
# }
# }
# bind $txt <Delete> {
# if {[%W tag ranges sel] ne ""} {
# if {![IsSelectionInLastLine %W]} {
# break
# }
# } else {
# if {![IsLastLine %W]} {
# break
# }
# }
# }
# # Защита от вставки
# bind $txt <<Paste>> {
# if {[%W tag ranges sel] ne ""} {
# if {![IsSelectionInLastLine %W]} {
# break
# }
# } else {
# if {![IsLastLine %W]} {
# break
# }
# }
# }
# # Защита от вырезания
# bind $txt <<Cut>> {
# if {[%W tag ranges sel] ne ""} {
# if {![IsSelectionInLastLine %W]} {
# break
# }
# } else {
# break
# }
# }
focus -force $w.frame.text.t
}
@@ -970,6 +1084,8 @@ proc SendSignal {pid signal} {
}
}
# Правка файла настроек
proc Settings {} {
global dir
@@ -977,3 +1093,34 @@ proc Settings {} {
FileOper::Edit [file join $dir(cfg) projman.ini]
# Config::read $dir(cfg)
}
# Определяем пути до программ для запуска исходников
proc ExecutorCommandPathSetting {fileType} {
global cfgVariables tcl_platform
# puts $cfgVariables($fileType)
if {[info exists cfgVariables($fileType)] == 1 && $cfgVariables($fileType) ne ""} {
if {$tcl_platform(platform) eq "windows"} {
set cmd "where $cfgVariables($fileType)"
} else {
set cmd "which $cfgVariables($fileType)"
}
puts "ExecutorCommandPathSetting $fileType"
puts [catch {exec {*}$cmd} executor_path]
puts "executor_path $executor_path"
if {[catch {exec {*}$cmd} executor_path]} {
puts "Программа $cfgVariables($fileType) для выполнения файлов $fileType не найдена в системе"
set cfgVariables($fileType) ""
return
}
set full_path [string trim $executor_path]
set first_path [lindex [split $executor_path "\n"] 0]
# puts "Git найден: $first_path"
set cfgVariables($fileType) $first_path
puts "first_path $first_path"
}
if {[info exists cfgVariables($fileType)] == 0} {
set cfgVariables($fileType) ""
puts $cfgVariables($fileType)
}
}

View File

@@ -9,8 +9,8 @@ exec wish8.6 "$0" -- "$@"
# Home page: https://nuk-svk.ru
######################################################
# Version: 2.0.0
# Release: alpha20
# Build: 31102025185656
# Release: alpha21
# Build: 03122025180445
######################################################
# определим текущую версию, релиз и т.д.
@@ -43,6 +43,24 @@ package require fileutil
# package require Thread
package require fileutil::magic::filetype
# Определим установлен ли пакет Img для расширенной поддержки изображений
proc PackagePresent {pkg} {
# puts $pkg
foreach item [package names] {
# puts [string match -nocase Img $item]
if {[string match -nocase Img $item] == 1} {
puts "The $pkg package was found"
return true
}
}
}
if {[PackagePresent "Img"] eq "true"} {
package require Img
} else {
puts "Img not present"
}
# Устанавливаем текущий каталог
set dir(root) [pwd]
set dir(doc) [file join $dir(root) doc]

View File

@@ -6,8 +6,8 @@
#
# $Id: black.tcl,v 1.2 2009/10/25 19:21:30 oberdorfer Exp $
package require Tk 8.4; # minimum version for Tile
package require tile 0.8; # depends upon tile
package require Tk; # minimum version for Tile
package require tile; # depends upon tile
namespace eval ttk {