Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added keyboard shortcuts #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 32 additions & 18 deletions vlsub.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,25 @@ local options = {
translation = {
int_all = 'All',
int_descr = 'Download subtitles from OpenSubtitles.org',
int_research = 'Research',
int_config = 'Config',
int_research = '&Research',
int_config = 'Con&fig',
int_configuration = 'Configuration',
int_help = 'Help',
int_search_hash = 'Search by hash',
int_search_name = 'Search by name',
int_help = '&Help',
int_search_hash = '&Search by hash',
int_search_name = 'Search by &name',
int_title = 'Title',
int_season = 'Season (series)',
int_episode = 'Episode (series)',
int_show_help = 'Show help',
int_show_conf = 'Show config',
int_dowload_sel = 'Download selection',
int_close = 'Close',
int_show_help = 'Show &help',
int_show_conf = 'Show con&fig',
int_dowload_sel = '&Download selection',
int_close = '&Close',
int_ok = 'Ok',
int_save = 'Save',
int_cancel = 'Cancel',
int_save = 'Sa&ve',
int_cancel = '&Cancel',
int_bool_true = 'Yes',
int_bool_false = 'No',
int_search_transl = 'Search translations',
int_search_transl = '&Search translations',
int_searching_transl = 'Searching translations ...',
int_int_lang = 'Interface language',
int_default_lang = 'Subtitles language',
Expand Down Expand Up @@ -330,7 +330,7 @@ function descriptor()
version = "0.9.13",
author = "exebetche",
url = 'http://www.opensubtitles.org/',
shortdesc = "VLsub";
shortdesc = "&VLsub";
description = options.translation.int_descr,
capabilities = {"menu", "input-listener" }
}
Expand Down Expand Up @@ -553,6 +553,8 @@ function trigger_menu(dlg_id)
dlg = vlc.dialog(
openSub.conf.useragent)
interface_main()
-- Trigger search after window has appeared
searchHash()
elseif dlg_id == 2 then
close_dlg()
dlg = vlc.dialog(
Expand Down Expand Up @@ -1020,7 +1022,7 @@ function apply_config()
if openSub.conf.dirPath and
not dir_path_err then
local config_saved = save_config()
trigger_menu(1)
show_main()
if not config_saved then
setError(lang["mess_err_conf_access"])
end
Expand Down Expand Up @@ -1684,14 +1686,21 @@ end
function download_subtitles()
local index = get_first_sel(input_table["mainlist"])

if index == 0 then
setMessage(lang["mess_no_selection"])
return false
local item
if index > 0 then
item = openSub.itemStore[index]
else
if openSub.itemStore[1].MovieReleaseName ~= "" then
item = openSub.itemStore[1]
else
setMessage(lang["mess_no_selection"])
return false
end
end

openSub.actionLabel = lang["mess_downloading"]

local item = openSub.itemStore[index]
display_subtitles() -- reset selection

if openSub.option.downloadBehaviour == 'manual'
or not openSub.file.hasInput then
Expand Down Expand Up @@ -1790,6 +1799,11 @@ function download_subtitles()
end

setMessage(message)

-- close vlsub window after downloading
if index == 0 then
close()
end
end

function dump_zip(url, dir, subfileName)
Expand Down