Compare commits
47 Commits
tcltk9.0
...
v2.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
| 47f1473167 | |||
| 72101c90d5 | |||
| 261dc38748 | |||
| e20cb3464f | |||
| d4ed578178 | |||
| 46017d027a | |||
| d4d38e26ce | |||
| a2c525ecd1 | |||
| f743c47d6b | |||
| 08ba3678f8 | |||
| 9cc837bdd8 | |||
| 9eb32586c7 | |||
| ff18a032f4 | |||
| debcffb9a2 | |||
| 9c15f23987 | |||
| 5f89f0ce31 | |||
| 6ec850c77c | |||
| 7def13e265 | |||
| cf41075f42 | |||
| 4f0e746128 | |||
| bc706ab410 | |||
| 83d70ebd3f | |||
| f9dbdf893d | |||
| f1fcd09f89 | |||
| cdb47df781 | |||
| d7e681c607 | |||
| 978482c2ae | |||
| 8435bf0254 | |||
| 604175491a | |||
| 9ff7fa815f | |||
| 1a490afe44 | |||
| 78107b529f | |||
| 781352b249 | |||
| 478a583c3a | |||
| 4f01a1fbd7 | |||
| 96dd7a1b4b | |||
|
|
4b2adb3299 | ||
|
|
0c4928c224 | ||
|
|
eb6b2c6f53 | ||
|
|
aa9bb03cc2 | ||
|
|
bcc3460e06 | ||
|
|
1385c91255 | ||
|
|
ead8267d61 | ||
|
|
45cbd7845b | ||
|
|
ef87b88156 | ||
| 264368c61f | |||
| c38dffeeb9 |
@@ -1,17 +1,74 @@
|
|||||||
name: Gitea Actions Demo
|
name: Build and Create Tag Release
|
||||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
on:
|
||||||
on: [push]
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Explore-Gitea-Actions:
|
build:
|
||||||
runs-on: tcl-tk-builder
|
runs-on: tcl-tk-builder
|
||||||
steps:
|
steps:
|
||||||
- name: Build the packages
|
- name: Клонирование
|
||||||
run: |
|
run: |
|
||||||
git clone ${{ vars.main_url }}${{ gitea.repository }}
|
git clone "${{ vars.main_url }}${{ gitea.repository }}.git" .
|
||||||
pwd
|
|
||||||
cd projman/debian
|
- name: Получение версии
|
||||||
./build-deb-projman.sh
|
id: get_version
|
||||||
cd ../../
|
run: |
|
||||||
curl --user ${{ vars.user}}:${{vars.api_token}} --upload-file "$(ls -1| grep projman | grep -E 'deb$')" ${{vars.main_url}}api/packages/${{vars.user}}/debian/pool/bookworm/main/upload
|
VERSION=$(grep "Version" projman.tcl | head -1 | grep -o '[0-9.]\+[a-zA-Z0-9]*' || echo "1.0.0")
|
||||||
- run: echo "This job's status is ${{ job.status }}."
|
RELEASE=$(grep "# Release" projman.tcl | tail -1 | awk '{print $NF}' || echo "$(date +%Y%m%d)")
|
||||||
|
|
||||||
|
# Создаем имя тега из версии
|
||||||
|
TAG="v${VERSION}-${RELEASE}"
|
||||||
|
echo "TAG=$TAG" >> $GITEA_ENV
|
||||||
|
echo "VERSION=$VERSION" >> $GITEA_ENV
|
||||||
|
|
||||||
|
echo "Будет создан тег: $TAG"
|
||||||
|
|
||||||
|
- name: Создание тега в git
|
||||||
|
run: |
|
||||||
|
git config user.email "svk@nuk-svk.ru"
|
||||||
|
git config user.name "svk"
|
||||||
|
|
||||||
|
# Создаем тег локально
|
||||||
|
git tag -a "$TAG" -m "Release $TAG"
|
||||||
|
|
||||||
|
git remote set-url origin "https://${{ secrets.USER }}:${{ secrets.API_TOKEN }}@git.nuk-svk.ru/${{ gitea.repository }}.git"
|
||||||
|
|
||||||
|
# Пушим тег на сервер
|
||||||
|
git push origin "$TAG"
|
||||||
|
- name: Сборка пакетов
|
||||||
|
run: |
|
||||||
|
cd debian && ./build-deb-projman.sh
|
||||||
|
cd ../openbsd && ./build-package-bsd.sh
|
||||||
|
|
||||||
|
echo "Собранные файлы:"
|
||||||
|
ls -la projman*
|
||||||
|
|
||||||
|
- name: Создание релиза с тегом
|
||||||
|
run: |
|
||||||
|
echo "Создаем релиз для тега: $TAG"
|
||||||
|
|
||||||
|
curl -X POST \
|
||||||
|
-u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{
|
||||||
|
"tag_name": "'"$TAG"'",
|
||||||
|
"name": "Projman '"$VERSION"'",
|
||||||
|
"body": "## Информация о сборке\n\n- Версия: '"$VERSION"'\n- Дата: '"$(date)"'\n- Коммит: '"$(git rev-parse --short HEAD)"'",
|
||||||
|
"draft": false,
|
||||||
|
"prerelease": false
|
||||||
|
}' \
|
||||||
|
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases"
|
||||||
|
|
||||||
|
- name: Загрузка файлов
|
||||||
|
run: |
|
||||||
|
# Загружаем все файлы projman*
|
||||||
|
curl -u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
|
||||||
|
--upload-file "../projman_2.0.0-beta1_amd64.deb" \
|
||||||
|
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases/tags/$TAG/assets?name=../projman_2.0.0-beta1_amd64.deb"
|
||||||
|
curl -u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
|
||||||
|
--upload-file "../projman-2.0.0beta1.tgz" \
|
||||||
|
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases/tags/$TAG/assets?name=../projman-2.0.0beta1.tgz"
|
||||||
|
|
||||||
|
|||||||
120
CHANGELOG
120
CHANGELOG
@@ -1,4 +1,122 @@
|
|||||||
projman (2.0.0-alfa16)
|
projman (2.0.0-beta1) stable; urgency=medium
|
||||||
|
|
||||||
|
* Сделан вывод отладочной информации по запросу.
|
||||||
|
* Добавлены параметры в файл конфигурации "debug" - включение или отключение отладки и "debugOut" - куда выводить информацию.
|
||||||
|
* Переделка кода.
|
||||||
|
* Добавлены процедуры проверки наличия параметров конфигурации в файле и устанвоки переменных по умолчанию.
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Wed, 21 Jan 2026 16:44:07 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha24) stable; urgency=medium
|
||||||
|
|
||||||
|
* Добавил фокус ввода на 'терминал' если он открыт во вкладке (при переключении вкладок).
|
||||||
|
* Исправил вставку кавычек при выделении текста
|
||||||
|
* Исправил ошибку при отправке сигналов несуществующему процессу.
|
||||||
|
* Уменьшил всплывающее меню: вынес менюшки Файл и Вид в подменю.
|
||||||
|
* Изменил команду загрузки пакета в репу
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Wed, 21 Jan 2026 16:35:06 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha23) stable; urgency=medium
|
||||||
|
|
||||||
|
* Исправлен флаг модификации при открытии файла
|
||||||
|
* Исправлена 'Отмена' до пустого файла. Внес исправления на основе изменений https://github.com/wandrien/projman
|
||||||
|
* Исправлено поведение при сочетании клавиш Control-y (повторение последнего действия)
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Mon, 19 Jan 2026 14:49:29 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha22) stable; urgency=medium
|
||||||
|
|
||||||
|
* Исправил закрытие вкладок редактора и сохранение файла при разделении экрана.
|
||||||
|
* Новая сборка
|
||||||
|
|
||||||
|
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 3 Dec 2025 18:06:32 +0300
|
||||||
|
|
||||||
|
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> 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
|
||||||
|
|
||||||
|
* Переделал сигналы и сочетния
|
||||||
|
* Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
|
||||||
|
* Добавлена передача сигналов для закрытия запущенного процесса
|
||||||
|
* Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f
|
||||||
|
* Добавлен диалог настроек
|
||||||
|
* Добавил псевдо-терминал
|
||||||
|
* Добавлен диалог при открытии файлов отличных от текстовых
|
||||||
|
* Добавлен просмотр файлов изображений (png, bmp, gif, ppm, pgm)
|
||||||
|
* Исправлена процедура опреления типа файла
|
||||||
|
* Добавлены диалоги для подтверждения открытия больших файлов, и двоичных файлов.
|
||||||
|
|
||||||
|
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 29 Oct 2025 13:10:31 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha18) stable; urgency=medium
|
||||||
|
|
||||||
|
* Поправил тему оформления
|
||||||
|
* Исправлена работа в windows
|
||||||
|
* Уменьшил количество выводимой отладочной информации
|
||||||
|
* Добавлено определение пути до git в зависимости от платформы.
|
||||||
|
* Исправлено создание файла конфигурации
|
||||||
|
* Добавлены номера версий в вызов tclsh8.6 и wish8.6.
|
||||||
|
* Убрана зависимость на Threads.
|
||||||
|
* Исправлено чтение структуры проекта при открытии из меню 'Открыть недавнее'
|
||||||
|
* Исправление работы процедуры varhelper
|
||||||
|
|
||||||
|
-- Sergey Kalinin <svk@nuk-svk.ru> Mon, 27 Oct 2025 14:05:40 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha17) stable; urgency=medium
|
||||||
|
|
||||||
|
* 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 <svk@nuk-svk.ru> Sat, 18 Oct 2025 16:29:50 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha17) stable; urgency=medium
|
||||||
|
|
||||||
|
* Косметические изменения.
|
||||||
|
* Исправлены ошибки при вставке кавычек
|
||||||
|
* Обновить README.md
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Thu, 31 Oct 2024 19:48:30 +0300
|
||||||
|
|
||||||
Sergey Kalinin <svk@nuk-svk.ru> Thu, 22 Aug 2024 15:09:19 +0300
|
Sergey Kalinin <svk@nuk-svk.ru> Thu, 22 Aug 2024 15:09:19 +0300
|
||||||
- changelog-gen.tcl: Добавлена генерация текстового журнала изменений
|
- changelog-gen.tcl: Добавлена генерация текстового журнала изменений
|
||||||
|
|||||||
2
debian/build-deb-projman.sh
vendored
2
debian/build-deb-projman.sh
vendored
@@ -3,7 +3,7 @@
|
|||||||
cd ../
|
cd ../
|
||||||
|
|
||||||
VERSION=$(grep Version projman.tcl | grep -oE '\b[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}\b')
|
VERSION=$(grep Version projman.tcl | grep -oE '\b[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}\b')
|
||||||
RELEASE=$(grep Release projman.tcl | grep -oE '[0-9A-Za-z]+$')
|
RELEASE=$(grep "# Release" projman.tcl | grep -oE '[0-9A-Za-z]+$')
|
||||||
BUILD_DATE=$(date +%d%m%Y%H%M%S)
|
BUILD_DATE=$(date +%d%m%Y%H%M%S)
|
||||||
TXT="# Build: ${BUILD_DATE}"
|
TXT="# Build: ${BUILD_DATE}"
|
||||||
echo "$VERSION, $RELEASE, $BUILD_DATE"
|
echo "$VERSION, $RELEASE, $BUILD_DATE"
|
||||||
|
|||||||
75
debian/changelog
vendored
75
debian/changelog
vendored
@@ -1,24 +1,80 @@
|
|||||||
projman (2.1.0-alpha0) stable; urgency=medium
|
projman (2.0.0-beta1) stable; urgency=medium
|
||||||
|
|
||||||
* Добавил вывод информации о версиях tcl и tk
|
* Сделан вывод отладочной информации по запросу.
|
||||||
* Добавил вывод номера версии tcl/tl в О Программе
|
* Добавлены параметры в файл конфигурации "debug" - включение или отключение отладки и "debugOut" - куда выводить информацию.
|
||||||
|
* Переделка кода.
|
||||||
|
* Добавлены процедуры проверки наличия параметров конфигурации в файле и устанвоки переменных по умолчанию.
|
||||||
|
|
||||||
-- Sergey Kalinin <svkalinin@samsonpost.ru> Mon, 10 Nov 2025 13:13:44 +0300
|
-- svk <svk@nuk-svk.ru> Wed, 21 Jan 2026 16:44:07 +0300
|
||||||
|
|
||||||
projman (2.1.0-alpha0) stable; urgency=medium
|
projman (2.0.0-alpha24) stable; urgency=medium
|
||||||
|
|
||||||
* Незначительные изменения
|
* Добавил фокус ввода на 'терминал' если он открыт во вкладке (при переключении вкладок).
|
||||||
|
* Исправил вставку кавычек при выделении текста
|
||||||
|
* Исправил ошибку при отправке сигналов несуществующему процессу.
|
||||||
|
* Уменьшил всплывающее меню: вынес менюшки Файл и Вид в подменю.
|
||||||
|
* Изменил команду загрузки пакета в репу
|
||||||
|
|
||||||
-- Sergey Kalinin <svkalinin@samsonpost.ru> Mon, 10 Nov 2025 13:00:43 +0300
|
-- svk <svk@nuk-svk.ru> Wed, 21 Jan 2026 16:35:06 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha23) stable; urgency=medium
|
||||||
|
|
||||||
|
* Исправлен флаг модификации при открытии файла
|
||||||
|
* Исправлена 'Отмена' до пустого файла. Внес исправления на основе изменений https://github.com/wandrien/projman
|
||||||
|
* Исправлено поведение при сочетании клавиш Control-y (повторение последнего действия)
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Mon, 19 Jan 2026 14:49:29 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha22) stable; urgency=medium
|
||||||
|
|
||||||
|
* Исправил закрытие вкладок редактора и сохранение файла при разделении экрана.
|
||||||
|
* Новая сборка
|
||||||
|
|
||||||
|
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 3 Dec 2025 18:06:32 +0300
|
||||||
|
|
||||||
|
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> Mon, 03 Dec 2025 17:22:44 +0300
|
||||||
|
|
||||||
projman (2.0.0-alpha19) stable; urgency=medium
|
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.
|
||||||
|
* Косметические изменения.
|
||||||
|
* Исправлены ошибки при вставке кавычек
|
||||||
|
|
||||||
-- Sergey Kalinin <svk@nuk-svk.ru> Thu, 30 Oct 2025 14:47:05 +0300
|
-- Калинин Сергей Валерьевич <svk@nuk-svk.ru> Thu, 30 Jan 2025 12:19:56 +0300
|
||||||
|
|
||||||
projman (2.0.0-alpha19) stable; urgency=medium
|
projman (2.0.0-alpha19) stable; urgency=medium
|
||||||
|
|
||||||
|
* Переделал сигналы и сочетния
|
||||||
* Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
|
* Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
|
||||||
* Добавлена передача сигналов для закрытия запущенного процесса
|
* Добавлена передача сигналов для закрытия запущенного процесса
|
||||||
* Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f
|
* Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f
|
||||||
@@ -409,3 +465,6 @@ projman (2.0.0-alfa0) stable; urgency=medium
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ RB=ruby
|
|||||||
HTM=firefox
|
HTM=firefox
|
||||||
HTML=firefox
|
HTML=firefox
|
||||||
LUA=lua
|
LUA=lua
|
||||||
|
\[Debug\]
|
||||||
|
debug=false
|
||||||
|
debugOut=stdout
|
||||||
"
|
"
|
||||||
proc Config::create {dir} {
|
proc Config::create {dir} {
|
||||||
set cfgFile [open [file join $dir projman.ini] "w+"]
|
set cfgFile [open [file join $dir projman.ini] "w+"]
|
||||||
@@ -131,3 +134,49 @@ proc Config::write {dir} {
|
|||||||
ini::commit $cfgFile
|
ini::commit $cfgFile
|
||||||
ini::close $cfgFile
|
ini::close $cfgFile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Добавление перменной в список
|
||||||
|
# если отсутствует нужная секция то она будет добавлена.
|
||||||
|
proc Config::AddVariable {key value section} {
|
||||||
|
# Проверяем, существует ли уже такая переменная
|
||||||
|
if {[info exists ::cfgVariables($key)]} {
|
||||||
|
DebugPuts "The variable '$key' already exists: $::cfgVariables($key)"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Добавляем в массив переменных
|
||||||
|
set ::cfgVariables($key) $value
|
||||||
|
|
||||||
|
# Добавляем в список ключей секции
|
||||||
|
if {[info exists ::cfgINIsections($section)]} {
|
||||||
|
# Проверяем, нет ли уже такого ключа в секции
|
||||||
|
if {[lsearch -exact $::cfgINIsections($section) $key] == -1} {
|
||||||
|
lappend ::cfgINIsections($section) $key
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
set ::cfgINIsections($section) [list $key]
|
||||||
|
}
|
||||||
|
DebugPuts "Config::AddVariable: The variable '$key' has been added to the array 'cfgVariables'"
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Проверяем наличие переменных в конфиге на основе "эталонного" списка
|
||||||
|
# и выставляем значение по умолчанию если в конфиге переменной нет
|
||||||
|
proc Config::CheckVariables {} {
|
||||||
|
set valList [split $::configDefault "\n"]
|
||||||
|
foreach item $valList {
|
||||||
|
if {[regexp -nocase -all -- {\[(\w+)\]} $item -> v1]} {
|
||||||
|
set section $v1
|
||||||
|
}
|
||||||
|
if {[regexp {^([^=]+)=(.*)$} $item -> var value]} {
|
||||||
|
if ![info exists ::cfgVariables($var)] {
|
||||||
|
DebugPuts "Error in Config::CheckVariables: variable ::cfgVariables($var) not found"
|
||||||
|
# set ::cfgVariables($var) $value
|
||||||
|
DebugPuts "Config::CheckVariables: The variable cfgVariables($var) setting to default value \"$value\""
|
||||||
|
Config::AddVariable "$var" "$value" "$section"
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
######################################################
|
######################################################
|
||||||
# Editor module
|
# Editor module
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
namespace eval Editor {
|
namespace eval Editor {
|
||||||
variable selectionTex
|
variable selectionTex
|
||||||
# Set the editor option
|
# Set the editor option
|
||||||
@@ -447,8 +446,8 @@ namespace eval Editor {
|
|||||||
# bindtags $w [list [winfo parent $w] $w Text sysAfter all]
|
# bindtags $w [list [winfo parent $w] $w Text sysAfter all]
|
||||||
bindtags $w [list [winfo toplevel $w] $w Ctext sysAfter all]
|
bindtags $w [list [winfo toplevel $w] $w Ctext sysAfter all]
|
||||||
catch { destroy .varhelper }
|
catch { destroy .varhelper }
|
||||||
puts [bindtags $w]
|
DebugPuts [bindtags $w]
|
||||||
puts [bind $w]
|
DebugPuts [bind $w]
|
||||||
|
|
||||||
}
|
}
|
||||||
proc VarHelper {x y w word wordType} {
|
proc VarHelper {x y w word wordType} {
|
||||||
@@ -461,7 +460,7 @@ namespace eval Editor {
|
|||||||
# set win .varhelper
|
# set win .varhelper
|
||||||
# Проверяем если есть выделение то блокировать появление диалога
|
# Проверяем если есть выделение то блокировать появление диалога
|
||||||
if {[$txt tag ranges sel] != ""} {
|
if {[$txt tag ranges sel] != ""} {
|
||||||
puts "You have selected text [$txt tag ranges sel]"
|
DebugPuts "You have selected text [$txt tag ranges sel]"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
# puts "$x $y $w $word $wordType"
|
# puts "$x $y $w $word $wordType"
|
||||||
@@ -796,14 +795,15 @@ namespace eval Editor {
|
|||||||
bind $txt <Control-comma> "Editor::Comment $txt $fileType"
|
bind $txt <Control-comma> "Editor::Comment $txt $fileType"
|
||||||
bind $txt <Control-period> "Editor::Uncomment $txt $fileType"
|
bind $txt <Control-period> "Editor::Uncomment $txt $fileType"
|
||||||
bind $txt <Control-eacute> Find
|
bind $txt <Control-eacute> Find
|
||||||
bind $txt <Insert> {OverWrite}
|
# bind $txt <Insert> {OverWrite}
|
||||||
bind $txt <ButtonRelease-1> "Editor::SearchBrackets $txt"
|
bind $txt <ButtonRelease-1> "Editor::SearchBrackets $txt"
|
||||||
bind $txt <Button-1><ButtonRelease-1> "Editor::SelectionHighlight $txt"
|
bind $txt <Button-1><ButtonRelease-1> "Editor::SelectionHighlight $txt"
|
||||||
bind $txt <<Modified>> "SetModifiedFlag $w $nb"
|
bind $txt <<Modified>> "SetModifiedFlag $w $nb auto"
|
||||||
bind $txt <Control-u> "Editor::SearchBrackets %W"
|
bind $txt <Control-u> "Editor::SearchBrackets %W"
|
||||||
bind $txt <Control-Cyrillic_ghe> "Editor::SearchBrackets %W"
|
bind $txt <Control-Cyrillic_ghe> "Editor::SearchBrackets %W"
|
||||||
bind $txt <Control-J> "catch {Editor::GoToFunction $txt}"
|
bind $txt <Control-J> "catch {Editor::GoToFunction $txt}"
|
||||||
bind $txt <Control-j> "catch {Editor::GoToFunction $txt}; break"
|
bind $txt <Control-j> "catch {Editor::GoToFunction $txt}; break"
|
||||||
|
bind $txt <Control-y> {Redo; break}
|
||||||
bind $txt <Control-Cyrillic_o> "catch {Editor::GoToFunction $txt}; break"
|
bind $txt <Control-Cyrillic_o> "catch {Editor::GoToFunction $txt}; break"
|
||||||
bind $txt <Alt-w> "$txt delete {insert wordstart} {insert wordend}"
|
bind $txt <Alt-w> "$txt delete {insert wordstart} {insert wordend}"
|
||||||
bind $txt <Alt-odiaeresis> "$txt delete {insert wordstart} {insert wordend}"
|
bind $txt <Alt-odiaeresis> "$txt delete {insert wordstart} {insert wordend}"
|
||||||
@@ -927,7 +927,9 @@ namespace eval Editor {
|
|||||||
}
|
}
|
||||||
if {$posNum == $posBegin} {
|
if {$posNum == $posBegin} {
|
||||||
if {$symbol == {"} || $symbol == {_}} {
|
if {$symbol == {"} || $symbol == {_}} {
|
||||||
$txt insert $lineEnd.$posEnd "$selText$symbol"
|
$txt tag remove sel $lineBegin.$posBegin $lineEnd.$posEnd
|
||||||
|
$txt insert $lineEnd.$posEnd "$symbol"
|
||||||
|
# $txt tag add sel "$lineBegin.$posBegin + 1 char" "$lineEnd.$posEnd + 1 char"
|
||||||
} else {
|
} else {
|
||||||
$txt insert $lineEnd.$posEnd "$symbol"
|
$txt insert $lineEnd.$posEnd "$symbol"
|
||||||
}
|
}
|
||||||
@@ -936,7 +938,7 @@ namespace eval Editor {
|
|||||||
if {$posBegin == 0} {
|
if {$posBegin == 0} {
|
||||||
$txt insert $pos "$symbol"
|
$txt insert $pos "$symbol"
|
||||||
} else {
|
} else {
|
||||||
$txt insert "$pos + 1 chars" "$symbol"
|
$txt insert "$pos + 0 chars" "$symbol"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$txt highlight $lineBegin.$posBegin $lineEnd.end
|
$txt highlight $lineBegin.$posBegin $lineEnd.end
|
||||||
@@ -965,7 +967,7 @@ namespace eval Editor {
|
|||||||
set nbEditorItem [NB::InsertItem $nbEditor $fileFullPath "file"]
|
set nbEditorItem [NB::InsertItem $nbEditor $fileFullPath "file"]
|
||||||
# puts "$nbEditorItem, $nbEditor"
|
# puts "$nbEditorItem, $nbEditor"
|
||||||
Editor $fileFullPath $nbEditor $nbEditorItem
|
Editor $fileFullPath $nbEditor $nbEditorItem
|
||||||
SetModifiedFlag $nbEditorItem $nbEditor
|
SetModifiedFlag $nbEditorItem $nbEditor force
|
||||||
focus -force $nbEditorItem.frmText.t.t
|
focus -force $nbEditorItem.frmText.t.t
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1308,7 +1310,7 @@ namespace eval Editor {
|
|||||||
}
|
}
|
||||||
ttk::button $win.bBackward -state disable -image backward_20x20 -command "puts $replaceString"
|
ttk::button $win.bBackward -state disable -image backward_20x20 -command "puts $replaceString"
|
||||||
ttk::button $win.bDone -image done_20x20 -state disable -command {
|
ttk::button $win.bDone -image done_20x20 -state disable -command {
|
||||||
puts "$findString -> $replaceString, $regexpSet"
|
DebugPuts "$findString -> $replaceString, $regexpSet"
|
||||||
}
|
}
|
||||||
ttk::button $win.bDoneAll -image doneall_20x20 -command {
|
ttk::button $win.bDoneAll -image doneall_20x20 -command {
|
||||||
Editor::FindReplaceText $Editor::txt "$findString" "$replaceString" $regexpSet
|
Editor::FindReplaceText $Editor::txt "$findString" "$replaceString" $regexpSet
|
||||||
@@ -1378,6 +1380,7 @@ namespace eval Editor {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
set frmText [Editor::EditorWidget $w $fileType $nb]
|
set frmText [Editor::EditorWidget $w $fileType $nb]
|
||||||
|
# puts "Editor::SplitEditorH: w - $w"
|
||||||
$frmText.t insert end [$w.frmText.t get 0.0 end]
|
$frmText.t insert end [$w.frmText.t get 0.0 end]
|
||||||
|
|
||||||
# $w.panelTxt add $w.frmText -weight 0
|
# $w.panelTxt add $w.frmText -weight 0
|
||||||
@@ -1392,7 +1395,7 @@ namespace eval Editor {
|
|||||||
global cfgVariables
|
global cfgVariables
|
||||||
regsub -all {\.|/|\\|\s|:} $fileFullPath "_" itemName
|
regsub -all {\.|/|\\|\s|:} $fileFullPath "_" itemName
|
||||||
set itemName ".frmWork.nbEditor2.$itemName"
|
set itemName ".frmWork.nbEditor2.$itemName"
|
||||||
# puts $itemName
|
DebugPuts "Editor::SplitEditoprV: nb item - $itemName"
|
||||||
if {[winfo exists $itemName] == 1} {
|
if {[winfo exists $itemName] == 1} {
|
||||||
.frmWork.nbEditor2 forget $itemName
|
.frmWork.nbEditor2 forget $itemName
|
||||||
destroy $itemName
|
destroy $itemName
|
||||||
@@ -1412,7 +1415,7 @@ namespace eval Editor {
|
|||||||
# grid columnconfigure .frmWork .frmWork.nbEditor2 -weight 1
|
# grid columnconfigure .frmWork .frmWork.nbEditor2 -weight 1
|
||||||
# grid rowconfigure .frmWork .frmWork.nbEditor2 -weight 1
|
# grid rowconfigure .frmWork .frmWork.nbEditor2 -weight 1
|
||||||
.frmWork.panelNB add .frmWork.nbEditor2 -weight 0
|
.frmWork.panelNB add .frmWork.nbEditor2 -weight 0
|
||||||
puts [FileOper::Edit $fileFullPath .frmWork.nbEditor2]
|
DebugPuts [FileOper::Edit $fileFullPath .frmWork.nbEditor2]
|
||||||
}
|
}
|
||||||
|
|
||||||
proc GoToLineNumber {text lineNumber} {
|
proc GoToLineNumber {text lineNumber} {
|
||||||
@@ -1453,7 +1456,7 @@ namespace eval Editor {
|
|||||||
bind $win.ent <Return> {
|
bind $win.ent <Return> {
|
||||||
set lineNumber [.gotoline.ent get]
|
set lineNumber [.gotoline.ent get]
|
||||||
# $txt see insert $lineNumber
|
# $txt see insert $lineNumber
|
||||||
puts $Editor::txt
|
DebugPuts $Editor::txt
|
||||||
$Editor::txt mark set insert $lineNumber.0
|
$Editor::txt mark set insert $lineNumber.0
|
||||||
$Editor::txt see insert
|
$Editor::txt see insert
|
||||||
focus $Editor::txt.t
|
focus $Editor::txt.t
|
||||||
@@ -1593,7 +1596,7 @@ namespace eval Editor {
|
|||||||
puts $fileFullPath
|
puts $fileFullPath
|
||||||
}
|
}
|
||||||
# puts [$w.panelTxt panes]
|
# puts [$w.panelTxt panes]
|
||||||
puts "$w $fileType $nb $fileFullPath"
|
DebugPuts "$w $fileType $nb $fileFullPath"
|
||||||
if [winfo exists $w.frmText2] {
|
if [winfo exists $w.frmText2] {
|
||||||
$w.panelTxt forget $w.frmText2
|
$w.panelTxt forget $w.frmText2
|
||||||
destroy $w.frmText2
|
destroy $w.frmText2
|
||||||
@@ -1603,6 +1606,7 @@ namespace eval Editor {
|
|||||||
|
|
||||||
set frmText [ttk::frame $w.frmText2 -border 1]
|
set frmText [ttk::frame $w.frmText2 -border 1]
|
||||||
$w.panelTxt add $frmText -weight 1
|
$w.panelTxt add $frmText -weight 1
|
||||||
|
# puts "SplitEditorForExecute: $w"
|
||||||
# focus -force $frmText.t.t
|
# focus -force $frmText.t.t
|
||||||
Execute $fileFullPath $frmText $w
|
Execute $fileFullPath $frmText $w
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ namespace eval FileOper {
|
|||||||
catch $cmd pipe
|
catch $cmd pipe
|
||||||
# puts $pipe
|
# puts $pipe
|
||||||
if [regexp -nocase -- {(\w+)/([\w\-_\.]+); charset=([[:alnum:]-]+)} $pipe m fType fExt fCharset] {
|
if [regexp -nocase -- {(\w+)/([\w\-_\.]+); charset=([[:alnum:]-]+)} $pipe m fType fExt fCharset] {
|
||||||
puts "$fType $fExt $fCharset"
|
DebugPuts "$fType $fExt $fCharset"
|
||||||
}
|
}
|
||||||
switch $opt {
|
switch $opt {
|
||||||
"charset" {
|
"charset" {
|
||||||
@@ -77,7 +77,7 @@ namespace eval FileOper {
|
|||||||
# линуксовый file не всегда корректно определяет тип файла
|
# линуксовый file не всегда корректно определяет тип файла
|
||||||
# используем пакет из tcl
|
# используем пакет из tcl
|
||||||
lassign [::fileutil::fileType $fileFullPath] fType fBinaryType fBinaryInterp
|
lassign [::fileutil::fileType $fileFullPath] fType fBinaryType fBinaryInterp
|
||||||
puts "File type is $fType, $fBinaryType, $fBinaryInterp"
|
DebugPuts "File type is $fType, $fBinaryType, $fBinaryInterp"
|
||||||
set ext [string tolower [file extension $fileFullPath]]
|
set ext [string tolower [file extension $fileFullPath]]
|
||||||
|
|
||||||
# Установка корректного типа для svg
|
# Установка корректного типа для svg
|
||||||
@@ -99,7 +99,7 @@ namespace eval FileOper {
|
|||||||
set fBinaryType "binary"
|
set fBinaryType "binary"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
puts "File type is $fType, $fBinaryType, $fBinaryInterp, $ext"
|
DebugPuts "File type is $fType, $fBinaryType, $fBinaryInterp, $ext"
|
||||||
|
|
||||||
switch $fType {
|
switch $fType {
|
||||||
"binary" {
|
"binary" {
|
||||||
@@ -298,9 +298,13 @@ namespace eval FileOper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc Close {} {
|
proc Close {{nbEditorWindow ""}} {
|
||||||
global nbEditor modified tree editors
|
global nbEditor modified tree editors
|
||||||
set nbItem [$nbEditor select]
|
if {$nbEditorWindow eq ""} {
|
||||||
|
set nbEditorWindow $nbEditor
|
||||||
|
}
|
||||||
|
set nbItem [$nbEditorWindow select]
|
||||||
|
# puts "Procedure FileOper::Close: item - $nbItem"
|
||||||
# puts "close tab $nbItem"
|
# puts "close tab $nbItem"
|
||||||
|
|
||||||
if {$nbItem == ""} {return}
|
if {$nbItem == ""} {return}
|
||||||
@@ -310,14 +314,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 $nbEditorWindow}
|
||||||
no {}
|
no {}
|
||||||
cancel {return "cancel"}
|
cancel {return "cancel"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$nbEditor forget $nbItem
|
if {[$nbEditorWindow select] eq $nbItem} {
|
||||||
destroy $nbItem
|
$nbEditorWindow 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
|
||||||
@@ -339,10 +345,11 @@ namespace eval FileOper {
|
|||||||
.frmStatus.lblPosition configure -text ""
|
.frmStatus.lblPosition configure -text ""
|
||||||
.frmStatus.lblEncoding configure -text ""
|
.frmStatus.lblEncoding configure -text ""
|
||||||
.frmStatus.lblSize configure -text ""
|
.frmStatus.lblSize configure -text ""
|
||||||
NB::NextTab $nbEditor 0
|
|
||||||
|
NB::NextTab $nbEditorWindow 0
|
||||||
}
|
}
|
||||||
|
|
||||||
proc Save {} {
|
proc Save {{type ""} {nbEditorWindow ""}} {
|
||||||
global nbEditor tree env activeProject dir
|
global nbEditor tree env activeProject dir
|
||||||
|
|
||||||
if [info exists activeProject] {
|
if [info exists activeProject] {
|
||||||
@@ -351,8 +358,15 @@ namespace eval FileOper {
|
|||||||
set dirProject $env(HOME)
|
set dirProject $env(HOME)
|
||||||
}
|
}
|
||||||
|
|
||||||
set nbEditorItem [$nbEditor select]
|
if {$nbEditorWindow eq ""} {
|
||||||
# puts "Saved editor text: $nbEditorItem"
|
set nbEditorWindow $nbEditor
|
||||||
|
set str [split [focus] "."]
|
||||||
|
set nbEditorWindow "[lindex $str 0].[lindex $str 1].[lindex $str 2]"
|
||||||
|
# puts "FileOper::Save: current window $nbEditorWindow"
|
||||||
|
}
|
||||||
|
# puts "FileOper::Save: $nbEditorWindow"
|
||||||
|
set nbEditorItem [$nbEditorWindow select]
|
||||||
|
DebugPuts "Saved editor text: $nbEditorItem"
|
||||||
if [string match "*untitled*" $nbEditorItem] {
|
if [string match "*untitled*" $nbEditorItem] {
|
||||||
set filePath [tk_getSaveFile -initialdir $dirProject -filetypes $::types -parent .]
|
set filePath [tk_getSaveFile -initialdir $dirProject -filetypes $::types -parent .]
|
||||||
if {$filePath eq ""} {
|
if {$filePath eq ""} {
|
||||||
@@ -360,7 +374,7 @@ namespace eval FileOper {
|
|||||||
}
|
}
|
||||||
# set fileName [string range $filePath [expr [string last "/" $filePath]+1] end]
|
# set fileName [string range $filePath [expr [string last "/" $filePath]+1] end]
|
||||||
set fileName [file tail $filePath]
|
set fileName [file tail $filePath]
|
||||||
$nbEditor tab $nbEditorItem -text $fileName
|
$nbEditorWindow tab $nbEditorItem -text $fileName
|
||||||
# set treeitem [Tree::InsertItem $tree {} $filePath "file" $fileName]
|
# set treeitem [Tree::InsertItem $tree {} $filePath "file" $fileName]
|
||||||
set lblName "lbl[string range $nbEditorItem [expr [string last "." $nbEditorItem] +1] end]"
|
set lblName "lbl[string range $nbEditorItem [expr [string last "." $nbEditorItem] +1] end]"
|
||||||
$nbEditorItem.header.$lblName configure -text $filePath
|
$nbEditorItem.header.$lblName configure -text $filePath
|
||||||
@@ -373,10 +387,16 @@ namespace eval FileOper {
|
|||||||
puts -nonewline $f $editedText
|
puts -nonewline $f $editedText
|
||||||
# puts "$f was saved"
|
# puts "$f was saved"
|
||||||
close $f
|
close $f
|
||||||
ResetModifiedFlag $nbEditorItem $nbEditor
|
ResetModifiedFlag $nbEditorItem $nbEditorWindow
|
||||||
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 {} {
|
||||||
@@ -477,12 +497,17 @@ namespace eval FileOper {
|
|||||||
$txt delete {end-1 line} end
|
$txt delete {end-1 line} end
|
||||||
# puts ">[$txt get {end-1 line} end]<"
|
# puts ">[$txt get {end-1 line} end]<"
|
||||||
}
|
}
|
||||||
|
# ------------
|
||||||
|
# Thanks https://github.com/wandrien/
|
||||||
|
# https://github.com/wandrien/projman/commit/7d5539ac2031fbdcb0f4a97465ff19d0c348cf33
|
||||||
|
$txt edit reset
|
||||||
|
# -----------
|
||||||
$txt see 1.0
|
$txt see 1.0
|
||||||
}
|
}
|
||||||
|
|
||||||
proc Edit {fileFullPath {nbEditor .frmWork.nbEditor}} {
|
proc Edit {fileFullPath {nbEditor .frmWork.nbEditor}} {
|
||||||
global tree
|
global tree
|
||||||
puts "$fileFullPath"
|
DebugPuts "$fileFullPath"
|
||||||
if {[file exists $fileFullPath] == 0} {
|
if {[file exists $fileFullPath] == 0} {
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace eval Git {
|
|||||||
}
|
}
|
||||||
if {[catch {exec {*}$cmd} git_path]} {
|
if {[catch {exec {*}$cmd} git_path]} {
|
||||||
puts "Git не найден в системе"
|
puts "Git не найден в системе"
|
||||||
set cfgVariables(gitCommand) "Git not found"
|
set cfgVariables(gitCommand) ""
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
set git_path [string trim $git_path]
|
set git_path [string trim $git_path]
|
||||||
|
|||||||
28
lib/gui.tcl
28
lib/gui.tcl
@@ -25,8 +25,8 @@ bind . <Control-q> Quit
|
|||||||
bind . <Control-Q> Quit
|
bind . <Control-Q> Quit
|
||||||
bind . <Control-Cyrillic_shorti> Quit
|
bind . <Control-Cyrillic_shorti> Quit
|
||||||
bind . <Control-eacute> Quit
|
bind . <Control-eacute> Quit
|
||||||
bind . <Insert> Add
|
# bind . <Insert> Add
|
||||||
bind . <Delete> Del
|
# bind . <Delete> Del
|
||||||
bind . <F1> ShowHelpDialog
|
bind . <F1> ShowHelpDialog
|
||||||
bind . <Control-n> Editor::New
|
bind . <Control-n> Editor::New
|
||||||
bind . <Control-N> Editor::New
|
bind . <Control-N> Editor::New
|
||||||
@@ -62,6 +62,21 @@ bind . <Alt-Cyrillic_el> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# -------------
|
||||||
|
# Thanks https://github.com/wandrien/
|
||||||
|
# https://github.com/wandrien/projman/commit/22f6e235c3532c20573d44ee7eaaaa1fb56ad544
|
||||||
|
event add <<Copy>> <Control-Insert>
|
||||||
|
event add <<Paste>> <Shift-Insert>
|
||||||
|
event add <<Cut>> <Shift-Delete>
|
||||||
|
|
||||||
|
set latestTxtWidget {}
|
||||||
|
bind all <FocusIn> {
|
||||||
|
if {[winfo class %W] eq "Ctext"} {
|
||||||
|
global latestTxtWidget
|
||||||
|
set latestTxtWidget %W
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# ---------
|
||||||
bind . <Control-s> {FileOper::Save}
|
bind . <Control-s> {FileOper::Save}
|
||||||
bind . <Control-S> {FileOper::Save}
|
bind . <Control-S> {FileOper::Save}
|
||||||
bind . <Control-Cyrillic_hardsign> {FileOper::Save}
|
bind . <Control-Cyrillic_hardsign> {FileOper::Save}
|
||||||
@@ -128,9 +143,14 @@ pack .frmMenu.mnuHelp -side right
|
|||||||
|
|
||||||
# PopUP menu
|
# PopUP menu
|
||||||
menu .popup
|
menu .popup
|
||||||
GetFileMenu .popup
|
|
||||||
GetEditMenu .popup
|
GetEditMenu .popup
|
||||||
GetViewMenu .popup
|
.popup add separator
|
||||||
|
menu .popup.file
|
||||||
|
.popup add cascade -label [::msgcat::mc "File"] -menu .popup.file
|
||||||
|
GetFileMenu .popup.file
|
||||||
|
menu .popup.view
|
||||||
|
.popup add cascade -label [::msgcat::mc "View"] -menu .popup.view
|
||||||
|
GetViewMenu .popup.view
|
||||||
|
|
||||||
set frmTool [ttk::frame .frmBody.frmTool]
|
set frmTool [ttk::frame .frmBody.frmTool]
|
||||||
ttk::panedwindow .frmBody.panel -orient horizontal -style TPanedwindow
|
ttk::panedwindow .frmBody.panel -orient horizontal -style TPanedwindow
|
||||||
|
|||||||
@@ -51,11 +51,16 @@ namespace eval NB {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if {[$w identify $x $y] == "close_button"} {
|
if {[$w identify $x $y] == "close_button"} {
|
||||||
FileOper::Close
|
# puts "NB::PressTab: w - $w"
|
||||||
|
FileOper::Close $w
|
||||||
} else {
|
} else {
|
||||||
set txt [$w select].frmText.t
|
set txt [$w select].frmText.t
|
||||||
if [winfo exists $txt] {
|
if {[winfo exists [$w select].frmText2] == 1} {
|
||||||
focus -force $txt.t
|
focus -force [$w select].frmText2.frame.text.t
|
||||||
|
} else {
|
||||||
|
if [winfo exists $txt] {
|
||||||
|
focus -force $txt.t
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,7 +68,12 @@ namespace eval NB {
|
|||||||
proc NextTab {w step} {
|
proc NextTab {w step} {
|
||||||
global tree
|
global tree
|
||||||
set i [expr [$w index end] - 1]
|
set i [expr [$w index end] - 1]
|
||||||
|
# puts "NB::NextTab $w"
|
||||||
if {[$w select] eq ""} {
|
if {[$w select] eq ""} {
|
||||||
|
# puts "NB::NextTab no items availabels"
|
||||||
|
if {$w eq ".frmWork.nbEditor2"} {
|
||||||
|
.frmWork.panelNB forget .frmWork.nbEditor2
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
set nbItemIndex [$w index [$w select]]
|
set nbItemIndex [$w index [$w select]]
|
||||||
@@ -75,13 +85,17 @@ namespace eval NB {
|
|||||||
$w select [expr $nbItemIndex + $step]
|
$w select [expr $nbItemIndex + $step]
|
||||||
}
|
}
|
||||||
set nbItem [string trimleft [$w select] "$w."]
|
set nbItem [string trimleft [$w select] "$w."]
|
||||||
# puts $nbItem
|
|
||||||
append treeItemName "file" "::" $nbItem
|
append treeItemName "file" "::" $nbItem
|
||||||
Tree::SelectItem $treeItemName
|
Tree::SelectItem $treeItemName
|
||||||
|
|
||||||
set txt [$w select].frmText.t
|
set txt [$w select].frmText.t
|
||||||
if [winfo exists $txt] {
|
DebugPuts "NextTab: [$w select]"
|
||||||
focus -force $txt.t
|
if {[winfo exists [$w select].frmText2] == 1} {
|
||||||
|
focus -force [$w select].frmText2.frame.text.t
|
||||||
|
} else {
|
||||||
|
if [winfo exists $txt] {
|
||||||
|
focus -force $txt.t
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,9 +195,19 @@ proc ResetModifiedFlag {w nbEditor} {
|
|||||||
# puts "ResetModifiedFlag: $lbl"
|
# puts "ResetModifiedFlag: $lbl"
|
||||||
$nbEditor tab $w -text $lbl
|
$nbEditor tab $w -text $lbl
|
||||||
}
|
}
|
||||||
proc SetModifiedFlag {w nbEditor} {
|
proc SetModifiedFlag {w nbEditor flag} {
|
||||||
global modified
|
global modified
|
||||||
#$w.frmText.t edit modified false
|
# ------------
|
||||||
|
# Thanks https://github.com/wandrien/
|
||||||
|
# https://github.com/wandrien/projman/commit/04e5c892ae06d3e013472d292cd4435804184f6b
|
||||||
|
if {$flag eq "force"} {
|
||||||
|
$w.frmText.t edit modified true
|
||||||
|
} else {
|
||||||
|
if {![$w.frmText.t edit modified]} {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# ---------
|
||||||
set modified($w) "true"
|
set modified($w) "true"
|
||||||
set lbl [$nbEditor tab $w -text]
|
set lbl [$nbEditor tab $w -text]
|
||||||
# puts "SetModifiedFlag: $w; $modified($w); >$lbl<"
|
# puts "SetModifiedFlag: $w; $modified($w); >$lbl<"
|
||||||
@@ -828,6 +838,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) ##
|
## MAKE PROJ PROCEDURE (RUNNING PROJECT) ##
|
||||||
proc Execute {filePath w activeEditor} {
|
proc Execute {filePath w activeEditor} {
|
||||||
global activeProject cfgVariables
|
global activeProject cfgVariables
|
||||||
@@ -847,37 +895,38 @@ proc Execute {filePath w activeEditor} {
|
|||||||
frame $w.frame -borderwidth 2 -relief ridge -background $cfgVariables(backGround)
|
frame $w.frame -borderwidth 2 -relief ridge -background $cfgVariables(backGround)
|
||||||
pack $w.frame -side top -fill both -expand true
|
pack $w.frame -side top -fill both -expand true
|
||||||
|
|
||||||
|
set txt $w.frame.text
|
||||||
ctext $w.frame.text -yscrollcommand "$w.frame.yscroll set" \
|
ctext $txt -yscrollcommand "$w.frame.yscroll set" -linemap 0 \
|
||||||
-bg $cfgVariables(backGround) -fg $cfgVariables(foreground) \
|
-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
|
-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
|
|
||||||
|
|
||||||
pack $w.frame.text -side left -fill both -expand true
|
scrollbar $w.frame.yscroll -relief sunken -borderwidth {1} -width {10} -takefocus 0 \
|
||||||
|
-command "$txt yview" -background $cfgVariables(backGround)
|
||||||
|
Highlight::ExecuteColorized $txt
|
||||||
|
|
||||||
|
pack $txt -side left -fill both -expand true
|
||||||
pack $w.frame.yscroll -side left -fill y
|
pack $w.frame.yscroll -side left -fill y
|
||||||
|
|
||||||
bind $w.frame.text <Return> [list Run $w $filePath]
|
bind $txt <Return> [list Run $w $filePath]
|
||||||
bind $w.frame.text <Control-r> [list CloseExecuteDialog $w $activeEditor]
|
bind $txt <Control-r> [list CloseExecuteDialog $w $activeEditor]
|
||||||
bind $w.frame.text <Control-Cyrillic_er> [list CloseExecuteDialog $w $activeEditor]
|
bind $txt <Control-Cyrillic_er> [list CloseExecuteDialog $w $activeEditor]
|
||||||
# focus -force $w.frmBtn.btnOk
|
# focus -force $w.frmBtn.btnOk
|
||||||
# $noteBook raise $node
|
# $noteBook raise $node
|
||||||
# insert debug data into text widget #
|
# insert debug data into text widget #
|
||||||
$w.frame.text tag configure bold -font $cfgVariables(fontBold)
|
$txt tag configure bold -font $cfgVariables(fontBold)
|
||||||
$w.frame.text tag configure error -font $cfgVariables(fontBold) -foreground red
|
$txt tag configure error -font $cfgVariables(fontBold) -foreground red
|
||||||
$w.frame.text tag add bold 0.0 0.end
|
$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 pos [$w.frame.text index insert]
|
||||||
set lineNum [lindex [split $pos "."] 0]
|
set lineNum [lindex [split $pos "."] 0]
|
||||||
$w.frame.text insert 0.0 "======================================================================================\n"
|
$w.frame.text insert 0.0 "======================================================================================\n"
|
||||||
|
|
||||||
# Added executor from config
|
# Added executor from config
|
||||||
set fileType [string toupper [string trimleft [file extension $filePath] "."]]
|
set fileType [string toupper [string trimleft [file extension $filePath] "."]]
|
||||||
if {[info exists cfgVariables(fileType)] == 0} {
|
if {[info exists cfgVariables($fileType)] != 0 && $cfgVariables($fileType) ne ""} {
|
||||||
$w.frame.text insert end "$cfgVariables($fileType) "
|
$w.frame.text insert end "$cfgVariables($fileType) %f"
|
||||||
}
|
}
|
||||||
unset fileType
|
unset fileType
|
||||||
# $w.frame.text insert end [string toupper [string trimleft [file extension $filePath] "."]]
|
# $w.frame.text insert end [string toupper [string trimleft [file extension $filePath] "."]]
|
||||||
@@ -885,7 +934,70 @@ proc Execute {filePath w activeEditor} {
|
|||||||
|
|
||||||
$w.frame.text tag add bold $lineNum.0 $lineNum.end
|
$w.frame.text tag add bold $lineNum.0 $lineNum.end
|
||||||
Highlight::ExecuteColorized $w.frame.text
|
Highlight::ExecuteColorized $w.frame.text
|
||||||
|
|
||||||
# focus -force $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
|
focus -force $w.frame.text.t
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -962,10 +1074,10 @@ proc SendSignal {pid signal} {
|
|||||||
if {$tcl_platform(platform) eq "unix"} {
|
if {$tcl_platform(platform) eq "unix"} {
|
||||||
# На Unix-системах
|
# На Unix-системах
|
||||||
switch -- $signal {
|
switch -- $signal {
|
||||||
"SIGINT" { exec kill -INT $pid } ; # Ctrl+C
|
"SIGINT" {catch {exec kill -INT $pid}} ; # Ctrl+C
|
||||||
"SIGTERM" { exec kill -TERM $pid } ; # Завершение
|
"SIGTERM" {catch {exec kill -TERM $pid}} ; # Завершение
|
||||||
"SIGTSTP" { exec kill -TSTP $pid } ; # Ctrl+Z (приостановка)
|
"SIGTSTP" {catch {exec kill -TSTP $pid}} ; # Ctrl+Z (приостановка)
|
||||||
"SIGKILL" { exec kill -KILL $pid } ; # Принудительное завершение
|
"SIGKILL" {catch {exec kill -KILL $pid}} ; # Принудительное завершение
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
# На Windows
|
# На Windows
|
||||||
@@ -982,6 +1094,8 @@ proc SendSignal {pid signal} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Правка файла настроек
|
# Правка файла настроек
|
||||||
proc Settings {} {
|
proc Settings {} {
|
||||||
global dir
|
global dir
|
||||||
@@ -1000,11 +1114,11 @@ proc ExecutorCommandPathSetting {fileType} {
|
|||||||
} else {
|
} else {
|
||||||
set cmd "which $cfgVariables($fileType)"
|
set cmd "which $cfgVariables($fileType)"
|
||||||
}
|
}
|
||||||
puts "ExecutorCommandPathSetting $fileType"
|
DebugPuts "ExecutorCommandPathSetting $fileType"
|
||||||
puts [catch {exec {*}$cmd} executor_path]
|
DebugPuts [catch {exec {*}$cmd} executor_path]
|
||||||
puts "executor_path $executor_path"
|
DebugPuts "executor_path $executor_path"
|
||||||
if {[catch {exec {*}$cmd} executor_path]} {
|
if {[catch {exec {*}$cmd} executor_path]} {
|
||||||
puts "Программа $cfgVariables($fileType) для выполнения файлов $fileType не найдена в системе"
|
DebugPuts "Программа $cfgVariables($fileType) для выполнения файлов $fileType не найдена в системе"
|
||||||
set cfgVariables($fileType) ""
|
set cfgVariables($fileType) ""
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -1013,10 +1127,50 @@ proc ExecutorCommandPathSetting {fileType} {
|
|||||||
|
|
||||||
# puts "Git найден: $first_path"
|
# puts "Git найден: $first_path"
|
||||||
set cfgVariables($fileType) $first_path
|
set cfgVariables($fileType) $first_path
|
||||||
puts "first_path $first_path"
|
DebugPuts "first_path $first_path"
|
||||||
}
|
}
|
||||||
if {[info exists cfgVariables($fileType)] == 0} {
|
if {[info exists cfgVariables($fileType)] == 0} {
|
||||||
set cfgVariables($fileType) ""
|
set cfgVariables($fileType) ""
|
||||||
puts $cfgVariables($fileType)
|
DebugPuts $cfgVariables($fileType)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# -----------
|
||||||
|
# Thanks https://github.com/wandrien/
|
||||||
|
# https://github.com/wandrien/projman/commit/22f6e235c3532c20573d44ee7eaaaa1fb56ad544
|
||||||
|
proc SendEventToLatestTxtWidget {ev} {
|
||||||
|
global latestTxtWidget
|
||||||
|
if {$latestTxtWidget eq ""} {
|
||||||
|
return
|
||||||
|
} elseif {[winfo exists $latestTxtWidget] && [winfo class $latestTxtWidget] eq "Ctext"} {
|
||||||
|
event generate ${latestTxtWidget}.t $ev
|
||||||
|
} else {
|
||||||
|
set latestTxtWidget ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
proc Cut {} { SendEventToLatestTxtWidget <<Cut>> }
|
||||||
|
proc Copy {} { SendEventToLatestTxtWidget <<Copy>> }
|
||||||
|
proc Paste {} { SendEventToLatestTxtWidget <<Paste>> }
|
||||||
|
proc Undo {} { SendEventToLatestTxtWidget <<Undo>> }
|
||||||
|
proc Redo {} { SendEventToLatestTxtWidget <<Redo>> }
|
||||||
|
# ------------
|
||||||
|
|
||||||
|
proc DebugPuts {msg} {
|
||||||
|
global cfgVariables
|
||||||
|
if ![info exists cfgVariables(debug)] {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
if ![info exists cfgVariables(debugOut)] {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
if {$cfgVariables(debug) eq "true"} {
|
||||||
|
if {$cfgVariables(debugOut) eq "stdout"} {
|
||||||
|
puts "$msg"
|
||||||
|
} elseif {$cfgVariables(debugOut) ne "" } {
|
||||||
|
set logFile [open $cfgVariables(debugOut) "a+"]
|
||||||
|
puts $logFile $::configDefault
|
||||||
|
close $logFile
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ namespace eval Tree {
|
|||||||
set key [lindex [split $id "::"] 0]
|
set key [lindex [split $id "::"] 0]
|
||||||
if {$values eq "" || $key eq ""} {return}
|
if {$values eq "" || $key eq ""} {return}
|
||||||
|
|
||||||
puts "$key $tree $values"
|
DebugPuts "$key $tree $values"
|
||||||
switch -regexp $key {
|
switch -regexp $key {
|
||||||
directory {
|
directory {
|
||||||
FileOper::ReadFolder $values
|
FileOper::ReadFolder $values
|
||||||
@@ -114,7 +114,7 @@ namespace eval Tree {
|
|||||||
}
|
}
|
||||||
file {
|
file {
|
||||||
set v [FileOper::Edit $values $nbEditor]
|
set v [FileOper::Edit $values $nbEditor]
|
||||||
puts $v
|
DebugPuts $v
|
||||||
if {$v eq false} {
|
if {$v eq false} {
|
||||||
$tree delete $id
|
$tree delete $id
|
||||||
}
|
}
|
||||||
|
|||||||
85
openbsd/build-package-bsd.sh
Executable file
85
openbsd/build-package-bsd.sh
Executable file
@@ -0,0 +1,85 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# create-openbsd-pkg.sh
|
||||||
|
|
||||||
|
PKG_NAME="projman"
|
||||||
|
WORK_DIR=projman_openbsd
|
||||||
|
VERSION=$(grep Version ../projman.tcl | grep -oE '\b[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}\b')
|
||||||
|
RELEASE=$(grep "# Release" ../projman.tcl | grep -oE '[0-9A-Za-z]+$')
|
||||||
|
BUILD_DATE=$(date +%d%m%Y%H%M%S)
|
||||||
|
TXT="# Build: ${BUILD_DATE}"
|
||||||
|
echo "$VERSION, $RELEASE, $BUILD_DATE"
|
||||||
|
|
||||||
|
PKG_VERSION="${VERSION}${RELEASE}"
|
||||||
|
PKG_FULLNAME="${PKG_NAME}-${PKG_VERSION}"
|
||||||
|
|
||||||
|
mkdir -p ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin
|
||||||
|
mkdir -p ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman
|
||||||
|
mkdir -p ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/man/man1
|
||||||
|
|
||||||
|
cp -r ../lib ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
|
||||||
|
cp -r ../theme ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
|
||||||
|
cp ../projman.tcl ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
|
||||||
|
cp ../changelog-gen.tcl ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/changeloggen
|
||||||
|
cp ../tkregexp.tcl ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/tkregexp
|
||||||
|
cp ../LICENSE ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
|
||||||
|
cp ../README.md ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
|
||||||
|
cp ../CHANGELOG ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
|
||||||
|
cp ../projman.desktop ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
|
||||||
|
cp ../projman.png ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
|
||||||
|
|
||||||
|
sed -i "/# Build:.*/c$TXT" ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
|
||||||
|
|
||||||
|
# ./changelog-gen.tcl --project-name projman --project-version ${VERSION} --project-release ${RELEASE} --out-file debian/changelog --deb --last
|
||||||
|
|
||||||
|
sed -i "s+^set\ dir(lib)+set\ dir(lib)\ /usr/local/share/projman/lib ;#+g" ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
|
||||||
|
|
||||||
|
sed -i "s+\[pwd\]+/usr/local/share/projman+g" ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
|
||||||
|
|
||||||
|
# cat > ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman << 'EOF'
|
||||||
|
# #!/bin/sh
|
||||||
|
# exec /usr/local/bin/wish8.6 "/usr/local/share/projman/projman.tcl" "$@"
|
||||||
|
# EOF
|
||||||
|
# chmod +x ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
|
||||||
|
|
||||||
|
cat > ${WORK_DIR}/${PKG_FULLNAME}/+CONTENTS << EOF
|
||||||
|
@name ${PKG_NAME}-${PKG_VERSION}
|
||||||
|
@version ${PKG_VERSION}
|
||||||
|
@depend lang/tk:tk-*:tcl-*
|
||||||
|
@depend devel/tcllib:tcllib-*:tcl-*
|
||||||
|
@depend devel/tklib:tklib-*:tcl-*
|
||||||
|
@comment Editor for Tcl/Tk and other languages.
|
||||||
|
@arch amd64
|
||||||
|
@wantlib pthread
|
||||||
|
@ignore
|
||||||
|
@cwd /usr/local
|
||||||
|
EOF
|
||||||
|
|
||||||
|
(cd ${WORK_DIR}/${PKG_FULLNAME}/usr/local && find . -type f | sed 's/^\.\///') | while read file; do
|
||||||
|
echo "$file" >> ${WORK_DIR}/${PKG_FULLNAME}/+CONTENTS
|
||||||
|
done
|
||||||
|
|
||||||
|
cat >> ${WORK_DIR}/${PKG_FULLNAME}/+CONTENTS << 'EOF'
|
||||||
|
@exec mkdir -p /var/log/projman 2>/dev/null || true
|
||||||
|
@exec echo "Package ${PKG_NAME} installed successfully"
|
||||||
|
@unexec rm -rf /var/log/projman 2>/dev/null || true
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "ProjMan is a code editor writen in TCL/Tk" > ${WORK_DIR}/${PKG_FULLNAME}/+COMMENT
|
||||||
|
|
||||||
|
cat > ${WORK_DIR}/${PKG_FULLNAME}/+DESC << 'EOF'
|
||||||
|
ProjMan (also known as "Tcl/Tk Project Manager") is a feature-rich editor
|
||||||
|
for programming in Tcl/Tk and other languages.
|
||||||
|
|
||||||
|
It includes a source editor with syntax highlighting and
|
||||||
|
code navigation, a context-sensitive help system, Git support, a
|
||||||
|
pseudo-terminal, image viewer and much more.
|
||||||
|
|
||||||
|
Supported languages for highlighting and navigation:
|
||||||
|
Tcl/Tk, GO, Perl, Python, Ruby, Shell (BASH), Markdown, YAML (Ansible), Lua.
|
||||||
|
EOF
|
||||||
|
|
||||||
|
(cd ${WORK_DIR} && tar -czf ../../../${PKG_FULLNAME}.tgz ${PKG_FULLNAME}/)
|
||||||
|
|
||||||
|
echo "Package created: ${PKG_FULLNAME}.tgz"
|
||||||
|
|
||||||
|
rm -rf ${WORK_DIR}
|
||||||
22
projman.tcl
22
projman.tcl
@@ -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
|
||||||
@@ -8,9 +8,9 @@ exec wish9.0 "$0" -- "$@"
|
|||||||
# Author: Sergey Kalinin svk@nuk-svk.ru
|
# Author: Sergey Kalinin svk@nuk-svk.ru
|
||||||
# Home page: https://nuk-svk.ru
|
# Home page: https://nuk-svk.ru
|
||||||
######################################################
|
######################################################
|
||||||
# Version: 2.1.0
|
# Version: 2.0.0
|
||||||
# Release: alpha0
|
# Release: beta1
|
||||||
# Build: 10112025132121
|
# Build: 22012026174911
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
# определим текущую версию, релиз и т.д.
|
# определим текущую версию, релиз и т.д.
|
||||||
@@ -34,7 +34,6 @@ while {[gets $f line] >=0} {
|
|||||||
}
|
}
|
||||||
close $f
|
close $f
|
||||||
|
|
||||||
|
|
||||||
package require msgcat
|
package require msgcat
|
||||||
package require inifile
|
package require inifile
|
||||||
package require ctext
|
package require ctext
|
||||||
@@ -49,7 +48,7 @@ proc PackagePresent {pkg} {
|
|||||||
foreach item [package names] {
|
foreach item [package names] {
|
||||||
# puts [string match -nocase Img $item]
|
# puts [string match -nocase Img $item]
|
||||||
if {[string match -nocase Img $item] == 1} {
|
if {[string match -nocase Img $item] == 1} {
|
||||||
puts "The $pkg package was found"
|
# puts "The $pkg package was found"
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,7 +69,7 @@ if { $::argc > 0 } {
|
|||||||
foreach arg $::argv {
|
foreach arg $::argv {
|
||||||
lappend opened $arg
|
lappend opened $arg
|
||||||
}
|
}
|
||||||
puts $opened
|
# puts $opened
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -98,7 +97,7 @@ source [file join $dir(lib) config.tcl]
|
|||||||
foreach modFile [lsort [glob -nocomplain [file join $dir(lib) *.tcl]]] {
|
foreach modFile [lsort [glob -nocomplain [file join $dir(lib) *.tcl]]] {
|
||||||
if {[file tail $modFile] ne "gui.tcl" && [file tail $modFile] ne "config.tcl"} {
|
if {[file tail $modFile] ne "gui.tcl" && [file tail $modFile] ne "config.tcl"} {
|
||||||
source $modFile
|
source $modFile
|
||||||
puts "Loading module $modFile"
|
# puts "Loading module $modFile"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,10 +106,10 @@ set dir(theme) "[file join $dir(root) theme]"
|
|||||||
foreach modFile [lsort [glob -nocomplain [file join $dir(theme) *]]] {
|
foreach modFile [lsort [glob -nocomplain [file join $dir(theme) *]]] {
|
||||||
if [file isdirectory $modFile] {
|
if [file isdirectory $modFile] {
|
||||||
source $modFile/[file tail $modFile].tcl
|
source $modFile/[file tail $modFile].tcl
|
||||||
puts "Loading theme $modFile.tcl"
|
# puts "Loading theme $modFile.tcl"
|
||||||
} elseif {[file extension $modFile] eq ".tcl"} {
|
} elseif {[file extension $modFile] eq ".tcl"} {
|
||||||
source $modFile
|
source $modFile
|
||||||
puts "Loading theme $modFile"
|
# puts "Loading theme $modFile"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,13 +119,14 @@ if {[file exists [file join $dir(cfg) projman.ini]] ==0} {
|
|||||||
Config::create $dir(cfg)
|
Config::create $dir(cfg)
|
||||||
}
|
}
|
||||||
Config::read $dir(cfg)
|
Config::read $dir(cfg)
|
||||||
|
Config::CheckVariables
|
||||||
|
|
||||||
::msgcat::mclocale $cfgVariables(locale)
|
::msgcat::mclocale $cfgVariables(locale)
|
||||||
|
|
||||||
if [::msgcat::mcload [file join $dir(lib) msgs]] {
|
if [::msgcat::mcload [file join $dir(lib) msgs]] {
|
||||||
puts "Load locale messages... OK"
|
puts "Load locale messages... OK"
|
||||||
}
|
}
|
||||||
puts "Setting the locale... [::msgcat::mclocale]"
|
DebugPuts "Setting the locale... [::msgcat::mclocale]"
|
||||||
|
|
||||||
source [file join $dir(lib) gui.tcl]
|
source [file join $dir(lib) gui.tcl]
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ namespace eval ttk::theme::black {
|
|||||||
-foreground [list selected $colors(-selectfg)] \
|
-foreground [list selected $colors(-selectfg)] \
|
||||||
-highlightbackground [list selected $colors(-lighter)]
|
-highlightbackground [list selected $colors(-lighter)]
|
||||||
}
|
}
|
||||||
puts [ttk::style element names]
|
# puts [ttk::style element names]
|
||||||
}
|
}
|
||||||
|
|
||||||
# A few tricks for Tablelist.
|
# A few tricks for Tablelist.
|
||||||
|
|||||||
Reference in New Issue
Block a user