dojo.provide("parus.progressDialog");dojo.require("dijit.Dialog");dojo.require("dijit.form.Button");dojo.require("dijit.ProgressBar");dojo.require("parus.parus8");dojo.require("parus.dialog");dojo.declare("parus.progressDialog",[parus.messageDialog],{max:null,_value:null,postCreate:function(){this.inherited(arguments);this.dialog.closeButtonNode.style.display="none";if(this.max){this.setMax(this.max)}},setMax:function(a){this.max=a;if(this.max){this.bar.attr("indeterminate",false);this.bar.attr("maximum",this.max);this.bar.attr("value",0);this._value=0}},step:function(){this._value++;this.bar.attr("value",this._value)}});dojo.mixin(parus.progressDialog,{iterateOverGrid:function(h,g,f,e){var c=g.store;var b=g.selection.getFirstSelected();var a=[];for(var d=0;d<g.selection.getSelectedCount();d++){a.push(b);b=g.selection.getNextSelected(b)}parus.progressDialog.iterateOverArray(h,a,f,e)},iterateOverArray:function(b,g,e,d){var c=new parus.progressDialog({message:b,max:g.length});c.show();var a=dojo.clone(g);var h=function(){var i=a.shift();if(i){try{e(i)}catch(f){c.step();setTimeout(h,50);throw f}c.step();setTimeout(h,50)}else{c.close();c.destroyRecursive();if(d){d()}}};setTimeout(h,50)}});