GithubHelp home page GithubHelp logo

cuda_config_menu's People

Contributors

alexey-t avatar kvichans avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

cudatext-addons

cuda_config_menu's Issues

cannot import cuda_macros

При старте Куд-

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'cuda_macros'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'cuda_macros'
OK config menus from "/home/user/Downloads/kv-menu2.json"

dont do this API check

if app.app_api_version()<MIN_API_VER: return app.msg_status(_('Need update CudaText'))

это config_menu()
Т.е. это равно проверке api= в install.inf

Send menu to toolbar

Why not (if possible) send the menu bar to a menu button? like on moderm web browsers, maybe a button on toolbar or along with tab bar (like list tabs button).
So you can obtain something of extra space :)

New in Cuda

Menu has also
Edit> Blank oper> Convert tabs
Edit> Blank oper> Convert spaces
pls to menu.json

имя в Plugins

лучше назвать с болш. букв и без "..."
Config Menu
как другие

About conf file, ru-board

5 Все таки неудобное решение с полным файлом меню, да и формат файла неудобен - юникод, да никакого толку от дерева структуры, но у меня руки есть и я просто допилю плагин.
Конечно лучше визуальный редактор, но, судя по всему, всякие настройки в cuda считаются второстепенным функционалом, чтобы на них время тратить. А если мне приспичит, то я для себя напишу.

http://forum.ru-board.com/topic.cgi?forum=5&bm=1&topic=47937&start=220#lt

Dialog

Пач делает диалог новым

замена ф-ции

    def config_menus_settings(self):
        cfg_file    = apx.get_opt('config_menus_from', DEF_MENU_CFG_FILE)
        cfg_on_start= apx.get_opt('config_menus_on_start', True)
        cfg_on_focus= apx.get_opt('config_menus_on_focus', False)

        res_file = 1
        res_onstart = 2
        res_onfocus = 3
        res_ok = 4

        c1 = chr(1)
        res = app.dlg_custom("Settings for 'Config menu'", 320, 136, '\n'.join([]
          +[c1.join(['type=label', 'pos=6,6,310,0', 'cap='+LC_MENU_CONFIG_FILE])]
          +[c1.join(['type=edit', 'pos=6,24,310,0', 'val='+cfg_file])]
          +[c1.join(['type=check', 'pos=6,54,310,0', 'cap=Configure menu on start', 'val='+('1' if cfg_on_start else '0')])]
          +[c1.join(['type=check', 'pos=6,74,310,0', 'cap=Configure menu on focus', 'val='+('1' if cfg_on_focus else '0')])]
          +[c1.join(['type=button', 'pos=106,104,206,0', 'cap=OK'])]
          +[c1.join(['type=button', 'pos=212,104,312,0', 'cap=Cancel'])]
          ))
        if res is None: return
        res, text = res
        text = text.splitlines()
        if res!=res_ok: return

        new_file = text[res_file]
        new_onstart = text[res_onstart]=='1'
        new_onfocus = text[res_onfocus]=='1'

        if new_file!=cfg_file:
            apx.set_opt('config_menus_from', new_file)
        if new_onstart!=cfg_on_start:
            apx.set_opt('config_menus_on_start', new_onstart)
        if new_onfocus!=cfg_on_focus:
            apx.set_opt('config_menus_on_focus', new_onfocus)
       #def config_menus_settings
   #class Command

Support settings-plugins

Added support
You must add special id in

SPEC_IDS= { 'recents':'_recents',  'langs':'_langs',  'enc':'_enc',  'lexers':'_lexers'
          ,'_recents':'_recents', '_langs':'_langs', '_enc':'_enc', '_lexers':'_lexers'
          ,  'plugins':'_plugins'
          , '_plugins':'_plugins'
          , '_themes-ui':'_themes-ui'
          , '_themes-syntax':'_themes-syntax'
          , '_oplugins':'_oplugins'
          }

works in my Cud alfa ver.

def menu

Commnds про кодировки- не все указали
азиатские забыли (и другие)

