import java.text.SimpleDateFormat;\r
import java.util.ArrayList;\r
import java.util.Calendar;\r
+import java.util.Collections;\r
import java.util.Date;\r
import java.util.GregorianCalendar;\r
import java.util.HashMap;\r
import com.trolltech.qt.gui.QDateEdit;\r
import com.trolltech.qt.gui.QDesktopServices;\r
import com.trolltech.qt.gui.QFileDialog;\r
+import com.trolltech.qt.gui.QFileDialog.AcceptMode;\r
+import com.trolltech.qt.gui.QFileDialog.FileMode;\r
import com.trolltech.qt.gui.QFontDatabase;\r
import com.trolltech.qt.gui.QFormLayout;\r
import com.trolltech.qt.gui.QGridLayout;\r
import com.trolltech.qt.gui.QTimeEdit;\r
import com.trolltech.qt.gui.QVBoxLayout;\r
import com.trolltech.qt.gui.QWidget;\r
-import com.trolltech.qt.gui.QFileDialog.AcceptMode;\r
-import com.trolltech.qt.gui.QFileDialog.FileMode;\r
import com.trolltech.qt.network.QNetworkRequest;\r
import com.trolltech.qt.webkit.QWebPage;\r
+import com.trolltech.qt.webkit.QWebPage.WebAction;\r
import com.trolltech.qt.webkit.QWebSettings;\r
import com.trolltech.qt.webkit.QWebView;\r
-import com.trolltech.qt.webkit.QWebPage.WebAction;\r
\r
import cx.fbn.nevernote.Global;\r
import cx.fbn.nevernote.dialog.EnCryptDialog;\r
import cx.fbn.nevernote.dialog.EnDecryptDialog;\r
+import cx.fbn.nevernote.dialog.GeoDialog;\r
import cx.fbn.nevernote.dialog.InsertLinkDialog;\r
import cx.fbn.nevernote.dialog.TableDialog;\r
import cx.fbn.nevernote.dialog.TagAssign;\r
private final QLineEdit urlText;\r
private final QLabel authorLabel;\r
private final QLineEdit authorText;\r
+ private final QComboBox geoBox;\r
public final TagLineEdit tagEdit;\r
public final QLabel tagLabel;\r
- private final QLabel urlLabel;\r
+ private final QPushButton urlLabel;\r
private final QLabel alteredLabel;\r
private final QDateEdit alteredDate;\r
private final QTimeEdit alteredTime;\r
titleLabel.setMaxLength(Constants.EDAM_NOTE_TITLE_LEN_MAX);\r
urlText = new QLineEdit();\r
authorText = new QLineEdit();\r
- urlLabel = new QLabel();\r
+ geoBox = new QComboBox();\r
+ urlLabel = new QPushButton();\r
+ urlLabel.clicked.connect(this, "sourceUrlClicked()");\r
authorLabel = new QLabel();\r
conn = c;\r
\r
subjectDate.setCalendarPopup(true);\r
subjectDate.setCalendarWidget(subjectCalendarWidget);\r
subjectTime = new QTimeEdit();\r
- subjectLabel = new QLabel("Subject Date:");\r
+ subjectLabel = new QLabel(tr("Subject Date:"));\r
subjectDate.dateChanged.connect(this, "subjectDateTimeChanged()");\r
subjectTime.timeChanged.connect(this, "subjectDateTimeChanged()");\r
authorText.textChanged.connect(this, "authorChanged()");\r
urlText.textChanged.connect(this, "sourceUrlChanged()");\r
\r
notebookBox = new QComboBox();\r
- notebookLabel = new QLabel("Notebook");\r
- createdLabel = new QLabel("Created:");\r
+ notebookLabel = new QLabel(tr("Notebook"));\r
+ createdLabel = new QLabel(tr("Created:"));\r
// selectedText = new String();\r
\r
urlLabel.setVisible(false);\r
urlText.setVisible(false);\r
authorLabel.setVisible(false);\r
+ \r
+ geoBox.setVisible(false);\r
+ geoBox.addItem(new QIcon(iconPath+"globe.png"), "");\r
+ geoBox.addItem(new String(tr("Set")));\r
+ geoBox.addItem(new String(tr("Clear")));\r
+ geoBox.addItem(new String(tr("View On Map")));\r
+ geoBox.activated.connect(this, "geoBoxChanged()");\r
+ \r
authorText.setVisible(false);\r
createdDate.setVisible(false);\r
alteredLabel.setVisible(false);\r
QHBoxLayout authorLayout = new QHBoxLayout();\r
authorLayout.addWidget(authorLabel, 0);\r
authorLayout.addWidget(authorText, 0);\r
+ authorLayout.addWidget(geoBox);\r
v.addLayout(authorLayout);\r
\r
dateLayout.addWidget(createdLabel, 0, 0);\r
dateLayout.addWidget(subjectTime, 0, 8);\r
v.addLayout(dateLayout, 0);\r
\r
- undoButton = newEditorButton("undo", "Undo Change");\r
- redoButton = newEditorButton("redo", "Redo Change");\r
- cutButton = newEditorButton("cut", "Cut");\r
- copyButton = newEditorButton("copy", "Copy");\r
- pasteButton = newEditorButton("paste", "Paste");\r
- boldButton = newEditorButton("bold", "Bold");\r
- underlineButton = newEditorButton("underline", "Underline");\r
- italicButton = newEditorButton("italic", "Italic");\r
+ undoButton = newEditorButton("undo", tr("Undo Change"));\r
+ redoButton = newEditorButton("redo", tr("Redo Change"));\r
+ cutButton = newEditorButton("cut", tr("Cut"));\r
+ copyButton = newEditorButton("copy", tr("Copy"));\r
+ pasteButton = newEditorButton("paste", tr("Paste"));\r
+ boldButton = newEditorButton("bold", tr("Bold"));\r
+ underlineButton = newEditorButton("underline", tr("Underline"));\r
+ italicButton = newEditorButton("italic", tr("Italic"));\r
\r
- rightAlignButton = newEditorButton("justifyRight", "Right Align");\r
- leftAlignButton = newEditorButton("justifyLeft", "Left Align");\r
- centerAlignButton = newEditorButton("justifyCenter", "Center Align");\r
+ rightAlignButton = newEditorButton("justifyRight", tr("Right Align"));\r
+ leftAlignButton = newEditorButton("justifyLeft", tr("Left Align"));\r
+ centerAlignButton = newEditorButton("justifyCenter", tr("Center Align"));\r
\r
- strikethroughButton = newEditorButton("strikethrough", "Strikethrough");\r
- hlineButton = newEditorButton("hline", "Insert Horizontal Line");\r
- indentButton = newEditorButton("indent", "Shift Right");\r
- outdentButton = newEditorButton("outdent", "Shift Left");\r
- bulletListButton = newEditorButton("bulletList", "Bullet List");\r
- numberListButton = newEditorButton("numberList", "Number List");\r
+ strikethroughButton = newEditorButton("strikethrough", tr("Strikethrough"));\r
+ hlineButton = newEditorButton("hline", tr("Insert Horizontal Line"));\r
+ indentButton = newEditorButton("indent", tr("Shift Right"));\r
+ outdentButton = newEditorButton("outdent", tr("Shift Left"));\r
+ bulletListButton = newEditorButton("bulletList", tr("Bullet List"));\r
+ numberListButton = newEditorButton("numberList", tr("Number List"));\r
\r
\r
QHBoxLayout buttonLayout;\r
}\r
\r
buttonLayout.addWidget(newSeparator(), 0);\r
- fontColor = newEditorButton("fontColor", "Font Color");\r
+ fontColor = newEditorButton("fontColor", tr("Font Color"));\r
fontColorMenu = new ColorMenu(this);\r
fontColor.setMenu(fontColorMenu.getMenu());\r
fontColorMenu.getMenu().triggered.connect(this, "fontColorClicked()");\r
buttonLayout.addWidget(fontColor);\r
- fontHilight = newEditorButton("fontHilight", "Font Hilight Color");\r
+ fontHilight = newEditorButton("fontHilight", tr("Font Hilight Color"));\r
fontHilightColorMenu = new ColorMenu(this);\r
fontHilight.setMenu(fontHilightColorMenu.getMenu());\r
fontHilightColorMenu.getMenu().triggered.connect(this, "fontHilightClicked()");\r
notebookBox.setEnabled(!v);\r
tagEdit.setEnabled(!v);\r
authorLabel.setEnabled(!v);\r
+ geoBox.setEnabled(!v);\r
urlText.setEnabled(!v);\r
createdDate.setEnabled(!v);\r
subjectDate.setEnabled(!v);\r
setNote(null);\r
browser.setContent(new QByteArray());\r
tagEdit.setText("");\r
- urlLabel.setText("Source URL:");\r
+ tagEdit.tagCompleter.reset();\r
+ urlLabel.setText(tr("Source URL:"));\r
titleLabel.setText("");\r
logger.log(logger.EXTREME, "Exiting BrowserWindow.clear()");\r
}\r
public void setTag(String t) {\r
saveTagList = t;\r
tagEdit.setText(t);\r
+ tagEdit.tagCompleter.reset();\r
}\r
\r
// Set the source URL\r
public void setUrl(String t) {\r
- urlLabel.setText("Source URL:\t");\r
+ urlLabel.setText(tr("Source URL:\t"));\r
urlText.setText(t);\r
}\r
\r
+ // The user want's to launch a web browser on the source of the URL\r
+ public void sourceUrlClicked() {\r
+ // Make sure we have a valid URL\r
+ if (urlText.text().trim().equals(""))\r
+ return;\r
+ \r
+ String url = urlText.text();\r
+ if (!url.toLowerCase().startsWith(tr("http://")))\r
+ url = tr("http://") +url;\r
+ \r
+ if (!QDesktopServices.openUrl(new QUrl(url))) {\r
+ logger.log(logger.LOW, "Error opening file :" +url);\r
+ }\r
+ }\r
+ \r
public void setAuthor(String t) {\r
- authorLabel.setText("Author:\t");\r
+ authorLabel.setText(tr("Author:\t"));\r
authorText.setText(t);\r
}\r
\r
urlLabel.setVisible(extendedOn);\r
urlText.setVisible(extendedOn);\r
authorText.setVisible(extendedOn);\r
+ geoBox.setVisible(extendedOn);\r
authorLabel.setVisible(extendedOn);\r
createdDate.setVisible(extendedOn);\r
createdTime.setVisible(extendedOn);\r
logger.log(logger.EXTREME, "URL is NN resource");\r
if (url.toString().endsWith("/vnd.evernote.ink")) {\r
logger.log(logger.EXTREME, "Unable to open ink note");\r
- QMessageBox.information(this, "Unable Open", "This is an ink note.\n"+\r
+ QMessageBox.information(this, tr("Unable Open"), tr("This is an ink note.\n"+\r
"Ink notes are not supported since Evernote has not\n published any specifications on them\n" +\r
- "and I'm too lazy to figure them out by myself.");\r
+ "and I'm too lazy to figure them out by myself."));\r
return;\r
}\r
String fullName = url.toString().substring(8);\r
fileName = res.getGuid()+Global.attachmentNameDelimeter+res.getAttributes().getFileName();\r
else\r
fileName = res.getGuid()+"."+type;\r
- QFile file = new QFile(Global.getDirectoryPath() +"res/"+fileName);\r
+ QFile file = new QFile(Global.getFileManager().getResDirPath(fileName));\r
QFile.OpenMode mode = new QFile.OpenMode();\r
mode.set(QFile.OpenModeFlag.WriteOnly);\r
boolean openResult = file.open(mode);\r
String encrypted = crypt.encrypt(text, dialog.getPassword().trim(), 64);\r
\r
if (encrypted.trim().equals("")) {\r
- QMessageBox.information(this, "Error", "Error Encrypting String");\r
+ QMessageBox.information(this, tr("Error"), tr("Error Encrypting String"));\r
return;\r
}\r
StringBuffer buffer = new StringBuffer(encrypted.length() + 100);\r
buffer.append("contentEditable=\"false\" alt=\"");\r
buffer.append(encrypted);\r
// NFC FIXME: should this be a file URL like in handleLocalAttachment and importAttachment?\r
- buffer.append("\" src=\"").append(FileUtils.toForwardSlashedPath(Global.getFileManager().getImageDirPath("encrypt.png")));\r
+ buffer.append("\" src=\"").append(FileUtils.toForwardSlashedPath(Global.getFileManager().getImageDirPath("encrypt.png") +"\""));\r
Global.cryptCounter++;\r
buffer.append(" id=\"crypt"+Global.cryptCounter.toString() +"\"");\r
buffer.append(" onMouseOver=\"style.cursor=\\'hand\\'\"");\r
// Tag line has been modified by typing text\r
@SuppressWarnings("unused")\r
private void modifyTagsTyping() {\r
-\r
- String newTags = tagEdit.text();\r
- List<String> test = tagEdit.tagCompleter.getTagList();\r
- if (newTags.equalsIgnoreCase(saveTagList))\r
+ String completionText = "";\r
+ if (tagEdit.currentCompleterSelection != null && !tagEdit.currentCompleterSelection.equals("")) {\r
+ completionText = tagEdit.currentCompleterSelection;\r
+ tagEdit.currentCompleterSelection = "";\r
+ }\r
+ \r
+ if (tagEdit.text().equalsIgnoreCase(saveTagList))\r
return;\r
\r
// We know something has changed...\r
String oldTagArray[] = saveTagList.split(Global.tagDelimeter);\r
- String newTagArray[] = newTags.split(Global.tagDelimeter);\r
+ String newTagArray[] = tagEdit.text().split(Global.tagDelimeter);\r
+ \r
+ if (!completionText.equals("") && newTagArray.length > 0) {\r
+ newTagArray[newTagArray.length-1] = completionText;\r
+ }\r
+ // Remove any potential duplicates from the new list\r
+ for (int i=0; i<newTagArray.length; i++) {\r
+ boolean foundOnce = false;\r
+ for (int j=0; j<newTagArray.length; j++) {\r
+ if (newTagArray[j].equalsIgnoreCase(newTagArray[i])) {\r
+ if (!foundOnce) {\r
+ foundOnce = true;\r
+ } else\r
+ newTagArray[j] = "";\r
+ }\r
+ }\r
+ }\r
\r
List<String> newTagList = new ArrayList<String>();\r
List<String> oldTagList = new ArrayList<String>();\r
if (!newTagArray[i].trim().equals(""))\r
newTagList.add(newTagArray[i]);\r
\r
+ // Let's cleanup the appearance of the tag list\r
+ Collections.sort(newTagList);\r
+ String newDisplay = "";\r
+ for (int i=0; i<newTagList.size(); i++) {\r
+ newDisplay = newDisplay+newTagList.get(i);\r
+ if (i<newTagList.size()-1)\r
+ newDisplay = newDisplay+", ";\r
+ }\r
+ tagEdit.blockSignals(true);\r
+ tagEdit.setText(newDisplay);\r
+ tagEdit.blockSignals(false);\r
+ \r
// We now have lists of the new & old. Remove duplicates. If all\r
// are removed from both then nothing has really changed\r
for (int i = newTagList.size() - 1; i >= 0; i--) {\r
\r
if (oldTagList.size() != 0 || newTagList.size() != 0) {\r
currentTags.clear();\r
+ newTagArray = tagEdit.text().split(Global.tagDelimeter);\r
for (int i = 0; i < newTagArray.length; i++)\r
if (!newTagArray[i].trim().equals(""))\r
currentTags.add(newTagArray[i].trim());\r
\r
noteSignal.tagsChanged.emit(currentNote.getGuid(), currentTags);\r
}\r
-\r
+ \r
}\r
\r
// Tab button was pressed\r
String content = getContent();\r
checkNoteTitle();\r
noteSignal.noteChanged.emit(currentNote.getGuid(), content); \r
- \r
- \r
-// noteSignal.noteChanged.emit(currentNote.getGuid(), unicode);\r
}\r
\r
// The notebook selection has changed\r
if (newLine > 0) {\r
text = text.substring(0, newLine);\r
if (text.trim().equals(""))\r
- text = "Untitled Note";\r
+ text = tr("Untitled Note");\r
titleLabel.setText(text);\r
} else {\r
if (text.length() > 20)\r
titleLabel.setText(text.substring(0, 20));\r
else {\r
if (text.trim().equals(""))\r
- titleLabel.setText("Untitled Note");\r
+ titleLabel.setText(tr("Untitled Note"));\r
else\r
titleLabel.setText(text);\r
}\r
String script_end = new String("');");\r
\r
long now = new Date().getTime();\r
- String path = Global.getDirectoryPath() + "res/"\r
- + (new Long(now).toString()) + ".jpg";\r
+ String path = Global.getFileManager().getResDirPath(\r
+ (new Long(now).toString()) + ".jpg");\r
\r
// This block is just a hack to make sure we wait at least 1ms so we\r
// don't\r
buffer = new StringBuffer(100);\r
\r
// Open the file & write the data\r
- String fileName = Global.getDirectoryPath()+"res/"+newRes.getGuid();\r
+ String fileName = Global.getFileManager().getResDirPath(newRes.getGuid());\r
QFile tfile = new QFile(fileName);\r
tfile.open(new QIODevice.OpenMode(QIODevice.OpenModeFlag.WriteOnly));\r
tfile.write(newRes.getData().getBody());\r
tfile.close();\r
- fileName = fileName.replace('\\', '/');\r
buffer.append(script_start_image);\r
- buffer.append("<img src=\"" +fileName);\r
+ buffer.append("<img src=\"" + FileUtils.toForwardSlashedPath(fileName));\r
// if (mimeType.equalsIgnoreCase("image/jpg"))\r
// mimeType = "image/jpeg";\r
buffer.append("\" en-tag=\"en-media\" type=\"" + mimeType +"\""\r
newRes.getAttributes().getFileName();\r
else\r
fileName = newRes.getGuid()+".pdf";\r
- QFile file = new QFile(Global.getDirectoryPath() +"res/"+fileName);\r
+ QFile file = new QFile(Global.getFileManager().getResDirPath(fileName));\r
QFile.OpenMode mode = new QFile.OpenMode();\r
mode.set(QFile.OpenModeFlag.WriteOnly);\r
file.open(mode);\r
file.close();\r
\r
PDFPreview pdfPreview = new PDFPreview();\r
- if (pdfPreview.setupPreview(Global.currentDir+"res/"+fileName, "pdf",0)) {\r
- // NFC TODO: should this be a 'file://' url like the ones above?\r
- imageURL = file.fileName() + ".png";\r
+ if (pdfPreview.setupPreview(Global.getFileManager().getResDirPath(fileName), "pdf",0)) {\r
+ // NFC TODO: should this be a 'file://' url like the ones above?\r
+ imageURL = file.fileName() + ".png";\r
}\r
}\r
\r
logger.log(logger.EXTREME, "Generating link tags");\r
buffer.append("<a en-tag=\"en-media\" guid=\"" +newRes.getGuid()+"\" ");\r
- buffer.append(" onContextMenu=\"window.jambi.imageContextMenu('" +Global.getDirectoryPath() +"res/"+fileName +"');\" ");\r
- buffer.append("type=\"" + mimeType + "\" href=\"nnres://" + fileName +"\" hash=\""+Global.byteArrayToHexString(newRes.getData().getBodyHash()) +"\" >");\r
+ buffer.append(" onContextMenu=\"window.jambi.imageContextMenu('")\r
+ .append(Global.getFileManager().getResDirPath(fileName))\r
+ .append("');\" "); buffer.append("type=\"" + mimeType + "\" href=\"nnres://" + fileName +"\" hash=\""+Global.byteArrayToHexString(newRes.getData().getBodyHash()) +"\" >");\r
buffer.append("<img src=\"" + imageURL + "\" title=\"" +newRes.getAttributes().getFileName());\r
buffer.append("\"></img>");\r
buffer.append("</a>");\r
return true;\r
if (type.equalsIgnoreCase("PDF"))\r
return true;\r
- String error = "Non-premium accounts can only attach JPG, PNG, GIF, MP3, WAV, AMR, or PDF files.";\r
- QMessageBox.information(this, "Non-Premium Account", error);\r
+ String error = tr("Non-premium accounts can only attach JPG, PNG, GIF, MP3, WAV, AMR, or PDF files.");\r
+ QMessageBox.information(this, tr("Non-Premium Account"), error);\r
\r
return false;\r
}\r
if (size < 25)\r
return true;\r
\r
- String error = "A file attachment may not exceed 25MB.";\r
- QMessageBox.information(this, "Attachment Size", error);\r
+ String error = tr("A file attachment may not exceed 25MB.");\r
+ QMessageBox.information(this, tr("Attachment Size"), error);\r
return false;\r
}\r
\r
private void authorChanged() {\r
noteSignal.authorChanged.emit(currentNote.getGuid(), authorText.text());\r
}\r
+ \r
+ @SuppressWarnings("unused")\r
+ private void geoBoxChanged() {\r
+ int index = geoBox.currentIndex();\r
+ geoBox.setCurrentIndex(0);\r
+ if (index == 1) {\r
+ GeoDialog box = new GeoDialog();\r
+ box.setLongitude(currentNote.getAttributes().getLongitude());\r
+ box.setLatitude(currentNote.getAttributes().getLatitude());\r
+ box.setAltitude(currentNote.getAttributes().getAltitude());\r
+ box.exec();\r
+ if (!box.okPressed())\r
+ return;\r
+ double alt = box.getAltitude();\r
+ double lat = box.getLatitude();\r
+ double lon = box.getLongitude();\r
+ if (alt != currentNote.getAttributes().getAltitude() ||\r
+ lon != currentNote.getAttributes().getLongitude() ||\r
+ lat != currentNote.getAttributes().getLatitude()) {\r
+ noteSignal.geoChanged.emit(currentNote.getGuid(), lon, lat, alt);\r
+ currentNote.getAttributes().setAltitude(alt);\r
+ currentNote.getAttributes().setLongitude(lon);\r
+ currentNote.getAttributes().setLatitude(lat);\r
+ }\r
+ }\r
+ \r
+ if (index == 2) {\r
+ noteSignal.geoChanged.emit(currentNote.getGuid(), 0.0, 0.0, 0.0);\r
+ currentNote.getAttributes().setAltitude(0.0);\r
+ currentNote.getAttributes().setLongitude(0.0);\r
+ currentNote.getAttributes().setLatitude(0.0);\r
+ }\r
+ \r
+ if (index == 3 || index == 0) {\r
+ QDesktopServices.openUrl(new QUrl("http://maps.google.com/maps?z=6&q="+currentNote.getAttributes().getLatitude() +"," +currentNote.getAttributes().getLongitude()));\r
+ }\r
+ }\r
\r
// ************************************************************\r
// * User chose to save an attachment. Pares out the request *\r
QFileDialog fd = new QFileDialog(this);\r
fd.setFileMode(FileMode.AnyFile);\r
fd.setConfirmOverwrite(true);\r
- fd.setWindowTitle("Save File");\r
+ fd.setWindowTitle(tr("Save File"));\r
fd.setAcceptMode(AcceptMode.AcceptSave);\r
fd.setDirectory(System.getProperty("user.home"));\r
String name = request.url().toString();\r
} else {\r
guid = name;\r
}\r
- guid = guid.replace("nnres://", "").replace(Global.currentDir.replace("\\","/")+"res/", "");\r
+\r
+ // Strip URL prefix and base dir\r
+ guid = guid.replace("nnres://", "")\r
+ .replace(FileUtils.toForwardSlashedPath(Global.getFileManager().getResDirPath()), "");\r
+\r
pos = guid.lastIndexOf('.');\r
if (pos > 0)\r
guid = guid.substring(0,pos);\r
// * User chose to save an attachment. Pares out the request *\r
// * into a guid & file. Save the result. --- DONE FROM downloadAttachment now!!!!! \r
// ************************************************************\r
+ // NFC TODO: unused? remove\r
public void downloadImage(QNetworkRequest request) {\r
QFileDialog fd = new QFileDialog(this);\r
fd.setFileMode(FileMode.AnyFile);\r
fd.setConfirmOverwrite(true);\r
- fd.setWindowTitle("Save File");\r
+ fd.setWindowTitle(tr("Save File"));\r
fd.setAcceptMode(AcceptMode.AcceptSave);\r
fd.setDirectory(System.getProperty("user.home"));\r
String name = request.url().toString();\r
name = name.replace("nnres://", "");\r
- String dPath = Global.getDirectoryPath() + "res/";\r
- dPath = dPath.replace('\\', '/');\r
+ String dPath = FileUtils.toForwardSlashedPath(Global.getFileManager().getResDirPath());\r
name = name.replace(dPath, "");\r
int pos = name.lastIndexOf('.');\r
String guid = name;\r
//* MicroFocus changed\r
//****************************************************************\r
private void microFocusChanged() {\r
- \r
boldButton.setDown(false);\r
italicButton.setDown(false);\r
underlineButton.setDown(false);\r
browser.insertTableAction.setEnabled(true);\r
browser.insertTableRowAction.setEnabled(false);\r
browser.deleteTableRowAction.setEnabled(false);\r
- browser.insertLinkAction.setText("Insert Hyperlink");\r
+ browser.insertLinkAction.setText(tr("Insert Hyperlink"));\r
currentHyperlink ="";\r
insideList = false;\r
forceTextPaste = false;\r
}\r
\r
public void setInsideLink(String link) {\r
- browser.insertLinkAction.setText("Edit Hyperlink");\r
+ browser.insertLinkAction.setText(tr("Edit Hyperlink"));\r
currentHyperlink = link;\r
}\r
\r
\r
r.setGuid(randint);\r
conn.getNoteTable().noteResourceTable.saveNoteResource(r, true);\r
- QFile f = new QFile(Global.getDirectoryPath() +"res/" +newFile);\r
+ QFile f = new QFile(Global.getFileManager().getResDirPath(newFile));\r
QByteArray bin = new QByteArray(r.getData().getBody());\r
f.open(QFile.OpenModeFlag.WriteOnly);\r
f.write(bin);\r
String source; \r
if (locTag.startsWith("src")) {\r
source = newSegment.substring(startSrcPos+locTag.length(),endSrcPos);\r
- newSegment = newSegment.replace(source, Global.getDirectoryPath().replace("\\", "/")+"res/"+newFile);\r
+ newSegment = newSegment.replace(source,\r
+ FileUtils.toForwardSlashedPath(Global.getFileManager().getResDirPath(newFile)));\r
} else {\r
source = newSegment.substring(startSrcPos+locTag.length(),endSrcPos);\r
newSegment = newSegment.replace(source, newFile);\r
// browser.previousPageAction.setVisible(false);\r
}\r
*/\r
-}
\ No newline at end of file
+}\r