diff --git a/mozilla/extensions/sql/base/public/mozISqlService.idl b/mozilla/extensions/sql/base/public/mozISqlService.idl index e91366baa8a..8d1fd6081de 100644 --- a/mozilla/extensions/sql/base/public/mozISqlService.idl +++ b/mozilla/extensions/sql/base/public/mozISqlService.idl @@ -37,6 +37,7 @@ #include "nsISupports.idl" interface nsIRDFResource; +interface nsISimpleEnumerator; interface mozISqlConnection; /** @@ -77,13 +78,15 @@ interface mozISqlService : nsISupports * @param aHostname hostname for the database * @param aPort port for the database * @param aDatabase database name + * @param aPriority priority * @return an RDF resource representing the alias */ nsIRDFResource addAlias(in AString aName, in AString aType, in AString aHostname, in long aPort, - in AString aDatabase); + in AString aDatabase, + in long aPriority); /** * Retrieves alias information. The out parameters are filled in with @@ -95,13 +98,15 @@ interface mozISqlService : nsISupports * @param aHostname hostname of the database * @param aPort port of the database * @param aDatabase database name + * @param aPriority priority */ void fetchAlias(in nsIRDFResource aAlias, out AString aName, out AString aType, out AString aHostname, out long aPort, - out AString aDatabase); + out AString aDatabase, + out long aPriority); /** * Update the information of an alias that has already been added. The new @@ -114,13 +119,15 @@ interface mozISqlService : nsISupports * @param aHostname hostname for the database * @param aPort port for the database * @param aDatabase database name + * @param aPriority priority */ void updateAlias(in nsIRDFResource aAlias, in AString aName, in AString aType, in AString aHostname, in long aPort, - in AString aDatabase); + in AString aDatabase, + in long aPriority); /** * Removes an alias that already exists. @@ -137,6 +144,14 @@ interface mozISqlService : nsISupports */ nsIRDFResource getAlias(in AString aName); + /** + * Get the aliases with the given name. + * + * @param aName the name of the aliases to retrieve + * @return an enumerator for the aliases + */ + nsISimpleEnumerator getAliases(in AString aName); + /** * Retrieves an SQL connection to a database given its alias. If a * connection is already open, that connection is returned. Otherwise, diff --git a/mozilla/extensions/sql/base/resources/content/aliasDialog.js b/mozilla/extensions/sql/base/resources/content/aliasDialog.js index 3996bd63b7d..9b9a19bd60a 100644 --- a/mozilla/extensions/sql/base/resources/content/aliasDialog.js +++ b/mozilla/extensions/sql/base/resources/content/aliasDialog.js @@ -40,6 +40,7 @@ var type; var hostname; var port; var database; +var priority; function init() { sqlService = Components.classes["@mozilla.org/sql/service;1"] @@ -50,11 +51,12 @@ function init() { hostname = document.getElementById("hostname"); port = document.getElementById("port"); database = document.getElementById("database"); + priority = document.getElementById("priority"); if (window.arguments) { // get original values var alias = window.arguments[0]; - sqlService.fetchAlias(alias, name, type, hostname, port, database); + sqlService.fetchAlias(alias, name, type, hostname, port, database, priority); } } @@ -63,11 +65,11 @@ function onAccept() { // update an existing alias var alias = window.arguments[0]; sqlService.updateAlias(alias, name.value, type.value, hostname.value, - port.value, database.value); + port.value, database.value, priority.value); } else { // add a new database sqlService.addAlias(name.value, type.value, hostname.value, - port.value, database.value); + port.value, database.value, priority.value); } } diff --git a/mozilla/extensions/sql/base/resources/content/aliasDialog.xul b/mozilla/extensions/sql/base/resources/content/aliasDialog.xul index 45090a9d1c4..8cdcacf74dd 100644 --- a/mozilla/extensions/sql/base/resources/content/aliasDialog.xul +++ b/mozilla/extensions/sql/base/resources/content/aliasDialog.xul @@ -42,7 +42,7 @@ @@ -75,6 +75,10 @@