]> git.sven.stormbind.net Git - sven/vym.git/blob - noteeditor.cpp
ba1710d6a0ed675e967847575ea044d93f118ced
[sven/vym.git] / noteeditor.cpp
1 #include "noteeditor.h"
2
3 #include <QMenuBar>
4
5 #include "vymnote.h"
6 #include "settings.h"
7  
8 extern Settings settings;
9 extern QString vymName;
10
11 NoteEditor::NoteEditor(QString scope):TextEditor()
12 {
13     editorName = tr("Note Editor","Name of editor shown as window title");
14     setWindowTitle("");
15
16     menuBar()->show();
17
18     // Load Settings
19     init(scope);
20 }
21
22 NoteEditor::~NoteEditor() {}
23
24 VymNote NoteEditor::getNote()
25 {
26     VymNote note;
27     if (actionFormatRichText->isChecked() )
28         note.setRichText( getText());
29     else
30         note.setPlainText( getText());
31     note.setFontHint (getFontHint() );
32     note.setFilenameHint (getFilenameHint () );
33     return note;
34 }
35
36 void NoteEditor::setNote (const VymNote &note)  
37 {
38     if (note.isRichText ())
39         setRichText(note.getText());
40     else
41     {
42         setPlainText(note.getText());
43         setFontHint (note.getFontHint() );
44     }
45     setFilenameHint (note.getFilenameHint() );
46 }