diff --git a/data/resources/application/de.xml b/data/resources/application/de.xml index 8500d4d78..cb7fe17dc 100644 --- a/data/resources/application/de.xml +++ b/data/resources/application/de.xml @@ -322,7 +322,8 @@ - + + diff --git a/data/resources/application/en.xml b/data/resources/application/en.xml index ddefaa4e5..b27731760 100644 --- a/data/resources/application/en.xml +++ b/data/resources/application/en.xml @@ -321,7 +321,8 @@ - + + diff --git a/data/resources/application/fr.xml b/data/resources/application/fr.xml index 596b50ac7..f0eea8fb6 100644 --- a/data/resources/application/fr.xml +++ b/data/resources/application/fr.xml @@ -322,7 +322,8 @@ - + + diff --git a/data/resources/application/hu.xml b/data/resources/application/hu.xml index cdfe59816..2413aaafb 100644 --- a/data/resources/application/hu.xml +++ b/data/resources/application/hu.xml @@ -322,7 +322,8 @@ - + + diff --git a/data/resources/application/it.xml b/data/resources/application/it.xml index d23ab0b70..95c877cd7 100644 --- a/data/resources/application/it.xml +++ b/data/resources/application/it.xml @@ -322,7 +322,8 @@ - + + diff --git a/data/resources/application/ru.xml b/data/resources/application/ru.xml index 112764c3e..824b0db96 100644 --- a/data/resources/application/ru.xml +++ b/data/resources/application/ru.xml @@ -321,7 +321,8 @@ - + + diff --git a/data/resources/application/vi.xml b/data/resources/application/vi.xml index 4a6b1cd96..76a0ce83f 100644 --- a/data/resources/application/vi.xml +++ b/data/resources/application/vi.xml @@ -322,7 +322,8 @@ - + + diff --git a/data/resources/application/zh.xml b/data/resources/application/zh.xml index 7bafad212..e28dc935a 100644 --- a/data/resources/application/zh.xml +++ b/data/resources/application/zh.xml @@ -322,7 +322,8 @@ - + + diff --git a/src/org/geometerplus/android/fbreader/network/CustomCatalogDialog.java b/src/org/geometerplus/android/fbreader/network/CustomCatalogDialog.java index 939139871..63d45d625 100644 --- a/src/org/geometerplus/android/fbreader/network/CustomCatalogDialog.java +++ b/src/org/geometerplus/android/fbreader/network/CustomCatalogDialog.java @@ -103,8 +103,13 @@ class CustomCatalogDialog extends NetworkDialog { } final NetworkLibrary library = NetworkLibrary.Instance(); - if (library.hasCustomLink(myTitle, (ICustomNetworkLink) myLink)) { - final String err = myResource.getResource("alreadyExists").getValue(); + if (library.hasCustomLinkTitle(myTitle, (ICustomNetworkLink) myLink)) { + final String err = myResource.getResource("titleAlreadyExists").getValue(); + sendError(true, false, err); + return; + } + if (library.hasCustomLinkSite(siteName, (ICustomNetworkLink) myLink)) { + final String err = myResource.getResource("siteAlreadyExists").getValue(); sendError(true, false, err); return; } diff --git a/src/org/geometerplus/fbreader/network/NetworkLibrary.java b/src/org/geometerplus/fbreader/network/NetworkLibrary.java index 266d91713..abb1d92b5 100644 --- a/src/org/geometerplus/fbreader/network/NetworkLibrary.java +++ b/src/org/geometerplus/fbreader/network/NetworkLibrary.java @@ -475,13 +475,13 @@ public class NetworkLibrary { link.saveLink(); } - public int getCustomLinksNumber() { + /*public int getCustomLinksNumber() { return myCustomLinks.size(); } public ICustomNetworkLink getCustomLink(int index) { return myCustomLinks.get(index); - } + }*/ public void removeCustomLink(ICustomNetworkLink link) { final int index = Collections.binarySearch(myCustomLinks, link, new LinksComparator()); @@ -493,12 +493,21 @@ public class NetworkLibrary { link.setSaveLinkListener(null); } - public boolean hasCustomLink(String title, ICustomNetworkLink exeptFor) { - for (ICustomNetworkLink link: myCustomLinks) { + public boolean hasCustomLinkTitle(String title, ICustomNetworkLink exeptFor) { + for (INetworkLink link: myLinks) { if (link != exeptFor && link.getTitle().equals(title)) { return true; } } return false; } + + public boolean hasCustomLinkSite(String siteName, ICustomNetworkLink exeptFor) { + for (INetworkLink link: myLinks) { + if (link != exeptFor && link.getSiteName().equals(siteName)) { + return true; + } + } + return false; + } }