private final ApplicationLogger logger;\r
private final DatabaseConnection conn;\r
public boolean resourceError = false;\r
- public boolean readOnly = false;\r
+ public boolean readOnly = false; \r
+ public boolean inkNote = false;\r
public boolean addHighlight = true;\r
private Note currentNote;\r
private String currentNoteGuid;\r
public void setNote(Note note, boolean pdfPreview) {\r
currentNote = note;\r
this.pdfPreview = pdfPreview;\r
- currentNoteGuid = note.getGuid();\r
readOnly = false;\r
+ currentNoteGuid = null;\r
+ if (note != null) {\r
+ currentNoteGuid = note.getGuid();\r
+ readOnly = conn.getNotebookTable().isReadOnly(note.getNotebookGuid());\r
+ } \r
resourceError = false;\r
}\r
\r
\r
// Rebuild the note HTML to something usable\r
public String rebuildNoteHTML() {\r
+ if (currentNote == null)\r
+ return null;\r
logger.log(logger.HIGH, "Entering NeverNote.rebuildNoteHTML");\r
logger.log(logger.EXTREME, "Note guid: " +currentNoteGuid);\r
logger.log(logger.EXTREME, "Note Text:" +currentNote);\r
\r
// Get the recognition XML that tells where to hilight on the image\r
Resource recoResource = conn.getNoteTable().noteResourceTable.getNoteResourceRecognition(resGuid);\r
+ if (recoResource.getRecognition().getBody() == null || recoResource.getRecognition().getBody().length == 0)\r
+ return;\r
QByteArray recoData = new QByteArray(recoResource.getRecognition().getBody());\r
String xml = recoData.toString();\r
\r
\r
// Check to see if this word matches something we were searching for.\r
for (int k=0; k<enSearch.hilightWords.size(); k++) {\r
- if (enSearch.hilightWords.get(k).equalsIgnoreCase(text))\r
+ String searchWord = enSearch.hilightWords.get(k).toLowerCase();\r
+ if (searchWord.startsWith("*"))\r
+ searchWord = searchWord.substring(1);\r
+ if (searchWord.endsWith("*"))\r
+ searchWord = searchWord.substring(0,searchWord.length()-1);\r
+ if (text.toLowerCase().contains(searchWord))\r
p2.drawRect(x,y,w,h); \r
}\r
}\r
Resource r = null;\r
if (resGuid != null)\r
r = conn.getNoteTable().noteResourceTable.getNoteResource(resGuid,true);\r
- if (r==null || r.getData() == null || r.getData().getBody().length == 0)\r
- resourceError = true;;\r
+ if (r==null || r.getData() == null || r.getData().getBody().length == 0) {\r
+ resourceError = true;\r
+ readOnly = true;\r
+ }\r
if (r!= null && r.getData() != null && r.getData().getBody().length > 0) {\r
tfile.open(new QIODevice.OpenMode(QIODevice.OpenModeFlag.WriteOnly));\r
QByteArray binData = new QByteArray(r.getData().getBody());\r
private void modifyApplicationTags(QDomDocument doc, QDomElement docElem, QDomElement enmedia, QDomAttr hash, String appl) {\r
logger.log(logger.HIGH, "Entering NeverNote.modifyApplicationTags");\r
if (appl.equalsIgnoreCase("vnd.evernote.ink")) {\r
- readOnly = true;\r
+ inkNote = true;\r
if (buildInkNote(doc, docElem, enmedia, hash, appl))\r
return;\r
}\r
todo.setAttribute("unchecked","");\r
todo.setAttribute("value", checked);\r
todo.setAttribute("onClick", "value=checked;window.jambi.contentChanged(); ");\r
+ todo.setAttribute("onMouseOver", "style.cursor='hand'");\r
todo.setTagName("input");\r
logger.log(logger.HIGH, "Leaving NeverNote.modifyTodoTags");\r
}\r