X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=src%2Fnoteeditor.cpp;fp=src%2Fnoteeditor.cpp;h=56927d5874b3e6ad5d9040f4a4d2084f8c428b21;hb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;hp=0000000000000000000000000000000000000000;hpb=7dfa3fe589d1722d49681f42cdb0bf1e6efb5223;p=sven%2Fvym.git diff --git a/src/noteeditor.cpp b/src/noteeditor.cpp new file mode 100644 index 0000000..56927d5 --- /dev/null +++ b/src/noteeditor.cpp @@ -0,0 +1,47 @@ +#include "noteeditor.h" + +#include + +#include "settings.h" +#include "vymnote.h" + +extern Settings settings; +extern QString vymName; + +NoteEditor::NoteEditor(QString scope) : TextEditor() +{ + editorName = tr("Note Editor", "Name of editor shown as window title"); + setWindowTitle(""); + + menuBar()->show(); + + setUseColorMapBackground(false); + + // Load Settings + init(scope); +} + +NoteEditor::~NoteEditor() {} + +VymNote NoteEditor::getNote() +{ + VymNote note; + if (actionFormatRichText->isChecked()) + note.setRichText(getText()); + else + note.setPlainText(getText()); + note.setFontHint(getFontHint()); + note.setFilenameHint(getFilenameHint()); + return note; +} + +void NoteEditor::setNote(const VymNote ¬e) +{ + if (note.isRichText()) + setRichText(note.getText()); + else { + setPlainText(note.getText()); + setFontHint(note.getFontHint()); + } + setFilenameHint(note.getFilenameHint()); +}