diff -r e2a80d9b5858 -r 699f28529079 texteditor.cpp --- a/texteditor.cpp Thu Jul 06 15:39:54 2006 +0000 +++ b/texteditor.cpp Tue Aug 15 12:01:14 2006 +0000 @@ -39,7 +39,7 @@ TextEditor::TextEditor() { printer = new QPrinter( QPrinter::HighResolution ); - printer->setPrinterName (settings.readEntry("/vym/mainwindow/printerName",printer->printerName())); + printer->setPrinterName (settings.value("/mainwindow/printerName",printer->printerName()).toString()); // Editor (use MyTextEdit to wrap verticalAlignmentChanged to // int argument. see header file) @@ -64,25 +64,23 @@ setInactive(); // Load Settings - resize (settings.readNumEntry( "/vym/noteeditor/geometry/width", 450), - settings.readNumEntry( "/vym/noteeditor/geometry/height",600)); - move (settings.readNumEntry( "/vym/noteeditor/geometry/posX", 150), - settings.readNumEntry( "/vym/noteeditor/geometry/posY", 50)); + resize (settings.value ( "/noteeditor/geometry/size", QSize(450,600)).toSize()); + move (settings.value ( "/noteeditor/geometry/pos", QPoint (250,50)).toPoint()); - if (settings.readEntry( "/vym/noteeditor/showWithMain","yes") =="yes") + if (settings.value ( "/noteeditor/showWithMain",true).toBool()) setShowWithMain(true); else setShowWithMain(false); - varFont.fromString( settings.readEntry - ("/vym/noteeditor/fonts/varFont", - "Nimbus Sans l,14,-1,5,48,0,0,0,0,0") + varFont.fromString( settings.value + ("/noteeditor/fonts/varFont", + "Nimbus Sans l,14,-1,5,48,0,0,0,0,0").toString() ); - fixedFont.fromString (settings.readEntry ( - "/vym/noteeditor/fonts/fixedFont", - "Courier,14,-1,5,48,0,0,0,1,0") + fixedFont.fromString (settings.value( + "/noteeditor/fonts/fixedFont", + "Courier,14,-1,5,48,0,0,0,1,0").toString() ); - QString s=settings.readEntry ("/vym/noteeditor/fonts/fonthintDefault","variable"); + QString s=settings.value ("/noteeditor/fonts/fonthintDefault","variable").toString(); if (s == "fixed") { actionSettingsFonthintDefault->setOn (true); @@ -95,7 +93,7 @@ filenameHint=""; // Save settings in vymrc - settings.writeEntry("/vym/mainwindow/printerName",printer->printerName()); + settings.setValue("/mainwindow/printerName",printer->printerName()); } @@ -103,26 +101,19 @@ { if (printer) delete printer; // Save Settings - settings.writeEntry( "/vym/noteeditor/geometry/width", width() ); - settings.writeEntry( "/vym/noteeditor/geometry/height", height() ); - settings.writeEntry( "/vym/noteeditor/geometry/posX", pos().x() ); - settings.writeEntry( "/vym/noteeditor/geometry/posY", pos().y() ); + settings.setValue( "/noteeditor/geometry/size", size() ); + settings.setValue( "/noteeditor/geometry/pos", pos() ); - if (showWithMain()) - settings.writeEntry( "/vym/noteeditor/showWithMain","yes"); - else - settings.writeEntry( "/vym/noteeditor/showWithMain","no"); + settings.setValue( "/noteeditor/showWithMain",showWithMain()); QString s; if (actionSettingsFonthintDefault->isOn() ) s="fixed"; else s="variable"; - settings.writeEntry( "/vym/noteeditor/fonts/fonthintDefault",s ); - settings.writeEntry ("/vym/noteeditor/fonts/varFont", - varFont.toString() ); - settings.writeEntry ("/vym/noteeditor/fonts/fixedFont", - fixedFont.toString() ); + settings.setValue( "/noteeditor/fonts/fonthintDefault",s ); + settings.setValue("/noteeditor/fonts/varFont", varFont.toString() ); + settings.setValue("/noteeditor/fonts/fixedFont", fixedFont.toString() ); } bool TextEditor::isEmpty() @@ -208,8 +199,8 @@ void TextEditor::setupFileActions() { - QToolBar *tb = addToolBar ( tr("File Actions") ); - QMenu *fileMenu = menuBar()->addMenu( tr( "&File" )); + QToolBar *tb = addToolBar ( tr("Note Actions") ); + QMenu *fileMenu = menuBar()->addMenu( tr( "&Note" )); QAction *a; a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Import..." ),this); @@ -342,7 +333,7 @@ a = new QAction( QPixmap(iconPath+"formatfixedfont.png"), tr( "&Font hint" ), Qt::ALT + Qt::Key_I, this, "fontHint" ); a->setStatusTip (tr( "Toggle font hint for the whole text" ) ); a->setToggleAction (true); - a->setOn (settings.readBoolEntry ("/vym/noteeditor/fonts/useFixedByDefault",false) ); + a->setOn (settings.value("/noteeditor/fonts/useFixedByDefault",false).toBool() ); connect( a, SIGNAL( activated() ), this, SLOT( toggleFonthint() ) ); formatMenu->addAction (a); tb->addAction (a);