Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
CASettings Class Reference

Class for storing the Canorus settings. More...

#include <settings.h>

Inheritance diagram for CASettings:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CASettings (QObject *parent=0)
 CASettings (const QString &fileName, QObject *parent=0)
virtual ~CASettings ()
int readSettings ()
void writeSettings ()
bool finaleLyricsBehaviour ()
void setFinaleLyricsBehaviour (bool b)
bool shadowNotesInOtherStaffs ()
void setShadowNotesInOtherStaffs (bool b)
bool playInsertedNotes ()
void setPlayInsertedNotes (bool b)
bool autoBar ()
void setAutoBar (bool b)
QDir documentsDirectory ()
void setDocumentsDirectory (QDir d)
CAFileFormats::CAFileFormatType defaultSaveFormat ()
void setDefaultSaveFormat (CAFileFormats::CAFileFormatType t)
int autoRecoveryInterval ()
void setAutoRecoveryInterval (int interval)
int maxRecentDocuments ()
void setMaxRecentDocuments (int r)
bool antiAliasing ()
void setAntiAliasing (bool a)
QColor backgroundColor ()
void setBackgroundColor (QColor backgroundColor)
QColor foregroundColor ()
void setForegroundColor (QColor foregroundColor)
QColor selectionColor ()
void setSelectionColor (QColor selectionColor)
QColor selectionAreaColor ()
void setSelectionAreaColor (QColor selectionAreaColor)
QColor selectedContextColor ()
void setSelectedContextColor (QColor selectedContextColor)
QColor hiddenElementsColor ()
void setDisabledElementsColor (QColor disabledElementsColor)
QColor disabledElementsColor ()
void setHiddenElementsColor (QColor hiddenElementsColor)
int midiInPort ()
void setMidiInPort (int in)
int midiOutPort ()
void setMidiOutPort (int out)
CATypesetter::CATypesetterType typesetter ()
void setTypesetter (CATypesetter::CATypesetterType t)
QString typesetterLocation ()
void setTypesetterLocation (QString tl)
bool useSystemDefaultTypesetter ()
void setUseSystemDefaultTypesetter (bool s)
QString pdfViewerLocation ()
void setPdfViewerLocation (QString pl)
bool useSystemDefaultPdfViewer ()
void setUseSystemDefaultPdfViewer (bool s)

Static Public Member Functions

static const QString defaultSettingsPath ()

Static Public Attributes

static const bool DEFAULT_FINALE_LYRICS_BEHAVIOUR = false
static const bool DEFAULT_SHADOW_NOTES_IN_OTHER_STAFFS = false
static const bool DEFAULT_PLAY_INSERTED_NOTES = true
static const bool DEFAULT_AUTO_BAR = true
static const QDir DEFAULT_DOCUMENTS_DIRECTORY = QDir::home()
static const
CAFileFormats::CAFileFormatType 
DEFAULT_SAVE_FORMAT = CAFileFormats::Can
static const int DEFAULT_AUTO_RECOVERY_INTERVAL = 1
static const int DEFAULT_MAX_RECENT_DOCUMENTS = 15
static const bool DEFAULT_ANTIALIASING = true
static const QColor DEFAULT_BACKGROUND_COLOR = QColor(255, 255, 240)
static const QColor DEFAULT_FOREGROUND_COLOR = Qt::black
static const QColor DEFAULT_SELECTION_COLOR = Qt::red
static const QColor DEFAULT_SELECTION_AREA_COLOR = QColor( 255, 0, 80, 70 )
static const QColor DEFAULT_SELECTED_CONTEXT_COLOR = Qt::blue
static const QColor DEFAULT_HIDDEN_ELEMENTS_COLOR = Qt::green
static const QColor DEFAULT_DISABLED_ELEMENTS_COLOR = Qt::gray
static const int DEFAULT_MIDI_IN_PORT = -1
static const int DEFAULT_MIDI_OUT_PORT = -1
static const
CATypesetter::CATypesetterType 
DEFAULT_TYPESETTER = CATypesetter::LilyPond
static const QString DEFAULT_TYPESETTER_LOCATION
static const bool DEFAULT_USE_SYSTEM_TYPESETTER = true
static const QString DEFAULT_PDF_VIEWER_LOCATION = ""
static const bool DEFAULT_USE_SYSTEM_PDF_VIEWER = true

Private Member Functions

void writeRecentDocuments ()
void readRecentDocuments ()

Private Attributes

