33
44const { Clutter, Gio, GLib, GObject, Pango, Cinnamon, St } = imports . gi ;
55
6- // const Animation = imports.ui.animation;
76const CheckBox = imports . ui . checkBox ;
87const Dialog = imports . ui . dialog ;
98const Main = imports . ui . main ;
@@ -15,7 +14,6 @@ const CinnamonEntry = imports.ui.cinnamonEntry;
1514const Util = imports . misc . util ;
1615
1716var LIST_ITEM_ICON_SIZE = 48 ;
18- var WORK_SPINNER_ICON_SIZE = 16 ;
1917
2018const REMEMBER_MOUNT_PASSWORD_KEY = 'remember-mount-password' ;
2119
@@ -379,17 +377,10 @@ var CinnamonMountPasswordDialog = GObject.registerClass({
379377 this . setInitialKeyFocus ( this . _passwordEntry ) ;
380378 CinnamonEntry . addContextMenu ( this . _passwordEntry ) ;
381379
382- // this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, {
383- // animate: true,
384- // });
385-
386- if ( rtl ) {
387- // passwordGridLayout.attach(this._workSpinner, 0, curGridRow, 1, 1);
380+ if ( rtl )
388381 passwordGridLayout . attach ( this . _passwordEntry , 1 , curGridRow , 1 , 1 ) ;
389- } else {
382+ else
390383 passwordGridLayout . attach ( this . _passwordEntry , 0 , curGridRow , 1 , 1 ) ;
391- // passwordGridLayout.attach(this._workSpinner, 1, curGridRow, 1, 1);
392- }
393384 curGridRow += 1 ;
394385
395386 let warningBox = new St . BoxLayout ( { vertical : true } ) ;
@@ -409,14 +400,14 @@ var CinnamonMountPasswordDialog = GObject.registerClass({
409400
410401 content . add_child ( passwordGrid ) ;
411402
412- // if (flags & Gio.AskPasswordFlags.SAVING_SUPPORTED) {
413- // this._rememberChoice = new CheckBox.CheckBox(_("Remember Password"));
414- // // this._rememberChoice.checked =
415- // // global.settings.get_boolean(REMEMBER_MOUNT_PASSWORD_KEY);
416- // content.add_child(this._rememberChoice);
417- // } else {
418- // this._rememberChoice = null;
419- // }
403+ if ( flags & Gio . AskPasswordFlags . SAVING_SUPPORTED ) {
404+ this . _rememberChoice = new CheckBox . CheckBox ( _ ( "Remember Password" ) ) ;
405+ this . _rememberChoice . checked =
406+ global . settings . get_boolean ( REMEMBER_MOUNT_PASSWORD_KEY ) ;
407+ content . add_child ( this . _rememberChoice ) ;
408+ } else {
409+ this . _rememberChoice = null ;
410+ }
420411
421412 this . contentLayout . add_child ( content ) ;
422413
@@ -452,15 +443,16 @@ var CinnamonMountPasswordDialog = GObject.registerClass({
452443 }
453444
454445 reaskPassword ( ) {
455- // this._workSpinner.stop ();
446+ this . _passwordEntry . end_busy ( ) ;
456447 this . _passwordEntry . set_text ( '' ) ;
457- this . _errorMessageLabel . text = _ ( 'Sorry, that didn’t work. Please try again. ' ) ;
448+ this . _errorMessageLabel . text = _ ( 'Please try again' ) ;
458449 this . _errorMessageLabel . opacity = 255 ;
459450
460451 Util . wiggle ( this . _passwordEntry ) ;
461452 }
462453
463454 _onCancelButton ( ) {
455+ this . _passwordEntry . end_busy ( ) ;
464456 this . emit ( 'response' , - 1 , '' , false , false , false , 0 ) ;
465457 }
466458
@@ -483,10 +475,10 @@ var CinnamonMountPasswordDialog = GObject.registerClass({
483475 this . _errorMessageLabel . opacity = 0 ;
484476 }
485477
486- // global.settings.set_boolean(REMEMBER_MOUNT_PASSWORD_KEY,
487- // this._rememberChoice && this._rememberChoice.checked);
478+ global . settings . set_boolean ( REMEMBER_MOUNT_PASSWORD_KEY ,
479+ this . _rememberChoice && this . _rememberChoice . checked ) ;
488480
489- // this._workSpinner.play ();
481+ this . _passwordEntry . start_busy ( ) ;
490482 this . emit ( 'response' , 1 ,
491483 this . _passwordEntry . get_text ( ) ,
492484 this . _rememberChoice &&
0 commit comments