Commit de5ac864 authored by CardBook's avatar CardBook

version 27.3

parent 3c7c8ccf
......@@ -901,7 +901,7 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) {
myFile.create( Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 420 );
}
var myMode = "WINDOW";
cardbookSynchronization.loadFile(myFile, wdw_addressbooksAdd.gFinishParams[i].dirPrefId, myMode, "NOIMPORT", "");
cardbookSynchronization.loadFile(myFile, wdw_addressbooksAdd.gFinishParams[i].dirPrefId, myMode, "NOIMPORTFILE", "");
cardbookSynchronization.waitForDirFinished(wdw_addressbooksAdd.gFinishParams[i].dirPrefId, wdw_addressbooksAdd.gFinishParams[i].name, myMode);
}
} else if (wdw_addressbooksAdd.gType === "DIRECTORY") {
......@@ -947,7 +947,7 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) {
cardbookSynchronization.initMultipleOperations(wdw_addressbooksAdd.gFinishParams[i].dirPrefId);
cardbookRepository.cardbookDirRequest[wdw_addressbooksAdd.gFinishParams[i].dirPrefId]++;
var myMode = "WINDOW";
cardbookSynchronization.loadDir(myDir, wdw_addressbooksAdd.gFinishParams[i].dirPrefId, myMode, "NOIMPORT", "");
cardbookSynchronization.loadDir(myDir, wdw_addressbooksAdd.gFinishParams[i].dirPrefId, myMode, "NOIMPORTDIR", "");
cardbookSynchronization.waitForDirFinished(wdw_addressbooksAdd.gFinishParams[i].dirPrefId, wdw_addressbooksAdd.gFinishParams[i].name, myMode);
}
}
......
......@@ -82,7 +82,7 @@ if ("undefined" == typeof(wdw_addressbooksEdit)) {
save: function () {
if (document.getElementById('dateFormatMenuList').value != wdw_addressbooksEdit.initialDateFormat) {
cardbookDates.convertAddressBookDate(window.arguments[0].dirPrefId, document.getElementById('nameTextBox').value,
wdw_addressbooksEdit.initialDateFormat, document.getElementById('dateFormatMenuList').value);
wdw_addressbooksEdit.initialDateFormat, document.getElementById('dateFormatMenuList').value);
}
cardbookPreferences.setName(window.arguments[0].dirPrefId, document.getElementById('nameTextBox').value);
cardbookPreferences.setColor(window.arguments[0].dirPrefId, document.getElementById('colorInput').value);
......
......@@ -62,7 +62,7 @@ if ("undefined" == typeof(ovl_attachments)) {
OnStopRunningUrl: function (aUrl, aStatus) {
if (aStatus == 0) {
wdw_cardbooklog.updateStatusProgressInformationWithDebug2("debug mode : attachment successfully downloaded");
cardbookSynchronization.loadFile(this.mFile, this.myDirPrefId, "WINDOW", "IMPORT", "");
cardbookSynchronization.loadFile(this.mFile, this.myDirPrefId, "WINDOW", "IMPORTFILE", "");
} else {
wdw_cardbooklog.updateStatusProgressInformationWithDebug2("debug mode : attachment not successfully downloaded, status : " + aStatus);
}
......
......@@ -53,6 +53,16 @@ if ("undefined" == typeof(cardbookElementTools)) {
}
},
addProgressmeter: function (aParent, aId, aParameters) {
var aProgressmeter = document.createElement('progressmeter');
aParent.appendChild(aProgressmeter);
aProgressmeter.setAttribute('id', aId);
for (var prop in aParameters) {
aProgressmeter.setAttribute(prop, aParameters[prop]);
}
},
addHBox: function (aType, aIndex, aParent) {
var aHBox = document.createElement('hbox');
aParent.appendChild(aHBox);
......@@ -64,51 +74,10 @@ if ("undefined" == typeof(cardbookElementTools)) {
return aHBox;
},
addGrid: function (aType, aParent) {
var aGrid = document.createElement('grid');
aParent.appendChild(aGrid);
aGrid.setAttribute('id', aType + '_grid');
aGrid.setAttribute('flex', '1');
return aGrid;
},
addGridColumns: function (aType, aParent, aParameters) {
var aGridColumns = document.createElement('columns');
aParent.appendChild(aGridColumns);
aGridColumns.setAttribute('id', aType + '_gridColumns');
for (var prop in aParameters) {
aGridColumns.setAttribute(prop, aParameters[prop]);
}
return aGridColumns;
},
addGridRows: function (aType, aParent, aParameters) {
var aGridRows = document.createElement('rows');
aParent.appendChild(aGridRows);
aGridRows.setAttribute('id', aType + '_gridRows');
for (var prop in aParameters) {
aGridRows.setAttribute(prop, aParameters[prop]);
}
return aGridRows;
},
addGridColumn: function (aType, aIndex, aParent, aParameters) {
var aGridColumn = document.createElement('column');
aParent.appendChild(aGridColumn);
aGridColumn.setAttribute('id', aType + '_' + aIndex + '_gridColumn');
for (var prop in aParameters) {
aGridColumn.setAttribute(prop, aParameters[prop]);
}
return aGridColumn;
},
addGridRow: function (aType, aIndex, aParent, aParameters) {
addGridRow: function (aParent, aId, aParameters) {
var aGridRow = document.createElement('row');
aParent.appendChild(aGridRow);
aGridRow.setAttribute('id', aType + '_' + aIndex + '_gridRow');
aGridRow.setAttribute('id', aId);
for (var prop in aParameters) {
aGridRow.setAttribute(prop, aParameters[prop]);
......@@ -116,6 +85,17 @@ if ("undefined" == typeof(cardbookElementTools)) {
return aGridRow;
},
addLabel: function (aOrigBox, aId, aValue, aControl, aParameters) {
var aLabel = document.createElement('label');
aOrigBox.appendChild(aLabel);
aLabel.setAttribute('id', aId);
aLabel.setAttribute('value', aValue);
aLabel.setAttribute('control', aControl);
for (var prop in aParameters) {
aLabel.setAttribute(prop, aParameters[prop]);
}
},
addKeyTextbox: function (aParent, aId, aValue, aParameters, aVersion, aIndex) {
var myKexTextBox = cardbookElementTools.addTextbox(aParent, aId, aValue, aParameters);
myKexTextBox.version = aVersion;
......
......@@ -91,12 +91,21 @@ if ("undefined" == typeof(cardbookIndexedDB)) {
var db = cardbookRepository.cardbookDatabase.db;
var transaction = db.transaction(["cards"], "readonly");
var store = transaction.objectStore("cards");
var countRequest = store.count(aKeyRange);
var cursorRequest = store.openCursor(aKeyRange);
transaction.oncomplete = function() {
cb(aDirPrefId);
};
countRequest.onsuccess = function(e) {
cardbookRepository.cardbookServerSyncTotal[aDirPrefId] = countRequest.result;
};
countRequest.onerror = function(e) {
cardbookRepository.cardbookDatabase.onerror();
};
cursorRequest.onsuccess = function(e) {
var result = e.target.result;
if (result) {
......@@ -112,11 +121,10 @@ if ("undefined" == typeof(cardbookIndexedDB)) {
}
}
cardbookRepository.cardbookServerSyncDone[aDirPrefId]++;
cardbookRepository.cardbookServerSyncTotal[aDirPrefId]++;
result.continue();
}
};
cursorRequest.onerror = function(e) {
cardbookRepository.cardbookDatabase.onerror();
};
......
......@@ -295,13 +295,14 @@ if ("undefined" == typeof(cardBookObserver)) {
cardbookUtils.setColumnsState(myColumns);
wdw_cardbook.refreshWindow();
break;
case "cardbook.ABAddedDirect":
case "cardbook.ABRemovedDirect":
wdw_cardbook.clearCard();
case "cardbook.catAddedDirect":
case "cardbook.catRemovedIndirect":
case "cardbook.catRemovedDirect":
case "cardbook.catModifiedIndirect":
case "cardbook.catModifiedDirect":
case "cardbook.ABAddedDirect":
case "cardbook.ABRemovedDirect":
case "cardbook.ABModifiedDirect":
case "cardbook.cardAddedDirect":
case "cardbook.cardModifiedDirect":
......
......@@ -1452,35 +1452,39 @@ var cardbookRepository = {
deleteCards: function (aListOfCards, aSource) {
try {
var listOfFileToRewrite = [];
for (var i = 0; i < aListOfCards.length; i++) {
if (!cardbookPreferences.getReadOnly(aListOfCards[i].dirPrefId)) {
var myDirPrefIdName = cardbookPreferences.getName(aListOfCards[i].dirPrefId);
var myDirPrefIdType = cardbookPreferences.getType(aListOfCards[i].dirPrefId);
if (myDirPrefIdType === "FILE") {
listOfFileToRewrite.push(aListOfCards[i].dirPrefId);
cardbookRepository.removeCardFromRepository(aListOfCards[i], false);
} else if (myDirPrefIdType === "CACHE" || myDirPrefIdType === "DIRECTORY" || myDirPrefIdType === "LOCALDB") {
cardbookRepository.removeCardFromRepository(aListOfCards[i], true);
} else {
if (cardbookUtils.searchTagCreated(aListOfCards[i])) {
cardbookRepository.removeCardFromRepository(aListOfCards[i], true);
} else {
cardbookUtils.addTagDeleted(aListOfCards[i]);
cardbookRepository.addCardToCache(aListOfCards[i], "WINDOW", cardbookUtils.getFileCacheNameFromCard(aListOfCards[i]));
cardbookRepository.removeCardFromRepository(aListOfCards[i], false);
Services.tm.currentThread.dispatch({ run: function() {
var listOfFileToRewrite = [];
for (var i = 0; i < aListOfCards.length; i++) {
Services.tm.currentThread.dispatch({ run: function() {
if (!cardbookPreferences.getReadOnly(aListOfCards[i].dirPrefId)) {
var myDirPrefIdName = cardbookPreferences.getName(aListOfCards[i].dirPrefId);
var myDirPrefIdType = cardbookPreferences.getType(aListOfCards[i].dirPrefId);
if (myDirPrefIdType === "FILE") {
listOfFileToRewrite.push(aListOfCards[i].dirPrefId);
cardbookRepository.removeCardFromRepository(aListOfCards[i], false);
} else if (myDirPrefIdType === "CACHE" || myDirPrefIdType === "DIRECTORY" || myDirPrefIdType === "LOCALDB") {
cardbookRepository.removeCardFromRepository(aListOfCards[i], true);
} else {
if (cardbookUtils.searchTagCreated(aListOfCards[i])) {
cardbookRepository.removeCardFromRepository(aListOfCards[i], true);
} else {
cardbookUtils.addTagDeleted(aListOfCards[i]);
cardbookRepository.addCardToCache(aListOfCards[i], "WINDOW", cardbookUtils.getFileCacheNameFromCard(aListOfCards[i]));
cardbookRepository.removeCardFromRepository(aListOfCards[i], false);
}
}
cardbookUtils.formatStringForOutput("cardDeletedOK", [myDirPrefIdName, aListOfCards[i].fn]);
wdw_cardbooklog.addActivity("cardDeletedOK", [myDirPrefIdName, aListOfCards[i].fn], "deleteMail");
// performance reason
// update the UI only at the end
if (i == aListOfCards.length - 1) {
cardbookUtils.notifyObservers(aSource);
}
}
}
cardbookUtils.formatStringForOutput("cardDeletedOK", [myDirPrefIdName, aListOfCards[i].fn]);
wdw_cardbooklog.addActivity("cardDeletedOK", [myDirPrefIdName, aListOfCards[i].fn], "deleteMail");
// performance reason
// update the UI only at the end
if (i == aListOfCards.length - 1) {
cardbookUtils.notifyObservers(aSource);
}
}}, Components.interfaces.nsIEventTarget.DISPATCH_SYNC);
}
}
cardbookRepository.reWriteFiles(listOfFileToRewrite);
cardbookRepository.reWriteFiles(listOfFileToRewrite);
}}, Components.interfaces.nsIEventTarget.DISPATCH_NORMAL);
}
catch (e) {
wdw_cardbooklog.updateStatusProgressInformation("cardbookRepository.deleteCards error : " + e, "Error");
......
This diff is collapsed.
......@@ -368,13 +368,13 @@ if ("undefined" == typeof(cardbookTypes)) {
}
if (aReadOnly) {
if (myValue != "") {
currentRow = cardbookTypes.addRow(aOrigBox, 'orgRow_' + i);
cardbookTypes.addLabel(currentRow, 'orgLabel_' + i, myOrgStructure[i], 'orgTextBox_' + i, {class: 'header'});
currentRow = cardbookElementTools.addGridRow(aOrigBox, 'orgRow_' + i, {align: 'center'});
cardbookElementTools.addLabel(currentRow, 'orgLabel_' + i, myOrgStructure[i], 'orgTextBox_' + i, {class: 'header'});
cardbookElementTools.addTextbox(currentRow, 'orgTextBox_' + i, myValue, {flex: '1', readonly: 'true'});
}
} else {
currentRow = cardbookTypes.addRow(aOrigBox, 'orgRow_' + i);
cardbookTypes.addLabel(currentRow, 'orgLabel_' + i, myOrgStructure[i], 'orgTextBox_' + i, {class: 'header'});
currentRow = cardbookElementTools.addGridRow(aOrigBox, 'orgRow_' + i, {align: 'center'});
cardbookElementTools.addLabel(currentRow, 'orgLabel_' + i, myOrgStructure[i], 'orgTextBox_' + i, {class: 'header'});
var myTextBox = cardbookElementTools.addTextbox(currentRow, 'orgTextBox_' + i, myValue, {flex: '1', type: 'autocomplete', autocompletesearch: 'form-history', autocompletesearchparam: 'orgTextBox_' + i, class:'padded'});
myTextBox.addEventListener("input", wdw_cardEdition.setDisplayName, false);
}
......@@ -383,35 +383,35 @@ if ("undefined" == typeof(cardbookTypes)) {
var myOrgValue = cardbookUtils.unescapeString(cardbookUtils.escapeString(aOrgValue));
if (aReadOnly) {
if (myOrgValue != "") {
currentRow = cardbookTypes.addRow(aOrigBox, 'orgRow_0');
cardbookTypes.addLabel(currentRow, 'orgLabel', strBundle.getString("orgLabel"), 'orgTextBox_0', {class: 'header'});
currentRow = cardbookElementTools.addGridRow(aOrigBox, 'orgRow_0', {align: 'center'});
cardbookElementTools.addLabel(currentRow, 'orgLabel', strBundle.getString("orgLabel"), 'orgTextBox_0', {class: 'header'});
cardbookElementTools.addTextbox(currentRow, 'orgTextBox_0', myOrgValue, {flex: '1', readonly: 'true'});
}
} else {
currentRow = cardbookTypes.addRow(aOrigBox, 'orgRow_0');
cardbookTypes.addLabel(currentRow, 'orgLabel', strBundle.getString("orgLabel"), 'orgTextBox_0', {class: 'header'});
currentRow = cardbookElementTools.addGridRow(aOrigBox, 'orgRow_0', {align: 'center'});
cardbookElementTools.addLabel(currentRow, 'orgLabel', strBundle.getString("orgLabel"), 'orgTextBox_0', {class: 'header'});
var myTextBox = cardbookElementTools.addTextbox(currentRow, 'orgTextBox_0', myOrgValue, {flex: '1', type: 'autocomplete', autocompletesearch: 'form-history', autocompletesearchparam: 'orgTextBox_0', class:'padded'});
myTextBox.addEventListener("input", wdw_cardEdition.setDisplayName, false);
}
}
if (aReadOnly) {
if (aTitleValue != "") {
currentRow = cardbookTypes.addRow(aOrigBox, 'titleRow');
cardbookTypes.addLabel(currentRow, 'titleLabel', strBundle.getString("titleLabel"), 'titleTextBox', {class: 'header'});
currentRow = cardbookElementTools.addGridRow(aOrigBox, 'titleRow', {align: 'center'});
cardbookElementTools.addLabel(currentRow, 'titleLabel', strBundle.getString("titleLabel"), 'titleTextBox', {class: 'header'});
cardbookElementTools.addTextbox(currentRow, 'titleTextBox', aTitleValue, {flex: '1', readonly: 'true'});
}
if (aRoleValue != "") {
currentRow = cardbookTypes.addRow(aOrigBox, 'roleRow');
cardbookTypes.addLabel(currentRow, 'roleLabel', strBundle.getString("roleLabel"), 'roleTextBox', {class: 'header'});
currentRow = cardbookElementTools.addGridRow(aOrigBox, 'roleRow', {align: 'center'});
cardbookElementTools.addLabel(currentRow, 'roleLabel', strBundle.getString("roleLabel"), 'roleTextBox', {class: 'header'});
cardbookElementTools.addTextbox(currentRow, 'roleTextBox', aRoleValue, {flex: '1', readonly: 'true'});
}
} else {
currentRow = cardbookTypes.addRow(aOrigBox, 'titleRow');
cardbookTypes.addLabel(currentRow, 'titleLabel', strBundle.getString("titleLabel"), 'titleTextBox', {class: 'header'});
currentRow = cardbookElementTools.addGridRow(aOrigBox, 'titleRow', {align: 'center'});
cardbookElementTools.addLabel(currentRow, 'titleLabel', strBundle.getString("titleLabel"), 'titleTextBox', {class: 'header'});
var myTextBox = cardbookElementTools.addTextbox(currentRow, 'titleTextBox', aTitleValue, {flex: '1', type: 'autocomplete', autocompletesearch: 'form-history', autocompletesearchparam: 'titleTextBox', class:'padded'});
myTextBox.addEventListener("input", wdw_cardEdition.setDisplayName, false);
currentRow = cardbookTypes.addRow(aOrigBox, 'roleRow');
cardbookTypes.addLabel(currentRow, 'roleLabel', strBundle.getString("roleLabel"), 'roleTextBox', {class: 'header'});
currentRow = cardbookElementTools.addGridRow(aOrigBox, 'roleRow', {align: 'center'});
cardbookElementTools.addLabel(currentRow, 'roleLabel', strBundle.getString("roleLabel"), 'roleTextBox', {class: 'header'});
var myTextBox = cardbookElementTools.addTextbox(currentRow, 'roleTextBox', aRoleValue, {flex: '1', type: 'autocomplete', autocompletesearch: 'form-history', autocompletesearchparam: 'roleTextBox', class:'padded'});
myTextBox.addEventListener("input", wdw_cardEdition.setDisplayName, false);
}
......@@ -440,38 +440,19 @@ if ("undefined" == typeof(cardbookTypes)) {
j--;
if (aReadOnly) {
if (myValue != "") {
currentRow = cardbookTypes.addRow(aOrigBox, myField + 'Row');
cardbookTypes.addLabel(currentRow, myField + 'Label', myLabel, myField + 'TextBox', {class: 'header'});
currentRow = cardbookElementTools.addGridRow(aOrigBox, myField + 'Row', {align: 'center'});
cardbookElementTools.addLabel(currentRow, myField + 'Label', myLabel, myField + 'TextBox', {class: 'header'});
cardbookElementTools.addTextbox(currentRow, myField + 'TextBox', myValue, {flex: '1', readonly: 'true'});
}
} else {
currentRow = cardbookTypes.addRow(aOrigBox, myField + 'Row');
cardbookTypes.addLabel(currentRow, myField + 'Label', myLabel, myField + 'TextBox', {class: 'header'});
currentRow = cardbookElementTools.addGridRow(aOrigBox, myField + 'Row', {align: 'center'});
cardbookElementTools.addLabel(currentRow, myField + 'Label', myLabel, myField + 'TextBox', {class: 'header'});
cardbookElementTools.addTextbox(currentRow, myField + 'TextBox', myValue, {flex: '1'});
}
}
return othersTemp;
},
addRow: function (aOrigBox, aId) {
var aRow = document.createElement('row');
aOrigBox.appendChild(aRow);
aRow.setAttribute('id', aId);
aRow.setAttribute('align', 'center');
return aRow;
},
addLabel: function (aOrigBox, aId, aValue, aControl, aParameters) {
var aLabel = document.createElement('label');
aOrigBox.appendChild(aLabel);
aLabel.setAttribute('id', aId);
aLabel.setAttribute('value', aValue);
aLabel.setAttribute('control', aControl);
for (var prop in aParameters) {
aLabel.setAttribute(prop, aParameters[prop]);
}
},
loadDynamicTypes: function (aType, aIndex, aInputTypes, aPgName, aPgType, aCardValue, aVersion) {
var strBundle = document.getElementById("cardbook-strings");
var aOrigBox = document.getElementById(aType + 'Groupbox');
......@@ -490,7 +471,7 @@ if ("undefined" == typeof(cardbookTypes)) {
var aPrefButton = cardbookElementTools.addPrefStar(aHBox, aType, aIndex, cardbookUtils.getPrefBooleanFromTypes(aInputTypes))
cardbookTypes.addLabel(aHBox, aType + '_' + aIndex + '_prefWeightBoxLabel', cardbookPreferences.getPrefValueLabel(), aType + '_' + aIndex + '_prefWeightBox', {tooltip: strBundle.getString("prefWeightTooltip")});
cardbookElementTools.addLabel(aHBox, aType + '_' + aIndex + '_prefWeightBoxLabel', cardbookPreferences.getPrefValueLabel(), aType + '_' + aIndex + '_prefWeightBox', {tooltip: strBundle.getString("prefWeightTooltip")});
cardbookElementTools.addTextbox(aHBox, aType + '_' + aIndex + '_prefWeightBox', cardbookUtils.getPrefValueFromTypes(aInputTypes, document.getElementById('versionTextBox').value), {size: "5"});
if (aPrefButton.getAttribute('haspref')) {
document.getElementById(aType + '_' + aIndex + '_prefWeightBoxLabel').disabled = false;
......@@ -675,7 +656,7 @@ if ("undefined" == typeof(cardbookTypes)) {
cardbookElementTools.addCaption(aType, aOrigBox);
}
var aRow = cardbookElementTools.addGridRow(aType, aIndex, aOrigBox, {align: 'start'});
var aRow = cardbookElementTools.addGridRow(aOrigBox, aType + '_' + aIndex + '_gridRow', {align: 'start'});
var myInputTypes = [];
myInputTypes = cardbookUtils.getOnlyTypesFromTypes(aInputTypes);
......
......@@ -199,7 +199,7 @@ if ("undefined" == typeof(wdw_migrate)) {
var myLowerEmail = myEmail.toLowerCase();
var myName = myABCard.getProperty("DisplayName","");
try {
// within a standard list all members are simple cards... weird...
// within a standard list all members are simple cards… weird…
if ((myName == myEmail) && wdw_migrate.allLists[myName] && wdw_migrate.allLists[myName].solved) {
myTargetMembers.push(["urn:uuid:" + wdw_migrate.allLists[myName].uid, myName]);
} else if (cardbookRepository.cardbookCardEmails[aDirPrefIdTarget][myLowerEmail]) {
......@@ -275,7 +275,9 @@ if ("undefined" == typeof(wdw_migrate)) {
myABCard = myABCard.QueryInterface(Components.interfaces.nsIAbCard);
if (!myABCard.isMailList) {
cardbookRepository.cardbookServerSyncTotal[aDirPrefIdTarget]++;
wdw_migrate.translateStandardCards(aDirPrefIdTarget, aDirPrefIdTargetName, myABCard, aVersion, aDateFormat, aMode);
Services.tm.currentThread.dispatch({ run: function() {
wdw_migrate.translateStandardCards(aDirPrefIdTarget, aDirPrefIdTargetName, myABCard, aVersion, aDateFormat, aMode);
}}, Components.interfaces.nsIEventTarget.DISPATCH_SYNC);
}
}
var abCardsEnumerator = contact.childCards;
......
......@@ -14,7 +14,6 @@
<script src="cardbookUtils.js"/>
<script src="cardbookSynchronization.js"/>
<script src="cardbookIndexedDB.js"/>
<script src="cardbookCountries.js"/>
<script src="ovl_init.js"/>
<script src="cardbookMailPopularity.js"/>
<script src="ovl_mailPopularity.js"/>
......
......@@ -171,7 +171,6 @@
<menuitem id="cardbookToolsBirthdayList" label="&cardbookToolsMenuBirthdayListLabel;" oncommand="wdw_cardbook.displayBirthdayList();"/>
<menuitem id="cardbookToolsSyncLightning" label="&cardbookToolsMenuSyncLightningLabel;" oncommand="wdw_cardbook.displaySyncList();"/>
<menuseparator/>
<menuitem id="cardbookToolsMenuComplexSearch" label="&cardbookToolbarComplexSearchLabel;" oncommand="wdw_cardbook.editComplexSearch();"/>
<menuitem id="cardbookToolsMenuFindSingleDuplicates" label="&cardbookToolsMenuFindSingleDuplicatesLabel;" oncommand="wdw_cardbook.findDuplicatesFromAccountsOrCats();"/>
<menuitem id="cardbookToolsMenuFindDuplicates" label="&cardbookToolsMenuFindAllDuplicatesLabel;" oncommand="wdw_cardbook.findDuplicates();"/>
<menuseparator/>
......
......@@ -89,7 +89,7 @@ if ("undefined" == typeof(ovl_synchro)) {
prefs.setCharPref("accountsShown", "all");
prefs.setCharPref("accountShown", "");
prefs.setCharPref("uncategorizedCards", "");
prefs.setCharPref("addonVersion", "27.2");
prefs.setCharPref("addonVersion", "27.3");
},
lEventTimerSync : { notify: function(lTimerSync) {
......@@ -113,7 +113,7 @@ if ("undefined" == typeof(ovl_synchro)) {
// setting addonVersion, userAgent and prodid
cardbookRepository.addonVersion = cardbookPreferences.getStringPref("extensions.cardbook.addonVersion");
cardbookRepository.userAgent = "Thunderbird CardBook/" + cardbookRepository.addonVersion;
cardbookRepository.prodid = "-//Thunderbird.org/NONSGML Thunderbird CardBook V"+ cardbookRepository.addonVersion + "//EN";
cardbookRepository.prodid = "-//Thunderbird.net/NONSGML Thunderbird CardBook V"+ cardbookRepository.addonVersion + "//EN";
// setting autocompleteRestrictSearch and autocompleteRestrictSearchFields
cardbookRepository.autocompleteRestrictSearch = cardbookPreferences.getBoolPref("extensions.cardbook.autocompleteRestrictSearch");
......
if ("undefined" == typeof(wdw_logEdition)) {
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("chrome://cardbook/content/cardbookRepository.js");
var wdw_bulkOperation = {
lTimerBulkOperation: {},
load: function () {
wdw_bulkOperation.lTimerBulkOperation[1] = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer);
var lTimerBulkOperation = wdw_bulkOperation.lTimerBulkOperation[1];
lTimerBulkOperation.initWithCallback({ notify: function(lTimerBulkOperation) {
var close = true;
for (var dirPrefId in cardbookRepository.lTimerDirAll) {
var total = cardbookRepository.cardbookServerSyncTotal[dirPrefId];
var done = cardbookRepository.cardbookServerSyncDone[dirPrefId];
if (total !=0 && done !=0) {
if (!(document.getElementById("bulkProgressmeter_" + dirPrefId))) {
var currentRow = cardbookElementTools.addGridRow(document.getElementById("bulkOperationRows"), 'bulkOperationRow_' + dirPrefId, {align: 'center'});
cardbookElementTools.addLabel(currentRow, 'bulkOperationRowLabel_' + dirPrefId, cardbookPreferences.getName(dirPrefId), 'bulkOperationProgressmeter_' + dirPrefId);
cardbookElementTools.addProgressmeter(currentRow, "bulkProgressmeter_" + dirPrefId, {mode: "determined"});
}
var value = Math.round(done / total * 100);
document.getElementById("bulkProgressmeter_" + dirPrefId).value = value;
if (value != 100) {
close = false;
}
} else if (document.getElementById("bulkProgressmeter_" + dirPrefId)) {
document.getElementById("bulkProgressmeter_" + dirPrefId).value = 100;
}
}
if (close) {
wdw_bulkOperation.cancel();
}
}
}, 1000, Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
},
cancel: function () {
wdw_bulkOperation.lTimerBulkOperation[1].cancel();
close();
}
};
};
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://cardbook/skin/logEdition.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % bulkOperationDTD SYSTEM "chrome://cardbook/locale/wdw_bulkOperation.dtd"> %bulkOperationDTD;
<!ENTITY % buttonsDTD SYSTEM "chrome://cardbook/locale/wdw_editionButtons.dtd"> %buttonsDTD;
]>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="wdw_bulkOperation.load();" resizable="true"
onclose="wdw_bulkOperation.cancel();"
id="wdw_bulkOperation" title="&wdw_bulkOperationTitle;"
persist="screenX screenY width height"
style="min-width:100px;min-height:100px;">
<stringbundleset id="stringbundleset"/>
<script src="chrome://cardbook/content/preferences/cardbookPreferences.js"/>
<script src="cardbookElementTools.js"/>
<script src="wdw_bulkOperation.js"/>
<keyset id="wdw_bulkOperation-keys">
<key id="escapeKey" keycode="VK_ESCAPE" oncommand="wdw_bulkOperation.cancel();"/>
</keyset>
<grid id="bulkOperationGrid" align="center" flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows id="bulkOperationRows"/>
</grid>
<hbox>
<spacer flex="1"/>
<button id="closeEditionLabel" label="&closeEditionLabel;" accesskey="&closeEditionAccesskey;" oncommand="wdw_bulkOperation.cancel();"/>
</hbox>
</window>
......@@ -681,10 +681,11 @@ if ("undefined" == typeof(wdw_cardbook)) {
}
cardbookSynchronization.initMultipleOperations(myDirPrefId);
cardbookRepository.cardbookFileRequest[myDirPrefId]++;
wdw_cardbook.bulkOperation();
if (cardbookUtils.getFileNameExtension(aFile.leafName).toLowerCase() == "csv") {
cardbookSynchronization.loadCSVFile(aFile, myTarget, "WINDOW", "cardbook.cardImportedFromFile");
} else {
cardbookSynchronization.loadFile(aFile, myTarget, "WINDOW", "IMPORT", "cardbook.cardImportedFromFile");
cardbookSynchronization.loadFile(aFile, myTarget, "WINDOW", "IMPORTFILE", "cardbook.cardImportedFromFile");
}
cardbookSynchronization.waitForImportFinished(myDirPrefId, myDirPrefIdName);
}
......@@ -717,7 +718,8 @@ if ("undefined" == typeof(wdw_cardbook)) {
}
cardbookSynchronization.initMultipleOperations(myDirPrefId);
cardbookRepository.cardbookDirRequest[myDirPrefId]++;
cardbookSynchronization.loadDir(aDirectory, myTarget, "WINDOW", "IMPORT", "cardbook.cardImportedFromFile");
wdw_cardbook.bulkOperation();
cardbookSynchronization.loadDir(aDirectory, myTarget, "WINDOW", "IMPORTDIR", "cardbook.cardImportedFromFile");
cardbookSynchronization.waitForImportFinished(myDirPrefId, myDirPrefIdName);
}
catch (e) {
......@@ -855,12 +857,14 @@ if ("undefined" == typeof(wdw_cardbook)) {
myCreatedEvent = "cardbook.cardPasted";
myDeletedEvent = "cardbook.cardRemovedIndirect";
}
cardbookSynchronization.importCard(myCard, myTarget, askUser, myCreatedEvent);
if (myDirPrefId != myCard.dirPrefId) {
if (wdw_cardbook.cutAndPaste != "") {
cardbookRepository.deleteCards([myCard], myDeletedEvent);
Services.tm.currentThread.dispatch({ run: function() {
cardbookSynchronization.importCard(myCard, myTarget, askUser, myCreatedEvent);
if (myDirPrefId != myCard.dirPrefId) {
if (wdw_cardbook.cutAndPaste != "") {
cardbookRepository.deleteCards([myCard], myDeletedEvent);
}
}
}
}}, Components.interfaces.nsIEventTarget.DISPATCH_SYNC);
} else {
cardbookUtils.formatStringForOutput("clipboardWrong");
}
......@@ -888,6 +892,11 @@ if ("undefined" == typeof(wdw_cardbook)) {
}
},
bulkOperation: function () {
var myArgs = {};
openDialog("chrome://cardbook/content/wdw_bulkOperation.xul", "", cardbookRepository.windowParams, myArgs);
},
chooseActionTreeForClick: function (aEvent) {
wdw_cardbook.setCurrentTypeFromEvent(aEvent);
// only left click
......@@ -1452,12 +1461,14 @@ if ("undefined" == typeof(wdw_cardbook)) {
myCreatedEvent = "cardbook.cardDragged";
myDeletedEvent = "cardbook.cardRemovedIndirect";
}
cardbookSynchronization.importCard(myCard, myTarget, askUser, myCreatedEvent);
if (myDirPrefId != myCard.dirPrefId) {
if (!aEvent.ctrlKey) {
cardbookRepository.deleteCards([myCard], myDeletedEvent);
Services.tm.currentThread.dispatch({ run: function() {
cardbookSynchronization.importCard(myCard, myTarget, askUser, myCreatedEvent);
if (myDirPrefId != myCard.dirPrefId) {
if (!aEvent.ctrlKey) {
cardbookRepository.deleteCards([myCard], myDeletedEvent);
}
}
}
}}, Components.interfaces.nsIEventTarget.DISPATCH_SYNC);
} else {
cardbookUtils.formatStringForOutput("draggableWrong");
}
......@@ -2343,7 +2354,7 @@ if ("undefined" == typeof(wdw_cardbook)) {
cardbookAccountMenuContextShowing: function () {
var myTree = document.getElementById('accountsOrCatsTree');
if (cardbookRepository.cardbookAccounts.length == 0) {
if (cardbookDirTree.visibleData.length == 0) {
wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuEditServer', 'cardbookAccountMenuCloseServer', 'cardbookAccountMenuEnableOrDisableAddressbook',
'cardbookAccountMenuReadOnlyOrReadWriteAddressbook', 'cardbookAccountMenuSync', 'cardbookAccountMenuExportToFile', 'cardbookAccountMenuImportFromFile',
'cardbookAccountMenuExportToDir', 'cardbookAccountMenuImportFromDir'], true);
......@@ -2484,7 +2495,7 @@ if ("undefined" == typeof(wdw_cardbook)) {
wdw_cardbook.setElementLabelWithBundle('enableOrDisableFromAccountsOrCats', "disableFromAccountsOrCats");
wdw_cardbook.setElementLabelWithBundle('readOnlyOrReadWriteFromAccountsOrCats', "readOnlyFromAccountsOrCats");
var myTree = document.getElementById('accountsOrCatsTree');
if (cardbookRepository.cardbookAccounts.length != 0) {
if (cardbookDirTree.visibleData.length != 0 && myTree.currentIndex != -1) {
var myAccountId = myTree.view.getCellText(myTree.currentIndex, {id: "accountId"});
var myPrefId = cardbookUtils.getAccountId(myAccountId);
if (cardbookPreferences.getEnabled(myPrefId)) {
......
......@@ -157,7 +157,7 @@ periodicSyncSetting=%1$S : Nastavování procesu opakované synchronizace (inter
periodicSyncSyncing=%S : Synchronizace kvůli opakované synchronizaci …
fileEmpty=Soubor %S je prázdný
fileAlreadyOpen=Soubor %S je již v Cardbooku otevřen
fileAlreadyOpen=Soubor %S je již v CardBooku otevřen
directoryAlreadyOpen=Adresář %S je již v CardBooku otevřen
parsingCardError=%1$S : Chyba při parsování kontaktu : \n%2$S \n%3$S
......
<!ENTITY wdw_bulkOperationTitle "Běžící…">
<!ENTITY generalTabLabel "Obecné">
<!ENTITY CardBookTabLabel "Záložka Cardbooku">
<!ENTITY CardBookTabLabel "Záložka CardBooku">
<!ENTITY typesTabLabel "Typy">
<!ENTITY IMPPsTabLabel "Adresy IM">
<!ENTITY customFieldsTabLabel "Vlastní pole">
......
<!ENTITY wdw_bulkOperationTitle "Kører…">
......@@ -367,7 +367,7 @@ downEntryTooltip=Nach unten verschieben
selectedCardsDeletionConfirmMessagePF=Sind Sie sicher, dass Sie den ausgewählten Kontakt löschen möchten?;Sind Sie sicher, dass Sie die %1 ausgewählten Kontakte löschen möchten?