Problem with upgrade

В конфигураторе menu.json используются имена из cudatext_cmd.py. Если эти имена меняются, то возникает проблема, как это донести до пользователей.
Например, сегодня имена
cmd_Encoding_utf8_Reload
cmd_Encoding_utf8_NoReload
поменялись на
cmd_Encoding_utf8bom_Reload
cmd_Encoding_utf8bom_NoReload
Предлагаю ввести запрет на переименования

Ask

Если я пр. понял то по ум-ю плагин не работает
И только если я что то в menu file поправлю- работает
лучше дать команду- а- активировать меню плага. б- убрать. в- открыть menu file

Dialog too narrow

Оч.тесный диалог- имя файла не умещается

menu-smal

Add new cmd's

Pls add command "Edit/ Char map"
and Encodings asian/arabic - to def menu

"add" to menu

cd_config_menu.py line 151:
i added an "if line" to not clear the menu if "how" set to "add"

if mnu_dict.get('how', 'add') == 'clear':
    app.app_proc(app.PROC_MENU_CLEAR, top_id)

Use new api, dont use deprecated

У себя правил-
заменял
app.app_proc( app.PROC_MENU_ADD, f('{};{};{}', prnt_id, hnt, cap))
на
app.menu_proc(id_action=app.MENU_ADD, id_menu=prnt_id, command=hnt, caption=cap)

Dont work on Cud 1.10

Чистая установка
заходим в длг плагина.

  • кнопка Create запрещена.
  • нажал Help- странное сообщ. Need existed file. "existing" надо. Какой файл
  • кнопка Open дает ошибку
Python 3.5.2
OK config menus from "/home/user/Downloads/cud_old/settings/menu.json"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/user/Downloads/cud_old/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 "/home/user/Downloads/cud_old/py/cuda_config_menu/cd_plug_lib.py", line 497, in dlg_wrapper
    aid     = cnts[btn_i]['cid']
KeyError: 'cid'

JSON error

