Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

PrefsManager Class Reference

Manage Scribus preferences here, and here alone Start to move the preferences out of scribus.cpp and provide some more features and hide some of the data within this class TODO Move prefsFile in here from scribus.cpp and stop passing it in for convertOldPreferences TODO Lots more :). More...

#include <prefsmanager.h>

Collaboration diagram for PrefsManager:

Collaboration graph
[legend]

List of all members.

Signals

void prefsChanged ()

Public Member Functions

 PrefsManager (QObject *parent=0)
 ~PrefsManager ()
void setup ()
void initDefaults ()
 Initialise the defaults for prefs in this class Only set the GUI font stuff up if we have a GUI!!! Must be run after: PrefsManager::GetAllFonts().
void initDefaultGUIFont (const QFont &)
void initDefaultCheckerPrefs (CheckerPrefsList *cp)
void initDefaultActionKeys ()
void applyLoadedShortCuts ()
void initArrowStyles ()
QString setupPreferencesLocation ()
 Set the user's preference file location. Rename any existing old preferences files.
bool copyOldPreferences ()
 Copy 1.2 prefs XML before loading, and copy rc files we don't yet convert.
void convert12Preferences ()
 Move and convert 1.2 style preferences to new XML format.
const QString preferencesLocation ()
 Get the prefs location property.
void ReadPrefs (const QString &fname=QString::null)
 Read the preferences.
void ReadPrefsXML ()
void SavePrefs (const QString &fname=QString::null)
 Save the preferences.
void SavePrefsXML ()
bool WritePref (QString ho)
 Writes the preferences physically to the file. Here is the XML file created itself.
bool ReadPref (QString ho)
 Reads the preferences physically from the file. Here is the XML file parsed itself. Returns false on error. It's the caller's job to make sure the prefs file actually exists.
void setupMainWindow (ScribusMainWindow *mw)
 Set up the main window with prefs values, recent files list, main window size etc.
void setGhostscriptExecutable (const QString &)
void setImageEditorExecutable (const QString &)
void setExtBrowserExecutable (const QString &)
void setLatexConfigs (const QStringList &)
void setLatexEditorExecutable (const QString &)
QString ghostscriptExecutable () const
QString imageEditorExecutable () const
QString extBrowserExecutable () const
QStringList latexConfigs () const
QString latexEditorExecutable () const
bool latexUseEmbeddedEditor () const
bool latexStartWithEmptyFrames () const
int gsResolution ()
 Get the users preferred preview resolution.
int latexResolution () const
bool latexForceDpi () const
const QString documentDir ()
 Get the users preferred document directory.
void setDocumentDir (const QString &dirname)
int mouseWheelValue () const
double displayScale () const
 Get the user set display scale.
const QString & guiLanguage () const
 Get the GUI language from preferences.
const QString & guiStyle () const
 Get the GUI style from preferences.
const QString & guiSystemStyle () const
const int & guiFontSize () const
 Get the GUI style from preferences.
const int & paletteFontSize () const
void setKeyEntry (const QString &, const QString &, const QKeySequence &, const int &)
void setShowStartupDialog (const bool)
void setColorSet (const ColorList &)
 Sets the preferences' color set.
void setColorSetName (const QString &)
 Sets the preferences' color set name.
const ColorListcolorSet ()
 Returns the preferences' color set.
ColorListcolorSetPtr ()
 Returns a pointer to the preferences' color set. Needed for now until colors are better defined.
const QString & colorSetName ()
 Returns the preferences' color set name.
bool isToolColor (const QString &name)
 Return if a color belongs to tools prefs colors.
QStringList toolColorNames ()
 Return the list of used colors in tool prefs.
void replaceToolColors (const QMap< QString, QString > replaceMap)
 Replace used colors in tool prefs.
bool GetAllFonts (bool showFontInfo)
 Finds the fonts on the system Must be run after: PrefsManager::setup() Must be run before: PrefsManager::initDefaults().
ApplicationPrefsapplicationPrefs ()
PrefsFileapplicationPrefsFile ()
bool importingFrom12x ()
const QString & lastError () const
 Return the last error reported by a PrefsManager method.
void alertSavePrefsFailed () const
 Display a GUI alert informing the user that saving prefs failed. This might want to move to another class later, perhaps being triggered by a signal emitted here.
void alertLoadPrefsFailed () const

Static Public Member Functions

static PrefsManagerinstance ()
 Returns a pointer to the PrefsManager instance.
static void deleteInstance ()
 Deletes the PrefsManager Instance Must be called when PrefsManager is no longer needed.
static bool isToolColor (const struct toolPrefs &settings, const QString &name)
static QStringList toolColorNames (const struct toolPrefs &settings)
static void replaceToolColors (struct toolPrefs &settings, const QMap< QString, QString > replaceMap)

Public Attributes

struct ApplicationPrefs appPrefs
 Temporarily public while this class takes shape so progress can happen and cvs can build.
PrefsFileprefsFile

Private Attributes

QString prefsLocation
bool importingFrom12
QString m_lastError
 The last error message generated by a method of this class. Do not write "success" messages to this.

Static Private Attributes

static PrefsManager_instance = 0
 The only instance of PrefsManager available.


Detailed Description

Manage Scribus preferences here, and here alone Start to move the preferences out of scribus.cpp and provide some more features and hide some of the data within this class TODO Move prefsFile in here from scribus.cpp and stop passing it in for convertOldPreferences TODO Lots more :).

Author:
Craig Bradney

Definition at line 43 of file prefsmanager.h.


Constructor & Destructor Documentation

PrefsManager::PrefsManager ( QObject *  parent = 0  ) 

Definition at line 60 of file prefsmanager.cpp.

Referenced by instance().

PrefsManager::~PrefsManager (  ) 

Definition at line 65 of file prefsmanager.cpp.

References appPrefs, ApplicationPrefs::AvailFonts, and prefsFile.


Member Function Documentation

PrefsManager * PrefsManager::instance (  )  [static]

Returns a pointer to the PrefsManager instance.

Returns:
A pointer to the PrefsManager instance

Definition at line 71 of file prefsmanager.cpp.

References _instance, and PrefsManager().

