Compare commits

2 Commits

6 changed files with 31 additions and 69 deletions

9
debian/changelog vendored
View File

@@ -1,11 +1,12 @@
projman (2.0.0-alpha19) stable; urgency=medium projman (2.0.0-alpha20) stable; urgency=medium
* Небольшие исправления * Исправил сохранение и закрытие нового файла. Теперь при сохранении файл будет переоткрыт под новым именем.
-- Sergey Kalinin <svk@nuk-svk.ru> Thu, 30 Oct 2025 14:47:05 +0300 -- Sergey Kalinin <svk@nuk-svk.ru> Fri, 31 Oct 2025 18:56:38 +0300
projman (2.0.0-alpha19) stable; urgency=medium projman (2.0.0-alpha19) stable; urgency=medium
* Переделал сигналы и сочетния
* Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения. * Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
* Добавлена передача сигналов для закрытия запущенного процесса * Добавлена передача сигналов для закрытия запущенного процесса
* Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f * Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f
@@ -394,3 +395,5 @@ projman (2.0.0-alfa0) stable; urgency=medium

0
errors
View File

View File

@@ -9,42 +9,12 @@
namespace eval FileOper { namespace eval FileOper {
global packages variable types
variable types
set ::types { set ::types {
{"All files" *} {"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 ""}} { proc GetFileMimeType {fileFullPath {opt ""}} {
global cfgVariables global cfgVariables
# Проверям наличие программы в системе, если есть то добавляем опции # Проверям наличие программы в системе, если есть то добавляем опции
@@ -106,15 +76,15 @@ namespace eval FileOper {
if {$fBinaryType ne ""} { if {$fBinaryType ne ""} {
switch $fBinaryType { switch $fBinaryType {
"graphic" { "graphic" {
if {[SupportImageType $fBinaryInterp] eq "true"} { if {$fBinaryInterp ne "png" && $fBinaryInterp ne "gif" && $fBinaryInterp ne "ppm" && $fBinaryInterp ne "pgm"} {
return image
} else {
set answer [tk_messageBox -message [::msgcat::mc "The file looks like a image. Support not implemented yet."] -icon question -type ok] set answer [tk_messageBox -message [::msgcat::mc "The file looks like a image. Support not implemented yet."] -icon question -type ok]
switch $answer { switch $answer {
ok { ok {
return false return false
} }
} }
} else {
return image
} }
} }
default { default {
@@ -129,15 +99,14 @@ namespace eval FileOper {
return text return text
} }
"image" { "image" {
if {[SupportImageType $fBinaryInterp] eq "true"} { if {$fBinaryInterp ne "png" && $fBinaryInterp ne "gif" && $fBinaryInterp ne "ppm" && $fBinaryInterp ne "pgm" && $fBinaryInterp} {
return image
} else {
set answer [tk_messageBox -message [::msgcat::mc "The file looks like a image. Support not implemented yet."] -icon question -type ok] set answer [tk_messageBox -message [::msgcat::mc "The file looks like a image. Support not implemented yet."] -icon question -type ok]
switch $answer { switch $answer {
ok { ok {
return false return false
} }
} }
return image
} }
} }
"empty" { "empty" {
@@ -310,14 +279,16 @@ namespace eval FileOper {
-icon question -type yesnocancel \ -icon question -type yesnocancel \
-detail [::msgcat::mc "Do you want to save it?"]] -detail [::msgcat::mc "Do you want to save it?"]]
switch $answer { switch $answer {
yes Save yes {Save close}
no {} no {}
cancel {return "cancel"} cancel {return "cancel"}
} }
} }
} }
$nbEditor forget $nbItem if {[$nbEditor select] eq $nbItem} {
destroy $nbItem $nbEditor forget $nbItem
destroy $nbItem
}
set treeItem "file::[string range $nbItem [expr [string last "." $nbItem] +1] end ]" set treeItem "file::[string range $nbItem [expr [string last "." $nbItem] +1] end ]"
if [$tree exists $treeItem] { if [$tree exists $treeItem] {
# delete all functions from tree item # delete all functions from tree item
@@ -342,7 +313,7 @@ namespace eval FileOper {
NB::NextTab $nbEditor 0 NB::NextTab $nbEditor 0
} }
proc Save {} { proc Save {{type ""}} {
global nbEditor tree env activeProject dir global nbEditor tree env activeProject dir
if [info exists activeProject] { if [info exists activeProject] {
@@ -377,6 +348,12 @@ namespace eval FileOper {
if {[file tail $filePath] eq "projman.ini"} { if {[file tail $filePath] eq "projman.ini"} {
Config::read $dir(cfg) Config::read $dir(cfg)
} }
if [string match "*untitled*" $nbEditorItem] {
FileOper::Close
if {$type ne "close"} {
FileOper::Edit $filePath
}
}
} }
proc SaveAll {} { proc SaveAll {} {

View File

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

View File

@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# Tcl ignores the next line -*- tcl -*- \ # Tcl ignores the next line -*- tcl -*- \
exec wish9.0 "$0" -- "$@" exec wish8.6 "$0" -- "$@"
###################################################### ######################################################
# Tcl/Tk Project manager 2.0 # Tcl/Tk Project manager 2.0
@@ -9,8 +9,8 @@ exec wish9.0 "$0" -- "$@"
# Home page: https://nuk-svk.ru # Home page: https://nuk-svk.ru
###################################################### ######################################################
# Version: 2.0.0 # Version: 2.0.0
# Release: alpha19 # Release: alpha20
# Build: 30102025145246 # Build: 31102025185656
###################################################### ######################################################
# определим текущую версию, релиз и т.д. # определим текущую версию, релиз и т.д.
@@ -43,24 +43,6 @@ package require fileutil
# package require Thread # package require Thread
package require fileutil::magic::filetype 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(root) [pwd]
set dir(doc) [file join $dir(root) doc] 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 $ # $Id: black.tcl,v 1.2 2009/10/25 19:21:30 oberdorfer Exp $
package require Tk; # minimum version for Tile package require Tk 8.4; # minimum version for Tile
package require tile; # depends upon tile package require tile 0.8; # depends upon tile
namespace eval ttk { namespace eval ttk {