[
{"cap":"", "hint":"top", "sub": [
{"cap":"文件 ", "hint":"top-file", "sub": [
{"cap":"新建文件", "cmd":"cmd_FileNew"}
,{"cap":"从模板新建文件...", "cmd":"cmd_FileNewMenu"}

image

Update for Cuda

Cuda has 2 items: a)renamed "groups- 1+2 horz", b)new "groups- 1+2 vert"

Add to `menu.json` contents of the Tab context menu

@kvichans plugin "Config Menu" by pressing button "Create config file with native menu" doesn't create any other items than top-menu, top menu submenu, editor context-menu . I think it would be useful if it also have ability to create a default menu for tab header context menu and dropdown submenu of toolbar buttons, something like this:

,{"cap":"", "hint":"tab", "sub":[
     {"cap":"Close tab", "cmd":"cmd_FileClose"}
    ,{"cap":"Close", "sub":[
       {"cap":"Others (same group)","cmd":"cmd_FileCloseOtherThis"}
      ,{"cap":"Others (all groups)","cmd":"cmd_FileCloseOtherAll"}
...

So far I'm creating it manually (and then add the items I need), here's a default template if anyone needs one:

{
  {"cap":"", "hint":"tab", "sub":[
     {"cap":"Close tab", "cmd":"cmd_FileClose"}
    ,{"cap":"Close", "sub":[
       {"cap":"Others (same group)","cmd":"cmd_FileCloseOtherThis"}
      ,{"cap":"Others (all groups)","cmd":"cmd_FileCloseOtherAll"}
      ,{"cap":"All (same group)","cmd":"?"}
      ,{"cap":"All (all groups)","cmd":"cmd_FileCloseAll"}
      ,{"cap":"Left tabs (same group)","cmd":"?"}
      ,{"cap":"Right tabs (same group)","cmd":"?"}
    ]}
    ,{"cap":"-"}
    ,{"cap":"Save", "cmd":"cmd_FileSave"}
    ,{"cap":"Save as...", "cmd":"cmd_FileSaveAs"}
    ,{"cap":"-"}
    ,{"cap":"Copy to clipboard","sub":[
       {"cap":"Copy full filepath", "cmd":"cmd_CopyFilenameFull"}
      ,{"cap":"Copy filepath only", "cmd":"cmd_CopyFilenameDir"}
      ,{"cap":"Copy filename only", "cmd":"cmd_CopyFilenameName"}
    ]}
    ,{"cap":"Move tab to group","sub":[
       {"cap":"1","cmd":"cmd_MoveTabToGroup1"}
      ,{"cap":"2","cmd":"cmd_MoveTabToGroup2"}
      ,{"cap":"3","cmd":"cmd_MoveTabToGroup3"}
      ,{"cap":"4","cmd":"cmd_MoveTabToGroup4"}
      ,{"cap":"5","cmd":"cmd_MoveTabToGroup5"}
      ,{"cap":"6","cmd":"cmd_MoveTabToGroup6"}
      ,{"cap":"-"}
      ,{"cap":"Floating 1","cmd":"cmd_MoveTabToGroupFloating1"}
      ,{"cap":"Floating 2","cmd":"cmd_MoveTabToGroupFloating2"}
      ,{"cap":"Floating 3","cmd":"cmd_MoveTabToGroupFloating3"}
      ,{"cap":"-"}
      ,{"cap":"Next","cmd":"cmd_MoveTabToGroupNext"}
      ,{"cap":"Previous","cmd":"cmd_MoveTabToGroupPrev"}
    ]}
    ,{"cap":"Pinned","cmd":"cmd_ToggleTabPinned"}
    ,{"cap":"Set tab color...","cmd":"cmd_SetTabColor"}
  ]}
}

Note: "?" are put in place of commands that I could not find.

Apply item

Apply--что это. зачем. в меню. почему нельзя иметь опции и все?

menu ui

Пока неудобно-если поставил плаг он просто поменял меню..
в Куд добавилось в меню. а тут не видно. из-за плага. Нужно сделать комм 1- которая запретит исп-ть конфиг menu.json, комм 2- которая включит menu.json

Menu config>
    Don't use menu config
    Use menu config
    Edit menu config

тогда не надо опций?

incorr command code

{"cap":"Copy current line" ,"cmd":"cCommand_ClipboardCopy"}
Не тот код команды (это просто Копир. -надо копир. строку)

incorr command, Delete

вместо команды **KeyDelete
надо исп-ть cCommand_TextDeleteSelection (в menu.json)-оно не делетит если нет выдел-я

deleted menu.json

Удалил settings/menu.json-теперь плаг ступорит. ничего не может сделать
Удалил ключ в usr- стало ок(не хор. решение)

Msg fix

'Choose existed file` --> 'Chosen file not exists:\n%s'

Weird code

помоему, так не пишут.

+    mn_cfg_json = mn_cfg_json \
+                    if mn_cfg_json else \
+                  apx.get_opt('config_menus_from', DEF_MENU_CFG_FILE, apx.CONFIG_LEV_USER) \

Новые пункты

новые подменю-пункты "Языки","темы"

  • надо бы добавить в default menu

  • учтите

    "recents" - recent-files submenu
    "themes" - color-themes submenu
    "langs" - translations submenu

Test with Cud1.4.5

changed Themes sub; now it has 2 subs
new ids for it

  • 'themes-ui';
  • 'themes-syntax';

chd also dialog for themes. now 2 cmds to call 2 dialogs.

fix language

"Select" button -> "Browse"
"Open" btn -> "Edit"

tooltips for checkboxes-
"Apply menu once on CudaText start"
"Apply menu (common or lexer specific) when file tab gets focus"

Need check for filename or lexername

config_menus() -не нашел прорвеку ed.get_filename()!=''
или ed.get_prop(PROP_LEXER_FILE)!=''.
Это бы ускорило плаг, может? из-за лишних on_focus.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.