Referenced by CreateMode::activate(), FontPrefs::AddPath(), SCFonts::AddUserPath(), Annot::Annot(), ScriXmlDoc::AskForFont(), Scribus13Format::AskForFont(), AspellPluginImpl::AspellPluginImpl(), ScripterCore::buildRecentScriptsMenu(), callGS(), PDFExportDialog::ChangeFile(), MergeDoc::changeFile(), FontPrefs::ChangePath(), CharSelect::CharSelect(), CollectForOutput::collectFonts(), CollectForOutput::CollectForOutput(), EPSPlug::convert(), convertPS2PS(), Biblio::copyObj(), tfFilter::createWidget(), CupsOptions::CupsOptions(), CWDialog::CWDialog(), DelColor::DelColor(), FontPrefs::DelPath(), PDFLibCore::doExport(), ScribusMainWindow::DoFileClose(), CurveWidget::doLoad(), CurveWidget::doSave(), ScPageOutput::DrawGlyphs(), PageItem_TextFrame::DrawObj_Post(), Canvas::DrawPageMarks(), MasterPagesPalette::duplicateMasterPage(), Editor::Editor(), PageItem_LatexFrame::editorError(), TabPDFOptions::EnableLPI(), ExportForm::ExportForm(), TabKeyboardShortcutsWidget::exportKeySetFile(), SCFonts::findFont(), FontCombo::FontCombo(), FontComboH::FontComboH(), FontPrefs::FontPrefs(), FontPreview::FontPreview(), Annota::GetFile(), getGSExePaths(), getGSVersion(), SampleItem::getSample(), Scribus134Format::GetStyle(), Scribus12Format::GetStyle(), gtAction::gtAction(), gtDialogs::gtDialogs(), CharSelect::hide(), Hruler::Hruler(), Hyphenator::Hyphenator(), EPSPlug::Image(), WMFImportPlugin::import(), SVGImportPlugin::import(), Biblio::Import(), OODrawImportPlugin::import(), ImportPSPlugin::import(), EPSPlug::import(), ImportAIPlugin::import(), AIPlug::import(), ColorManager::importColors(), TabKeyboardShortcutsWidget::importKeySetFile(), LegacyMode::importToPage(), ScribusDoc::init(), ScribusMainWindow::initScMW(), ScribusCore::initScribusCore(), ScribusDoc::itemAddUserFrame(), LatexEditor::LatexEditor(), UrlLauncher::launchUrlExt(), Biblio::Load(), Scribus13Format::loadFile(), Scribus134Format::loadFile(), Scribus12Format::loadFile(), loadIcon(), Scribus134Format::loadPage(), PatternDialog::loadPattern(), PatternDialog::loadPatternDir(), ScImgDataLoader_PS::loadPicture(), StoryEditor::loadPrefs(), InsertAFrame::locateImageFile(), LoremManager::LoremManager(), MissingFont::MissingFont(), LegacyMode::mouseReleaseEvent(), FreehandMode::mouseReleaseEvent(), BezierMode::mouseReleaseEvent(), CreateMode::mouseReleaseEvent(), CollectForOutput::newDirDialog(), NewDoc::NewDoc(), Biblio::NewLib(), Biblio::ObjFromCopyAction(), Biblio::ObjFromMenu(), OdtIm::OdtIm(), PageItem_LatexFrame::PageItem_LatexFrame(), SVGPlug::parsePA(), PDFLibCore::PDF_Image(), PDFExportDialog::PDFExportDialog(), PPreview::PPreview(), Preferences::Preferences(), ScPrintEngine_PS::print(), ScPrintEngine_GDI::print(), PrintDialog::PrintDialog(), Printer_print(), ScPrintEngine_GDI::printPage_PS(), AIPlug::processData(), CollectForOutput::processItem(), PSLib::PS_image(), I18nXmlStreamReader::readI18nText(), FontPrefs::readPaths(), ScripterCore::ReadPlugPrefs(), satdialog::readPrefs(), PageItem_LatexFrame::realDpi(), FontPrefs::rebuildDialog(), ScripterCore::rebuildRecentScriptsMenu(), ReformDoc::ReformDoc(), ScribusDoc::reorganiseFonts(), TabTools::restoreDefaults(), TabPrinter::restoreDefaults(), TabPDFOptions::restoreDefaults(), ReformDoc::restoreDefaults(), SVGExportPlugin::run(), PageItem_LatexFrame::runEditor(), gtDialogs::runFileDialog(), MenuNFT::RunNFTPlug(), MenuSAT::RunSATPlug(), RunScriptDialog::RunScriptDialog(), SampleItem::SampleItem(), Biblio::SaveAs(), PrefsDialogBase::saveButton_clicked(), ScripterCore::SavePlugPrefs(), ScPreview::ScPreview(), scribus_colornames(), scribus_delcolor(), scribus_fontnames(), scribus_getcolor(), scribus_getcolorasrgb(), scribus_newcolor(), scribus_renderfont(), scribus_setcolor(), scribus_setfont(), scribus_xfontnames(), ScriXmlDoc::ScriXmlDoc(), ScrPaletteBase::ScrPaletteBase(), SearchReplace::SearchReplace(), SMCharacterStyle::selected(), SMParagraphStyle::selected(), PrintDialog::SelFile(), Preferences::setActionHistoryLength(), PageItem_LatexFrame::setConfigFile(), SampleItem::setFont(), PythonConsole::setFonts(), ScrPaletteBase::setFontSize(), ScrPaletteBase::setPrefsContext(), TabTools::setSample(), ScribusDoc::setup(), LegacyMode::SetupDrawNoResize(), HelpBrowser::setupLocalUI(), PPreview::setValues(), StyleManager::shortcutExists(), CharSelect::show(), SMCharacterStyle::slotFont(), SMParagraphStyle::slotFont(), Hyphenator::slotHyphenate(), StyleManager::slotImport(), TabDocument::slotUndo(), ScribusCore::startGUI(), SToolBFont::SToolBFont(), ScribusView::stopGesture(), StoryEditor::StoryEditor(), StyleManager::StyleManager(), SWConfig::SWConfig(), SyntaxColors::SyntaxColors(), TabDocument::TabDocument(), testGSAvailability(), testGSDeviceAvailability(), TextFilter::TextFilter(), tfDia::tfDia(), UndoManager::UndoManager(), UndoPalette::UndoPalette(), ReformDoc::updateDocumentSettings(), FontPrefs::UpdateFliste(), PageItem_LatexFrame::updateImage(), Vruler::Vruler(), StencilReader::writeDefaults(), FontPrefs::writePaths(), and SyntaxColors::~SyntaxColors().

void PrefsManager::deleteInstance (  )  [static]

Deletes the PrefsManager Instance Must be called when PrefsManager is no longer needed.

Definition at line 79 of file prefsmanager.cpp.

References _instance.

Referenced by ScribusMainWindow::closeEvent(), and ScribusQApp::~ScribusQApp().

void PrefsManager::setup (  ) 

void PrefsManager::initDefaults (  ) 

Initialise the defaults for prefs in this class Only set the GUI font stuff up if we have a GUI!!! Must be run after: PrefsManager::GetAllFonts().

Default font and size

Default colours

Set Default window position and size to sane default values which should work on every screen

Definition at line 117 of file prefsmanager.cpp.

