Menu

[2edc72]: / noteeditor.cpp  Maximize  Restore  History

Download this file

104 lines (79 with data), 2.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
#include "noteeditor.h"
#include "noteobj.h"
#include "settings.h"
extern bool debug;
extern Settings settings;
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
NoteEditor::NoteEditor()
{
//qDebug()<<"Constr. NoteEditor";
menuBar()->show();
// Load Settings
//restoreState (settings.value("/satellite/noteeditor/state",0).toByteArray());
resize (settings.value ( "/satellite/noteeditor/geometry/size", QSize(450,600)).toSize());
move (settings.value ( "/satellite/noteeditor/geometry/pos", QPoint (250,50)).toPoint());
setShowWithMain (settings.value ( "/satellite/noteeditor/showWithMain",true).toBool());
return;
/*
setCentralWidget( e );
statusBar()->message( tr("Ready","Statusbar message"), statusbarTime);
setCaption(vymName +" - " +tr ("Note Editor","Window caption"));
// Toolbars
setupFileActions();
setupEditActions();
setupFormatActions();
setupSettingsActions();
// Various states
blockChangedSignal=false;
setInactive();
*/
varFont.fromString( settings.value
("/satellite/noteeditor/fonts/varFont",
"Nimbus Sans l,10,-1,5,48,0,0,0,0,0").toString()
);
fixedFont.fromString (settings.value(
"/satellite/noteeditor/fonts/fixedFont",
"Courier,10-1,5,48,0,0,0,1,0").toString()
);
QString s=settings.value ("/satellite/noteeditor/fonts/fonthintDefault","variable").toString();
if (s == "fixed")
{
actionSettingsFonthintDefault->setChecked (true);
e->setCurrentFont (fixedFont);
} else
{
actionSettingsFonthintDefault->setChecked (false);
e->setCurrentFont (varFont);
}
}
NoteEditor::~NoteEditor()
{
//qDebug ()<<"Destr. NoteEditor";
// Save Settings
settings.setValue( "/satellite/noteeditor/geometry/size", size() );
settings.setValue( "/satellite/noteeditor/geometry/pos", pos() );
//settings.setValue ("/satellite/noteeditor/state",saveState(0));
settings.setValue( "/satellite/noteeditor/showWithMain",showwithmain);
QString s;
if (actionSettingsFonthintDefault->isChecked() )
s="fixed";
else
s="variable";
settings.setValue( "/satellite/noteeditor/fonts/fonthintDefault",s );
settings.setValue("/satellite/noteeditor/fonts/varFont", varFont.toString() );
settings.setValue("/satellite/noteeditor/fonts/fixedFont", fixedFont.toString() );
}
NoteObj NoteEditor::getNoteObj()
{
NoteObj note (getText() );
note.setFontHint (getFontHint() );
note.setFilenameHint (getFilenameHint () );
return note;
}
void NoteEditor::setNote (const NoteObj &note)
{
setText (note.getNote() );
setFilenameHint (note.getFilenameHint() );
setFontHint (note.getFontHint() );
}