bool _finaleLyricsBehaviour
bool _shadowNotesInOtherStaffs
bool _playInsertedNotes
bool _autoBar
QDir _documentsDirectory
CAFileFormats::CAFileFormatType _defaultSaveFormat
int _autoRecoveryInterval
int _maxRecentDocuments
bool _antiAliasing
QColor _backgroundColor
QColor _foregroundColor
QColor _selectionColor
QColor _selectionAreaColor
QColor _selectedContextColor
QColor _hiddenElementsColor
QColor _disabledElementsColor
int _midiOutPort
int _midiInPort
CATypesetter::CATypesetterType _typesetter
QString _typesetterLocation
bool _useSystemDefaultTypesetter
QString _pdfViewerLocation
bool _useSystemDefaultPdfViewer

Detailed Description

Class for storing the Canorus settings.

Copyright (c) 2007, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.

Licensed under the GNU GENERAL PUBLIC LICENSE. See COPYING for details.

This class is a model class used for reading and writing the settings in/out of the config file.

The default location of config files are usually $HOME$/.config/Canorus for POSIX systems and HOME% data on M$ systems. See


Constructor & Destructor Documentation

CASettings::CASettings ( QObject parent = 0)

Create a new settings instance using the default config file for a local user.

CASettings::CASettings ( const QString &  fileName,
QObject parent = 0 
)

Create a new settings instance using the config file fileName.

CASettings::~CASettings ( ) [virtual]

References writeSettings().

Here is the call graph for this function:


Member Function Documentation

bool CASettings::antiAliasing ( ) [inline]

References _antiAliasing.

Referenced by writeSettings().

Here is the caller graph for this function:

bool CASettings::autoBar ( ) [inline]

References _autoBar.

Referenced by CAMainWin::insertMusElementAt(), and writeSettings().

Here is the caller graph for this function:

References _autoRecoveryInterval.

Referenced by writeSettings().

Here is the caller graph for this function:

QColor CASettings::backgroundColor ( ) [inline]

References _backgroundColor.

Referenced by setBackgroundColor(), and writeSettings().

Here is the caller graph for this function:

References _defaultSaveFormat.

Referenced by CASettingsDialog::setupPages(), and writeSettings().

Here is the caller graph for this function:

const QString CASettings::defaultSettingsPath ( ) [static]

Returns the default settings path. This function is static and is used when no config filename is specified or when a plugin wants a settings directory to store its own settings in.

Referenced by CAAutoRecovery::cleanupRecovery(), main(), CAAutoRecovery::openRecovery(), and CAAutoRecovery::saveRecovery().

Here is the caller graph for this function:

QColor CASettings::disabledElementsColor ( ) [inline]

References _disabledElementsColor.

Referenced by setDisabledElementsColor(), and writeSettings().

Here is the caller graph for this function:

QDir CASettings::documentsDirectory ( ) [inline]

References _documentsDirectory.

Referenced by writeSettings().

Here is the caller graph for this function:

References _finaleLyricsBehaviour.

Referenced by CAMainWin::onTextEditKeyPressEvent(), and writeSettings().

Here is the caller graph for this function:

QColor CASettings::foregroundColor ( ) [inline]

References _foregroundColor.

Referenced by setForegroundColor(), and writeSettings().

Here is the caller graph for this function:

QColor CASettings::hiddenElementsColor ( ) [inline]

References _hiddenElementsColor.

Referenced by setHiddenElementsColor(), and writeSettings().

Here is the caller graph for this function:

References _maxRecentDocuments.

Referenced by writeSettings().

Here is the caller graph for this function:

int CASettings::midiInPort ( ) [inline]

References _midiInPort.

Referenced by setMidiInPort(), CASettingsDialog::setupPages(), and writeSettings().

Here is the caller graph for this function:

int CASettings::midiOutPort ( ) [inline]

References _midiOutPort.

Referenced by CASettingsDialog::setupPages(), and writeSettings().

Here is the caller graph for this function:

QString CASettings::pdfViewerLocation ( ) [inline]

References _pdfViewerLocation.

Referenced by writeSettings().

Here is the caller graph for this function:

bool CASettings::playInsertedNotes ( ) [inline]

References _playInsertedNotes.

Referenced by CAMainWin::insertMusElementAt(), and writeSettings().

Here is the caller graph for this function:

void CASettings::readRecentDocuments ( ) [private]

References CACanorus::addRecentDocument().

Referenced by readSettings().

Here is the call graph for this function:

Here is the caller graph for this function:

Opens the settings stored in a config file and sets the local values. Returns Undefined, if everything went fine or appropriate settings page, if a file or value wasn't set and settings window should be shown (eg. setup the MIDI devices the first time).

References DEFAULT_ANTIALIASING, DEFAULT_AUTO_BAR, DEFAULT_AUTO_RECOVERY_INTERVAL, DEFAULT_BACKGROUND_COLOR, DEFAULT_DISABLED_ELEMENTS_COLOR, DEFAULT_DOCUMENTS_DIRECTORY, DEFAULT_FINALE_LYRICS_BEHAVIOUR, DEFAULT_FOREGROUND_COLOR, DEFAULT_HIDDEN_ELEMENTS_COLOR, DEFAULT_MAX_RECENT_DOCUMENTS, DEFAULT_MIDI_IN_PORT, DEFAULT_MIDI_OUT_PORT, DEFAULT_PDF_VIEWER_LOCATION, DEFAULT_PLAY_INSERTED_NOTES, DEFAULT_SAVE_FORMAT, DEFAULT_SELECTED_CONTEXT_COLOR, DEFAULT_SELECTION_AREA_COLOR, DEFAULT_SELECTION_COLOR, DEFAULT_SHADOW_NOTES_IN_OTHER_STAFFS, DEFAULT_TYPESETTER, DEFAULT_TYPESETTER_LOCATION, DEFAULT_USE_SYSTEM_PDF_VIEWER, DEFAULT_USE_SYSTEM_TYPESETTER, CACanorus::midiDevice(), readRecentDocuments(), setAntiAliasing(), setAutoBar(), setAutoRecoveryInterval(), setBackgroundColor(), setDefaultSaveFormat(), setDisabledElementsColor(), setDocumentsDirectory(), setFinaleLyricsBehaviour(), setForegroundColor(), setHiddenElementsColor(), setMaxRecentDocuments(), setMidiInPort(), setMidiOutPort(), setPdfViewerLocation(), setPlayInsertedNotes(), setSelectedContextColor(), setSelectionAreaColor(), setSelectionColor(), setShadowNotesInOtherStaffs(), setTypesetter(), setTypesetterLocation(), setUseSystemDefaultPdfViewer(), and setUseSystemDefaultTypesetter().

Referenced by CACanorus::initSettings().

Here is the call graph for this function:

Here is the caller graph for this function:

QColor CASettings::selectedContextColor ( ) [inline]

References _selectedContextColor.

Referenced by setSelectedContextColor(), and writeSettings().

Here is the caller graph for this function:

QColor CASettings::selectionAreaColor ( ) [inline]

References _selectionAreaColor.

Referenced by setSelectionAreaColor(), and writeSettings().

Here is the caller graph for this function:

QColor CASettings::selectionColor ( ) [inline]

References _selectionColor.

Referenced by setSelectionColor(), and writeSettings().

Here is the caller graph for this function:

void CASettings::setAntiAliasing ( bool  a) [inline]

References _antiAliasing.

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the caller graph for this function:

void CASettings::setAutoBar ( bool  b) [inline]

References _autoBar.

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the caller graph for this function:

void CASettings::setAutoRecoveryInterval ( int  interval) [inline]

References _autoRecoveryInterval.

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the caller graph for this function:

void CASettings::setBackgroundColor ( QColor  backgroundColor) [inline]

References _backgroundColor, and backgroundColor().

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the call graph for this function:

Here is the caller graph for this function:

References _defaultSaveFormat.

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the caller graph for this function:

void CASettings::setDisabledElementsColor ( QColor  disabledElementsColor) [inline]

References _disabledElementsColor, and disabledElementsColor().

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the call graph for this function:

Here is the caller graph for this function:

void CASettings::setDocumentsDirectory ( QDir  d) [inline]

References _documentsDirectory.

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the caller graph for this function:

void CASettings::setFinaleLyricsBehaviour ( bool  b) [inline]

References _finaleLyricsBehaviour.

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the caller graph for this function:

void CASettings::setForegroundColor ( QColor  foregroundColor) [inline]

References _foregroundColor, and foregroundColor().

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the call graph for this function:

Here is the caller graph for this function:

void CASettings::setHiddenElementsColor ( QColor  hiddenElementsColor) [inline]

References _hiddenElementsColor, and hiddenElementsColor().

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the call graph for this function:

Here is the caller graph for this function:

void CASettings::setMaxRecentDocuments ( int  r) [inline]

References _maxRecentDocuments.

Referenced by readSettings().

Here is the caller graph for this function:

void CASettings::setMidiInPort ( int  in)

References _midiInPort, CAMidiDevice::closeInputPort(), CACanorus::midiDevice(), midiInPort(), and CAMidiDevice::openInputPort().

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the call graph for this function:

Here is the caller graph for this function:

void CASettings::setMidiOutPort ( int  out) [inline]

References _midiOutPort.

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the caller graph for this function:

void CASettings::setPdfViewerLocation ( QString  pl) [inline]

References _pdfViewerLocation.

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the caller graph for this function:

void CASettings::setPlayInsertedNotes ( bool  b) [inline]

References _playInsertedNotes.

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the caller graph for this function:

void CASettings::setSelectedContextColor ( QColor  selectedContextColor) [inline]

References _selectedContextColor, and selectedContextColor().

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the call graph for this function:

Here is the caller graph for this function:

void CASettings::setSelectionAreaColor ( QColor  selectionAreaColor) [inline]

References _selectionAreaColor, and selectionAreaColor().

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the call graph for this function:

Here is the caller graph for this function:

void CASettings::setSelectionColor ( QColor  selectionColor) [inline]

References _selectionColor, and selectionColor().

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the call graph for this function:

Here is the caller graph for this function:

void CASettings::setShadowNotesInOtherStaffs ( bool  b) [inline]

References _shadowNotesInOtherStaffs.

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the caller graph for this function:

References _typesetter.

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the caller graph for this function:

void CASettings::setTypesetterLocation ( QString  tl) [inline]

References _typesetterLocation.

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the caller graph for this function:

void CASettings::setUseSystemDefaultPdfViewer ( bool  s) [inline]

References _useSystemDefaultPdfViewer.

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the caller graph for this function:

void CASettings::setUseSystemDefaultTypesetter ( bool  s) [inline]

References _useSystemDefaultTypesetter.

Referenced by CASettingsDialog::applySettings(), and readSettings().

Here is the caller graph for this function:

References _shadowNotesInOtherStaffs.

Referenced by CAScoreViewPort::paintEvent(), and writeSettings().

Here is the caller graph for this function:

References _typesetter.

Referenced by writeSettings().

Here is the caller graph for this function:

QString CASettings::typesetterLocation ( ) [inline]

References _typesetterLocation.

Referenced by writeSettings().

Here is the caller graph for this function:

References _useSystemDefaultPdfViewer.

Referenced by writeSettings().

Here is the caller graph for this function:

References _useSystemDefaultTypesetter.

Referenced by writeSettings().

Here is the caller graph for this function:

References CACanorus::recentDocumentList().

Referenced by writeSettings().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

bool CASettings::_antiAliasing [private]

Referenced by antiAliasing(), and setAntiAliasing().

bool CASettings::_autoBar [private]

Referenced by autoBar(), and setAutoBar().

QColor CASettings::_backgroundColor [private]
QColor CASettings::_foregroundColor [private]
int CASettings::_midiInPort [private]

Referenced by midiInPort(), and setMidiInPort().

int CASettings::_midiOutPort [private]

Referenced by midiOutPort(), and setMidiOutPort().

QString CASettings::_pdfViewerLocation [private]
QColor CASettings::_selectionColor [private]

Referenced by setTypesetter(), and typesetter().

Referenced by readSettings().

const bool CASettings::DEFAULT_AUTO_BAR = true [static]

Referenced by readSettings().

Referenced by readSettings().

const QColor CASettings::DEFAULT_BACKGROUND_COLOR = QColor(255, 255, 240) [static]
const QDir CASettings::DEFAULT_DOCUMENTS_DIRECTORY = QDir::home() [static]

Copyright (c) 2007, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.

Licensed under the GNU GENERAL PUBLIC LICENSE. See COPYING for details.

Referenced by readSettings().

const QColor CASettings::DEFAULT_FOREGROUND_COLOR = Qt::black [static]
const QColor CASettings::DEFAULT_HIDDEN_ELEMENTS_COLOR = Qt::green [static]

Referenced by readSettings().

Referenced by readSettings().

Referenced by readSettings().

Referenced by readSettings().

Referenced by readSettings().

Referenced by readSettings().

const QColor CASettings::DEFAULT_SELECTION_AREA_COLOR = QColor( 255, 0, 80, 70 ) [static]
const QColor CASettings::DEFAULT_SELECTION_COLOR = Qt::red [static]

Referenced by readSettings().

Referenced by readSettings().

Referenced by readSettings().

Referenced by readSettings().


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