References appPrefs, PDFOptions::Articles, ApplicationPrefs::askBeforeSubstituite, toolPrefs::aspectRatio, ApplicationPrefs::AutoCheck, typoPrefs::autoLineSpacing, ApplicationPrefs::Automatic, ApplicationPrefs::AutoSave, ApplicationPrefs::AutoSaveTime, ApplicationPrefs::AvailFonts, guidesPrefs::baseColor, guidesPrefs::baseShown, guidesPrefs::before, PDFOptions::Binding, CMSData::BlackPoint, PDFOptions::bleedMarks, PDFOptions::bleeds, ApplicationPrefs::bleeds, PDFOptions::Bookmarks, MarginStruct::Bottom, ApplicationPrefs::checkerProfiles, ApplicationPrefs::ClipMargin, CMSData::CMSinUse, guidesPrefs::colBordersShown, PDFOptions::colorMarks, PageSet::Columns, PDFOptions::Compress, PDFOptions::Compression_Auto, PDFOptions::CompressMethod, toolPrefs::constrain, PDFOptions::cropMarks, ApplicationPrefs::curCheckProfile, SCFontsIterator::currentKey(), ApplicationPrefs::CustomColorSets, PDFOptions::Datei, toolPrefs::dBrush, toolPrefs::dBrushPict, ApplicationPrefs::DCMSset, ApplicationPrefs::DColors, toolPrefs::dCols, ApplicationPrefs::DControlCharColor, LatexConfigCache::defaultConfigs(), CMSData::DefaultImageRGBProfile, CMSData::DefaultIntentColors, CMSData::DefaultIntentImages, ApplicationPrefs::defaultItemAttributes, CMSData::DefaultMonitorProfile, CMSData::DefaultPrinterProfile, CMSData::DefaultSolidColorCMYKProfile, CMSData::DefaultSolidColorRGBProfile, ApplicationPrefs::defaultToCSetups, toolPrefs::defFont, toolPrefs::defSize, toolPrefs::dEndArrow, ApplicationPrefs::DFrameAnnotationColor, ApplicationPrefs::DFrameColor, ApplicationPrefs::DFrameGroupColor, ApplicationPrefs::DFrameLinkColor, ApplicationPrefs::DFrameLockColor, ApplicationPrefs::DFrameNormColor, toolPrefs::dGap, PDFOptions::displayBookmarks, PDFOptions::displayFullscreen, PDFOptions::displayLayers, PDFOptions::displayThumbs, toolPrefs::dispX, toolPrefs::dispY, ApplicationPrefs::DisScale, toolPrefs::dLineArt, toolPrefs::dLstyleLine, ApplicationPrefs::DocDir, PDFOptions::docInfoMarks, PDFOptions::doClip, ApplicationPrefs::doCopyToScrapbook, ApplicationPrefs::documentTemplatesDir, ApplicationPrefs::docUnitIndex, PDFOptions::doMultiFile, PDFOptions::doOverprint, ApplicationPrefs::doOverprint, ApplicationPrefs::DPageBorderColor, ApplicationPrefs::DpapColor, toolPrefs::dPen, toolPrefs::dPenLine, toolPrefs::dPenText, toolPrefs::dShade, toolPrefs::dShade2, toolPrefs::dShadeLine, toolPrefs::dStartArrow, toolPrefs::dStrokeText, toolPrefs::dTabWidth, toolPrefs::dTextBackGround, toolPrefs::dTextBackGroundShade, toolPrefs::dTextLineColor, toolPrefs::dTextLineShade, toolPrefs::dTextPenShade, toolPrefs::dTextStrokeShade, toolPrefs::dWidth, toolPrefs::dWidthLine, PDFOptions::EmbeddedI, PDFOptions::EmbedList, PDFOptions::Encrypt, ApplicationPrefs::extBrowserExecutable, ApplicationPrefs::FacingPages, ColorSetManager::findPaletteLocations(), ColorSetManager::findPalettes(), PageSet::FirstPage, PDFOptions::fitWindow, guidesPrefs::framesShown, CMSData::GamutCheck, ApplicationPrefs::GapHorizontal, ApplicationPrefs::GapVertical, ApplicationPrefs::Gcr_Mode, ApplicationPrefs::GCRMode, getGSDefaultExeName(), ScPaths::getUserDocumentDir(), ApplicationPrefs::GFontSub, guidesPrefs::grabRad, ApplicationPrefs::grayscaleIcons, guidesPrefs::gridShown, ApplicationPrefs::gs_AntiAliasGraphics, ApplicationPrefs::gs_AntiAliasText, ApplicationPrefs::gs_exe, ApplicationPrefs::gs_Resolution, ApplicationPrefs::GUI, guidesPrefs::guideColor, guidesPrefs::guideRad, ApplicationPrefs::guidesSettings, guidesPrefs::guidesShown, ApplicationPrefs::haveStylePreview, PageSize::height(), windowPrefs::height, PDFOptions::hideMenuBar, PDFOptions::hideToolBar, ApplicationPrefs::HyCount, ApplicationPrefs::ignoredWords, ApplicationPrefs::imageEditorExecutable, PDFOptions::ImageProf, PDFOptions::Info, initDefaultActionKeys(), initDefaultCheckerPrefs(), ColorSetManager::initialiseDefaultPrefs(), PDFOptions::Intent, PDFOptions::Intent2, PDFOptions::isGrayscale, ApplicationPrefs::Language, ApplicationPrefs::latexConfigs, ApplicationPrefs::latexEditorExecutable, ApplicationPrefs::latexForceDpi, ApplicationPrefs::latexResolution, ApplicationPrefs::latexStartWithEmptyFrames, ApplicationPrefs::latexUseEmbeddedEditor, guidesPrefs::layerMarkersShown, MarginStruct::Left, guidesPrefs::linkShown, toolPrefs::lowResType, PDFOptions::LPISettings, toolPrefs::magMax, toolPrefs::magMin, toolPrefs::magStep, ApplicationPrefs::mainWinSettings, ApplicationPrefs::mainWinState, guidesPrefs::majorColor, guidesPrefs::majorGrid, guidesPrefs::margColor, ApplicationPrefs::marginColored, ApplicationPrefs::margins, guidesPrefs::marginsShown, PDFOptions::markOffset, windowPrefs::maximized, guidesPrefs::minorColor, guidesPrefs::minorGrid, ApplicationPrefs::MinWordLen, PDFOptions::MirrorH, PDFOptions::MirrorV, ApplicationPrefs::moveTimeout, PageSet::Name, CommonStrings::None, ApplicationPrefs::numScrapbookCopies, typoPrefs::offsetBaseGrid, PDFOptions::openAction, ApplicationPrefs::PageHeight, PDFOptions::PageLayout, CommonStrings::pageLocLeft, CommonStrings::pageLocMiddle, CommonStrings::pageLocMiddleLeft, CommonStrings::pageLocMiddleRight, CommonStrings::pageLocRight, PageSet::pageNames, ApplicationPrefs::pageOrientation, CommonStrings::pageSet1, CommonStrings::pageSet2, CommonStrings::pageSet3, CommonStrings::pageSet4, ApplicationPrefs::pageSets, ApplicationPrefs::pageSize, ApplicationPrefs::PageWidth, ApplicationPrefs::paragraphsLI, PDFOptions::PassOwner, PDFOptions::PassUser, ApplicationPrefs::PDF_Options, PDFOptions::PDFVersion_14, PDFOptions::Permissions, ApplicationPrefs::persistentScrapbook, PDFOptions::PicRes, toolPrefs::polyC, toolPrefs::polyF, toolPrefs::polyFd, toolPrefs::polyR, toolPrefs::polyS, CommonStrings::PostScript, PDFOptions::PresentMode, PDFOptions::PresentVals, PDFOptions::PrintProf, ApplicationPrefs::ProfileDir, ApplicationPrefs::PrPr_AntiAliasing, ApplicationPrefs::PrPr_C, ApplicationPrefs::PrPr_K, ApplicationPrefs::PrPr_M, ApplicationPrefs::PrPr_Mode, ApplicationPrefs::PrPr_Transparency, ApplicationPrefs::PrPr_Y, PDFOptions::Quality, PDFOptions::RecalcPic, ApplicationPrefs::RecentDCount, ApplicationPrefs::RecentDocs, ApplicationPrefs::RecentScrapbooks, PDFOptions::registrationMarks, PDFOptions::Resolution, MarginStruct::Right, PDFOptions::RotateDeg, PageSet::Rows, guidesPrefs::rulerMode, guidesPrefs::rulersShown, toolPrefs::scaleType, toolPrefs::scaleX, toolPrefs::scaleY, typoPrefs::scalingSubScript, typoPrefs::scalingSuperScript, PDFOptions::SComp, ApplicationPrefs::scratch, ApplicationPrefs::ScriptDir, toolPrefs::shadePict, guidesPrefs::showBleed, guidesPrefs::showControls, guidesPrefs::showPic, ApplicationPrefs::showStartupDialog, ApplicationPrefs::showToolTips, PDFOptions::SinglePage, singlePage, CMSData::SoftProofFullOn, CMSData::SoftProofOn, PDFOptions::SolidProf, ApplicationPrefs::specialWords, ApplicationPrefs::STEcolor, ApplicationPrefs::stickyTools, PDFOptions::SubsetList, toolPrefs::tabFillChar, PDFOptions::Thumbnails, ApplicationPrefs::toolSettings, MarginStruct::Top, ApplicationPrefs::typographicSettings, PDFOptions::useDocBleeds, toolPrefs::useEmbeddedPath, PDFOptions::useLayers, PDFOptions::UseLPI, PDFOptions::UseProfiles, PDFOptions::UseProfiles2, PDFOptions::UseRGB, ApplicationPrefs::useSmallWidgets, PDFOptions::UseSpotColors, ApplicationPrefs::useStandardLI, typoPrefs::valueBaseGrid, typoPrefs::valueSmallCaps, typoPrefs::valueStrikeThruPos, typoPrefs::valueStrikeThruWidth, typoPrefs::valueSubScript, typoPrefs::valueSuperScript, typoPrefs::valueUnderlinePos, typoPrefs::valueUnderlineWidth, PDFOptions::Version, ApplicationPrefs::Wheelval, PageSize::width(), windowPrefs::width, windowPrefs::xPosition, and windowPrefs::yPosition.

