Skip to content

Commit

Permalink
Fixes Bug #5562
Browse files Browse the repository at this point in the history
git-svn-id: https://qooxdoo-contrib.svn.sourceforge.net/svnroot/qooxdoo-contrib@21520 09f7d036-9b2a-0410-8fbe-9cff4eb17569
  • Loading branch information
cboulanger committed Oct 7, 2011
1 parent 98f5ecb commit 135d698
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 40 deletions.
2 changes: 1 addition & 1 deletion config.json
Expand Up @@ -34,7 +34,7 @@
"QOOXDOO_PATH" : "../../qooxdoo/1.5", "QOOXDOO_PATH" : "../../qooxdoo/1.5",
//"QXTHEME" : "dialog.theme.modern.Theme", //"QXTHEME" : "dialog.theme.modern.Theme",
"QXTHEME" : "qx.theme.Modern", "QXTHEME" : "qx.theme.Modern",
"API_EXCLUDE" : ["qx.test.*", "dialog.demo.*"], "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.demo.*", "${APPLICATION}.theme.*"],
"LOCALES" : [ "en","de","fr" ], "LOCALES" : [ "en","de","fr" ],
"CACHE" : "${TMPDIR}/cache", "CACHE" : "${TMPDIR}/cache",
"ROOT" : "." "ROOT" : "."
Expand Down
19 changes: 16 additions & 3 deletions source/class/dialog/Confirm.js
Expand Up @@ -47,6 +47,9 @@ qx.Class.define("dialog.Confirm",
*/ */
properties : properties :
{ {
/**
* Label used for the "yes button"
*/
yesButtonLabel : yesButtonLabel :
{ {
check : "String", check : "String",
Expand All @@ -55,6 +58,9 @@ qx.Class.define("dialog.Confirm",
event : "changeYesButtonLabel" event : "changeYesButtonLabel"
}, },


/**
* Icon used for the "yes button"
*/
yesButtonIcon : yesButtonIcon :
{ {
check : "String", check : "String",
Expand All @@ -63,6 +69,9 @@ qx.Class.define("dialog.Confirm",
event : "changeYesButtonIcon" event : "changeYesButtonIcon"
}, },


/**
* Label used for the "no button"
*/
noButtonLabel : noButtonLabel :
{ {
check : "String", check : "String",
Expand All @@ -71,6 +80,9 @@ qx.Class.define("dialog.Confirm",
event : "changeNoButtonLabel" event : "changeNoButtonLabel"
}, },


/**
* Icon used for the "no button"
*/
noButtonIcon : noButtonIcon :
{ {
check : "String", check : "String",
Expand All @@ -79,6 +91,9 @@ qx.Class.define("dialog.Confirm",
event : "changeNoButtonIcon" event : "changeNoButtonIcon"
}, },


/**
* This property controls the display of a cancel button
*/
allowCancel : allowCancel :
{ {
refine : true, refine : true,
Expand All @@ -98,7 +113,7 @@ qx.Class.define("dialog.Confirm",
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
PRIVATE MEMBERS PRIVATE MEMBERS
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
*/ */
_yesButton : null, _yesButton : null,
_noButton : null, _noButton : null,


Expand Down Expand Up @@ -143,8 +158,6 @@ qx.Class.define("dialog.Confirm",
this._message.setAllowStretchX(true); this._message.setAllowStretchX(true);
hbox.add( this._message, {flex:1} ); hbox.add( this._message, {flex:1} );


var _this = this;

/* /*
* Yes button * Yes button
*/ */
Expand Down
51 changes: 32 additions & 19 deletions source/class/dialog/Dialog.js
Expand Up @@ -51,7 +51,7 @@ qx.Class.define("dialog.Dialog",


/** /**
* Returns a dialog instance by type * Returns a dialog instance by type
* @param type {String} * @param type {String} The dialog type to get
* @return dialog.Dialog * @return dialog.Dialog
*/ */
getInstanceByType : function(type) getInstanceByType : function(type)
Expand Down Expand Up @@ -92,9 +92,9 @@ qx.Class.define("dialog.Dialog",


/** /**
* Shortcut for alert dialog * Shortcut for alert dialog
* @param message {String} * @param message {String} The message to display
* @param callback {Function} * @param callback {Function} The callback function
* @param context {Object} * @param context {Object} The context to use with the callback function
*/ */
alert : function( message, callback, context ) alert : function( message, callback, context )
{ {
Expand All @@ -106,6 +106,12 @@ qx.Class.define("dialog.Dialog",
})).show(); })).show();
}, },


/**
* Shortcut for error dialog
* @param message {String} The message to display
* @param callback {Function} The callback function
* @param context {Object} The context to use with the callback function
*/
error : function( message, callback, context ) error : function( message, callback, context )
{ {
(new dialog.Alert({ (new dialog.Alert({
Expand All @@ -116,6 +122,12 @@ qx.Class.define("dialog.Dialog",
})).show(); })).show();
}, },


/**
* Shortcut for warning dialog
* @param message {String} The message to display
* @param callback {Function} The callback function
* @param context {Object} The context to use with the callback function
*/
warning : function( message, callback, context ) warning : function( message, callback, context )
{ {
(new dialog.Alert({ (new dialog.Alert({
Expand All @@ -128,9 +140,9 @@ qx.Class.define("dialog.Dialog",


/** /**
* Shortcut for confirm dialog * Shortcut for confirm dialog
* @param message {String} * @param message {String} The message to display
* @param callback {Function} * @param callback {Function} The callback function
* @param context {Object} * @param context {Object} The context to use with the callback function
*/ */
confirm : function( message, callback, context ) confirm : function( message, callback, context )
{ {
Expand All @@ -146,10 +158,10 @@ qx.Class.define("dialog.Dialog",
* The value argument was forgotten in the initial implementation and * The value argument was forgotten in the initial implementation and
* comes last for backwards compatibility. This might change in a future * comes last for backwards compatibility. This might change in a future
* release. * release.
* @param message {String} * @param message {String} The message to display
* @param callback {Function} * @param callback {Function} The callback function
* @param context {Object} * @param context {Object} The context to use with the callback function
* @param value {String} * @param value {String} The default value of the prompt textfield
*/ */
prompt : function( message, callback, context, value ) prompt : function( message, callback, context, value )
{ {
Expand All @@ -163,10 +175,10 @@ qx.Class.define("dialog.Dialog",


/** /**
* Shortcut for select dialog * Shortcut for select dialog
* @param message {String} * @param message {String} The message to display
* @param options {Array} * @param options {Array} Options to select from
* @param callback {Function} * @param callback {Function} The callback function
* @param context {Object} * @param context {Object} The context to use with the callback function
* @param allowCancel {Boolean} Default: true * @param allowCancel {Boolean} Default: true
*/ */
select : function( message, options, callback, context, allowCancel ) select : function( message, options, callback, context, allowCancel )
Expand All @@ -182,10 +194,10 @@ qx.Class.define("dialog.Dialog",


/** /**
* Shortcut for form dialog * Shortcut for form dialog
* @param message {String} * @param message {String} The message to display
* @param formData {Map} * @param formData {Map} Map of form data. See {@link dialog.Form.formData}
* @param callback {Function} * @param callback {Function} The callback function
* @param context {Object} * @param context {Object} The context to use with the callback function
*/ */
form : function( message, formData, callback, context ) form : function( message, formData, callback, context )
{ {
Expand Down Expand Up @@ -426,6 +438,7 @@ qx.Class.define("dialog.Dialog",
*/ */


__container : null, __container : null,
__previousFocus : null,


/* /*
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Expand Down
16 changes: 8 additions & 8 deletions source/class/dialog/Form.js
Expand Up @@ -208,9 +208,10 @@ qx.Class.define("dialog.Form",


/** /**
* Constructs the form on-the-fly * Constructs the form on-the-fly
* @param formData * @param formData The form data map
* @param old * @param old The old value
* @return *
* @lint ignoreDeprecated(alert,eval)
*/ */
_applyFormData : function ( formData, old ) _applyFormData : function ( formData, old )
{ {
Expand Down Expand Up @@ -331,7 +332,7 @@ qx.Class.define("dialog.Form",
{ {
formElement.setUserData("orientation", fieldData.orientation ); formElement.setUserData("orientation", fieldData.orientation );
} }
var selected = null; //var selected = null;
fieldData.options.forEach( function( item ) fieldData.options.forEach( function( item )
{ {
var radioButton = new qx.ui.form.RadioButton( item.label ); var radioButton = new qx.ui.form.RadioButton( item.label );
Expand Down Expand Up @@ -393,7 +394,7 @@ qx.Class.define("dialog.Form",
var selectables = this.getSelectables(); var selectables = this.getSelectables();
selectables.forEach( function( selectable ) selectables.forEach( function( selectable )
{ {
var key = this.getUserData("key"); //var key = this.getUserData("key");
//console.warn( key +": '" + value + "' looking at '" + selectable.getLabel() + "' => " + selectable.getModel().getValue() ); //console.warn( key +": '" + value + "' looking at '" + selectable.getLabel() + "' => " + selectable.getModel().getValue() );
if ( selectable.getModel().getValue() === value ) if ( selectable.getModel().getValue() === value )
{ {
Expand All @@ -413,7 +414,7 @@ qx.Class.define("dialog.Form",
"converter" : qx.lang.Function.bind( function( selection ) "converter" : qx.lang.Function.bind( function( selection )
{ {
var value = selection[0].getModel().getValue(); var value = selection[0].getModel().getValue();
var key = this.getUserData("key"); //var key = this.getUserData("key");
//console.warn("Selection is " + ( selection.length ? selection[0].getLabel() : "none" ) + " -> Setting value for " + key +": " + value ); //console.warn("Selection is " + ( selection.length ? selection[0].getLabel() : "none" ) + " -> Setting value for " + key +": " + value );
return value; return value;
}, formElement) }, formElement)
Expand Down Expand Up @@ -619,8 +620,7 @@ qx.Class.define("dialog.Form",
* Default behavior: bind the enabled state of the "OK" button to the * Default behavior: bind the enabled state of the "OK" button to the
* validity of the current form. * validity of the current form.
* *
* @param form {qx.ui.form.Form} * @param form {qx.ui.form.Form} The form to bind
* @return {void}
*/ */
_onFormReady : function( form ) _onFormReady : function( form )
{ {
Expand Down
12 changes: 10 additions & 2 deletions source/class/dialog/Login.js
Expand Up @@ -99,12 +99,21 @@ qx.Class.define("dialog.Login",
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
*/ */


/**
* Apply function used by proterty {@link #text}
* @param value {String} New value
* @param old {String} Old value
*/
_applyText : function( value, old ) _applyText : function( value, old )
{ {
this._text.setValue( value ); this._text.setValue( value );
this._text.setVisibility( value ? "visible" : "excluded" ); this._text.setVisibility( value ? "visible" : "excluded" );
}, },


/**
* Apply function used by proterty {@link #textFont}
* @param value {String} New value
*/
_applyTextFont : function( value ) _applyTextFont : function( value )
{ {
this._text.setFont( value ); this._text.setFont( value );
Expand Down Expand Up @@ -257,10 +266,9 @@ qx.Class.define("dialog.Login",
/** /**
* Handler function called with the result of the authentication * Handler function called with the result of the authentication
* process. * process.
* @param result {Boolean} * @param result {Boolean} The state of login success
* @param message {String|Null} Optional HTML message that might contain * @param message {String|Null} Optional HTML message that might contain
* error information, such as "Wrong password". * error information, such as "Wrong password".
* @return
*/ */
_handleCheckLogin : function( result, message ) _handleCheckLogin : function( result, message )
{ {
Expand Down
1 change: 1 addition & 0 deletions source/class/dialog/Select.js
Expand Up @@ -135,6 +135,7 @@ qx.Class.define("dialog.Select",
/** /**
* Handle click on a button. Calls callback with * Handle click on a button. Calls callback with
* the value set in the options map. * the value set in the options map.
* @param value {var} The passed value
*/ */
_handleSelection : function( value ) _handleSelection : function( value )
{ {
Expand Down
12 changes: 5 additions & 7 deletions source/class/dialog/Wizard.js
Expand Up @@ -214,8 +214,7 @@ qx.Class.define("dialog.Wizard",
/** /**
* Add bindings to the validation manager to control the state of * Add bindings to the validation manager to control the state of
* the wizard buttons. * the wizard buttons.
* @param form {qx.ui.form.Form} * @param form {qx.ui.form.Form} The form to bind
* @return {void}
*/ */
_onFormReady : function( form ) _onFormReady : function( form )
{ {
Expand Down Expand Up @@ -251,8 +250,8 @@ qx.Class.define("dialog.Wizard",
/** /**
* Apply the page data. This initializes the response * Apply the page data. This initializes the response
* data model * data model
* @param pageData * @param pageData {Array} The new page data
* @param old * @param old {Array} The old page data
* @return * @return
*/ */
_applyPageData : function ( pageData, old ) _applyPageData : function ( pageData, old )
Expand Down Expand Up @@ -290,9 +289,8 @@ qx.Class.define("dialog.Wizard",
/** /**
* Go to a given wizard page. This recreates the * Go to a given wizard page. This recreates the
* form. * form.
* @param page {Integer} * @param page {Integer} The new page
* @param old {Integer} * @param old {Integer} The old page
* @return
*/ */
_applyPage : function ( page, old ) _applyPage : function ( page, old )
{ {
Expand Down

0 comments on commit 135d698

Please sign in to comment.