Compare commits
79 Commits
53869b8fe4
...
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 | ||
|
|
e534b27407 | ||
|
|
45cbd7845b | ||
|
|
b830838f8e | ||
|
|
ef87b88156 | ||
| 264368c61f | |||
| c38dffeeb9 | |||
| df1d9aa36d | |||
| cff798a9f1 | |||
| 64287f1a01 | |||
| 5e1c057bc5 | |||
| ab740f0be8 | |||
| 4c6713b2d3 | |||
| dc5fd60c0d | |||
| c3848566df | |||
| 961d597032 | |||
| 5d70d508cd | |||
| 8619e3e1f4 | |||
| 8834c0954e | |||
| 4e67dbfccf | |||
| e5b0468a44 | |||
| a9ac54ce54 | |||
| 297d0f7420 | |||
| 9b083515ba | |||
| 722bbc4e30 | |||
| bdb9b2db00 | |||
| 22bdd7b87e | |||
| 430f7d6607 | |||
|
|
f54333f942 | ||
|
|
f6a1b440f7 | ||
|
|
9b69e94412 | ||
|
|
8a1145a2d9 | ||
|
|
a78ab384ad | ||
|
|
b04e62434a | ||
|
|
439993091f | ||
|
|
7524a58f26 | ||
|
|
a6a220eb5a |
@@ -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"
|
||||||
|
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -5,4 +5,6 @@ debian/projman.substvars
|
|||||||
debian/files
|
debian/files
|
||||||
debian/projman.debhelper.log
|
debian/projman.debhelper.log
|
||||||
debian/*.tmp
|
debian/*.tmp
|
||||||
|
debian/errors
|
||||||
*.tmp
|
*.tmp
|
||||||
|
errors
|
||||||
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: Добавлена генерация текстового журнала изменений
|
||||||
|
|||||||
17
README.md
17
README.md
@@ -69,6 +69,17 @@ tcllib, tklib
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
- A pseudo-terminal for launching the edited file and other command
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- Image viewer
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
## Getting source code
|
## Getting source code
|
||||||
|
|
||||||
Download the source code https://git.nuk-svk.ru/svk/projman/
|
Download the source code https://git.nuk-svk.ru/svk/projman/
|
||||||
@@ -120,7 +131,6 @@ Or type "projman" into terminal, Or choose the name of the program "Projman" on
|
|||||||
- Ctrl-N - Create new file
|
- Ctrl-N - Create new file
|
||||||
- Ctrl-O - Open file
|
- Ctrl-O - Open file
|
||||||
- Ctrl-W - Close editor (file)
|
- Ctrl-W - Close editor (file)
|
||||||
- Ctrl-K - Open folder
|
|
||||||
- Ctrl-Q - Quit from ProjMan
|
- Ctrl-Q - Quit from ProjMan
|
||||||
- Ctrl-J - Show procedures (functions) list for navigation in open editor
|
- Ctrl-J - Show procedures (functions) list for navigation in open editor
|
||||||
- Ctrl-L - Find and display files where the variable is defined, the name of which is located under the cursor in the editor
|
- Ctrl-L - Find and display files where the variable is defined, the name of which is located under the cursor in the editor
|
||||||
@@ -134,6 +144,10 @@ Or type "projman" into terminal, Or choose the name of the program "Projman" on
|
|||||||
- Ctrl-G - Go to line dialog
|
- Ctrl-G - Go to line dialog
|
||||||
- Ctrl-C - Copy selected text into buffer
|
- Ctrl-C - Copy selected text into buffer
|
||||||
- Ctrl-V - Paste text from buffer
|
- Ctrl-V - Paste text from buffer
|
||||||
|
- Ctrl-R - Open terminal for edited file
|
||||||
|
- Ctrl-Z - Send SIGTSTP signal
|
||||||
|
- Ctrl-D - Send SIGINT signal
|
||||||
|
- Ctrl-C - Send SIGKILL signal
|
||||||
|
|
||||||
- Alt-P - Show/Hide the file tree panel
|
- Alt-P - Show/Hide the file tree panel
|
||||||
- Alt-W - Delete the current word
|
- Alt-W - Delete the current word
|
||||||
@@ -142,6 +156,7 @@ Or type "projman" into terminal, Or choose the name of the program "Projman" on
|
|||||||
- Alt-R - Delete current line
|
- Alt-R - Delete current line
|
||||||
- Alt-Y - Copy current line into buffer
|
- Alt-Y - Copy current line into buffer
|
||||||
- Alt-S - Split the edited window horizontally
|
- Alt-S - Split the edited window horizontally
|
||||||
|
- Alt-K - Open folder
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
|||||||
5
TODO
5
TODO
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
--- Ansible ---
|
--- Ansible ---
|
||||||
1. Определение всех переменных в отдельный список
|
1. Определение всех переменных в отдельный список
|
||||||
- внутри файла, конструкции вида:
|
- внутри файла, конструкции вида:
|
||||||
set_fact:
|
set_fact:
|
||||||
varName: value
|
varName: value
|
||||||
set_fact varName value
|
set_fact varName value
|
||||||
@@ -18,5 +18,4 @@
|
|||||||
- var1.yml
|
- var1.yml
|
||||||
- var2.yml
|
- var2.yml
|
||||||
|
|
||||||
3. Если используется роль и переменная не найдена в плэйбуке то искать в роли (не факт что требуется)
|
3. Если используется роль и переменная не найдена в плэйбуке
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Tcl ignores the next line -*- tcl -*- \
|
# Tcl ignores the next line -*- tcl -*- \
|
||||||
exec tclsh "$0" -- "$@"
|
exec tclsh8.6 "$0" -- "$@"
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# ProjMan 2
|
# ProjMan 2
|
||||||
@@ -334,4 +334,3 @@ if [info exists args(--txt)] {
|
|||||||
StoreChangeLog $outText
|
StoreChangeLog $outText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
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"
|
||||||
|
|||||||
132
debian/changelog
vendored
132
debian/changelog
vendored
@@ -1,3 +1,123 @@
|
|||||||
|
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
|
||||||
|
|
||||||
projman (2.0.0-alpha16) stable; urgency=medium
|
projman (2.0.0-alpha16) stable; urgency=medium
|
||||||
|
|
||||||
* build-deb-projman.sh: добавлена генерация changelog из git log
|
* build-deb-projman.sh: добавлена генерация changelog из git log
|
||||||
@@ -336,3 +456,15 @@ projman (2.0.0-alfa0) stable; urgency=medium
|
|||||||
|
|
||||||
-- svkalinin <banzaj28@yandex.ru> Thu, 5 Jul 2018 08:41:18 +0300
|
-- svkalinin <banzaj28@yandex.ru> Thu, 5 Jul 2018 08:41:18 +0300
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ set ::configDefault "\[General\]
|
|||||||
cfgModifyDate=''
|
cfgModifyDate=''
|
||||||
searchCommand=/usr/bin/grep
|
searchCommand=/usr/bin/grep
|
||||||
searchCommandOptions=-r -n -H
|
searchCommandOptions=-r -n -H
|
||||||
gitCommand=/usr/bin/git
|
gitCommand=
|
||||||
# must return a mime type of file
|
# must return a mime type of file
|
||||||
fileTypeCommand=/usr/bin/file
|
fileTypeCommand=/usr/bin/file
|
||||||
fileTypeCommandOptions=-i -b
|
fileTypeCommandOptions=-i -b
|
||||||
@@ -37,7 +37,7 @@ menuShow=true
|
|||||||
statusBarShow=true
|
statusBarShow=true
|
||||||
filesPanelShow=true
|
filesPanelShow=true
|
||||||
filesPanelPlace=left
|
filesPanelPlace=left
|
||||||
geometry=1024x768
|
geometry=800x600
|
||||||
guiFont={Droid Sans Mono} 9
|
guiFont={Droid Sans Mono} 9
|
||||||
guiFontBold={Droid Sans Mono} 9 bold
|
guiFontBold={Droid Sans Mono} 9 bold
|
||||||
guiFG=#cccccc
|
guiFG=#cccccc
|
||||||
@@ -64,6 +64,20 @@ multilineComments=true
|
|||||||
\[UserSession\]
|
\[UserSession\]
|
||||||
opened=
|
opened=
|
||||||
editedFiles=
|
editedFiles=
|
||||||
|
recentFolder=
|
||||||
|
\[Executor\]
|
||||||
|
TCL=tclsh
|
||||||
|
GO=go
|
||||||
|
PY=python3
|
||||||
|
SH=bash
|
||||||
|
PL=perl
|
||||||
|
RB=ruby
|
||||||
|
HTM=firefox
|
||||||
|
HTML=firefox
|
||||||
|
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+"]
|
||||||
@@ -120,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"
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
153
lib/editor.tcl
153
lib/editor.tcl
@@ -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
|
||||||
@@ -94,7 +93,7 @@ namespace eval Editor {
|
|||||||
# }
|
# }
|
||||||
set commentProcedure "GetComment"
|
set commentProcedure "GetComment"
|
||||||
|
|
||||||
puts "$fileType, $commentProcedure"
|
# puts "$fileType, $commentProcedure"
|
||||||
if {$selIndex != ""} {
|
if {$selIndex != ""} {
|
||||||
set lineBegin [lindex [split [lindex $selIndex 0] "."] 0]
|
set lineBegin [lindex [split [lindex $selIndex 0] "."] 0]
|
||||||
set lineEnd [lindex [split [lindex $selIndex 1] "."] 0]
|
set lineEnd [lindex [split [lindex $selIndex 1] "."] 0]
|
||||||
@@ -140,10 +139,10 @@ namespace eval Editor {
|
|||||||
|
|
||||||
set cmd "regexp -nocase -indices -- {(^|\s+)\\s*($symbol\\s*)(.*)} {$str} match v1 v2 v3"
|
set cmd "regexp -nocase -indices -- {(^|\s+)\\s*($symbol\\s*)(.*)} {$str} match v1 v2 v3"
|
||||||
|
|
||||||
puts $cmd
|
# puts $cmd
|
||||||
# puts [eval $cmd]
|
# puts [eval $cmd]
|
||||||
if [eval $cmd] {
|
if [eval $cmd] {
|
||||||
puts "$match, $v2, $v3"
|
# puts "$match, $v2, $v3"
|
||||||
return [list [lindex [split $v2] 0] [lindex [split $v3] 0]]
|
return [list [lindex [split $v2] 0] [lindex [split $v3] 0]]
|
||||||
} else {
|
} else {
|
||||||
return 0
|
return 0
|
||||||
@@ -253,7 +252,7 @@ namespace eval Editor {
|
|||||||
$txt highlight $lineBegin.0 $lineEnd.end
|
$txt highlight $lineBegin.0 $lineEnd.end
|
||||||
} else {
|
} else {
|
||||||
set str [$txt get $lineNum.0 $lineNum.end]
|
set str [$txt get $lineNum.0 $lineNum.end]
|
||||||
puts ">>>>> $str"
|
# puts ">>>>> $str"
|
||||||
if {[regexp -nocase -indices -- {(^\s*)(.*?)} $str match v1]} {
|
if {[regexp -nocase -indices -- {(^\s*)(.*?)} $str match v1]} {
|
||||||
set posBegin [lindex [split $v1] 0]
|
set posBegin [lindex [split $v1] 0]
|
||||||
set posEnd [lindex [split $v1] 1]
|
set posEnd [lindex [split $v1] 1]
|
||||||
@@ -277,7 +276,7 @@ namespace eval Editor {
|
|||||||
set pos [$txt index insert]
|
set pos [$txt index insert]
|
||||||
set lineNum [lindex [split $pos "."] 0]
|
set lineNum [lindex [split $pos "."] 0]
|
||||||
set posNum [lindex [split $pos "."] 1]
|
set posNum [lindex [split $pos "."] 1]
|
||||||
puts "$pos"
|
# puts "$pos"
|
||||||
if {$lineNum > 1} {
|
if {$lineNum > 1} {
|
||||||
# get current text
|
# get current text
|
||||||
set curText [$txt get $lineNum.0 "$lineNum.0 lineend"]
|
set curText [$txt get $lineNum.0 "$lineNum.0 lineend"]
|
||||||
@@ -398,7 +397,7 @@ namespace eval Editor {
|
|||||||
set win .varhelper
|
set win .varhelper
|
||||||
# if { [winfo exists $win] == 0 } { return }
|
# if { [winfo exists $win] == 0 } { return }
|
||||||
set ind [$win.lBox curselection]
|
set ind [$win.lBox curselection]
|
||||||
puts ">>>>>>>>>>>> VarHelperBind <<<<<<<<<<<<<<<<"
|
# puts ">>>>>>>>>>>> VarHelperBind <<<<<<<<<<<<<<<<"
|
||||||
|
|
||||||
switch -- $K {
|
switch -- $K {
|
||||||
Prior {
|
Prior {
|
||||||
@@ -443,12 +442,12 @@ namespace eval Editor {
|
|||||||
}
|
}
|
||||||
} ;# proc auto_completition_key
|
} ;# proc auto_completition_key
|
||||||
proc VarHelperEscape {w} {
|
proc VarHelperEscape {w} {
|
||||||
puts ">>>>>>>>>>>> VarHelperEscape <<<<<<<<<<<<<<<<"
|
# puts ">>>>>>>>>>>> VarHelperEscape <<<<<<<<<<<<<<<<"
|
||||||
# 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} {
|
||||||
@@ -459,7 +458,12 @@ namespace eval Editor {
|
|||||||
# блокировка открытия диалога если запущен другой
|
# блокировка открытия диалога если запущен другой
|
||||||
set txt $w
|
set txt $w
|
||||||
# set win .varhelper
|
# set win .varhelper
|
||||||
puts "$x $y $w $word $wordType"
|
# Проверяем если есть выделение то блокировать появление диалога
|
||||||
|
if {[$txt tag ranges sel] != ""} {
|
||||||
|
DebugPuts "You have selected text [$txt tag ranges sel]"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
# puts "$x $y $w $word $wordType"
|
||||||
set fileType [dict get $editors $txt fileType]
|
set fileType [dict get $editors $txt fileType]
|
||||||
|
|
||||||
if {[dict exists $editors $txt variableList] != 0} {
|
if {[dict exists $editors $txt variableList] != 0} {
|
||||||
@@ -575,6 +579,8 @@ namespace eval Editor {
|
|||||||
if { [set height [llength $findedVars]] > 10 } { set height 10 }
|
if { [set height [llength $findedVars]] > 10 } { set height 10 }
|
||||||
$win.lBox configure -height $height
|
$win.lBox configure -height $height
|
||||||
|
|
||||||
|
# focus $win.lBox
|
||||||
|
|
||||||
bind $win <Escape> {
|
bind $win <Escape> {
|
||||||
destroy $Editor::win
|
destroy $Editor::win
|
||||||
focus -force $Editor::txt.t
|
focus -force $Editor::txt.t
|
||||||
@@ -755,7 +761,7 @@ namespace eval Editor {
|
|||||||
}
|
}
|
||||||
## GET KEYS CODE ##
|
## GET KEYS CODE ##
|
||||||
proc Key {key str} {
|
proc Key {key str} {
|
||||||
puts "Pressed key code: $key, $str"
|
# puts "Pressed key code: $key, $str"
|
||||||
if {$key >= 10 && $key <= 22} {return "true"}
|
if {$key >= 10 && $key <= 22} {return "true"}
|
||||||
if {$key >= 24 && $key <= 36} {return "true"}
|
if {$key >= 24 && $key <= 36} {return "true"}
|
||||||
if {$key >= 38 && $key <= 50} {return "true"}
|
if {$key >= 38 && $key <= 50} {return "true"}
|
||||||
@@ -779,36 +785,50 @@ namespace eval Editor {
|
|||||||
bind $txt <Control-eacute> Quit
|
bind $txt <Control-eacute> Quit
|
||||||
bind $txt <Control-igrave> "Editor::SelectionPaste $txt"
|
bind $txt <Control-igrave> "Editor::SelectionPaste $txt"
|
||||||
bind $txt <Control-v> "Editor::SelectionPaste $txt"
|
bind $txt <Control-v> "Editor::SelectionPaste $txt"
|
||||||
|
bind $txt <Control-Cyrillic_em> "Editor::SelectionPaste $txt"
|
||||||
bind $txt <Control-l> "SearchVariable $txt; break"
|
bind $txt <Control-l> "SearchVariable $txt; break"
|
||||||
|
bind $txt <Control-Cyrillic_de> "SearchVariable $txt; break"
|
||||||
bind $txt <Control-i> "ImageBase64Encode $txt"
|
bind $txt <Control-i> "ImageBase64Encode $txt"
|
||||||
|
bind $txt <Control-Cyrillic_sha> "ImageBase64Encode $txt"
|
||||||
bind $txt <Control-bracketleft> "Editor::InsertTabular $txt"
|
bind $txt <Control-bracketleft> "Editor::InsertTabular $txt"
|
||||||
bind $txt <Control-bracketright> "Editor::DeleteTabular $txt"
|
bind $txt <Control-bracketright> "Editor::DeleteTabular $txt"
|
||||||
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-i> ImageBase64Encode
|
|
||||||
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-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 <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}"
|
||||||
|
bind $txt <Alt-Cyrillic_tse> "$txt delete {insert wordstart} {insert wordend}"
|
||||||
bind $txt <Alt-r> "$txt delete {insert linestart} {insert lineend + 1char}"
|
bind $txt <Alt-r> "$txt delete {insert linestart} {insert lineend + 1char}"
|
||||||
bind $txt <Alt-ecircumflex> "$txt delete {insert linestart} {insert lineend + 1char}"
|
bind $txt <Alt-ecircumflex> "$txt delete {insert linestart} {insert lineend + 1char}"
|
||||||
|
bind $txt <Alt-Cyrillic_er> "$txt delete {insert linestart} {insert lineend + 1char}"
|
||||||
bind $txt <Alt-b> "$txt delete {insert linestart} insert"
|
bind $txt <Alt-b> "$txt delete {insert linestart} insert"
|
||||||
|
bind $txt <Alt-Cyrillic_i> "$txt delete {insert linestart} insert"
|
||||||
bind $txt <Alt-e> "$txt delete insert {insert lineend}"
|
bind $txt <Alt-e> "$txt delete insert {insert lineend}"
|
||||||
|
bind $txt <Alt-Cyrillic_u> "$txt delete insert {insert lineend}"
|
||||||
bind $txt <Alt-s> "Editor::SplitEditorH $w $fileType"
|
bind $txt <Alt-s> "Editor::SplitEditorH $w $fileType"
|
||||||
bind $txt <Alt-ucircumflex> "Editor::SplitEditorH $w $fileType"
|
bind $txt <Alt-ucircumflex> "Editor::SplitEditorH $w $fileType"
|
||||||
|
bind $txt <Alt-Cyrillic_hardsign> "Editor::SplitEditorH $w $fileType"
|
||||||
bind $txt <Alt-y> "Editor::TextCopy $txt"
|
bind $txt <Alt-y> "Editor::TextCopy $txt"
|
||||||
|
bind $txt <Alt-Cyrillic_en> "Editor::TextCopy $txt"
|
||||||
bind $txt <Control-g> "Editor::GoToLineNumberDialog $txt"
|
bind $txt <Control-g> "Editor::GoToLineNumberDialog $txt"
|
||||||
|
bind $txt <Control-Cyrillic_pe> "Editor::GoToLineNumberDialog $txt"
|
||||||
bind $txt <Control-agrave> "Editor::FindDialog $w"
|
bind $txt <Control-agrave> "Editor::FindDialog $w"
|
||||||
bind $txt <Control-f> "Editor::FindDialog $txt"
|
bind $txt <Control-f> "Editor::FindDialog $txt"
|
||||||
|
bind $txt <Control-Cyrillic_a> "Editor::FindDialog $txt"
|
||||||
bind $txt <Control-F> "Editor::FindDialog $txt"
|
bind $txt <Control-F> "Editor::FindDialog $txt"
|
||||||
bind $txt <Control-odiaeresis> FileOper::Close
|
bind $txt <Control-odiaeresis> FileOper::Close
|
||||||
bind $txt <Control-w> FileOper::Close
|
bind $txt <Control-w> FileOper::Close
|
||||||
|
bind $txt <Control-Cyrillic_tse> FileOper::Close
|
||||||
bind $txt <Control-o> {
|
bind $txt <Control-o> {
|
||||||
set filePath [FileOper::OpenDialog]
|
set filePath [FileOper::OpenDialog]
|
||||||
if {$filePath != ""} {
|
if {$filePath != ""} {
|
||||||
@@ -823,6 +843,16 @@ namespace eval Editor {
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
bind $txt <Control-Cyrillic_shcha> {
|
||||||
|
set filePath [FileOper::OpenDialog]
|
||||||
|
if {$filePath != ""} {
|
||||||
|
FileOper::Edit $filePath
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
bind $txt <Control-r> "Editor::SplitEditorForExecute $w $fileType $nb "
|
||||||
|
bind $txt <Control-Cyrillic_ka> "Editor::SplitEditorForExecute $w $fileType $nb "
|
||||||
|
|
||||||
# bind $txt.t <KeyRelease> "Editor::ReleaseKey %K $txt.t $fileType"
|
# bind $txt.t <KeyRelease> "Editor::ReleaseKey %K $txt.t $fileType"
|
||||||
# bind $txt.t <KeyPress> "Editor::PressKey %K $txt.t"
|
# bind $txt.t <KeyPress> "Editor::PressKey %K $txt.t"
|
||||||
# bind $txt <KeyRelease> "Editor::Key %k %K"
|
# bind $txt <KeyRelease> "Editor::Key %k %K"
|
||||||
@@ -883,20 +913,33 @@ namespace eval Editor {
|
|||||||
set lineNum [lindex [split $pos "."] 0]
|
set lineNum [lindex [split $pos "."] 0]
|
||||||
set posNum [lindex [split $pos "."] 1]
|
set posNum [lindex [split $pos "."] 1]
|
||||||
set symbol [string trim [string trimleft $symbol "\\"]]
|
set symbol [string trim [string trimleft $symbol "\\"]]
|
||||||
# puts "Selindex : $selIndex, cursor position: $pos"
|
# puts "Selindex : $selIndex, cursor position: $pos, Symbol: $symbol"
|
||||||
if {$selIndex != ""} {
|
if {$selIndex != ""} {
|
||||||
set lineBegin [lindex [split [lindex $selIndex 0] "."] 0]
|
set lineBegin [lindex [split [lindex $selIndex 0] "."] 0]
|
||||||
set posBegin [lindex [split [lindex $selIndex 0] "."] 1]
|
set posBegin [lindex [split [lindex $selIndex 0] "."] 1]
|
||||||
set lineEnd [lindex [split [lindex $selIndex 1] "."] 0]
|
set lineEnd [lindex [split [lindex $selIndex 1] "."] 0]
|
||||||
set posEnd [lindex [split [lindex $selIndex 1] "."] 1]
|
set posEnd [lindex [split [lindex $selIndex 1] "."] 1]
|
||||||
# set selText [$txt get $lineBegin.$posBegin $lineEnd.$posEnd]
|
set selText [$txt get $lineBegin.$posBegin $lineEnd.$posEnd]
|
||||||
set selText $selectionText
|
# set selText $selectionText
|
||||||
# puts "Selected text: $selText, pos: $pos, lineBegin: $lineBegin, posBegin: $posBegin, pos end: $posEnd"
|
# puts "Selected text: $selText, pos: $pos, lineBegin: $lineBegin, posBegin: $posBegin, pos end: $posEnd"
|
||||||
if {$posNum == $posEnd} {
|
if {$posNum == $posEnd} {
|
||||||
$txt insert $lineBegin.$posBegin "$symbol"
|
$txt insert $lineBegin.$posBegin "$symbol"
|
||||||
}
|
}
|
||||||
if {$posNum == $posBegin} {
|
if {$posNum == $posBegin} {
|
||||||
$txt insert $lineBegin.$posEnd "$symbol"
|
if {$symbol == {"} || $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 {
|
||||||
|
$txt insert $lineEnd.$posEnd "$symbol"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if {$symbol == "'"} {
|
||||||
|
if {$posBegin == 0} {
|
||||||
|
$txt insert $pos "$symbol"
|
||||||
|
} else {
|
||||||
|
$txt insert "$pos + 0 chars" "$symbol"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$txt highlight $lineBegin.$posBegin $lineEnd.end
|
$txt highlight $lineBegin.$posBegin $lineEnd.end
|
||||||
# $txt insert $lineBegin.[expr $posBegin + 1] "$symbol"
|
# $txt insert $lineBegin.[expr $posBegin + 1] "$symbol"
|
||||||
@@ -924,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
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -942,7 +985,7 @@ namespace eval Editor {
|
|||||||
if {[eval [dict get $lexers $fileType procRegexpCommand]]} {
|
if {[eval [dict get $lexers $fileType procRegexpCommand]]} {
|
||||||
set procName_ [string trim $procName]
|
set procName_ [string trim $procName]
|
||||||
if {$treeItemName ne ""} {
|
if {$treeItemName ne ""} {
|
||||||
puts [Tree::InsertItem $tree $treeItemName $procName_ "procedure" "$procName_ ($params)"]
|
Tree::InsertItem $tree $treeItemName $procName_ "procedure" "$procName_ ($params)"
|
||||||
}
|
}
|
||||||
lappend procList [list $procName_ $params]
|
lappend procList [list $procName_ $params]
|
||||||
unset procName_
|
unset procName_
|
||||||
@@ -966,7 +1009,7 @@ namespace eval Editor {
|
|||||||
} else {
|
} else {
|
||||||
set varType ""
|
set varType ""
|
||||||
}
|
}
|
||||||
puts "variable: $varName, value: $varValue, type: $varType"
|
# puts "variable: $varName, value: $varValue, type: $varType"
|
||||||
lappend varList [list $varName $varValue]
|
lappend varList [list $varName $varValue]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -976,7 +1019,7 @@ namespace eval Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
proc FindFunction {txt findString} {
|
proc FindFunction {txt findString} {
|
||||||
puts "txt: $txt, $findString"
|
# puts "txt: $txt, $findString"
|
||||||
set pos "0.0"
|
set pos "0.0"
|
||||||
$txt see $pos
|
$txt see $pos
|
||||||
set line [lindex [split $pos "."] 0]
|
set line [lindex [split $pos "."] 0]
|
||||||
@@ -1043,7 +1086,7 @@ namespace eval Editor {
|
|||||||
# Вызов диалога со списком процедур или функций присутствующих в тексте
|
# Вызов диалога со списком процедур или функций присутствующих в тексте
|
||||||
proc GoToFunction { w } {
|
proc GoToFunction { w } {
|
||||||
global tree editors
|
global tree editors
|
||||||
puts $w
|
# puts $w
|
||||||
# set txt $w.frmText.t
|
# set txt $w.frmText.t
|
||||||
set txt $w
|
set txt $w
|
||||||
set box [$txt bbox insert]
|
set box [$txt bbox insert]
|
||||||
@@ -1053,7 +1096,7 @@ namespace eval Editor {
|
|||||||
# puts "--$txt"
|
# puts "--$txt"
|
||||||
# puts $editors($txt)
|
# puts $editors($txt)
|
||||||
foreach item [dict get $editors $txt procedureList] {
|
foreach item [dict get $editors $txt procedureList] {
|
||||||
puts $item
|
# puts $item
|
||||||
lappend l [lindex $item 0]
|
lappend l [lindex $item 0]
|
||||||
}
|
}
|
||||||
if {$l ne ""} {
|
if {$l ne ""} {
|
||||||
@@ -1145,7 +1188,7 @@ namespace eval Editor {
|
|||||||
|
|
||||||
proc FindReplaceText {txt findString replaceString regexp} {
|
proc FindReplaceText {txt findString replaceString regexp} {
|
||||||
global nbEditor
|
global nbEditor
|
||||||
puts [focus]
|
# puts [focus]
|
||||||
# set txt [$nbEditor select].frmText.t
|
# set txt [$nbEditor select].frmText.t
|
||||||
$txt tag remove sel 1.0 end
|
$txt tag remove sel 1.0 end
|
||||||
# $txt see $pos
|
# $txt see $pos
|
||||||
@@ -1174,7 +1217,7 @@ namespace eval Editor {
|
|||||||
set lstFindIndex [$txt search -all -nocase -count matchIndexPair $findString $line.$x end]
|
set lstFindIndex [$txt search -all -nocase -count matchIndexPair $findString $line.$x end]
|
||||||
# set symNumbers [string length "$findString"]
|
# set symNumbers [string length "$findString"]
|
||||||
}
|
}
|
||||||
puts $lstFindIndex
|
# puts $lstFindIndex
|
||||||
# puts $matchIndexPair
|
# puts $matchIndexPair
|
||||||
# set lstFindIndex [$txt search -all "$selectionText" 0.0]
|
# set lstFindIndex [$txt search -all "$selectionText" 0.0]
|
||||||
|
|
||||||
@@ -1188,7 +1231,7 @@ namespace eval Editor {
|
|||||||
set selFindRow [lindex [split $ind "."] 1]
|
set selFindRow [lindex [split $ind "."] 1]
|
||||||
# set endInd "$selFindLine.[expr $selFindRow + $symNumbers]"
|
# set endInd "$selFindLine.[expr $selFindRow + $symNumbers]"
|
||||||
set endInd "$selFindLine.[expr [lindex $matchIndexPair $i] + $selFindRow]"
|
set endInd "$selFindLine.[expr [lindex $matchIndexPair $i] + $selFindRow]"
|
||||||
puts "$ind; $selFindLine, $selFindRow; $endInd "
|
# puts "$ind; $selFindLine, $selFindRow; $endInd "
|
||||||
if {$replaceString ne ""} {
|
if {$replaceString ne ""} {
|
||||||
$txt replace $ind $endInd $replaceString
|
$txt replace $ind $endInd $replaceString
|
||||||
# Вычисляем индекс вхождения строки после замены для выделения в тексте
|
# Вычисляем индекс вхождения строки после замены для выделения в тексте
|
||||||
@@ -1241,7 +1284,7 @@ namespace eval Editor {
|
|||||||
} else {
|
} else {
|
||||||
if {[$nbEditor select] ne ""} {
|
if {[$nbEditor select] ne ""} {
|
||||||
set txt [$nbEditor select].frmText.t
|
set txt [$nbEditor select].frmText.t
|
||||||
puts $txt
|
# puts $txt
|
||||||
} else {
|
} else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -1267,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
|
||||||
@@ -1329,7 +1372,7 @@ namespace eval Editor {
|
|||||||
# Horizontal split the Editor text widget
|
# Horizontal split the Editor text widget
|
||||||
proc SplitEditorH {w fileType nb} {
|
proc SplitEditorH {w fileType nb} {
|
||||||
global cfgVariables
|
global cfgVariables
|
||||||
puts [$w.panelTxt panes]
|
# puts [$w.panelTxt panes]
|
||||||
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
|
||||||
@@ -1337,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
|
||||||
@@ -1349,9 +1393,9 @@ namespace eval Editor {
|
|||||||
|
|
||||||
proc SplitEditorV {fileFullPath} {
|
proc SplitEditorV {fileFullPath} {
|
||||||
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
|
||||||
@@ -1371,9 +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} {
|
||||||
@@ -1414,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
|
||||||
@@ -1471,8 +1513,8 @@ namespace eval Editor {
|
|||||||
dict set editors $txt fileType $fileType
|
dict set editors $txt fileType $fileType
|
||||||
dict set editors $txt procedureList [list]
|
dict set editors $txt procedureList [list]
|
||||||
|
|
||||||
puts ">>[dict get $editors $txt fileType]"
|
# puts ">>[dict get $editors $txt fileType]"
|
||||||
puts ">>[dict get $editors $txt procedureList]"
|
# puts ">>[dict get $editors $txt procedureList]"
|
||||||
# puts ">>>>> $editors"
|
# puts ">>>>> $editors"
|
||||||
|
|
||||||
if {[info procs ::Highlight::$fileType] ne ""} {
|
if {[info procs ::Highlight::$fileType] ne ""} {
|
||||||
@@ -1497,6 +1539,7 @@ namespace eval Editor {
|
|||||||
ICO
|
ICO
|
||||||
XPM
|
XPM
|
||||||
}
|
}
|
||||||
|
# puts "$itemName"
|
||||||
set fr $itemName
|
set fr $itemName
|
||||||
if ![string match "*untitled*" $itemName] {
|
if ![string match "*untitled*" $itemName] {
|
||||||
set lblText $fileFullPath
|
set lblText $fileFullPath
|
||||||
@@ -1507,6 +1550,8 @@ namespace eval Editor {
|
|||||||
set fileType [string toupper [string trimleft [file extension $fileFullPath] "."]]
|
set fileType [string toupper [string trimleft [file extension $fileFullPath] "."]]
|
||||||
if {$fileType eq ""} {set fileType "Unknown"}
|
if {$fileType eq ""} {set fileType "Unknown"}
|
||||||
|
|
||||||
|
ExecutorCommandPathSetting $fileType
|
||||||
|
|
||||||
ttk::frame $fr.header
|
ttk::frame $fr.header
|
||||||
set lblName "lbl[string range $itemName [expr [string last "." $itemName] +1] end]"
|
set lblName "lbl[string range $itemName [expr [string last "." $itemName] +1] end]"
|
||||||
ttk::label $fr.header.$lblName -text $lblText
|
ttk::label $fr.header.$lblName -text $lblText
|
||||||
@@ -1518,9 +1563,13 @@ namespace eval Editor {
|
|||||||
-command "Editor::SplitEditorH $fr $fileType $nb"
|
-command "Editor::SplitEditorH $fr $fileType $nb"
|
||||||
ttk::button $fr.header.$btnSplitV -image split_vertical_11x11 \
|
ttk::button $fr.header.$btnSplitV -image split_vertical_11x11 \
|
||||||
-command "Editor::SplitEditorV $fileFullPath"
|
-command "Editor::SplitEditorV $fileFullPath"
|
||||||
|
|
||||||
|
set btnSplitExecute "btnSplitExec[string range $itemName [expr [string last "." $itemName] +1] end]"
|
||||||
|
ttk::button $fr.header.$btnSplitExecute -image execute_11x11 \
|
||||||
|
-command "Editor::SplitEditorForExecute $fr $fileType $nb $fileFullPath"
|
||||||
# pack $fr.$btnSplitH $fr.$btnSplitV -side right -anchor e
|
# pack $fr.$btnSplitH $fr.$btnSplitV -side right -anchor e
|
||||||
pack $fr.header.$lblName -side left -expand true -fill x
|
pack $fr.header.$lblName -side left -expand true -fill x
|
||||||
pack $fr.header.$btnSplitV $fr.header.$btnSplitH -side right
|
pack $fr.header.$btnSplitV $fr.header.$btnSplitH $fr.header.$btnSplitExecute -side right
|
||||||
|
|
||||||
pack $fr.header -side top -fill x
|
pack $fr.header -side top -fill x
|
||||||
|
|
||||||
@@ -1538,4 +1587,28 @@ namespace eval Editor {
|
|||||||
|
|
||||||
return $fr
|
return $fr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc SplitEditorForExecute {w fileType nb {fileFullPath ""}} {
|
||||||
|
global cfgVariables tree
|
||||||
|
if {$fileFullPath eq ""} {
|
||||||
|
set treeItem "file::[string range $w [expr [string last "." $w] +1] end ]"
|
||||||
|
set fileFullPath [Tree::GetItemID $tree $treeItem]
|
||||||
|
puts $fileFullPath
|
||||||
|
}
|
||||||
|
# puts [$w.panelTxt panes]
|
||||||
|
DebugPuts "$w $fileType $nb $fileFullPath"
|
||||||
|
if [winfo exists $w.frmText2] {
|
||||||
|
$w.panelTxt forget $w.frmText2
|
||||||
|
destroy $w.frmText2
|
||||||
|
focus -force $w.frmText.t.t
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
set frmText [ttk::frame $w.frmText2 -border 1]
|
||||||
|
$w.panelTxt add $frmText -weight 1
|
||||||
|
# puts "SplitEditorForExecute: $w"
|
||||||
|
# focus -force $frmText.t.t
|
||||||
|
Execute $fileFullPath $frmText $w
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
194
lib/files.tcl
194
lib/files.tcl
@@ -9,11 +9,41 @@
|
|||||||
|
|
||||||
|
|
||||||
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
|
||||||
@@ -35,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" {
|
||||||
@@ -47,18 +77,72 @@ 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]]
|
||||||
|
|
||||||
|
# Установка корректного типа для svg
|
||||||
|
# Но для новых версий tcl
|
||||||
|
switch $ext {
|
||||||
|
".svg" {
|
||||||
|
set fType "binary"
|
||||||
|
set fBinaryInterp "svg"
|
||||||
|
set fBinaryType "graphic"
|
||||||
|
}
|
||||||
|
".torrent" {
|
||||||
|
set fType "binary"
|
||||||
|
set fBinaryInterp "torrent"
|
||||||
|
set fBinaryType "x-bittorrent"
|
||||||
|
}
|
||||||
|
".pdf" {
|
||||||
|
set fType "binary"
|
||||||
|
set fBinaryInterp "pdf"
|
||||||
|
set fBinaryType "binary"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DebugPuts "File type is $fType, $fBinaryType, $fBinaryInterp, $ext"
|
||||||
|
|
||||||
switch $fType {
|
switch $fType {
|
||||||
"binary" {
|
"binary" {
|
||||||
|
if {$fBinaryType ne ""} {
|
||||||
|
switch $fBinaryType {
|
||||||
|
"graphic" {
|
||||||
|
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 false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default {
|
||||||
|
return binary
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return binary
|
||||||
|
}
|
||||||
|
}
|
||||||
"text" {
|
"text" {
|
||||||
return text
|
return text
|
||||||
}
|
}
|
||||||
"image" {
|
"image" {
|
||||||
|
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 false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"empty" {
|
||||||
|
return text
|
||||||
|
}
|
||||||
default {
|
default {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -149,6 +233,7 @@ namespace eval FileOper {
|
|||||||
# }
|
# }
|
||||||
# .frmStatus.lblGitLogo configure -image git_logo_20x20
|
# .frmStatus.lblGitLogo configure -image git_logo_20x20
|
||||||
# .frmStatus.lblGit configure -text "[::msgcat::mc "Branch"]: [Git::Branches current]"
|
# .frmStatus.lblGit configure -text "[::msgcat::mc "Branch"]: [Git::Branches current]"
|
||||||
|
AddRecentEditedFolder $fullPath
|
||||||
return $fullPath
|
return $fullPath
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,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}
|
||||||
@@ -225,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} {
|
||||||
|
$nbEditorWindow forget $nbItem
|
||||||
destroy $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
|
||||||
@@ -254,28 +345,36 @@ 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
|
global nbEditor tree env activeProject dir
|
||||||
|
|
||||||
if [info exists activeProject] {
|
if [info exists activeProject] {
|
||||||
set dir $activeProject
|
set dirProject $activeProject
|
||||||
} else {
|
} else {
|
||||||
set dir $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 $dir -filetypes $::types -parent .]
|
set filePath [tk_getSaveFile -initialdir $dirProject -filetypes $::types -parent .]
|
||||||
if {$filePath eq ""} {
|
if {$filePath eq ""} {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
# 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
|
||||||
@@ -286,9 +385,18 @@ namespace eval FileOper {
|
|||||||
set editedText [$nbEditorItem.frmText.t get 0.0 end]
|
set editedText [$nbEditorItem.frmText.t get 0.0 end]
|
||||||
set f [open $filePath "w+"]
|
set f [open $filePath "w+"]
|
||||||
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"} {
|
||||||
|
Config::read $dir(cfg)
|
||||||
|
}
|
||||||
|
if [string match "*untitled*" $nbEditorItem] {
|
||||||
|
FileOper::Close
|
||||||
|
if {$type ne "close"} {
|
||||||
|
FileOper::Edit $filePath
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc SaveAll {} {
|
proc SaveAll {} {
|
||||||
@@ -315,7 +423,7 @@ namespace eval FileOper {
|
|||||||
|
|
||||||
proc ReadFolder {directory {parent ""}} {
|
proc ReadFolder {directory {parent ""}} {
|
||||||
global tree dir lexers project
|
global tree dir lexers project
|
||||||
puts "Read the folder $directory"
|
# puts "Read the folder $directory"
|
||||||
set rList ""
|
set rList ""
|
||||||
if {[catch {cd $directory}] != 0} {
|
if {[catch {cd $directory}] != 0} {
|
||||||
return ""
|
return ""
|
||||||
@@ -387,33 +495,63 @@ namespace eval FileOper {
|
|||||||
# Delete emty last line
|
# Delete emty last line
|
||||||
if {[$txt get {end-1 line} end] eq "\n" || [$txt get {end-1 line} end] eq "\r\n"} {
|
if {[$txt get {end-1 line} end] eq "\n" || [$txt get {end-1 line} end] eq "\r\n"} {
|
||||||
$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
|
||||||
|
DebugPuts "$fileFullPath"
|
||||||
if {[file exists $fileFullPath] == 0} {
|
if {[file exists $fileFullPath] == 0} {
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
puts "$fileFullPath File type [::fileutil::magic::filetype $fileFullPath]"
|
# puts "$fileFullPath File type [::fileutil::magic::filetype $fileFullPath]"
|
||||||
set fileType [FileOper::GetFileMimeType $fileFullPath]
|
set fileType [FileOper::GetFileMimeType $fileFullPath]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# puts "$fileType <<<<<<<<<<<"
|
||||||
|
|
||||||
switch $fileType {
|
switch $fileType {
|
||||||
"text" {
|
"text" {
|
||||||
# return text
|
# return text
|
||||||
}
|
}
|
||||||
"image" {
|
"image" {
|
||||||
# return image
|
}
|
||||||
|
"binary" {
|
||||||
|
set answer [tk_messageBox -message [::msgcat::mc "The file looks like a binary file. Open anyway?"] \
|
||||||
|
-icon question -type yesno]
|
||||||
|
switch $answer {
|
||||||
|
yes {}
|
||||||
|
no {return}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
false {
|
false {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
# Проверяем размер файла и если он больше 1мб вывести предупреждение
|
||||||
|
# puts " File size = [file size $fileFullPath]"
|
||||||
|
if {[file size $fileFullPath] > 1000000} {
|
||||||
|
set answer [tk_messageBox -message [::msgcat::mc "The file size to big. Open anyway?"] \
|
||||||
|
-detail [GetFileAttr $fileFullPath "size"] \
|
||||||
|
-icon question -type yesno]
|
||||||
|
switch $answer {
|
||||||
|
yes {}
|
||||||
|
no {return}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
set filePath [file dirname $fileFullPath]
|
set filePath [file dirname $fileFullPath]
|
||||||
set fileName [file tail $fileFullPath]
|
set fileName [file tail $fileFullPath]
|
||||||
regsub -all {\.|/|\\|\s} $fileFullPath "_" itemName
|
|
||||||
|
regsub -all {\.|/|\\|\s|:} $fileFullPath "_" itemName
|
||||||
|
set itemName [string tolower $itemName]
|
||||||
set itemName "$nbEditor.$itemName"
|
set itemName "$nbEditor.$itemName"
|
||||||
set treeItemName [Tree::InsertItem $tree {} $fileFullPath "file" $fileName]
|
set treeItemName [Tree::InsertItem $tree {} $fileFullPath "file" $fileName]
|
||||||
|
|
||||||
@@ -422,6 +560,11 @@ namespace eval FileOper {
|
|||||||
|
|
||||||
if {[winfo exists $itemName] == 0} {
|
if {[winfo exists $itemName] == 0} {
|
||||||
NB::InsertItem $nbEditor $fileFullPath "file"
|
NB::InsertItem $nbEditor $fileFullPath "file"
|
||||||
|
if {$fileType eq "image"} {
|
||||||
|
ImageViewer $fileFullPath $itemName $itemName
|
||||||
|
return $itemName
|
||||||
|
}
|
||||||
|
|
||||||
Editor::Editor $fileFullPath $nbEditor $itemName
|
Editor::Editor $fileFullPath $nbEditor $itemName
|
||||||
ReadFile $fileFullPath $itemName
|
ReadFile $fileFullPath $itemName
|
||||||
$itemName.frmText.t highlight 1.0 end
|
$itemName.frmText.t highlight 1.0 end
|
||||||
@@ -429,6 +572,11 @@ namespace eval FileOper {
|
|||||||
$itemName.frmText.t see 1.1
|
$itemName.frmText.t see 1.1
|
||||||
}
|
}
|
||||||
$nbEditor select $itemName
|
$nbEditor select $itemName
|
||||||
|
focus -force $itemName
|
||||||
|
if {$fileType eq "image"} {
|
||||||
|
# ImageViewer $fileFullPath $itemName $itemName
|
||||||
|
return $itemName
|
||||||
|
}
|
||||||
Editor::ReadStructure $itemName.frmText.t $treeItemName
|
Editor::ReadStructure $itemName.frmText.t $treeItemName
|
||||||
GetVariablesFromFile $fileFullPath
|
GetVariablesFromFile $fileFullPath
|
||||||
$itemName.frmText.t.t mark set insert 1.0
|
$itemName.frmText.t.t mark set insert 1.0
|
||||||
@@ -436,6 +584,8 @@ namespace eval FileOper {
|
|||||||
focus -force $itemName.frmText.t.t
|
focus -force $itemName.frmText.t.t
|
||||||
.frmStatus.lblSize configure -text [GetFileAttr $fileFullPath "size"]
|
.frmStatus.lblSize configure -text [GetFileAttr $fileFullPath "size"]
|
||||||
.frmStatus.lblEncoding configure -text [GetFileMimeType $fileFullPath "charset"]
|
.frmStatus.lblEncoding configure -text [GetFileMimeType $fileFullPath "charset"]
|
||||||
|
# puts ">> $itemName"
|
||||||
|
|
||||||
return $itemName
|
return $itemName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
48
lib/git.tcl
48
lib/git.tcl
@@ -12,6 +12,28 @@
|
|||||||
namespace eval Git {
|
namespace eval Git {
|
||||||
variable gitCommand
|
variable gitCommand
|
||||||
|
|
||||||
|
# Определим путь до команды git в зависимсти от платформы
|
||||||
|
proc CommandPathSetting {} {
|
||||||
|
global cfgVariables tcl_platform
|
||||||
|
if {$cfgVariables(gitCommand) == ""} {
|
||||||
|
if {$tcl_platform(platform) eq "windows"} {
|
||||||
|
set cmd {where git}
|
||||||
|
} else {
|
||||||
|
set cmd {which git}
|
||||||
|
}
|
||||||
|
if {[catch {exec {*}$cmd} git_path]} {
|
||||||
|
puts "Git не найден в системе"
|
||||||
|
set cfgVariables(gitCommand) ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
set git_path [string trim $git_path]
|
||||||
|
set first_path [lindex [split $git_path "\n"] 0]
|
||||||
|
|
||||||
|
# puts "Git найден: $first_path"
|
||||||
|
set cfgVariables(gitCommand) $first_path
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
proc GetConfig {option} {
|
proc GetConfig {option} {
|
||||||
global activeProject cfgVariables
|
global activeProject cfgVariables
|
||||||
set confOptions {
|
set confOptions {
|
||||||
@@ -69,8 +91,8 @@ namespace eval Git {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch $cmd pipe
|
catch $cmd pipe
|
||||||
puts $cmd
|
# puts $cmd
|
||||||
puts $pipe
|
# puts $pipe
|
||||||
if [regexp -nocase -- {^error:} $pipe match] {
|
if [regexp -nocase -- {^error:} $pipe match] {
|
||||||
ShowMessage "Command: '$cmd' error" $pipe
|
ShowMessage "Command: '$cmd' error" $pipe
|
||||||
return
|
return
|
||||||
@@ -100,7 +122,7 @@ namespace eval Git {
|
|||||||
} else {
|
} else {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
puts $activeProject
|
# puts $activeProject
|
||||||
lappend cmd $cfgVariables(gitCommand)
|
lappend cmd $cfgVariables(gitCommand)
|
||||||
lappend cmd "branch"
|
lappend cmd "branch"
|
||||||
# lappend cmd "-s"
|
# lappend cmd "-s"
|
||||||
@@ -145,7 +167,7 @@ namespace eval Git {
|
|||||||
lappend cmd "--"
|
lappend cmd "--"
|
||||||
lappend cmd $activeProject
|
lappend cmd $activeProject
|
||||||
catch $cmd pipe
|
catch $cmd pipe
|
||||||
puts $cmd
|
# puts $cmd
|
||||||
if [regexp -nocase -- {^fatal:} $pipe match] {
|
if [regexp -nocase -- {^fatal:} $pipe match] {
|
||||||
ShowMessage "Command: '$cmd' error" $pipe
|
ShowMessage "Command: '$cmd' error" $pipe
|
||||||
return
|
return
|
||||||
@@ -167,7 +189,7 @@ namespace eval Git {
|
|||||||
lappend cmd "--"
|
lappend cmd "--"
|
||||||
lappend cmd [file join $activeProject [string trimleft $f "../"]]
|
lappend cmd [file join $activeProject [string trimleft $f "../"]]
|
||||||
catch $cmd pipe
|
catch $cmd pipe
|
||||||
puts $cmd
|
# puts $cmd
|
||||||
if [regexp -nocase -- {^fatal:} $pipe match] {
|
if [regexp -nocase -- {^fatal:} $pipe match] {
|
||||||
ShowMessage "Command: '$cmd' error" $pipe
|
ShowMessage "Command: '$cmd' error" $pipe
|
||||||
return
|
return
|
||||||
@@ -228,7 +250,7 @@ namespace eval Git {
|
|||||||
# set cmd exec
|
# set cmd exec
|
||||||
cd $activeProject
|
cd $activeProject
|
||||||
set url [Git::GetConfig remote.origin.url]
|
set url [Git::GetConfig remote.origin.url]
|
||||||
puts $url
|
# puts $url
|
||||||
if [regexp -nocase -all -- {^(http|https)://(.+)} $url match proto address] {
|
if [regexp -nocase -all -- {^(http|https)://(.+)} $url match proto address] {
|
||||||
Git::AuthorizationDialog "[::msgcat::mc "Authorization required"] [::msgcat::mc "for"] Git" $url
|
Git::AuthorizationDialog "[::msgcat::mc "Authorization required"] [::msgcat::mc "for"] Git" $url
|
||||||
} else {
|
} else {
|
||||||
@@ -248,7 +270,7 @@ namespace eval Git {
|
|||||||
# lappend cmd "$activeProject"
|
# lappend cmd "$activeProject"
|
||||||
# puts "$cmd"
|
# puts "$cmd"
|
||||||
catch $cmd pipe
|
catch $cmd pipe
|
||||||
puts $pipe
|
# puts $pipe
|
||||||
if [regexp -nocase -- {^fatal:} $pipe match] {
|
if [regexp -nocase -- {^fatal:} $pipe match] {
|
||||||
ShowMessage "Command: '$cmd' error" $pipe
|
ShowMessage "Command: '$cmd' error" $pipe
|
||||||
return
|
return
|
||||||
@@ -301,7 +323,7 @@ namespace eval Git {
|
|||||||
$w.body.lCommit delete $itemNumber
|
$w.body.lCommit delete $itemNumber
|
||||||
}
|
}
|
||||||
catch $cmd pipe
|
catch $cmd pipe
|
||||||
puts $cmd
|
# puts $cmd
|
||||||
$w.body.t delete 1.0 end
|
$w.body.t delete 1.0 end
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -357,7 +379,7 @@ namespace eval Git {
|
|||||||
$w.body.t delete 1.0 end
|
$w.body.t delete 1.0 end
|
||||||
set i 0
|
set i 0
|
||||||
foreach line [Git::Diff $fileName] {
|
foreach line [Git::Diff $fileName] {
|
||||||
puts $line
|
# puts $line
|
||||||
if {$i > 3} {
|
if {$i > 3} {
|
||||||
$w.body.t inser end "$line\n"
|
$w.body.t inser end "$line\n"
|
||||||
}
|
}
|
||||||
@@ -381,7 +403,7 @@ namespace eval Git {
|
|||||||
$w.body.lBox delete $itemNumber
|
$w.body.lBox delete $itemNumber
|
||||||
}
|
}
|
||||||
catch $cmd pipe
|
catch $cmd pipe
|
||||||
puts $cmd
|
# puts $cmd
|
||||||
$w.body.t delete 1.0 end
|
$w.body.t delete 1.0 end
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,7 +418,7 @@ namespace eval Git {
|
|||||||
puts $cmd
|
puts $cmd
|
||||||
|
|
||||||
catch $cmd pipe
|
catch $cmd pipe
|
||||||
puts $pipe
|
# puts $pipe
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
proc Config {repo user email} {
|
proc Config {repo user email} {
|
||||||
@@ -407,7 +429,7 @@ namespace eval Git {
|
|||||||
lappend cmd "config"
|
lappend cmd "config"
|
||||||
lappend cmd $repo
|
lappend cmd $repo
|
||||||
lappend cmd $dir
|
lappend cmd $dir
|
||||||
puts $cmd
|
# puts $cmd
|
||||||
|
|
||||||
# catch $cmd pipe
|
# catch $cmd pipe
|
||||||
# puts $pipe
|
# puts $pipe
|
||||||
@@ -425,7 +447,7 @@ namespace eval Git {
|
|||||||
lappend cmd $cfgVariables(gitCommand)
|
lappend cmd $cfgVariables(gitCommand)
|
||||||
lappend cmd "init"
|
lappend cmd "init"
|
||||||
lappend cmd $activeProject
|
lappend cmd $activeProject
|
||||||
puts $cmd
|
# puts $cmd
|
||||||
|
|
||||||
catch $cmd pipe
|
catch $cmd pipe
|
||||||
if [regexp -nocase -- {^fatal:} $pipe match] {
|
if [regexp -nocase -- {^fatal:} $pipe match] {
|
||||||
|
|||||||
47
lib/gui.tcl
47
lib/gui.tcl
@@ -23,12 +23,14 @@ wm overrideredirect . 0
|
|||||||
|
|
||||||
bind . <Control-q> Quit
|
bind . <Control-q> Quit
|
||||||
bind . <Control-Q> Quit
|
bind . <Control-Q> 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
|
||||||
|
bind . <Control-Cyrillic_te> Editor::New
|
||||||
bind . <Control-o> {
|
bind . <Control-o> {
|
||||||
set filePath [FileOper::OpenDialog]
|
set filePath [FileOper::OpenDialog]
|
||||||
if {$filePath != ""} {
|
if {$filePath != ""} {
|
||||||
@@ -41,21 +43,45 @@ bind . <Control-O> {
|
|||||||
FileOper::Edit $filePath
|
FileOper::Edit $filePath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bind . <Control-k> {
|
bind . <Alt-k> {
|
||||||
set folderPath [FileOper::OpenFolderDialog]
|
set folderPath [FileOper::OpenFolderDialog]
|
||||||
if {$folderPath != ""} {
|
if {$folderPath != ""} {
|
||||||
FileOper::ReadFolder $folderPath
|
FileOper::ReadFolder $folderPath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bind . <Control-K> {
|
bind . <Alt-K> {
|
||||||
set folderPath [FileOper::OpenFolderDialog]
|
set folderPath [FileOper::OpenFolderDialog]
|
||||||
if {$folderPath != ""} {
|
if {$folderPath != ""} {
|
||||||
FileOper::ReadFolder $folderPath
|
FileOper::ReadFolder $folderPath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bind . <Alt-Cyrillic_el> {
|
||||||
|
set folderPath [FileOper::OpenFolderDialog]
|
||||||
|
if {$folderPath != ""} {
|
||||||
|
FileOper::ReadFolder $folderPath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# -------------
|
||||||
|
# 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 . <Alt-p> {ViewFilesTree true}
|
bind . <Alt-p> {ViewFilesTree true}
|
||||||
|
bind . <Alt-Cyrillic_ze> {ViewFilesTree true}
|
||||||
bind . <Button-3> {catch [PopupMenu %X %Y]}
|
bind . <Button-3> {catch [PopupMenu %X %Y]}
|
||||||
|
|
||||||
#ttk::style configure TPanedwindow -background blue
|
#ttk::style configure TPanedwindow -background blue
|
||||||
@@ -117,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
|
||||||
@@ -134,11 +165,15 @@ grid .frmBody.panel -row 0 -column 1 -sticky nesw
|
|||||||
grid columnconfigure .frmBody .frmBody.panel -weight 1
|
grid columnconfigure .frmBody .frmBody.panel -weight 1
|
||||||
grid rowconfigure .frmBody .frmBody.panel -weight 1
|
grid rowconfigure .frmBody .frmBody.panel -weight 1
|
||||||
|
|
||||||
|
# Панель инстурментов
|
||||||
ttk::button $frmTool.btn_tree -command ToolBtnTreePress -image tree_24x24
|
ttk::button $frmTool.btn_tree -command ToolBtnTreePress -image tree_24x24
|
||||||
ttk::button $frmTool.btn_search -command FileOper::FindInFiles -image search_24x24
|
ttk::button $frmTool.btn_search -command FileOper::FindInFiles -image search_24x24
|
||||||
ttk::button $frmTool.btn_git -command Git::Dialog -image git_24x24
|
ttk::button $frmTool.btn_git -command Git::Dialog -image git_24x24
|
||||||
|
ttk::button $frmTool.btn_settings -command Settings -image settings_24x24
|
||||||
|
|
||||||
pack $frmTool.btn_tree $frmTool.btn_search $frmTool.btn_git -side top -padx 1 -pady 1
|
pack $frmTool.btn_tree $frmTool.btn_search $frmTool.btn_git -side top -padx 1 -pady 1
|
||||||
|
pack $frmTool.btn_settings -side bottom -padx 1 -pady 10
|
||||||
|
|
||||||
# #label $frmTool.lbl_logo -image tcl
|
# #label $frmTool.lbl_logo -image tcl
|
||||||
# pack $frmTool.btn_quit -side bottom -padx 5 -pady 5
|
# pack $frmTool.btn_quit -side bottom -padx 5 -pady 5
|
||||||
# #pack $frmTool.lbl_logo -side bottom -padx 5 -pady 5
|
# #pack $frmTool.lbl_logo -side bottom -padx 5 -pady 5
|
||||||
|
|||||||
@@ -190,5 +190,25 @@ namespace eval Highlight {} {
|
|||||||
ctext::addHighlightClassForRegexp $txt namespaces #0093ff {->|\+\+|::}
|
ctext::addHighlightClassForRegexp $txt namespaces #0093ff {->|\+\+|::}
|
||||||
ctext::addHighlightClass $txt bool #3e803b {null false true}
|
ctext::addHighlightClass $txt bool #3e803b {null false true}
|
||||||
}
|
}
|
||||||
|
proc ExecuteColorized {txt} {
|
||||||
|
# ctext::addHighlightClassForRegexp $txt flags orange {\s-[a-zA-Z]+}
|
||||||
|
# ctext::addHighlightClass $txt stackControl #19a2a6 [info commands]
|
||||||
|
# ctext::addHighlightClass $txt widgets #9d468d [list canvas ctext button entry label text labelframe frame toplevel scrollbar checkbutton canvas listbox menu menubar menubutton radiobutton scale entry message tk_chooseDir tk_getSaveFile tk_getOpenFile tk_chooseColor tk_optionMenu ttk::button ttk::checkbutton ttk::combobox ttk::entry ttk::frame ttk::intro ttk::label ttk::labelframe ttk::menubutton ttk::treeview ttk::notebook ttk::panedwindow ttk::progressbar ttk::radiobutton ttk::scale ttk::scrollbar ttk::separator ttk::sizegrip ttk::spinbox ]
|
||||||
|
# ctext::addHighlightClassWithOnlyCharStart $txt vars #4471ca "\$"
|
||||||
|
# ctext::addHighlightClass $txt variable_funcs gold {set global variable unset}
|
||||||
|
# # ctext::addHighlightClassForSpecialChars $txt brackets green {[]{}()}
|
||||||
|
# ctext::addHighlightClassForRegexp $txt namespaces #4f64ff {::}
|
||||||
|
# ctext::addHighlightClassForRegexp $txt qoute #b84a0c {("|'|`).+("|'|`)}
|
||||||
|
# ctext::addHighlightClassForRegexp $txt colors #68ceff {(#)(\w)+?(\s|$)}
|
||||||
|
# ctext::addHighlightClassForRegexp $txt comments #666666 {(^|;)\s*(#)[^\n\r]*}
|
||||||
|
# ctext::addHighlightClass $txt bool #3e803b {null false true}
|
||||||
|
# ctext::addHighlightClassForRegexp $txt paths lightblue {(\s)([\w]+)(=)}
|
||||||
|
# ctext::addHighlightClassForSpecialChars $txt tags lightgreen {<>/}
|
||||||
|
# ctext::addHighlightClassForRegexp $txt tags #199100 {/.+\s}
|
||||||
|
ctext::addHighlightClassForRegexp $txt gopaths lightblue {(.+?):(\d+):(\d+):}
|
||||||
|
ctext::addHighlightClassForRegexp $txt paths lightblue {(\\|/|\.|^)((\w)|(\.)|(/)|([\.\w]))+?\s}
|
||||||
|
ctext::addHighlightClass $txt compile_errors #ff5050 {error Error ERROR invalid undefined cannot}
|
||||||
|
ctext::addHighlightClassForRegexp $txt url lightblue {\w+://\w.+\w+}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1913,3 +1913,37 @@ image create photo j2_16x12 -data {
|
|||||||
5nEG7+28M9SARyoW37c7A72MxzFpr/Dd1sUKRxpZbJg7joMDAwDgDzlS9ta5m7mUAAAAAElFTkSu
|
5nEG7+28M9SARyoW37c7A72MxzFpr/Dd1sUKRxpZbJg7joMDAwDgDzlS9ta5m7mUAAAAAElFTkSu
|
||||||
QmCC
|
QmCC
|
||||||
}
|
}
|
||||||
|
image create photo execute_11x11 -data {
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAABg2lDQ1BJQ0MgcHJvZmlsZQAAKJF9
|
||||||
|
kT1Iw1AUhU9TpVIqDnYQUclQneyiIo5ahSJUCLVCqw4mL/2DJg1Jiouj4Fpw8Gex6uDirKuDqyAI
|
||||||
|
/oC4C06KLlLifUmhRYwPLu/jvHcO990HCI0K06yuWUDTbTOdTIjZ3KoYekUYw1QjiMrMMuYkKQXf
|
||||||
|
9XWPAN/v4jzL/96fq1fNWwwIiMSzzDBt4g3i6U3b4LxPHGUlWSU+Jx43qUHiR64rHr9xLros8Myo
|
||||||
|
mUnPE0eJxWIHKx3MSqZGPEUcUzWd8oWsxyrnLc5apcZaffIXRvL6yjLXqYaQxCKWIEGEghrKqMBG
|
||||||
|
nHadFAtpOk/4+Addv0QuhVxlMHIsoAoNsusH/4Pfs7UKkxNeUiQBdL84zscoENoFmnXH+T52nOYJ
|
||||||
|
EHwGrvS2v9oAZj5Jr7e12BHQtw1cXLc1ZQ+43AEGngzZlF0pSCUUCsD7GX1TDui/BcJr3txa5zh9
|
||||||
|
ADI0q9QNcHAIjBUpe93n3T2dc/v3Tmt+P5frcrXBnzRwAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
|
||||||
|
WXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH6QodCiMdxWTpZwAAABl0RVh0Q29tbWVudABDcmVhdGVk
|
||||||
|
IHdpdGggR0lNUFeBDhcAAABHSURBVBjTjY/BDQAwCAKNUzleux1b2Y+PxgiRJ7kjalYBkADSRLwX
|
||||||
|
SvCpZIKzlUlwdWMXJFw5Kzgi7mr5A/XyBI4wA9kzFHrskxvBNKQinAAAAABJRU5ErkJggg==
|
||||||
|
}
|
||||||
|
image create photo settings_24x24 -data {
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABg2lDQ1BJQ0MgcHJvZmlsZQAAKJF9
|
||||||
|
kT1Iw1AUhU9TpVIqDnYQUclQneyiIo5ahSJUCLVCqw4mL/2DJg1Jiouj4Fpw8Gex6uDirKuDqyAI
|
||||||
|
/oC4C06KLlLifUmhRYwPLu/jvHcO990HCI0K06yuWUDTbTOdTIjZ3KoYekUYw1QjiMrMMuYkKQXf
|
||||||
|
9XWPAN/v4jzL/96fq1fNWwwIiMSzzDBt4g3i6U3b4LxPHGUlWSU+Jx43qUHiR64rHr9xLros8Myo
|
||||||
|
mUnPE0eJxWIHKx3MSqZGPEUcUzWd8oWsxyrnLc5apcZaffIXRvL6yjLXqYaQxCKWIEGEghrKqMBG
|
||||||
|
nHadFAtpOk/4+Addv0QuhVxlMHIsoAoNsusH/4Pfs7UKkxNeUiQBdL84zscoENoFmnXH+T52nOYJ
|
||||||
|
EHwGrvS2v9oAZj5Jr7e12BHQtw1cXLc1ZQ+43AEGngzZlF0pSCUUCsD7GX1TDui/BcJr3txa5zh9
|
||||||
|
ADI0q9QNcHAIjBUpe93n3T2dc/v3Tmt+P5frcrXBnzRwAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
|
||||||
|
WXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH6QodESQY6jzHvgAAABl0RVh0Q29tbWVudABDcmVhdGVk
|
||||||
|
IHdpdGggR0lNUFeBDhcAAAHySURBVEjHrZZPSFVREMZ/iomaBm1SApFHIEoL+6e7ROHTFkEbaWNb
|
||||||
|
95YgSFiLyECIoJXtIkEXZqSrIoYwQiEScVOCguQylCzKpyFBm3PjvcO5f8L3wV3cufPNnHNmvjO3
|
||||||
|
jAwws06gxTN/lTSfxq0gGx4BFz3bAVCdRizPmOBswFZlZg1HTmBm9UBVzOczafwyL9groAGYAJ4D
|
||||||
|
bcDDwPFE+AKMADPAdWAAaATOSfpdlMDM+oDZAvJPoC7jEf4CagveRySN/0tgZtXAKtBMabAH5CRt
|
||||||
|
RzUYyhj80D1pOA48KCzyQArhE9AlqVJSJXAeeJvC6TezY1GCXmAtxnEd6JD0LjJIWnWchRjOFtAj
|
||||||
|
6bDcETaAS8DLgPNdSXnfKOkPMBzw/wC0S1oq0oEL8jpAWIw7A0nLAfOypO3/UfKJBBGG+AdBJZtZ
|
||||||
|
DhgMEK4mJL8WsN0ws8tFSnYimwRqAoQfQJukLW/1jcB7oClmF7ckPYkSbAK5hJXmXV9HNWoH7gCn
|
||||||
|
U9R9KrquR4GpBOca4L57smJM0n7UptNuu6XCOvDY76KbntMC8C1DsDzwxrPdlrTv62AFuOeu6lZJ
|
||||||
|
3W5MPksIPgdckHTF1XAMeCrpRXAexPT6yYSddEj6eKSJJmk3IcFGqWby51AbSvpeqr+KPjcKC7GT
|
||||||
|
hfgXbteIc85F7RUAAAAASUVORK5CYII=
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
proc ImageViewer {f w node} {
|
proc ImageViewer {f w node} {
|
||||||
|
global factor cfgVariables
|
||||||
set factor($node) 1.0
|
set factor($node) 1.0
|
||||||
ttk::frame $w.f
|
ttk::frame $w.f
|
||||||
pack $w.f -side left -fill both -expand true
|
pack $w.f -side left -fill both -expand true
|
||||||
canvas $w.f.c -xscrollcommand "$w.f.x set" -yscrollcommand "$w.y set"
|
canvas $w.f.c -xscrollcommand "$w.f.x set" -yscrollcommand "$w.y set" -bg $cfgVariables(backGround)
|
||||||
ttk::scrollbar $w.f.x -ori hori -command "$w.f.c xview"
|
ttk::scrollbar $w.f.x -ori hori -command "$w.f.c xview"
|
||||||
ttk::scrollbar $w.y -ori vert -command "$w.f.c yview"
|
ttk::scrollbar $w.y -ori vert -command "$w.f.c yview"
|
||||||
|
|
||||||
@@ -20,15 +21,15 @@ proc ImageViewer {f w node} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
proc openImg {fn w node} {
|
proc openImg {fn w node} {
|
||||||
global im1
|
global im1 factor
|
||||||
set im1 [image create photo -file $fn]
|
set im1 [image create photo -file $fn]
|
||||||
#scale $w
|
scale $w $factor($node) $node
|
||||||
list [file size $fn] bytes, [image width $im1]x[image height $im1]
|
list [file size $fn] bytes, [image width $im1]x[image height $im1]
|
||||||
$w create image 1 1 -image $im1 -anchor nw -tag img
|
$w create image 1 1 -image $im1 -anchor nw -tag img
|
||||||
}
|
}
|
||||||
|
|
||||||
proc scale {w {n 1} node} {
|
proc scale {w {n 1} node} {
|
||||||
global im1 im2 factor noteBook tab_label
|
global im1 im2 factor tab_label
|
||||||
set factor($node) [expr {$factor($node) * $n}]
|
set factor($node) [expr {$factor($node) * $n}]
|
||||||
$w delete img
|
$w delete img
|
||||||
catch {image delete $im2}
|
catch {image delete $im2}
|
||||||
@@ -41,7 +42,8 @@ proc scale {w {n 1} node} {
|
|||||||
$im2 copy $im1 -subsample $f $f
|
$im2 copy $im1 -subsample $f $f
|
||||||
}
|
}
|
||||||
$w create image 1 1 -image $im2 -anchor nw -tag img
|
$w create image 1 1 -image $im2 -anchor nw -tag img
|
||||||
$noteBook itemconfigure $node -text "$tab_label (size x$factor($node))"
|
set noteBook [file extension $node]
|
||||||
|
# $noteBook itemconfigure $node -text "(size x$factor($node))"
|
||||||
$w config -scrollregion [$w bbox all]
|
$w config -scrollregion [$w bbox all]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,6 +54,7 @@ proc ImageBase64Encode {text} {
|
|||||||
{"GIF" {.gif}}
|
{"GIF" {.gif}}
|
||||||
{"JPEG" {.jpg}}
|
{"JPEG" {.jpg}}
|
||||||
{"BMP" {.bmp}}
|
{"BMP" {.bmp}}
|
||||||
|
{"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 .]
|
||||||
@@ -65,5 +68,3 @@ proc ImageBase64Encode {text} {
|
|||||||
$text insert [Position] "image create photo $name -data {\n$data\n}"
|
$text insert [Position] "image create photo $name -data {\n$data\n}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
14
lib/menu.tcl
14
lib/menu.tcl
@@ -9,7 +9,7 @@
|
|||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
proc GetFileMenu {m} {
|
proc GetFileMenu {m} {
|
||||||
global activeProject
|
global activeProject cfgVariables
|
||||||
$m add command -label [::msgcat::mc "New file"] -command Editor::New\
|
$m add command -label [::msgcat::mc "New file"] -command Editor::New\
|
||||||
-accelerator "Ctrl+N"
|
-accelerator "Ctrl+N"
|
||||||
$m add command -label [::msgcat::mc "Open file"] -accelerator "Ctrl+O" -command {
|
$m add command -label [::msgcat::mc "Open file"] -accelerator "Ctrl+O" -command {
|
||||||
@@ -25,8 +25,15 @@ proc GetFileMenu {m} {
|
|||||||
$m add command -label [::msgcat::mc "Close all"] -command {FileOper::CloseAll}
|
$m add command -label [::msgcat::mc "Close all"] -command {FileOper::CloseAll}
|
||||||
|
|
||||||
$m add separator
|
$m add separator
|
||||||
|
menu $m.openRecent
|
||||||
|
$m add cascade -label [::msgcat::mc "Open recent"] -menu $m.openRecent
|
||||||
|
foreach item $cfgVariables(recentFolder) {
|
||||||
|
$m.openRecent add command -label $item -command [list OpenRecentProject $item]
|
||||||
|
}
|
||||||
|
|
||||||
$m add command -label [::msgcat::mc "Open folder"] -accelerator "Ctrl+K" -command {
|
$m add separator
|
||||||
|
|
||||||
|
$m add command -label [::msgcat::mc "Open folder"] -accelerator "Alt+K" -command {
|
||||||
set folderPath [FileOper::OpenFolderDialog]
|
set folderPath [FileOper::OpenFolderDialog]
|
||||||
if {$folderPath != ""} {
|
if {$folderPath != ""} {
|
||||||
# set activeProject $folderPath
|
# set activeProject $folderPath
|
||||||
@@ -69,7 +76,8 @@ proc GetEditMenu {m} {
|
|||||||
$m add separator
|
$m add separator
|
||||||
$m add command -label [::msgcat::mc "Insert image"] -accelerator "Ctrl+I"\
|
$m add command -label [::msgcat::mc "Insert image"] -accelerator "Ctrl+I"\
|
||||||
-command ImageBase64Encode
|
-command ImageBase64Encode
|
||||||
|
$m add separator
|
||||||
|
$m add command -label [::msgcat::mc "Settings"] -command Settings
|
||||||
}
|
}
|
||||||
|
|
||||||
proc GetViewMenu {m} {
|
proc GetViewMenu {m} {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
# Author: Roman Schaller <r.schaller@gmx.ch> #
|
# Author: Roman Schaller <r.schaller@gmx.ch> #
|
||||||
###########################################################
|
###########################################################
|
||||||
|
|
||||||
::msgcat::mcset de "About ..." "<EFBFBD>ber ..."
|
::msgcat::mcset de "About ..." "Über ..."
|
||||||
::msgcat::mcset de "Add to project" "Zu Projekt hinzuf<EFBFBD>gen"
|
::msgcat::mcset de "Add to project" "Zu Projekt hinzufügen"
|
||||||
::msgcat::mcset de "Author" "Autor"
|
::msgcat::mcset de "Author" "Autor"
|
||||||
::msgcat::mcset de "Text autoformat" "Text autoformat"
|
::msgcat::mcset de "Text autoformat" "Text autoformat"
|
||||||
::msgcat::mcset de "Cancel" "Abbrechen"
|
::msgcat::mcset de "Cancel" "Abbrechen"
|
||||||
@@ -29,9 +29,9 @@
|
|||||||
::msgcat::mcset de "Cut into clipboard" "In Zwischenablage ausschneiden"
|
::msgcat::mcset de "Cut into clipboard" "In Zwischenablage ausschneiden"
|
||||||
::msgcat::mcset de "CVS commit"
|
::msgcat::mcset de "CVS commit"
|
||||||
::msgcat::mcset de "CVS update"
|
::msgcat::mcset de "CVS update"
|
||||||
::msgcat::mcset de "Delete" "L<EFBFBD>schen"
|
::msgcat::mcset de "Delete" "Löschen"
|
||||||
::msgcat::mcset de "Delete backup files" "Backup-Dateien l<EFBFBD>schen"
|
::msgcat::mcset de "Delete backup files" "Backup-Dateien löschen"
|
||||||
::msgcat::mcset de "Delete project" "Projekt l<EFBFBD>schen"
|
::msgcat::mcset de "Delete project" "Projekt löschen"
|
||||||
::msgcat::mcset de "Delete from project" "Von Projekt entfernen"
|
::msgcat::mcset de "Delete from project" "Von Projekt entfernen"
|
||||||
::msgcat::mcset de "Docs dir" "Dok Verzeichnis"
|
::msgcat::mcset de "Docs dir" "Dok Verzeichnis"
|
||||||
::msgcat::mcset de "Don't selected file"
|
::msgcat::mcset de "Don't selected file"
|
||||||
@@ -42,10 +42,10 @@
|
|||||||
::msgcat::mcset de "Error open URL"
|
::msgcat::mcset de "Error open URL"
|
||||||
::msgcat::mcset de "Exit" "Beenden"
|
::msgcat::mcset de "Exit" "Beenden"
|
||||||
::msgcat::mcset de "File" "Datei"
|
::msgcat::mcset de "File" "Datei"
|
||||||
::msgcat::mcset de "File already exists. Overwrite?" "Datei besteht bereits. <EFBFBD>berschreiben?"
|
::msgcat::mcset de "File already exists. Overwrite?" "Datei besteht bereits. Überschreiben?"
|
||||||
::msgcat::mcset de "File modify" "Datei bearbeiten"
|
::msgcat::mcset de "File modify" "Datei bearbeiten"
|
||||||
::msgcat::mcset de "File was modifyed. Close?" "Datei wurde ge<EFBFBD>ndert. Trotzdem schliessen?"
|
::msgcat::mcset de "File was modifyed. Close?" "Datei wurde geändert. Trotzdem schliessen?"
|
||||||
::msgcat::mcset de "File was modifyed. Save?" "Datei wurde ge<EFBFBD>ndert. Jetzt speichern?"
|
::msgcat::mcset de "File was modifyed. Save?" "Datei wurde geändert. Jetzt speichern?"
|
||||||
::msgcat::mcset de "File saved" "Datei gespeichert"
|
::msgcat::mcset de "File saved" "Datei gespeichert"
|
||||||
::msgcat::mcset de "Find" "Suchen"
|
::msgcat::mcset de "Find" "Suchen"
|
||||||
::msgcat::mcset de "Font normal" "Schrift normal"
|
::msgcat::mcset de "Font normal" "Schrift normal"
|
||||||
@@ -55,15 +55,15 @@
|
|||||||
::msgcat::mcset de "Home dir" "Home Verzeichnis"
|
::msgcat::mcset de "Home dir" "Home Verzeichnis"
|
||||||
::msgcat::mcset de "Home page" "Homepage"
|
::msgcat::mcset de "Home page" "Homepage"
|
||||||
::msgcat::mcset de "Image dir" "Image Verzeichnis"
|
::msgcat::mcset de "Image dir" "Image Verzeichnis"
|
||||||
::msgcat::mcset de "Insert" "Einf<EFBFBD>gen"
|
::msgcat::mcset de "Insert" "Einfügen"
|
||||||
::msgcat::mcset de "Interface language" "Interface Sprache"
|
::msgcat::mcset de "Interface language" "Interface Sprache"
|
||||||
::msgcat::mcset de "Install Tcl/Tk Project Manager" "Tcl/Tk Project Manager installieren"
|
::msgcat::mcset de "Install Tcl/Tk Project Manager" "Tcl/Tk Project Manager installieren"
|
||||||
::msgcat::mcset de "Line number" "Zeilennummer"
|
::msgcat::mcset de "Line number" "Zeilennummer"
|
||||||
::msgcat::mcset de "Make RPM" "RPM erstellen"
|
::msgcat::mcset de "Make RPM" "RPM erstellen"
|
||||||
::msgcat::mcset de "Make archive" "Archiv erstellen"
|
::msgcat::mcset de "Make archive" "Archiv erstellen"
|
||||||
::msgcat::mcset de "Make backup files" "Backup-Dateien erstellen"
|
::msgcat::mcset de "Make backup files" "Backup-Dateien erstellen"
|
||||||
::msgcat::mcset de "Must be one file select!" "Eine Datei muss ausgew<EFBFBD>hlt sein!"
|
::msgcat::mcset de "Must be one file select!" "Eine Datei muss ausgewählt sein!"
|
||||||
::msgcat::mcset de "Must be one or two file select!" "Eine oder zwei Dateien m<EFBFBD>ssen ausgew<EFBFBD>hlt sein!"
|
::msgcat::mcset de "Must be one or two file select!" "Eine oder zwei Dateien müssen ausgewählt sein!"
|
||||||
::msgcat::mcset de "Modifying the Registry..."
|
::msgcat::mcset de "Modifying the Registry..."
|
||||||
::msgcat::mcset de "Modules" "Module"
|
::msgcat::mcset de "Modules" "Module"
|
||||||
::msgcat::mcset de "New" "Neu"
|
::msgcat::mcset de "New" "Neu"
|
||||||
@@ -71,19 +71,19 @@
|
|||||||
::msgcat::mcset de "New project" "Neues Projekt"
|
::msgcat::mcset de "New project" "Neues Projekt"
|
||||||
::msgcat::mcset de "Not implemented yet" "Noch nicht implementiert"
|
::msgcat::mcset de "Not implemented yet" "Noch nicht implementiert"
|
||||||
::msgcat::mcset de "Not found active project" "Kein aktives Projekt gefunden"
|
::msgcat::mcset de "Not found active project" "Kein aktives Projekt gefunden"
|
||||||
::msgcat::mcset de "Open" "<EFBFBD>ffnen"
|
::msgcat::mcset de "Open" "Öffnen"
|
||||||
::msgcat::mcset de "Open file" "Datei <EFBFBD>ffnen"
|
::msgcat::mcset de "Open file" "Datei öffnen"
|
||||||
::msgcat::mcset de "Open project" "Projekt <EFBFBD>ffnen"
|
::msgcat::mcset de "Open project" "Projekt öffnen"
|
||||||
::msgcat::mcset de "Opened file in progress" "Ge<EFBFBD>ffnete Datei in Bearbeitung"
|
::msgcat::mcset de "Opened file in progress" "Geöffnete Datei in Bearbeitung"
|
||||||
::msgcat::mcset de "Overwrite" "<EFBFBD>berschreiben"
|
::msgcat::mcset de "Overwrite" "Überschreiben"
|
||||||
::msgcat::mcset de "Paste" "Einf<EFBFBD>gen"
|
::msgcat::mcset de "Paste" "Einfügen"
|
||||||
::msgcat::mcset de "Paste from clipboard" "Von Zwischenablage einf<EFBFBD>gen"
|
::msgcat::mcset de "Paste from clipboard" "Von Zwischenablage einfügen"
|
||||||
::msgcat::mcset de "Print ..." "Drucken ..."
|
::msgcat::mcset de "Print ..." "Drucken ..."
|
||||||
::msgcat::mcset de "Print" "Drucken"
|
::msgcat::mcset de "Print" "Drucken"
|
||||||
::msgcat::mcset de "Print command" "Druck-Befehl"
|
::msgcat::mcset de "Print command" "Druck-Befehl"
|
||||||
::msgcat::mcset de "Print selected text" "Markierter Text drucken"
|
::msgcat::mcset de "Print selected text" "Markierter Text drucken"
|
||||||
::msgcat::mcset de "Program finished successfully" "Programm wurde erfolgreich beendet"
|
::msgcat::mcset de "Program finished successfully" "Programm wurde erfolgreich beendet"
|
||||||
::msgcat::mcset de "Program failed" "Ausf<EFBFBD>hrung fehlgeschlagen"
|
::msgcat::mcset de "Program failed" "Ausführung fehlgeschlagen"
|
||||||
::msgcat::mcset de "Programm output" "Programm Ausgabe"
|
::msgcat::mcset de "Programm output" "Programm Ausgabe"
|
||||||
::msgcat::mcset de "Project" "Projekt"
|
::msgcat::mcset de "Project" "Projekt"
|
||||||
::msgcat::mcset de "Projects" "Projekte"
|
::msgcat::mcset de "Projects" "Projekte"
|
||||||
@@ -101,8 +101,8 @@
|
|||||||
::msgcat::mcset de "Release"
|
::msgcat::mcset de "Release"
|
||||||
::msgcat::mcset de "RPM dir" "RPM Verzeichnis"
|
::msgcat::mcset de "RPM dir" "RPM Verzeichnis"
|
||||||
::msgcat::mcset de "RPM file mask" "RPM Datei Maske"
|
::msgcat::mcset de "RPM file mask" "RPM Datei Maske"
|
||||||
::msgcat::mcset de "Run" "Ausf<EFBFBD>hren"
|
::msgcat::mcset de "Run" "Ausführen"
|
||||||
::msgcat::mcset de "Running project" "Projekt ausf<EFBFBD>hren"
|
::msgcat::mcset de "Running project" "Projekt ausführen"
|
||||||
::msgcat::mcset de "Running file"
|
::msgcat::mcset de "Running file"
|
||||||
::msgcat::mcset de "Save" "Speichern"
|
::msgcat::mcset de "Save" "Speichern"
|
||||||
::msgcat::mcset de "Save as" "Speichern unter"
|
::msgcat::mcset de "Save as" "Speichern unter"
|
||||||
@@ -110,9 +110,9 @@
|
|||||||
::msgcat::mcset de "Save file as" "Datei speichern unter"
|
::msgcat::mcset de "Save file as" "Datei speichern unter"
|
||||||
::msgcat::mcset de "Save all" "Alles speichern"
|
::msgcat::mcset de "Save all" "Alles speichern"
|
||||||
::msgcat::mcset de "Search" "Suchen"
|
::msgcat::mcset de "Search" "Suchen"
|
||||||
::msgcat::mcset de "Select" "Ausw<EFBFBD>hlen"
|
::msgcat::mcset de "Select" "Auswählen"
|
||||||
::msgcat::mcset de "Select directory" "Verzeichnis ausw<EFBFBD>hlen"
|
::msgcat::mcset de "Select directory" "Verzeichnis auswählen"
|
||||||
::msgcat::mcset de "Selected directory" "Ausgew<EFBFBD>hltes Verzeichnis"
|
::msgcat::mcset de "Selected directory" "Ausgewähltes Verzeichnis"
|
||||||
::msgcat::mcset de "Settings" "Einstellungen"
|
::msgcat::mcset de "Settings" "Einstellungen"
|
||||||
::msgcat::mcset de "Show backup files" "Backup-Dateien anzeigen"
|
::msgcat::mcset de "Show backup files" "Backup-Dateien anzeigen"
|
||||||
::msgcat::mcset de "Interpretator" "Interpreter"
|
::msgcat::mcset de "Interpretator" "Interpreter"
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
::msgcat::mcset de "TGZ file mask" "TGZ Datei Maske"
|
::msgcat::mcset de "TGZ file mask" "TGZ Datei Maske"
|
||||||
::msgcat::mcset de "Thanks" "Danksagung"
|
::msgcat::mcset de "Thanks" "Danksagung"
|
||||||
::msgcat::mcset de "Toolbar" "Symbolleiste"
|
::msgcat::mcset de "Toolbar" "Symbolleiste"
|
||||||
::msgcat::mcset de "Undo" "R<EFBFBD>ckg<EFBFBD>ngig"
|
::msgcat::mcset de "Undo" "Rückgängig"
|
||||||
::msgcat::mcset de "Update"
|
::msgcat::mcset de "Update"
|
||||||
::msgcat::mcset de "Version"
|
::msgcat::mcset de "Version"
|
||||||
::msgcat::mcset de "View" "Ansicht"
|
::msgcat::mcset de "View" "Ansicht"
|
||||||
@@ -130,4 +130,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -59,12 +59,16 @@
|
|||||||
::msgcat::mcset en "Editor font bold"
|
::msgcat::mcset en "Editor font bold"
|
||||||
::msgcat::mcset en "Error open URL"
|
::msgcat::mcset en "Error open URL"
|
||||||
::msgcat::mcset en "Editor settings"
|
::msgcat::mcset en "Editor settings"
|
||||||
|
::msgcat::mcset en "Enter command for execute file"
|
||||||
::msgcat::mcset en "Exit"
|
::msgcat::mcset en "Exit"
|
||||||
::msgcat::mcset en "File"
|
::msgcat::mcset en "File"
|
||||||
::msgcat::mcset en "File already exists. Overwrite?"
|
::msgcat::mcset en "File already exists. Overwrite?"
|
||||||
::msgcat::mcset en "File modify"
|
::msgcat::mcset en "File modify"
|
||||||
::msgcat::mcset en "File was modifyed. Close?"
|
::msgcat::mcset en "File was modifyed. Close?"
|
||||||
::msgcat::mcset en "File was modifyed. Save?"
|
::msgcat::mcset en "File was modifyed. Save?"
|
||||||
|
::msgcat::mcset en "The file looks like a binary file. Open anyway?"
|
||||||
|
::msgcat::mcset en "The file looks like a image. Support not implemented yet."
|
||||||
|
::msgcat::mcset en "The file size to big. Open anyway?"
|
||||||
::msgcat::mcset en "File saved"
|
::msgcat::mcset en "File saved"
|
||||||
::msgcat::mcset en "Files"
|
::msgcat::mcset en "Files"
|
||||||
::msgcat::mcset en "Find"
|
::msgcat::mcset en "Find"
|
||||||
@@ -108,6 +112,7 @@
|
|||||||
::msgcat::mcset en "Open file"
|
::msgcat::mcset en "Open file"
|
||||||
::msgcat::mcset en "Open project"
|
::msgcat::mcset en "Open project"
|
||||||
::msgcat::mcset en "Opened file in progress"
|
::msgcat::mcset en "Opened file in progress"
|
||||||
|
::msgcat::mcset en "Open recent"
|
||||||
::msgcat::mcset en "Operators"
|
::msgcat::mcset en "Operators"
|
||||||
::msgcat::mcset en "Overwrite"
|
::msgcat::mcset en "Overwrite"
|
||||||
::msgcat::mcset en "Parameters"
|
::msgcat::mcset en "Parameters"
|
||||||
@@ -181,7 +186,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
::msgcat::mcset ru "Close" "Закрыть"
|
::msgcat::mcset ru "Close" "Закрыть"
|
||||||
::msgcat::mcset ru "Close all" "Закрыть все"
|
::msgcat::mcset ru "Close all" "Закрыть все"
|
||||||
::msgcat::mcset ru "Close file" "Закрыть файл"
|
::msgcat::mcset ru "Close file" "Закрыть файл"
|
||||||
::msgcat::mcset ru "Close folder" "Закрыть папку"
|
::msgcat::mcset ru "Close folder" "Закрыть каталог"
|
||||||
::msgcat::mcset ru "Close Project Manager?" "Выйти из программы?"
|
::msgcat::mcset ru "Close Project Manager?" "Выйти из программы?"
|
||||||
::msgcat::mcset ru "Comments" "Коментарии"
|
::msgcat::mcset ru "Comments" "Коментарии"
|
||||||
::msgcat::mcset ru "Comment selected" "Закоментировать"
|
::msgcat::mcset ru "Comment selected" "Закоментировать"
|
||||||
@@ -77,6 +77,7 @@
|
|||||||
::msgcat::mcset ru "Editor settings" "Настройки редактора"
|
::msgcat::mcset ru "Editor settings" "Настройки редактора"
|
||||||
::msgcat::mcset ru "Editor helpers" "Подсказки при вводе"
|
::msgcat::mcset ru "Editor helpers" "Подсказки при вводе"
|
||||||
::msgcat::mcset ru "Encode" "Перекодировка"
|
::msgcat::mcset ru "Encode" "Перекодировка"
|
||||||
|
::msgcat::mcset ru "Enter command for execute file" "Введите команду для запуска текущего файла"
|
||||||
::msgcat::mcset ru "Authorisation required" "Требуется авторизация"
|
::msgcat::mcset ru "Authorisation required" "Требуется авторизация"
|
||||||
::msgcat::mcset ru "Error open URL" "Ошибка открытия URL"
|
::msgcat::mcset ru "Error open URL" "Ошибка открытия URL"
|
||||||
::msgcat::mcset ru "Exit" "Выход"
|
::msgcat::mcset ru "Exit" "Выход"
|
||||||
@@ -88,6 +89,9 @@
|
|||||||
::msgcat::mcset ru "File was modifyed" "Файл был изменен"
|
::msgcat::mcset ru "File was modifyed" "Файл был изменен"
|
||||||
::msgcat::mcset ru "File modify" "Файл изменен"
|
::msgcat::mcset ru "File modify" "Файл изменен"
|
||||||
::msgcat::mcset ru "File saved" "Файл сохранен"
|
::msgcat::mcset ru "File saved" "Файл сохранен"
|
||||||
|
::msgcat::mcset ru "The file looks like a binary file. Open anyway?" "Файл похож на двоичный. Открыть все равно?"
|
||||||
|
::msgcat::mcset ru "The file looks like a image. Support not implemented yet." "Файл выглядит как изображение. Поддержка пока не реализована."
|
||||||
|
::msgcat::mcset ru "The file size to big. Open anyway?" "Файл большого размера. Открыть все равно?"
|
||||||
::msgcat::mcset ru "Find" "Найти"
|
::msgcat::mcset ru "Find" "Найти"
|
||||||
::msgcat::mcset ru "Found" "Найдено"
|
::msgcat::mcset ru "Found" "Найдено"
|
||||||
::msgcat::mcset ru "Find in files" "Найти в файлах"
|
::msgcat::mcset ru "Find in files" "Найти в файлах"
|
||||||
@@ -138,9 +142,10 @@
|
|||||||
::msgcat::mcset ru "No" "Нет"
|
::msgcat::mcset ru "No" "Нет"
|
||||||
::msgcat::mcset ru "Open" "Открыть"
|
::msgcat::mcset ru "Open" "Открыть"
|
||||||
::msgcat::mcset ru "Open file" "Открыть файл"
|
::msgcat::mcset ru "Open file" "Открыть файл"
|
||||||
::msgcat::mcset ru "Open folder" "Открыть папку"
|
::msgcat::mcset ru "Open folder" "Открыть каталог"
|
||||||
::msgcat::mcset ru "Open project" "Открыть проект"
|
::msgcat::mcset ru "Open project" "Открыть проект"
|
||||||
::msgcat::mcset ru "Opened file in progress" "Открытие файла"
|
::msgcat::mcset ru "Opened file in progress" "Открытие файла"
|
||||||
|
::msgcat::mcset ru "Open recent" "Открыть недавнее"
|
||||||
::msgcat::mcset ru "Operators" "Операторы"
|
::msgcat::mcset ru "Operators" "Операторы"
|
||||||
::msgcat::mcset ru "Overwrite" "Замена"
|
::msgcat::mcset ru "Overwrite" "Замена"
|
||||||
::msgcat::mcset ru "Parameters" "Параметры"
|
::msgcat::mcset ru "Parameters" "Параметры"
|
||||||
@@ -195,7 +200,7 @@
|
|||||||
::msgcat::mcset ru "Select directory" "Выбор директории"
|
::msgcat::mcset ru "Select directory" "Выбор директории"
|
||||||
::msgcat::mcset ru "Selected directory" "Директория"
|
::msgcat::mcset ru "Selected directory" "Директория"
|
||||||
::msgcat::mcset ru "Selection color" "Цвет выделения"
|
::msgcat::mcset ru "Selection color" "Цвет выделения"
|
||||||
::msgcat::mcset ru "Settings" "Установки"
|
::msgcat::mcset ru "Settings" "Настройки"
|
||||||
::msgcat::mcset ru "Statusbar" "Строка статуса"
|
::msgcat::mcset ru "Statusbar" "Строка статуса"
|
||||||
::msgcat::mcset ru "Show backup files" "Показывать временные файлы"
|
::msgcat::mcset ru "Show backup files" "Показывать временные файлы"
|
||||||
::msgcat::mcset ru "Show the Menu" "Показывать меню"
|
::msgcat::mcset ru "Show the Menu" "Показывать меню"
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ namespace eval NB {
|
|||||||
proc InsertItem {nb item type} {
|
proc InsertItem {nb item type} {
|
||||||
switch $type {
|
switch $type {
|
||||||
file {
|
file {
|
||||||
regsub -all {\.|/|\\|\s} $item "_" itemName
|
set item [string tolower $item]
|
||||||
|
regsub -all {\.|/|\\|\s|:} $item "_" itemName
|
||||||
|
# puts "$item -> $itemName"
|
||||||
if [winfo exists $nb.$itemName] {
|
if [winfo exists $nb.$itemName] {
|
||||||
set fm $nb.$itemName
|
set fm $nb.$itemName
|
||||||
} else {
|
} else {
|
||||||
@@ -49,19 +51,29 @@ 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 [$w select].frmText2] == 1} {
|
||||||
|
focus -force [$w select].frmText2.frame.text.t
|
||||||
|
} else {
|
||||||
if [winfo exists $txt] {
|
if [winfo exists $txt] {
|
||||||
focus -force $txt.t
|
focus -force $txt.t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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]]
|
||||||
@@ -73,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
|
||||||
|
DebugPuts "NextTab: [$w select]"
|
||||||
|
if {[winfo exists [$w select].frmText2] == 1} {
|
||||||
|
focus -force [$w select].frmText2.frame.text.t
|
||||||
|
} else {
|
||||||
if [winfo exists $txt] {
|
if [winfo exists $txt] {
|
||||||
focus -force $txt.t
|
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<"
|
||||||
@@ -254,11 +264,13 @@ proc FindImage {ext} {
|
|||||||
|
|
||||||
namespace eval Help {
|
namespace eval Help {
|
||||||
proc About {} {
|
proc About {} {
|
||||||
global projman
|
global projman tcl_version tk_version
|
||||||
set msg "Tcl/Tk project Manager\n\n"
|
set msg "Tcl/Tk project Manager\n\n"
|
||||||
append msg "Version: " $projman(Version) "\n" \
|
append msg "Version: " $projman(Version) "\n" \
|
||||||
"Release: " $projman(Release) "\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" \
|
"Author: " $projman(Author) "\n" \
|
||||||
"Home page: " $projman(Homepage)
|
"Home page: " $projman(Homepage)
|
||||||
# foreach name [array names projman] {
|
# foreach name [array names projman] {
|
||||||
@@ -277,17 +289,17 @@ namespace eval Help {
|
|||||||
proc SearchVariable {txt} {
|
proc SearchVariable {txt} {
|
||||||
global fileStructure project variables
|
global fileStructure project variables
|
||||||
set varName [$txt get {insert wordstart} {insert wordend}]
|
set varName [$txt get {insert wordstart} {insert wordend}]
|
||||||
puts ">>>$varName<<<"
|
# puts ">>>$varName<<<"
|
||||||
if {[info exists project] == 0} {return}
|
if {[info exists project] == 0} {return}
|
||||||
foreach f [array names project] {
|
foreach f [array names project] {
|
||||||
puts "--$f"
|
# puts "--$f"
|
||||||
puts "----"
|
# puts "----"
|
||||||
foreach a $project($f) {
|
foreach a $project($f) {
|
||||||
puts "-----$variables($a)"
|
# puts "-----$variables($a)"
|
||||||
foreach b $variables($a) {
|
foreach b $variables($a) {
|
||||||
puts "------$b -- [lindex $b 0]"
|
# puts "------$b -- [lindex $b 0]"
|
||||||
if {$varName eq [lindex $b 0]} {
|
if {$varName eq [lindex $b 0]} {
|
||||||
puts "УРААААААА $varName = $b в файле $a \n\t [lindex $b 0]"
|
# puts "УРААААААА $varName = $b в файле $a \n\t [lindex $b 0]"
|
||||||
# FindVariablesDialog $txt "$varName: \[...\][file tail $a]"
|
# FindVariablesDialog $txt "$varName: \[...\][file tail $a]"
|
||||||
lappend l [list $varName [lindex $b 1] $a]
|
lappend l [list $varName [lindex $b 1] $a]
|
||||||
}
|
}
|
||||||
@@ -355,7 +367,7 @@ proc FindVariablesDialog {txt args} {
|
|||||||
foreach { word } $args {
|
foreach { word } $args {
|
||||||
foreach lst $word {
|
foreach lst $word {
|
||||||
# set l [split $lst " "]
|
# set l [split $lst " "]
|
||||||
puts "[lindex $lst 0] -[lindex $lst 1] -[lindex $lst 2]"
|
# puts "[lindex $lst 0] -[lindex $lst 1] -[lindex $lst 2]"
|
||||||
# lappend l2 [lindex $l 0] [lindex $l 1] [file tail [lindex $l 2]]
|
# lappend l2 [lindex $l 0] [lindex $l 1] [file tail [lindex $l 2]]
|
||||||
# $win.lBox insert {} end -values $lst -text {1 2 3}
|
# $win.lBox insert {} end -values $lst -text {1 2 3}
|
||||||
$win.lBox insert end "[lindex $lst 0] > [lindex $lst 1] > [lindex $lst 2]\n"
|
$win.lBox insert end "[lindex $lst 0] > [lindex $lst 1] > [lindex $lst 2]\n"
|
||||||
@@ -441,7 +453,7 @@ proc SearchStringInFolder {str} {
|
|||||||
if {$tcl_platform(platform) == "windows"} {
|
if {$tcl_platform(platform) == "windows"} {
|
||||||
} elseif {$tcl_platform(platform) == "mac"} {
|
} elseif {$tcl_platform(platform) == "mac"} {
|
||||||
} elseif {$tcl_platform(platform) == "unix"} {
|
} elseif {$tcl_platform(platform) == "unix"} {
|
||||||
puts "$cfgVariables(searchCommand) $cfgVariables(searchCommandOptions) $str $activeProject"
|
# puts "$cfgVariables(searchCommand) $cfgVariables(searchCommandOptions) $str $activeProject"
|
||||||
# Составляем строку (точнее список) для запуска команды
|
# Составляем строку (точнее список) для запуска команды
|
||||||
set cmd exec
|
set cmd exec
|
||||||
regsub -all {\[} $str {\\[} str
|
regsub -all {\[} $str {\\[} str
|
||||||
@@ -683,3 +695,482 @@ proc SetActiveProject {path} {
|
|||||||
.frmStatus.lblGitLogo configure -image git_logo_20x20
|
.frmStatus.lblGitLogo configure -image git_logo_20x20
|
||||||
.frmStatus.lblGit configure -text "[::msgcat::mc "Branch"]: [Git::Branches current]"
|
.frmStatus.lblGit configure -text "[::msgcat::mc "Branch"]: [Git::Branches current]"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Added recently opened folder into menu "File"->"Open recent"
|
||||||
|
proc OpenRecentProject {path} {
|
||||||
|
SetActiveProject $path
|
||||||
|
FileOper::ReadFolder $path
|
||||||
|
ReadFilesFromDirectory $path $path
|
||||||
|
}
|
||||||
|
|
||||||
|
proc AddRecentEditedFolder {path} {
|
||||||
|
global cfgVariables
|
||||||
|
if {$path == ""} {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if {[info exists cfgVariables(recentFolder)] == 0} {
|
||||||
|
set cfgVariables(recentFolder) [list $path]
|
||||||
|
} else {
|
||||||
|
# check if path already in a list
|
||||||
|
foreach item $cfgVariables(recentFolder) {
|
||||||
|
if {$item == $path} {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# check list length, and remove 0 element if length is 10
|
||||||
|
if {[llength $cfgVariables(recentFolder)] == 10} {
|
||||||
|
# lremove $cfgVariables(recentFolder) 0; # tcl 8.7
|
||||||
|
set cfgVariables(recentFolder) [lrange $cfgVariables(recentFolder) 1 end]
|
||||||
|
}
|
||||||
|
lappend cfgVariables(recentFolder) $path
|
||||||
|
}
|
||||||
|
.frmMenu.mnuFile.m.openRecent add command -label $path -command [list OpenRecentProject $path]
|
||||||
|
}
|
||||||
|
|
||||||
|
# ================== OLD ====================
|
||||||
|
proc launchBrowser {url} {
|
||||||
|
global tcl_platform
|
||||||
|
if {$tcl_platform(platform) eq "windows"} {
|
||||||
|
set command [list {*}[auto_execok start] {}]
|
||||||
|
if {[file isdirectory $url]} {
|
||||||
|
set url [file nativename [file join $url .]]
|
||||||
|
}
|
||||||
|
} elseif {$tcl_platform(os) eq "Darwin"} {
|
||||||
|
set command [list open]
|
||||||
|
} else {
|
||||||
|
set command [list xdg-open]
|
||||||
|
}
|
||||||
|
exec {*}$command $url &
|
||||||
|
}
|
||||||
|
## EXEC EXTERNAL BROWSER AND GOTO URL ##
|
||||||
|
proc GoToURL {url} {
|
||||||
|
global env tcl_platform
|
||||||
|
if {$tcl_platform(platform) == "windows"} {
|
||||||
|
set pipe [open "|iexplore $url" "r"]
|
||||||
|
} elseif {$tcl_platform(platform) == "mac"} {
|
||||||
|
set pipe [open "|iexplore $url" "r"]
|
||||||
|
} elseif {$tcl_platform(platform) == "unix"} {
|
||||||
|
#$env(BROWSER)
|
||||||
|
#set pipe [open "|$env(BROWSER) $url" "r"]
|
||||||
|
launchBrowser $url
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fileevent $pipe readable
|
||||||
|
fconfigure $pipe -buffering none -blocking no
|
||||||
|
}
|
||||||
|
## MAKING TAR ARCHIVE ##
|
||||||
|
proc MakeTGZ {} {
|
||||||
|
global activeProject tgzDir tgzNamed workDir projDir env tcl_platform
|
||||||
|
if {$activeProject == ""} {
|
||||||
|
set answer [tk_messageBox\
|
||||||
|
-message [::msgcat::mc "Not found active project"]\
|
||||||
|
-type ok -icon warning\
|
||||||
|
-title [::msgcat::mc "Warning"]]
|
||||||
|
case $answer {
|
||||||
|
ok {return 0}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FileDialog tree save_all
|
||||||
|
set file [open [file join $workDir $activeProject.proj] r]
|
||||||
|
while {[gets $file line]>=0} {
|
||||||
|
scan $line "%s" keyWord
|
||||||
|
set string [string range $line [string first "\"" $line] [string last "\"" $line]]
|
||||||
|
set string [string trim $string "\""]
|
||||||
|
if {$keyWord == "ProjectDirName"} {
|
||||||
|
set dir "$string"
|
||||||
|
}
|
||||||
|
if {$keyWord == "ProjectVersion"} {
|
||||||
|
set version "$string"
|
||||||
|
}
|
||||||
|
if {$keyWord == "ProjectRelease"} {
|
||||||
|
set release "$string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close $file
|
||||||
|
set res [split $tgzNamed "-"]
|
||||||
|
set name [lindex $res 0]
|
||||||
|
set ver [lindex $res 1]
|
||||||
|
set rel [lindex $res 2]
|
||||||
|
if {$name == "projectName"} {
|
||||||
|
set name $activeProject
|
||||||
|
}
|
||||||
|
if {$ver == "version"} {
|
||||||
|
append name "-$version"
|
||||||
|
}
|
||||||
|
if {$rel == "release"} {
|
||||||
|
append name "-$release"
|
||||||
|
}
|
||||||
|
# multiplatform featuring #
|
||||||
|
if {$tcl_platform(platform) == "windows"} {
|
||||||
|
append name ".zip"
|
||||||
|
} elseif {$tcl_platform(platform) == "mac"} {
|
||||||
|
append name ".zip"
|
||||||
|
} elseif {$tcl_platform(platform) == "unix"} {
|
||||||
|
append name ".tar.gz"
|
||||||
|
}
|
||||||
|
catch {cd $projDir} res
|
||||||
|
if {[file exists [file join $tgzDir $name]] == 1} {
|
||||||
|
set answer [tk_messageBox\
|
||||||
|
-message "[::msgcat::mc "File already exists. Overwrite?"] \"$name\" ?"\
|
||||||
|
-type yesno -icon question -default yes\
|
||||||
|
-title [::msgcat::mc "Question"]]
|
||||||
|
case $answer {
|
||||||
|
yes {file delete [file join $tgzDir $name]}
|
||||||
|
no {return 0}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# multiplatform featuring #
|
||||||
|
if {$tcl_platform(platform) == "windows"} {
|
||||||
|
catch [exec pkzip -r -p [file join $tgzDir $name] [file join $activeProject *]] err
|
||||||
|
} elseif {$tcl_platform(platform) == "mac"} {
|
||||||
|
catch [exec zip -c [file join $tgzDir $name] $activeProject] err
|
||||||
|
} elseif {$tcl_platform(platform) == "unix"} {
|
||||||
|
catch [exec tar -czvf [file join $tgzDir $name] $activeProject] err
|
||||||
|
}
|
||||||
|
# message dialog #
|
||||||
|
set msg "[::msgcat::mc "Archive created in"] [file join $tgzDir $name]"
|
||||||
|
set icon info
|
||||||
|
set answer [tk_messageBox\
|
||||||
|
-message "$msg"\
|
||||||
|
-type ok -icon $icon]
|
||||||
|
case $answer {
|
||||||
|
ok {return 0}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Процедура для проверки, находится ли редактирование в последней строке
|
||||||
|
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
|
||||||
|
if {$activeProject == ""} {
|
||||||
|
set answer [tk_messageBox\
|
||||||
|
-message "[::msgcat::mc "Not found active project"]"\
|
||||||
|
-type ok -icon warning\
|
||||||
|
-title [::msgcat::mc "Warning"]]
|
||||||
|
case $answer {
|
||||||
|
ok {return 0}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FileOper::Save
|
||||||
|
set file $filePath
|
||||||
|
set action run
|
||||||
|
# create array with file names #
|
||||||
|
frame $w.frame -borderwidth 2 -relief ridge -background $cfgVariables(backGround)
|
||||||
|
pack $w.frame -side top -fill both -expand true
|
||||||
|
|
||||||
|
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) \
|
||||||
|
-selectborderwidth 0 -selectbackground $cfgVariables(selectbg) -width 10 -height 10
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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 #
|
||||||
|
$txt tag configure bold -font $cfgVariables(fontBold)
|
||||||
|
$txt tag configure error -font $cfgVariables(fontBold) -foreground red
|
||||||
|
$txt tag add bold 0.0 0.end
|
||||||
|
|
||||||
|
$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
|
||||||
|
}
|
||||||
|
|
||||||
|
proc CloseExecuteDialog {w activeEditor} {
|
||||||
|
destroy $w
|
||||||
|
focus $activeEditor.frmText.t.t
|
||||||
|
}
|
||||||
|
|
||||||
|
proc Run {w filePath} {
|
||||||
|
# Получаем индекс конца последней строки
|
||||||
|
set endIndex [$w.frame.text index "end-1c"]; # или "end-1l lineend"
|
||||||
|
|
||||||
|
# Получаем индекс начала последней строки
|
||||||
|
set startIndex [$w.frame.text index "end-1l linestart"]
|
||||||
|
|
||||||
|
set command [$w.frame.text get $startIndex $endIndex end]
|
||||||
|
# Заменяем знак %f на имя текущего файла
|
||||||
|
regsub -all "%f" $command "$filePath" fullCommand
|
||||||
|
$w.frame.text replace $startIndex $endIndex $fullCommand
|
||||||
|
|
||||||
|
# $w.frame.text insert "end-4l linestart"
|
||||||
|
cd [file dirname $filePath]
|
||||||
|
set pipe [open "|$fullCommand 2> [file join [file dirname $filePath] errors]" "r"]
|
||||||
|
set f [open [file join [file dirname $filePath] errors] "r"]
|
||||||
|
set processPID [pid $pipe]
|
||||||
|
|
||||||
|
bind $w.frame.text <Control-c> [list SendSignal $processPID "SIGINT"]
|
||||||
|
bind $w.frame.text <Control-z> [list SendSignal $processPID "SIGTSTP"]
|
||||||
|
bind $w.frame.text <Control-d> [list SendSignal $processPID "SIGKILL"]
|
||||||
|
|
||||||
|
# set pipe [open "|$command $filePath" "r"]
|
||||||
|
# set f [open [file join ~ tmp errors] "r"]
|
||||||
|
fileevent $pipe readable [list DebugInfo $w.frame.text $pipe $f]
|
||||||
|
fconfigure $pipe -buffering none -blocking no
|
||||||
|
}
|
||||||
|
|
||||||
|
## INSERT DEBUG INFORMATION INTO TEXT WIDGET ##
|
||||||
|
proc DebugInfo {widget file f} {
|
||||||
|
$widget configure -state normal
|
||||||
|
if {[eof $file]} {
|
||||||
|
catch [close $file] msg
|
||||||
|
if {$msg != ""} {
|
||||||
|
puts $msg
|
||||||
|
$widget insert "end-4l linestart" "[::msgcat::mc "Program failed"]: $msg\n";
|
||||||
|
} else {
|
||||||
|
# Highlight::ExecuteColorized $widget
|
||||||
|
puts $msg
|
||||||
|
$widget see "end-1l lineend"
|
||||||
|
$widget delete "end-1l lineend" end
|
||||||
|
# $widget insert end "\n-------------------------------------------------\n"
|
||||||
|
# $widget insert end "[::msgcat::mc "Program finished successfully"]\n"
|
||||||
|
}
|
||||||
|
Highlight::ExecuteColorized $widget
|
||||||
|
# close $f
|
||||||
|
} else {
|
||||||
|
# Highlight::ExecuteColorized $widget
|
||||||
|
$widget insert "end-4l linestart" "[read $file]"
|
||||||
|
}
|
||||||
|
while {[gets $f line]>=0} {
|
||||||
|
Highlight::ExecuteColorized $widget
|
||||||
|
$widget insert "end-4l linestart" "$line\n"
|
||||||
|
# puts $line
|
||||||
|
}
|
||||||
|
# close $f
|
||||||
|
$widget see end
|
||||||
|
$widget tag add error 0.0 0.end
|
||||||
|
# $widget configure -state disabled
|
||||||
|
}
|
||||||
|
|
||||||
|
# Функция для отправки сигнала процессу
|
||||||
|
proc SendSignal {pid signal} {
|
||||||
|
global tcl_platform
|
||||||
|
|
||||||
|
if {$tcl_platform(platform) eq "unix"} {
|
||||||
|
# На Unix-системах
|
||||||
|
switch -- $signal {
|
||||||
|
"SIGINT" {catch {exec kill -INT $pid}} ; # Ctrl+C
|
||||||
|
"SIGTERM" {catch {exec kill -TERM $pid}} ; # Завершение
|
||||||
|
"SIGTSTP" {catch {exec kill -TSTP $pid}} ; # Ctrl+Z (приостановка)
|
||||||
|
"SIGKILL" {catch {exec kill -KILL $pid}} ; # Принудительное завершение
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
# На Windows
|
||||||
|
switch -- $signal {
|
||||||
|
"SIGINT" - "SIGTERM" {
|
||||||
|
# Используем taskkill для завершения
|
||||||
|
catch {exec taskkill /PID $pid /T}
|
||||||
|
}
|
||||||
|
"SIGKILL" {
|
||||||
|
# Принудительное завершение на Windows
|
||||||
|
catch {exec taskkill /PID $pid /T /F}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Правка файла настроек
|
||||||
|
proc Settings {} {
|
||||||
|
global dir
|
||||||
|
|
||||||
|
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)"
|
||||||
|
}
|
||||||
|
DebugPuts "ExecutorCommandPathSetting $fileType"
|
||||||
|
DebugPuts [catch {exec {*}$cmd} executor_path]
|
||||||
|
DebugPuts "executor_path $executor_path"
|
||||||
|
if {[catch {exec {*}$cmd} executor_path]} {
|
||||||
|
DebugPuts "Программа $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
|
||||||
|
DebugPuts "first_path $first_path"
|
||||||
|
}
|
||||||
|
if {[info exists cfgVariables($fileType)] == 0} {
|
||||||
|
set 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#
|
#
|
||||||
######################################################
|
######################################################
|
||||||
package require fileutil
|
package require fileutil
|
||||||
package require Thread
|
# package require Thread
|
||||||
|
|
||||||
# TCL procedure
|
# TCL procedure
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ proc GetVariablesFromFile {fileName} {
|
|||||||
set varList ""
|
set varList ""
|
||||||
set params ""
|
set params ""
|
||||||
set varsBegin false
|
set varsBegin false
|
||||||
puts $fileName
|
# puts $fileName
|
||||||
set f [open "$fileName" r]
|
set f [open "$fileName" r]
|
||||||
if {[dict exists $lexers $fileType] == 0} {return}
|
if {[dict exists $lexers $fileType] == 0} {return}
|
||||||
while {[gets $f line] >=0 } {
|
while {[gets $f line] >=0 } {
|
||||||
@@ -32,7 +32,7 @@ proc GetVariablesFromFile {fileName} {
|
|||||||
set indentSize 0
|
set indentSize 0
|
||||||
}
|
}
|
||||||
set varsBegin true
|
set varsBegin true
|
||||||
puts "====== $varsBegin $indentSize"
|
# puts "$varsBegin $indentSize"
|
||||||
continue
|
continue
|
||||||
# lappend varList [list $varName $varValue]
|
# lappend varList [list $varName $varValue]
|
||||||
}
|
}
|
||||||
@@ -41,13 +41,13 @@ proc GetVariablesFromFile {fileName} {
|
|||||||
set l [GetVarFromLine $line $fileType]
|
set l [GetVarFromLine $line $fileType]
|
||||||
if {$line eq ""} {
|
if {$line eq ""} {
|
||||||
set varsBegin false
|
set varsBegin false
|
||||||
puts "====== $varsBegin $indentSize [lindex $l 3]"
|
# puts "$varsBegin $indentSize [lindex $l 3]"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if {[lindex $l 3] ne ""} {
|
if {[lindex $l 3] ne ""} {
|
||||||
if [expr [lindex $l 3] <= $indentSize] {
|
if [expr [lindex $l 3] <= $indentSize] {
|
||||||
set varsBegin false
|
set varsBegin false
|
||||||
puts "====== $varsBegin $indentSize >[lindex $l 3]<"
|
# puts "$varsBegin $indentSize >[lindex $l 3]<"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ proc GetVarFromLine {line fileType} {
|
|||||||
set varType ""
|
set varType ""
|
||||||
}
|
}
|
||||||
set indentLength [string length $indent]
|
set indentLength [string length $indent]
|
||||||
puts "variable: $varName, value: $varValue, type: $varType, indent: >$indent< $indentLength"
|
# puts "variable: $varName, value: $varValue, type: $varType, indent: >$indent< $indentLength"
|
||||||
return [list $varName $varValue $varType $indentLength]
|
return [list $varName $varValue $varType $indentLength]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ proc GetVariablesFromVarFile {fileName} {
|
|||||||
set procList ""
|
set procList ""
|
||||||
set varList ""
|
set varList ""
|
||||||
set params ""
|
set params ""
|
||||||
puts $fileName
|
# puts $fileName
|
||||||
set f [open "$fileName" r]
|
set f [open "$fileName" r]
|
||||||
if {[dict exists $lexers $fileType] == 0} {return}
|
if {[dict exists $lexers $fileType] == 0} {return}
|
||||||
while {[gets $f line] >=0 } {
|
while {[gets $f line] >=0 } {
|
||||||
@@ -122,7 +122,7 @@ proc ReadFilesFromDirectory {directory root {type ""}} {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
foreach fileName [glob -nocomplain *] {
|
foreach fileName [glob -nocomplain *] {
|
||||||
puts "Find file: $fileName [lsearch -exact -nocase $l $fileName]"
|
# puts "Find file: $fileName [lsearch -exact -nocase $l $fileName]"
|
||||||
if {[lsearch -exact $l $fileName] != -1 && [file isdirectory [file join $root $directory $fileName]] == 1} {
|
if {[lsearch -exact $l $fileName] != -1 && [file isdirectory [file join $root $directory $fileName]] == 1} {
|
||||||
# puts "--- $root $fileName"
|
# puts "--- $root $fileName"
|
||||||
ReadFilesFromDirectory [file join $directory $fileName] $root "var"
|
ReadFilesFromDirectory [file join $directory $fileName] $root "var"
|
||||||
@@ -179,8 +179,8 @@ proc ReadFilesFromDirectory {directory root {type ""}} {
|
|||||||
#
|
#
|
||||||
proc Accept { dirLib directory } {
|
proc Accept { dirLib directory } {
|
||||||
global dir
|
global dir
|
||||||
puts $dir(lib)
|
# puts $dir(lib)
|
||||||
puts $dirLib
|
# puts $dirLib
|
||||||
# переменная с указанием ваших действия перед порождением потока
|
# переменная с указанием ваших действия перед порождением потока
|
||||||
set threadinit {
|
set threadinit {
|
||||||
# если необходимо, загружаем исходный tcl код, расположенный в других файлах
|
# если необходимо, загружаем исходный tcl код, расположенный в других файлах
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ namespace eval Tree {
|
|||||||
# puts "$tree $parent $item $type $text"
|
# puts "$tree $parent $item $type $text"
|
||||||
switch $type {
|
switch $type {
|
||||||
file {
|
file {
|
||||||
regsub -all {\.|/|\\|\s} $item "_" subNode
|
regsub -all {\.|/|\\|\s|:} $item "_" subNode
|
||||||
|
set subNode [string tolower $subNode]
|
||||||
# puts "Inserted tree node: $subNode"
|
# puts "Inserted tree node: $subNode"
|
||||||
set fileExt [string trimleft [file extension $text] "."]
|
set fileExt [string trimleft [file extension $text] "."]
|
||||||
#set fileName [string trimleft [file extension $text] "."]
|
#set fileName [string trimleft [file extension $text] "."]
|
||||||
@@ -41,7 +42,8 @@ namespace eval Tree {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
directory {
|
directory {
|
||||||
regsub -all {\.|/|\\|\s} $item "_" subNode
|
regsub -all {\.|/|\\|\s|:} $item "_" subNode
|
||||||
|
set subNode [string tolower $subNode]
|
||||||
# puts $subNode
|
# puts $subNode
|
||||||
if {[string match {*debian*} [string tolower [file tail $item]]]} {
|
if {[string match {*debian*} [string tolower [file tail $item]]]} {
|
||||||
set image [::FindImage debian]
|
set image [::FindImage debian]
|
||||||
@@ -104,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
|
||||||
@@ -112,6 +114,7 @@ namespace eval Tree {
|
|||||||
}
|
}
|
||||||
file {
|
file {
|
||||||
set v [FileOper::Edit $values $nbEditor]
|
set v [FileOper::Edit $values $nbEditor]
|
||||||
|
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}
|
||||||
40
projman.tcl
40
projman.tcl
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Tcl ignores the next line -*- tcl -*- \
|
# Tcl ignores the next line -*- tcl -*- \
|
||||||
exec wish "$0" -- "$@"
|
exec wish8.6 "$0" -- "$@"
|
||||||
|
|
||||||
######################################################
|
######################################################
|
||||||
# Tcl/Tk Project manager 2.0
|
# Tcl/Tk Project manager 2.0
|
||||||
@@ -9,8 +9,8 @@ exec wish "$0" -- "$@"
|
|||||||
# Home page: https://nuk-svk.ru
|
# Home page: https://nuk-svk.ru
|
||||||
######################################################
|
######################################################
|
||||||
# Version: 2.0.0
|
# Version: 2.0.0
|
||||||
# Release: alpha16
|
# Release: beta1
|
||||||
# Build: 22082024151054
|
# Build: 22012026174911
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
# определим текущую версию, релиз и т.д.
|
# определим текущую версию, релиз и т.д.
|
||||||
@@ -34,15 +34,32 @@ 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
|
||||||
package require base64
|
package require base64
|
||||||
package require fileutil
|
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]
|
||||||
@@ -52,7 +69,7 @@ if { $::argc > 0 } {
|
|||||||
foreach arg $::argv {
|
foreach arg $::argv {
|
||||||
lappend opened $arg
|
lappend opened $arg
|
||||||
}
|
}
|
||||||
puts $opened
|
# puts $opened
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -80,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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,16 +119,19 @@ 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]
|
||||||
|
|
||||||
|
Git::CommandPathSetting
|
||||||
|
|
||||||
# Open the PATH if command line argument has been setting
|
# Open the PATH if command line argument has been setting
|
||||||
if [info exists opened] {
|
if [info exists opened] {
|
||||||
foreach path $opened {
|
foreach path $opened {
|
||||||
|
|||||||
@@ -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 8.4; # minimum version for Tile
|
package require Tk; # minimum version for Tile
|
||||||
package require tile 0.8; # depends upon tile
|
package require tile; # depends upon tile
|
||||||
|
|
||||||
|
|
||||||
namespace eval ttk {
|
namespace eval ttk {
|
||||||
@@ -39,6 +39,7 @@ namespace eval ttk::theme::black {
|
|||||||
-lightest "#ffffff"
|
-lightest "#ffffff"
|
||||||
-selectbg "#4a6984"
|
-selectbg "#4a6984"
|
||||||
-selectfg "#ffffff"
|
-selectfg "#ffffff"
|
||||||
|
-font "#c8c8c8"
|
||||||
}
|
}
|
||||||
if {[info commands ::ttk::style] ne ""} {
|
if {[info commands ::ttk::style] ne ""} {
|
||||||
set styleCmd ttk::style
|
set styleCmd ttk::style
|
||||||
@@ -75,21 +76,22 @@ namespace eval ttk::theme::black {
|
|||||||
# ttk widgets.
|
# ttk widgets.
|
||||||
$styleCmd configure TButton \
|
$styleCmd configure TButton \
|
||||||
-width -8 -padding {5 1} -relief link
|
-width -8 -padding {5 1} -relief link
|
||||||
$styleCmd configure TMenubutton\
|
$styleCmd configure TMenubutton \
|
||||||
-relief flat -arrowsize 0
|
-relief flat -arrowsize 0
|
||||||
|
|
||||||
$styleCmd configure TCheckbutton \
|
$styleCmd configure TCheckbutton \
|
||||||
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
|
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
|
||||||
$styleCmd configure TRadiobutton \
|
$styleCmd configure TRadiobutton \
|
||||||
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
|
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
|
||||||
|
|
||||||
$styleCmd configure TEntry \
|
$styleCmd configure TEntry \
|
||||||
-fieldbackground gray20 -foreground black \
|
-fieldbackground gray20 -foreground $colors(-font) \
|
||||||
-padding {2 0} -border -1
|
-padding {2 0} -border -1
|
||||||
$styleCmd configure TCombobox \
|
$styleCmd configure TCombobox \
|
||||||
-fieldbackground white -foreground black \
|
-fieldbackground white -foreground $colors(-font)\
|
||||||
-padding {2 0}
|
-padding {2 0}
|
||||||
$styleCmd configure TSpinbox \
|
$styleCmd configure TSpinbox \
|
||||||
-fieldbackground white -foreground black \
|
-fieldbackground white -foreground $colors(-font) \
|
||||||
-padding {2 0}
|
-padding {2 0}
|
||||||
|
|
||||||
$styleCmd configure TNotebook \
|
$styleCmd configure TNotebook \
|
||||||
@@ -103,8 +105,8 @@ namespace eval ttk::theme::black {
|
|||||||
|
|
||||||
# tk widgets.
|
# tk widgets.
|
||||||
$styleCmd map Menu \
|
$styleCmd map Menu \
|
||||||
-background [list active $colors(-lighter)] \
|
-background [list active $colors(-dark)] \
|
||||||
-foreground [list disabled $colors(-disabledfg)]
|
-foreground [list disabled $colors(-lightest)] \
|
||||||
|
|
||||||
$styleCmd configure TreeCtrl \
|
$styleCmd configure TreeCtrl \
|
||||||
-background gray30 -itembackground {gray60 gray50} \
|
-background gray30 -itembackground {gray60 gray50} \
|
||||||
@@ -116,8 +118,13 @@ namespace eval ttk::theme::black {
|
|||||||
# -background [list selected $colors(-selectbg)] \
|
# -background [list selected $colors(-selectbg)] \
|
||||||
|
|
||||||
$styleCmd configure Treeview -fieldbackground gray25
|
$styleCmd configure Treeview -fieldbackground gray25
|
||||||
|
|
||||||
|
$styleCmd map Canvas \
|
||||||
|
-background [list selected $colors(-lighter)] \
|
||||||
|
-foreground [list selected $colors(-selectfg)] \
|
||||||
|
-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.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#-*-tcl-*-
|
#-*-tcl-*-
|
||||||
# the next line restarts using wish \
|
# the next line restarts using wish \
|
||||||
exec wish "$0" -- ${1+"$@"}
|
exec wish8.6 "$0" -- ${1+"$@"}
|
||||||
|
|
||||||
|
|
||||||
set version 3.0
|
set version 3.0
|
||||||
@@ -1365,6 +1365,3 @@ proc make-regexp::make-regexp {words} {
|
|||||||
set regexp
|
set regexp
|
||||||
}
|
}
|
||||||
#==============================================================================================
|
#==============================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user