Scribus
Open source desktop publishing at your fingertips
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>

Inheritance diagram for PrefsManager:
Collaboration diagram for PrefsManager:

Public Slots

void languageChange ()
 

Signals

void prefsChanged ()
 

Public Member Functions

 PrefsManager (QObject *parent=0)
 
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() More...
 
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. More...
 
bool copyOldPreferences ()
 Copy 1.2 prefs XML before loading, and copy rc files we don't yet convert. More...
 
void convert12Preferences ()
 Move and convert 1.2 style preferences to new XML format. More...
 
const QString preferencesLocation ()
 Get the prefs location property. More...
 
void ReadPrefs (const QString &fname=QString::null)
 Read the preferences. More...
 
void ReadPrefsXML ()
 
void SavePrefs (const QString &fname=QString::null)
 Save the preferences. More...
 
void SavePrefsXML ()
 
bool WritePref (QString ho)
 Writes the preferences physically to the file. Here is the XML file created itself. More...
 
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. More...
 
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 setUniconvExecutable (const QString &)
 
void setLatexConfigs (const QStringList &)
 
void setLatexCommands (const QMap< QString, QString > &commands)
 
void setLatexEditorExecutable (const QString &)
 
QString ghostscriptExecutable () const
 
QString imageEditorExecutable () const
 
QString extBrowserExecutable () const
 
QString uniconvExecutable () const
 
QStringList latexConfigs () const
 
QMap< QString, QString > latexCommands () const
 
bool renderFrameConfigured ()
 
QString latexEditorExecutable () 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 mouseWheelJump () const
 
double displayScale () const
 Get the user set display scale.
 
const QString & uiLanguage () 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)
 
bool showPageShadow () const
 
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() More...
 
ApplicationPrefsapplicationPrefs ()
 
void setNewPrefs (ApplicationPrefs &newPrefs)
 
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. More...
 
static void deleteInstance ()
 Deletes the PrefsManager Instance Must be called when PrefsManager is no longer needed.
 
static bool isToolColor (const struct ItemToolPrefs &settings, const QString &name)
 
static QStringList toolColorNames (const struct ItemToolPrefs &settings)
 
static void replaceToolColors (struct ItemToolPrefs &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
 

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

Member Function Documentation

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
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
booltrue if prefs were imported
bool PrefsManager::GetAllFonts ( bool  showFontInfo)

Finds the fonts on the system Must be run after: PrefsManager::setup() Must be run before: PrefsManager::initDefaults()

Parameters
showFontInfoflag to get extended fotn info
Return values
booltrue on finding 1 or more fonts
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

PrefsManager * PrefsManager::instance ( )
static

Returns a pointer to the PrefsManager instance.

Returns
A pointer to the PrefsManager instance
const QString PrefsManager::preferencesLocation ( )

Get the prefs location property.

Return values
QStringLocation of the user's preferences
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
hoa file name to write
Return values
booltrue on success, false on write error
void PrefsManager::ReadPrefs ( const QString &  fname = QString::null)

Read the preferences.

Parameters
fnameoptional filename with preferences. If is not given, the defualt is used.
void PrefsManager::SavePrefs ( const QString &  fname = QString::null)

Save the preferences.

Parameters
fnameoptional filename with preferences. If is not given, the defualt is used.
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
QStringLocation of the user's preferences
bool PrefsManager::WritePref ( QString  ho)

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

Parameters
hoa file name to write
Return values
booltrue on success, false on write error

The documentation for this class was generated from the following files: