diff options
Diffstat (limited to 'core/ext/pm/modules_browser.lua')
-rw-r--r-- | core/ext/pm/modules_browser.lua | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/core/ext/pm/modules_browser.lua b/core/ext/pm/modules_browser.lua index 8472ee0d..839fbce9 100644 --- a/core/ext/pm/modules_browser.lua +++ b/core/ext/pm/modules_browser.lua @@ -133,16 +133,18 @@ end function perform_menu_action(menu_id, selected_item) if menu_id == ID.NEW then local status, module_name = - cocoa_dialog('standard-inputbox', { - ['title'] = locale.PM_BROWSER_MODULE_NEW_TITLE, - ['informative-text'] = locale.PM_BROWSER_MODULE_NEW_INFO_TEXT - }):match('^(%d)%s+([^\n]+)%s+$') + textadept.dialog('standard-inputbox', + '--title', locale.PM_BROWSER_MODULE_NEW_TITLE, + '--informative-text', + locale.PM_BROWSER_MODULE_NEW_INFO_TEXT + ):match('^(%d)%s+([^\n]+)%s+$') if status ~= '1' then return end local status, lang_name = - cocoa_dialog('standard-inputbox', { - ['title'] = locale.PM_BROWSER_MODULE_NEW_LANG_TITLE, - ['informative-text'] = locale.PM_BROWSER_MODULE_NEW_LANG_INFO_TEXT - }):match('^(%d)%s+([^\n]+)%s+$') + textadept.dialog('standard-inputbox', + '--title', locale.PM_BROWSER_MODULE_NEW_LANG_TITLE, + '--informative-text', + locale.PM_BROWSER_MODULE_NEW_LANG_INFO_TEXT + ):match('^(%d)%s+([^\n]+)%s+$') if status ~= '1' then return end local module_dir = _HOME..'/modules/'..module_name if lfs.mkdir(module_dir) then @@ -162,22 +164,22 @@ function perform_menu_action(menu_id, selected_item) f:write(out) f:close() else - cocoa_dialog('ok-msgbox', { - ['text'] = locale.PM_BROWSER_MODULE_NEW_ERROR, - ['informative-text'] = locale.PM_BROWSER_MODULE_NEW_ERROR_TEXT, - ['no-cancel'] = true - }) + textadept.dialog('ok-msgbox', + '--text', locale.PM_BROWSER_MODULE_NEW_ERROR, + '--informative-text', + locale.PM_BROWSER_MODULE_NEW_ERROR_TEXT, + '--no-cancel') return end elseif menu_id == ID.DELETE then local module_name = selected_item[2] - if cocoa_dialog('yesno-msgbox', { - ['text'] = locale.PM_BROWSER_MODULE_DELETE_TITLE, - ['informative-text'] = - string.format(locale.PM_BROWSER_MODULE_DELETE_TEXT, module_name), - ['no-cancel'] = true, - ['no-newline'] = true - }) == '1' then + if textadept.dialog('yesno-msgbox', + '--text', locale.PM_BROWSER_MODULE_DELETE_TITLE, + '--informative-text', + string.format(locale.PM_BROWSER_MODULE_DELETE_TEXT, + module_name), + '--no-cancel', + '--no-newline') == '1' then local function remove_directory(dirpath) for name in lfs.dir(dirpath) do if not name:find('^%.%.?$') then os.remove(dirpath..'/'..name) end |