File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -277,8 +277,17 @@ var ActionBroker = function()
277277 var shortcuts_hash = window . settings . general . get ( "shortcuts-hash" ) ;
278278 if ( this . _hash_shortcuts ( default_shortcuts ) != shortcuts_hash )
279279 {
280- stored_shortcuts = this . _sync_shortcuts ( default_shortcuts , stored_shortcuts ) ;
281- this . _store_shortcuts ( stored_shortcuts ) ;
280+ try
281+ {
282+ stored_shortcuts = this . _sync_shortcuts ( default_shortcuts , stored_shortcuts ) ;
283+ this . _store_shortcuts ( stored_shortcuts ) ;
284+ }
285+ catch ( e )
286+ {
287+ stored_shortcuts = null ;
288+ window . settings . general . set ( "shortcuts" , null ) ;
289+ window . settings . general . set ( "shortcuts-hash" , "" ) ;
290+ }
282291 }
283292 }
284293 return stored_shortcuts || default_shortcuts ;
Original file line number Diff line number Diff line change @@ -126,3 +126,27 @@ function ConfirmDialogPrototype()
126126ConfirmDialogPrototype . prototype = new BaseDialog ( ) ;
127127ConfirmDialog . prototype = new ConfirmDialogPrototype ( ) ;
128128
129+ /**
130+ * @constructor
131+ */
132+ function AlertDialog ( template , ok_callback ) {
133+ this . _init ( template , ok_callback || function ( ) { } ) ;
134+ } ;
135+
136+ function AlertDialogPrototype ( )
137+ {
138+ this . _init = function ( template , ok_callback )
139+ {
140+ var buttons = [
141+ {
142+ label : ui_strings . S_BUTTON_OK ,
143+ handler : ok_callback ,
144+ }
145+ ] ;
146+ BaseDialog . prototype . _init . call ( this , template , buttons ) ;
147+ } ;
148+ } ;
149+
150+ AlertDialogPrototype . prototype = new BaseDialog ( ) ;
151+ AlertDialog . prototype = new AlertDialogPrototype ( ) ;
152+
Original file line number Diff line number Diff line change @@ -1694,3 +1694,6 @@ ui_strings.S_SCRIPT_TYPE_EXTENSIONJS = "Extension";
16941694
16951695/* DESC: Script type for events in the profiler */
16961696ui_strings . S_SCRIPT_TYPE_DEBUGGER = "Debugger" ;
1697+
1698+ /* DESC: Alert dialog that updating of the custom shortcuts with new ones has failed. */
1699+ ui_strings . D_SHORTCUTS_UPDATE_FAILED = "We could not update your custom keyboard shortcuts with the new ones." ;
You can’t perform that action at this time.
0 commit comments