"Config Menu" plugin for CudaText

Plugins for SynWrite and CudaText...
User avatar
kvichans
Posts: 203
Joined: 07.10.2012 05:45

Post by kvichans »

1. What is value of key "config_menus_from" in your user.json? Is it "master_menu.json"?

2. Change in your master_menu.json
   {"cap":"Line &Ends", "hint":"_ends"
to
   {"cap":"Line &Ends", "hint":"ends"
I have no ideas how "hint":"_ends" was appeared here.

3.
qwerky wrote:When open plugin ("Config File" is populated), and click either "Select" or "Apply Now", the dialog goes away and immediately returns, but with the "Config File" box empty. Nothing shown in console.

When open plugin ("Config File" is populated), and click "Open", the dialog goes away. Console shows:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "\CudaText\py\cuda_config_menu\cd_config_menu.py", line 438, in dlg_config
btn, vals, chds = dlg_wrapper(_('Config menu'), 5+350+5, 5+190+5, cnts, vals, focus_cid='file')
File "\CudaText\py\cuda_config_menu\cd_plug_lib.py", line 497, in dlg_wrapper
aid = cnts[btn_i]['cid']
KeyError: 'cid'
Update plugin to version 1.1.04. Is problem now?
CudaText 1.163, TC9.51x32, Win10x64(1920x1080)
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

kvichans wrote:1. What is value of key "config_menus_from" in your user.json? Is it "master_menu.json"?
Yes, correct.
2. Change in your master_menu.json
   {"cap":"Line &Ends", "hint":"_ends"
to
   {"cap":"Line &Ends", "hint":"ends"
I have no ideas how "hint":"_ends" was appeared here.
Done; no more console report about _ends.
Update plugin to version 1.1.04. Is problem now?
Plugin Manager | Update... shows 1.1.02 local and available. Also, can't find Config Menu plugin on SourceForge plugins. Where to get 1.1.04?
User avatar
kvichans
Posts: 203
Joined: 07.10.2012 05:45

Post by kvichans »

Try again
CudaText 1.163, TC9.51x32, Win10x64(1920x1080)
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

Hi kvichans. Okay, now it updated--perhaps the old version was still cached somewhere.

Maybe I just don't understand how the dialog is supposed to work. What are the Open and the Select... buttons supposed to do? When I open the dialog, the text box contains "master_menu.json" (correct), and the Create config file... button is grayed out. If I click Open, the dialog goes away and immediately returns with no change; apparently nothing happens (what should it do?). If I click Select, I get a File Open dialog, which allows one to select a different file.

Although I may be confused, ultimately the plugin did provide the desired functionality, allowing to create the original menu file, then choose an edited file, and have it applied on startup (excellent :D ). I haven't tried the Apply on focus (don't know if I need it.)
User avatar
kvichans
Posts: 203
Joined: 07.10.2012 05:45

Post by kvichans »

Hi qwerky.
1. Open opens your "master_menu.json" in CudaText. If the file is already opened then the action like nothing.

2. Create config file can scan only initial (natural) menus and save it to file. As "master_menu.json" is already used as the button is not available.
To unblock the button you need to uncheck Apply on start and restart CudaText.

3. Dont worry about Apply on focus. It is testing feature to load menus by lexers. I think nobody uses it (no claims).

Do yours menus are successfully loaded on start?
CudaText 1.163, TC9.51x32, Win10x64(1920x1080)
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

Thank you. That answers all my questions.

Yes, menus successfully load and operate, so the plugin is doing its job--thank you for making it :) .
Alex842
Posts: 40
Joined: 25.10.2015 09:43

Post by Alex842 »

Приветствую!
Вчера обновил CudaText и плагин до последних версий и только вчера же обратил внимание на такую опцию в плагине:
Note that key "config_menus_from" can has different values for different lexers. Thus you can use lexer-menus. For this you can open current lexer settings (Options/Settings - more/Settings - lexer overide) and set value for key "config_menus_from".
Обрадовался и решил попробовать. Но заметил такой баг:
1) Создал новый файл с меню для Python - menu_python.json
2) Зашёл в настройки лексера Python и вписал такие строки:

Code: Select all

  "config_menus_from": "menu_python.json",
  "config_menus_on_start": true,
  "config_menus_on_focus": true,
3) Перезапустил программу. Меню не поменялось, хотя в окне настроек плагина в поле "config file" стоит нужный файл. Переключился на новую вкладку, потом вернулся. Плагин стал срабатывать нормально. Т.е. при запуске программы, у меня файл сразу не подхватывается...
Версия CudaText 1.39.5.0, версия плагина 1.1.05.

P.S.
Забыл написать, что все остальные изменения нормально применяются сразу при запуске. Например, другой шрифт, размер шрифта, тип отступов и т.п.
User avatar
kvichans
Posts: 203
Joined: 07.10.2012 05:45

Post by kvichans »

Alex842
1. Ключи

Code: Select all

  "config_menus_on_start": true,
  "config_menus_on_focus": true,
нужно переместить в user.json. Они редактируются из диалога.

2. В "lexer Python.json" нужно оставить только

Code: Select all

  "config_menus_from": "menu_python.json",
3. Вы пишете
3) Перезапустил программу. Меню не поменялось, хотя в окне настроек плагина в поле "config file" стоит нужный файл.
- При запуске Куд у вас первым открывается файл с Питоном?
- Что у вас отображается в Консоли при старте и при переключении между табами?

4. Установите версию 1.1.06 из Гитхаба: команде из подменю Plugins/Addon Manadger укажите ссылку
https://github.com/kvichans/cuda_config_menu
В этой версии в диалоге всегда отображается главный конфиг.файл
CudaText 1.163, TC9.51x32, Win10x64(1920x1080)
Alex842
Posts: 40
Joined: 25.10.2015 09:43

Post by Alex842 »

Выполнил первые 2 пункта. Теперь в user.json имею 3 строчки:

Code: Select all

    "config_menus_from": "master_menu.json",
    "config_menus_on_start": true,
    "config_menus_on_focus": true,
в lexer Python.json только одну.

Code: Select all

"config_menus_from": "menu_python.json",
kvichans wrote: 3. - При запуске Куд у вас первым открывается файл с Питоном?
- Что у вас отображается в Консоли при старте и при переключении между табами?
- Да. Первым открываю файл ".py".
Консоль при старте:

Code: Select all

Python 3.5.4
Init: cuda_config_toolbar
Init: cuda_fontawesome
Init: cuda_tabs_list
Init: cuda_config_menu
Init: cuda_macros
OK config menus from "S:\DOPUS\progs\Text\cudatext\settings\master_menu.json" (1.1.05)
Init: cuda_ext
Loading icons: Axialis_20x20
Loading toolbar config
Init: cuda_exttools
Init: cuda_project_man
Init: cuda_sess_manager
Init: cuda_brackets_hilite
Init: cuda_insert_pics
Init: cuda_lint
При переключении на новую вкладку и обратно на вкладку с питоном добавляется только одна новая строка:

Code: Select all

OK config menus from "S:\DOPUS\progs\Text\cudatext\settings\menu_python.json" (1.1.05)
kvichans wrote: 4. Установите новую версию из Гитхаба: команде из подменю Plugins/Addon Manadger укажите ссылку
https://github.com/kvichans/cuda_config_menu
В этой версии в диалоге всегда отображается главный конфиг.файл
Скачал и установил. При старте программы в меню стоит плагин "menu_python.json", но значения берутся из "master_menu.json" (см. первый текст консоли). При переключении между вкладками, всё начинает работать как надо.
P.S.
Проверил на "чистой" программе. Скачал бету 1.39.5.0. Установил последнюю версию плагина. Ошибка осталась.
User avatar
kvichans
Posts: 203
Joined: 07.10.2012 05:45

Post by kvichans »

Ошибка осталась
Ошибка = не сработала загрузка меню для Питона на старте?
Покажите консоль при запуске Куд с новым плагином. Я извиняюсь, что поместил версию на ГХ позже, чем предыдущий пост здесь - вам пришлось делать лишние действия.
CudaText 1.163, TC9.51x32, Win10x64(1920x1080)
Post Reply