Referenced by Preferences::backToDefaults_clicked(), ScribusCore::initScribusCore(), and Preferences::restoreDefaults().

void PrefsManager::initDefaultGUIFont ( const QFont &  guiFont  ) 

void PrefsManager::initDefaultCheckerPrefs ( CheckerPrefsList cp  ) 

void PrefsManager::initDefaultActionKeys (  ) 

void PrefsManager::applyLoadedShortCuts (  ) 

void PrefsManager::initArrowStyles (  ) 

QString PrefsManager::setupPreferencesLocation (  ) 

Set the user's preference file location. Rename any existing old preferences files.

Author:
Craig Bradney
Date:
Thu 18 Nov 2004
Return values:
QString Location of the user's preferences

Definition at line 684 of file prefsmanager.cpp.

References ScPaths::getApplicationDataDir(), moveFile(), and prefsLocation.

Referenced by setup().

bool PrefsManager::copyOldPreferences (  ) 

Copy 1.2 prefs XML before loading, and copy rc files we don't yet convert.

Author:
Craig Bradney
Date:
Sun 09 Jan 2005
Return values:
bool true if prefs were imported

Definition at line 739 of file prefsmanager.cpp.

References copyFile(), prefsLocation, ScribusCore::primaryMainWindow(), ScMessageBox::question(), ScCore, ScribusCore::showSplash(), ScribusCore::splashShowing(), tr(), and ScribusCore::usingGUI().

