From df1d9aa36ddda53dde3a26329ef463757f2613de Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Fri, 31 Oct 2025 17:30:16 +0300 Subject: [PATCH 1/3] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D1=83=20=D0=BF?= =?UTF-8?q?=D0=B0=D0=BA=D0=B5=D1=82=D0=B0=20Img.=20=D0=98=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=20=D0=BF=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D0=BA=D1=83=20=D1=82=D0=B8=D0=BF=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=B8=D0=B7=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 1 - lib/files.tcl | 45 ++++++++++++++++++++++++++++++++++++++------- lib/imgviewer.tcl | 2 +- projman.tcl | 20 +++++++++++++++++++- theme/black.tcl | 4 ++-- 5 files changed, 60 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index c907f40..beee36c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -394,4 +394,3 @@ projman (2.0.0-alfa0) stable; urgency=medium - diff --git a/lib/files.tcl b/lib/files.tcl index 67ab73a..4650abd 100644 --- a/lib/files.tcl +++ b/lib/files.tcl @@ -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" { diff --git a/lib/imgviewer.tcl b/lib/imgviewer.tcl index ffe22db..436cf66 100644 --- a/lib/imgviewer.tcl +++ b/lib/imgviewer.tcl @@ -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 .] diff --git a/projman.tcl b/projman.tcl index 3d09cb7..7b7e1c6 100755 --- a/projman.tcl +++ b/projman.tcl @@ -1,6 +1,6 @@ #!/bin/sh # Tcl ignores the next line -*- tcl -*- \ -exec wish8.6 "$0" -- "$@" +exec wish9.0 "$0" -- "$@" ###################################################### # Tcl/Tk Project manager 2.0 @@ -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] diff --git a/theme/black.tcl b/theme/black.tcl index ca8439a..89bf5ed 100644 --- a/theme/black.tcl +++ b/theme/black.tcl @@ -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 { From b830838f8e23dce59b5df087c2f534c3c35a103c Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Mon, 10 Nov 2025 13:13:44 +0300 Subject: [PATCH 2/3] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20=D0=BD=D0=BE=D0=BC=D0=B5?= =?UTF-8?q?=D1=80=D0=B0=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D0=B8=20tcl/tl=20?= =?UTF-8?q?=D0=B2=20=D0=9E=20=D0=9F=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC?= =?UTF-8?q?=D0=BC=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 7 +++++++ lib/procedure.tcl | 6 ++++-- projman.tcl | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index beee36c..85acda2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +projman (2.1.0-alpha0) stable; urgency=medium + + * Незначительные изменения + + -- Sergey Kalinin Mon, 10 Nov 2025 13:00:43 +0300 + projman (2.0.0-alpha19) stable; urgency=medium * Небольшие исправления @@ -394,3 +400,4 @@ projman (2.0.0-alfa0) stable; urgency=medium + diff --git a/lib/procedure.tcl b/lib/procedure.tcl index 6cb52a2..ee6ea5e 100644 --- a/lib/procedure.tcl +++ b/lib/procedure.tcl @@ -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] { diff --git a/projman.tcl b/projman.tcl index 7b7e1c6..4666d95 100755 --- a/projman.tcl +++ b/projman.tcl @@ -8,9 +8,9 @@ exec wish9.0 "$0" -- "$@" # Author: Sergey Kalinin svk@nuk-svk.ru # Home page: https://nuk-svk.ru ###################################################### -# Version: 2.0.0 -# Release: alpha19 -# Build: 30102025145246 +# Version: 2.1.0 +# Release: alpha0 +# Build: 10112025130218 ###################################################### # определим текущую версию, релиз и т.д. From e534b27407deb87f579dedb598997f1411749e38 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Wed, 3 Dec 2025 17:01:58 +0300 Subject: [PATCH 3/3] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=BF=D1=83=D1=82=D0=B5=D0=B9=20=D0=BA=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D0=B0=D0=BC=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=B2=D1=8B=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D1=83?= =?UTF-8?q?=D0=B5=D0=BC=D1=8B=D1=85=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D0=BA=D0=B0=D0=B6=D0=B4=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6=D0=B8=D0=BC?= =?UTF-8?q?=D0=B0=D0=B5=D0=B3=D0=BE=20=D1=82=D0=B8=D0=BF=D0=B0.=20=D0=98?= =?UTF-8?q?=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=8D=D1=82=D0=B8=D1=85=20=D0=BD=D0=B0?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=BE=D0=B5=D0=BA=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D0=B2=D1=8B=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=B8=D0=B8=20?= =?UTF-8?q?=D1=84=D0=B0=D0=B9=D0=BB=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 8 ++++++++ lib/config.tcl | 10 ++++++++++ lib/editor.tcl | 2 ++ lib/procedure.tcl | 41 +++++++++++++++++++++++++++++++++++++++++ projman.tcl | 2 +- 5 files changed, 62 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 85acda2..5dc3a15 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +projman (2.1.0-alpha0) stable; urgency=medium + + * Добавил вывод информации о версиях tcl и tk + * Добавил вывод номера версии tcl/tl в О Программе + + -- Sergey Kalinin Mon, 10 Nov 2025 13:13:44 +0300 + projman (2.1.0-alpha0) stable; urgency=medium * Незначительные изменения @@ -401,3 +408,4 @@ projman (2.0.0-alfa0) stable; urgency=medium + diff --git a/lib/config.tcl b/lib/config.tcl index 88753cc..4d8a42b 100644 --- a/lib/config.tcl +++ b/lib/config.tcl @@ -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+"] diff --git a/lib/editor.tcl b/lib/editor.tcl index cfa315c..d8e3630 100644 --- a/lib/editor.tcl +++ b/lib/editor.tcl @@ -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]" diff --git a/lib/procedure.tcl b/lib/procedure.tcl index ee6ea5e..6833562 100644 --- a/lib/procedure.tcl +++ b/lib/procedure.tcl @@ -873,6 +873,16 @@ proc Execute {filePath w activeEditor} { 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} { + $w.frame.text insert end "$cfgVariables($fileType) " + } + 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 @@ -979,3 +989,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) + } +} diff --git a/projman.tcl b/projman.tcl index 4666d95..fe5e888 100755 --- a/projman.tcl +++ b/projman.tcl @@ -10,7 +10,7 @@ exec wish9.0 "$0" -- "$@" ###################################################### # Version: 2.1.0 # Release: alpha0 -# Build: 10112025130218 +# Build: 10112025132121 ###################################################### # определим текущую версию, релиз и т.д.