From c2073d2db13d58b60cc18a6f6d4b54874f69514c Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Sat, 8 Aug 2015 17:41:56 +0200 Subject: [PATCH] adds shortcuts dialog for the edit action function. Let;s user choose action from the list or enter action manually. adds shortcuts dialog for the edit action function. Let;s user choose action from the list or enter action manually. adjust custom action to change action and display previous action in keyboard dialog resolve merge conflicts small fixes to the change action method Merge branch 'master' of https://github.com/marcelveldt/script.skinshortcuts adds shortcuts dialog for the edit action function. Let;s user choose action from the list or enter action manually. adds shortcuts dialog for the edit action function. Let;s user choose action from the list or enter action manually. adjust custom action to change action and display previous action in keyboard dialog resolve merge conflicts small fixes to the change action method Merge branch 'master' of https://github.com/marcelveldt/script.skinshortcuts Merge branch 'master' of https://github.com/marcelveldt/script.skinshortcuts --- resources/language/Bulgarian/strings.po | 2 +- .../language/Chinese (Simple)/strings.po | 2 +- resources/language/Croatian/strings.po | 2 +- resources/language/Dutch/strings.po | 2 +- .../language/English (New Zealand)/strings.po | 4 ++-- resources/language/English (US)/strings.po | 4 ++-- resources/language/English/strings.po | 2 +- resources/language/French (Canada)/strings.po | 2 +- resources/language/Galician/strings.po | 2 +- resources/language/German/strings.po | 2 +- resources/language/Greek/strings.po | 2 +- resources/language/Hungarian/strings.po | 2 +- resources/language/Icelandic/strings.po | 2 +- resources/language/Italian/strings.po | 2 +- resources/language/Korean/strings.po | 2 +- resources/language/Lithuanian/strings.po | 2 +- resources/language/Norwegian/strings.po | 2 +- resources/language/Polish/strings.po | 2 +- .../language/Portuguese (Brazil)/strings.po | 2 +- resources/language/Portuguese/strings.po | 2 +- resources/language/Russian/strings.po | 2 +- resources/language/Spanish/strings.po | 2 +- resources/language/Swedish/strings.po | 2 +- resources/lib/gui.py | 22 ++++++------------- resources/lib/library.py | 4 ++-- 25 files changed, 34 insertions(+), 42 deletions(-) diff --git a/resources/language/Bulgarian/strings.po b/resources/language/Bulgarian/strings.po index 667eb399..6f454295 100644 --- a/resources/language/Bulgarian/strings.po +++ b/resources/language/Bulgarian/strings.po @@ -121,7 +121,7 @@ msgid "Set thumbail" msgstr "Задай миниатюра" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Персонално действие" msgctxt "#32030" diff --git a/resources/language/Chinese (Simple)/strings.po b/resources/language/Chinese (Simple)/strings.po index 65c7bfa2..a25e5a0b 100644 --- a/resources/language/Chinese (Simple)/strings.po +++ b/resources/language/Chinese (Simple)/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "设置缩略图" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "自定义动作" msgctxt "#32028" diff --git a/resources/language/Croatian/strings.po b/resources/language/Croatian/strings.po index fecc1cdd..9da566db 100644 --- a/resources/language/Croatian/strings.po +++ b/resources/language/Croatian/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Postavi minijaturu" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Prilagođena radnja" msgctxt "#32028" diff --git a/resources/language/Dutch/strings.po b/resources/language/Dutch/strings.po index 3b6fcd22..780ff1b8 100644 --- a/resources/language/Dutch/strings.po +++ b/resources/language/Dutch/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Stel miniatuur in" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Aangepaste actie" msgctxt "#32028" diff --git a/resources/language/English (New Zealand)/strings.po b/resources/language/English (New Zealand)/strings.po index e1ef9cfc..10a3ba3f 100644 --- a/resources/language/English (New Zealand)/strings.po +++ b/resources/language/English (New Zealand)/strings.po @@ -121,8 +121,8 @@ msgid "Set label" msgstr "Set label" msgctxt "#32027" -msgid "Custom action" -msgstr "Custom action" +msgid "Change action" +msgstr "Change action" msgctxt "#32028" msgid "Reset shortcuts" diff --git a/resources/language/English (US)/strings.po b/resources/language/English (US)/strings.po index 718f9614..daa0a366 100644 --- a/resources/language/English (US)/strings.po +++ b/resources/language/English (US)/strings.po @@ -125,8 +125,8 @@ msgid "Set thumbail" msgstr "Set thumbail" msgctxt "#32027" -msgid "Custom action" -msgstr "Custom action" +msgid "Change action" +msgstr "Change action" msgctxt "#32028" msgid "Reset shortcuts" diff --git a/resources/language/English/strings.po b/resources/language/English/strings.po index ef3e1773..7c17af8e 100644 --- a/resources/language/English/strings.po +++ b/resources/language/English/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "" msgctxt "#32028" diff --git a/resources/language/French (Canada)/strings.po b/resources/language/French (Canada)/strings.po index 84f6a1d6..ed3a4cbc 100644 --- a/resources/language/French (Canada)/strings.po +++ b/resources/language/French (Canada)/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Définir l'imagette" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Action personnalisée" msgctxt "#32028" diff --git a/resources/language/Galician/strings.po b/resources/language/Galician/strings.po index 584cfffb..108c551b 100644 --- a/resources/language/Galician/strings.po +++ b/resources/language/Galician/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Estabelecer miniatura" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Acción Personalizada" msgctxt "#32028" diff --git a/resources/language/German/strings.po b/resources/language/German/strings.po index 4e0b2308..58dee267 100644 --- a/resources/language/German/strings.po +++ b/resources/language/German/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Miniaturansicht festlegen" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Benutzerdefinierte Aktion" msgctxt "#32028" diff --git a/resources/language/Greek/strings.po b/resources/language/Greek/strings.po index 3456c91b..85a40b98 100644 --- a/resources/language/Greek/strings.po +++ b/resources/language/Greek/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Ορισμός μικρογραφίας" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Προσαρμοσμένη ενέργεια" msgctxt "#32028" diff --git a/resources/language/Hungarian/strings.po b/resources/language/Hungarian/strings.po index 85d4e346..2bf8e43c 100644 --- a/resources/language/Hungarian/strings.po +++ b/resources/language/Hungarian/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Bélyegkép beállítás" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Egyéni parancs" msgctxt "#32028" diff --git a/resources/language/Icelandic/strings.po b/resources/language/Icelandic/strings.po index b6337166..09a96a4a 100644 --- a/resources/language/Icelandic/strings.po +++ b/resources/language/Icelandic/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Setja smámynd" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Sérsniðið verk" msgctxt "#32028" diff --git a/resources/language/Italian/strings.po b/resources/language/Italian/strings.po index 28484586..7e5095c7 100644 --- a/resources/language/Italian/strings.po +++ b/resources/language/Italian/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Imposta miniatura" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Azione personalizzata" msgctxt "#32028" diff --git a/resources/language/Korean/strings.po b/resources/language/Korean/strings.po index de97dfd1..fe7eedb0 100644 --- a/resources/language/Korean/strings.po +++ b/resources/language/Korean/strings.po @@ -121,7 +121,7 @@ msgid "Set thumbail" msgstr "썸네일 설정" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "사용자 설정 동작" msgctxt "#32028" diff --git a/resources/language/Lithuanian/strings.po b/resources/language/Lithuanian/strings.po index e529ae4f..cbbd38ee 100644 --- a/resources/language/Lithuanian/strings.po +++ b/resources/language/Lithuanian/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Nustatyti miniatiūrą" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Individualus veiksmas" msgctxt "#32028" diff --git a/resources/language/Norwegian/strings.po b/resources/language/Norwegian/strings.po index a31ce560..432e5c7d 100644 --- a/resources/language/Norwegian/strings.po +++ b/resources/language/Norwegian/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Sett minityr" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Egendefinert handling" msgctxt "#32028" diff --git a/resources/language/Polish/strings.po b/resources/language/Polish/strings.po index 82e42aa5..77b67fcc 100644 --- a/resources/language/Polish/strings.po +++ b/resources/language/Polish/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Zmień miniaturę" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Niestandardowa akcja" msgctxt "#32028" diff --git a/resources/language/Portuguese (Brazil)/strings.po b/resources/language/Portuguese (Brazil)/strings.po index 1f3f6dbd..327f0a90 100644 --- a/resources/language/Portuguese (Brazil)/strings.po +++ b/resources/language/Portuguese (Brazil)/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Setar miniatura" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Ação customizada" msgctxt "#32028" diff --git a/resources/language/Portuguese/strings.po b/resources/language/Portuguese/strings.po index ec005a77..b5524ea7 100644 --- a/resources/language/Portuguese/strings.po +++ b/resources/language/Portuguese/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Definir miniatura" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Acção personalizada" msgctxt "#32028" diff --git a/resources/language/Russian/strings.po b/resources/language/Russian/strings.po index 1876b24a..6c4a53ba 100644 --- a/resources/language/Russian/strings.po +++ b/resources/language/Russian/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Выбрать эскиз" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Пользовательское действие" msgctxt "#32028" diff --git a/resources/language/Spanish/strings.po b/resources/language/Spanish/strings.po index 82ca8118..6ba77058 100644 --- a/resources/language/Spanish/strings.po +++ b/resources/language/Spanish/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Establecer miniatura" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Acción personalizada" msgctxt "#32028" diff --git a/resources/language/Swedish/strings.po b/resources/language/Swedish/strings.po index aec6c404..76e82574 100644 --- a/resources/language/Swedish/strings.po +++ b/resources/language/Swedish/strings.po @@ -125,7 +125,7 @@ msgid "Set thumbail" msgstr "Ange miniatyr" msgctxt "#32027" -msgid "Custom action" +msgid "Change action" msgstr "Egen åtgärd" msgctxt "#32028" diff --git a/resources/lib/gui.py b/resources/lib/gui.py index 6c3941c2..fcda8a5b 100644 --- a/resources/lib/gui.py +++ b/resources/lib/gui.py @@ -519,7 +519,7 @@ def _save_shortcuts_function( self ): icon = listitem.getProperty( "original-icon" ) else: icon = listitem.getProperty( "icon" ) - + xmltree.SubElement( shortcut, "icon" ).text = try_decode( icon ) xmltree.SubElement( shortcut, "thumb" ).text = try_decode( listitem.getProperty( "thumbnail" ) ) @@ -1002,21 +1002,13 @@ def onClick(self, controlID): action = listitem.getProperty( "path" ) if action == "noop": action = "" - - # Get new action from keyboard dialog - keyboard = xbmc.Keyboard( action, xbmc.getLocalizedString(528), False ) - keyboard.doModal() - if ( keyboard.isConfirmed() ): - action = try_decode( keyboard.getText() ) - - if action == "": - action = "noop" - - # Check that a change was really made - if action == try_decode( listitem.getProperty( "path" ) ): - return - else: + selectedShortcut = LIBRARY.selectShortcut(custom = True, currentAction = listitem.getProperty("path")) + if selectedShortcut: + if selectedShortcut.getProperty( "path" ): + action = try_decode(selectedShortcut.getProperty( "path" )) + + if listitem.getProperty( "path" ) == action: return self.changeMade = True diff --git a/resources/lib/library.py b/resources/lib/library.py index d869f5ec..2cef6dfd 100755 --- a/resources/lib/library.py +++ b/resources/lib/library.py @@ -1649,7 +1649,7 @@ def _rename_playlist( self, target, newLabel ): # === COMMON SELECT SHORTCUT METHOD === # ===================================== - def selectShortcut( self, group = "", custom = False, availableShortcuts = None, windowTitle = None, showNone = False ): + def selectShortcut( self, group = "", custom = False, availableShortcuts = None, windowTitle = None, showNone = False, currentAction = "" ): # This function allows the user to select a shortcut # If group is empty, start background loading of shortcuts @@ -1731,7 +1731,7 @@ def selectShortcut( self, group = "", custom = False, availableShortcuts = None, elif path == "||CUSTOM||": # Let the user type a command - keyboard = xbmc.Keyboard( "", __language__(32027), False ) + keyboard = xbmc.Keyboard( currentAction, __language__(32027), False ) keyboard.doModal() if ( keyboard.isConfirmed() ):