Referenced by setup().

void PrefsManager::convert12Preferences (  ) 

Move and convert 1.2 style preferences to new XML format.

Author:
Craig Ringer
Date:
Sun 26 June 2005
Return values:
None 

Definition at line 823 of file prefsmanager.cpp.

References PrefsFile::getContext(), PrefsContext::getTable(), prefsFile, prefsLocation, and PrefsTable::set().

Referenced by setup().

const QString PrefsManager::preferencesLocation (  ) 

Get the prefs location property.

Return values:
QString Location of the user's preferences

Definition at line 734 of file prefsmanager.cpp.

References prefsLocation.

Referenced by ScribusMainWindow::initScrapbook(), Preferences::Preferences(), ScPrintEngine_PS::print(), and ScPrintEngine_GDI::printPage_PS().

void PrefsManager::ReadPrefs ( const QString &  fname = QString::null  ) 

Read the preferences.

Parameters:
fname optional filename with preferences. If is not given, the defualt is used.

Definition at line 840 of file prefsmanager.cpp.

References alertLoadPrefsFailed(), prefsLocation, and ReadPref().

Referenced by ScribusCore::initScribusCore().

void PrefsManager::ReadPrefsXML (  ) 

void PrefsManager::SavePrefs ( const QString &  fname = QString::null  ) 

void PrefsManager::SavePrefsXML (  ) 

bool PrefsManager::WritePref ( QString  ho  ) 

Writes the preferences physically to the file. Here is the XML file created itself.

Parameters:
ho a file name to write
Return values:
bool true on success, false on write error

Definition at line 1181 of file prefsmanager.cpp.

References ApplicationPrefs::AppFontSize, appPrefs, PDFOptions::Articles, ApplicationPrefs::askBeforeSubstituite, toolPrefs::aspectRatio, ApplicationPrefs::AutoCheck, typoPrefs::autoLineSpacing, ApplicationPrefs::Automatic, ApplicationPrefs::AutoSave, ApplicationPrefs::AutoSaveTime, ApplicationPrefs::AvailFonts, guidesPrefs::baseColor, guidesPrefs::baseShown, guidesPrefs::before, PDFOptions::Binding, CMSData::BlackPoint, PDFOptions::bleedMarks, PDFOptions::bleeds, ApplicationPrefs::bleeds, PDFOptions::Bookmarks, MarginStruct::Bottom, ApplicationPrefs::checkerProfiles, ApplicationPrefs::ClipMargin, CMSData::CMSinUse, guidesPrefs::colBordersShown, PDFOptions::colorMarks, colorModelRGB, PDFOptions::Compress, PDFOptions::CompressMethod, toolPrefs::constrain, cosd(), PDFOptions::cropMarks, ApplicationPrefs::curCheckProfile, ApplicationPrefs::CustomColorSets, toolPrefs::dBrush, toolPrefs::dBrushPict, ApplicationPrefs::DCMSset, ApplicationPrefs::DColors, ApplicationPrefs::DColorSet, toolPrefs::dCols, ApplicationPrefs::DControlCharColor, CMSData::DefaultImageCMYKProfile, CMSData::DefaultImageRGBProfile, CMSData::DefaultIntentColors, CMSData::DefaultIntentImages, ApplicationPrefs::defaultItemAttributes, CMSData::DefaultMonitorProfile, CMSData::DefaultPrinterProfile, CMSData::DefaultSolidColorCMYKProfile, CMSData::DefaultSolidColorRGBProfile, ApplicationPrefs::defaultToCSetups, toolPrefs::defFont, toolPrefs::defSize, toolPrefs::dEndArrow, ApplicationPrefs::DFrameAnnotationColor, ApplicationPrefs::DFrameColor, ApplicationPrefs::DFrameGroupColor, ApplicationPrefs::DFrameLinkColor, ApplicationPrefs::DFrameLockColor, ApplicationPrefs::DFrameNormColor, toolPrefs::dGap, PDFOptions::displayBookmarks, PDFOptions::displayFullscreen, PDFOptions::displayLayers, PDFOptions::displayThumbs, toolPrefs::dispX, toolPrefs::dispY, ApplicationPrefs::DisScale, toolPrefs::dLineArt, toolPrefs::dLstyleLine, ApplicationPrefs::DocDir, PDFOptions::docInfoMarks, PDFOptions::doClip, ApplicationPrefs::doCopyToScrapbook, ApplicationPrefs::documentTemplatesDir, ApplicationPrefs::docUnitIndex, PDFOptions::doMultiFile, PDFOptions::doOverprint, ApplicationPrefs::doOverprint, ApplicationPrefs::DPageBorderColor, ApplicationPrefs::DpapColor, toolPrefs::dPen, toolPrefs::dPenLine, toolPrefs::dPenText, toolPrefs::dShade, toolPrefs::dShade2, toolPrefs::dShadeLine, toolPrefs::dStartArrow, toolPrefs::dStrokeText, toolPrefs::dTabWidth, toolPrefs::dTextBackGround, toolPrefs::dTextBackGroundShade, toolPrefs::dTextLineColor, toolPrefs::dTextLineShade, toolPrefs::dTextPenShade, toolPrefs::dTextStrokeShade, toolPrefs::dWidth, toolPrefs::dWidthLine, PDFOptions::EmbeddedI, PDFOptions::Encrypt, extBrowserExecutable(), ApplicationPrefs::FacingPages, guidesPrefs::framesShown, CMSData::GamutCheck, ApplicationPrefs::GapHorizontal, ApplicationPrefs::GapVertical, ApplicationPrefs::Gcr_Mode, ApplicationPrefs::GCRMode, TabKeyboardShortcutsWidget::getKeyText(), ApplicationPrefs::GFontSub, ghostscriptExecutable(), guidesPrefs::grabRad, guidesPrefs::gridShown, ApplicationPrefs::gs_AntiAliasGraphics, ApplicationPrefs::gs_AntiAliasText, ApplicationPrefs::gs_Resolution, ApplicationPrefs::GUI, guidesPrefs::guideColor, guidesPrefs::guideRad, ApplicationPrefs::guidesSettings, guidesPrefs::guidesShown, ApplicationPrefs::haveStylePreview, windowPrefs::height, ApplicationPrefs::HyCount, ApplicationPrefs::ignoredWords, imageEditorExecutable(), PDFOptions::ImageProf, PDFOptions::Info, PDFOptions::Intent, PDFOptions::Intent2, PDFOptions::isGrayscale, ApplicationPrefs::KeyActions, ApplicationPrefs::Language, latexConfigs(), latexEditorExecutable(), ApplicationPrefs::latexForceDpi, latexResolution(), ApplicationPrefs::latexStartWithEmptyFrames, ApplicationPrefs::latexUseEmbeddedEditor, guidesPrefs::layerMarkersShown, MarginStruct::Left, guidesPrefs::linkShown, toolPrefs::lowResType, PDFOptions::LPISettings, m_lastError, toolPrefs::magMax, toolPrefs::magMin, toolPrefs::magStep, ApplicationPrefs::mainWinSettings, guidesPrefs::majorColor, guidesPrefs::majorGrid, guidesPrefs::margColor, ApplicationPrefs::marginColored, ApplicationPrefs::margins, guidesPrefs::marginsShown, PDFOptions::markOffset, windowPrefs::maximized, guidesPrefs::minorColor, guidesPrefs::minorGrid, ApplicationPrefs::MinWordLen, PDFOptions::MirrorH, PDFOptions::MirrorV, ApplicationPrefs::moveTimeout, ApplicationPrefs::numScrapbookCopies, typoPrefs::offsetBaseGrid, PDFOptions::openAction, ApplicationPrefs::PageHeight, PDFOptions::PageLayout, ApplicationPrefs::pageOrientation, ApplicationPrefs::pageSets, ApplicationPrefs::pageSize, ApplicationPrefs::PageWidth, ApplicationPrefs::PaletteFontSize, ApplicationPrefs::paragraphsLI, PDFOptions::PassOwner, PDFOptions::PassUser, ApplicationPrefs::PDF_Options, PDFOptions::Permissions, ApplicationPrefs::persistentScrapbook, PDFOptions::PicRes, toolPrefs::polyC, toolPrefs::polyF, toolPrefs::polyFd, toolPrefs::polyR, toolPrefs::polyS, PDFOptions::PresentMode, ApplicationPrefs::PrinterCommand, ApplicationPrefs::PrinterFile, ApplicationPrefs::PrinterName, PDFOptions::PrintProf, ApplicationPrefs::ProfileDir, ApplicationPrefs::PrPr_AntiAliasing, ApplicationPrefs::PrPr_C, ApplicationPrefs::PrPr_K, ApplicationPrefs::PrPr_M, ApplicationPrefs::PrPr_Mode, ApplicationPrefs::PrPr_Transparency, ApplicationPrefs::PrPr_Y, PDFOptions::Quality, PDFOptions::RecalcPic, ApplicationPrefs::RecentDCount, ApplicationPrefs::RecentDocs, ApplicationPrefs::RecentScrapbooks, PDFOptions::registrationMarks, PDFOptions::Resolution, MarginStruct::Right, PDFOptions::RotateDeg, guidesPrefs::rulerMode, guidesPrefs::rulersShown, toolPrefs::scaleType, toolPrefs::scaleX, toolPrefs::scaleY, typoPrefs::scalingSubScript, typoPrefs::scalingSuperScript, ApplicationPrefs::scratch, ApplicationPrefs::ScriptDir, ApplicationPrefs::SepalN, ApplicationPrefs::SepalT, toolPrefs::shadePict, guidesPrefs::showBleed, guidesPrefs::showControls, guidesPrefs::showPic, ApplicationPrefs::showStartupDialog, ApplicationPrefs::showToolTips, CMSData::SoftProofFullOn, CMSData::SoftProofOn, PDFOptions::SolidProf, ApplicationPrefs::specialWords, ApplicationPrefs::STEcolor, ApplicationPrefs::STEfont, ApplicationPrefs::stickyTools, toolPrefs::tabFillChar, PDFOptions::Thumbnails, ApplicationPrefs::toolSettings, MarginStruct::Top, tr(), ApplicationPrefs::typographicSettings, PDFOptions::useDocBleeds, toolPrefs::useEmbeddedPath, PDFOptions::useLayers, PDFOptions::UseLPI, PDFOptions::UseProfiles, PDFOptions::UseProfiles2, PDFOptions::UseRGB, ApplicationPrefs::useSmallWidgets, PDFOptions::UseSpotColors, ApplicationPrefs::useStandardLI, typoPrefs::valueBaseGrid, typoPrefs::valueSmallCaps, typoPrefs::valueStrikeThruPos, typoPrefs::valueStrikeThruWidth, typoPrefs::valueSubScript, typoPrefs::valueSuperScript, typoPrefs::valueUnderlinePos, typoPrefs::valueUnderlineWidth, PDFOptions::Version, ApplicationPrefs::Wheelval, windowPrefs::width, windowPrefs::xPosition, and windowPrefs::yPosition.

Referenced by SavePrefs().

bool PrefsManager::ReadPref ( QString  ho  ) 

Reads the preferences physically from the file. Here is the XML file parsed itself. Returns false on error. It's the caller's job to make sure the prefs file actually exists.

Parameters:
ho a file name to write
Return values:
bool true on success, false on write error

Definition at line 1667 of file prefsmanager.cpp.

References LPIData::Angle, ApplicationPrefs::AppFontSize, appPrefs, PDFOptions::Articles, ApplicationPrefs::askBeforeSubstituite, toolPrefs::aspectRatio, ObjectAttribute::autoaddto, ApplicationPrefs::AutoCheck, checkerPrefs::autoCheck, typoPrefs::autoLineSpacing, ApplicationPrefs::Automatic, ApplicationPrefs::AutoSave, ApplicationPrefs::AutoSaveTime, ApplicationPrefs::AvailFonts, guidesPrefs::baseColor,