|
|
|
@ -509,14 +509,32 @@ TQColor KNote::bgColor() const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KNote::setColor( const TQColor& fg, const TQColor& bg )
|
|
|
|
|
{
|
|
|
|
|
bool updateJournal = false;
|
|
|
|
|
TQString journalFg = m_journal->customProperty( "KNotes", "FgColor" );
|
|
|
|
|
if ( journalFg.isEmpty() || journalFg != fg.name() )
|
|
|
|
|
{
|
|
|
|
|
m_journal->setCustomProperty( "KNotes", "FgColor", fg.name() );
|
|
|
|
|
updateJournal = true;
|
|
|
|
|
}
|
|
|
|
|
TQString journalbg = m_journal->customProperty( "KNotes", "BgColor" );
|
|
|
|
|
if ( journalbg.isEmpty() || journalbg != bg.name() )
|
|
|
|
|
{
|
|
|
|
|
m_journal->setCustomProperty( "KNotes", "BgColor", bg.name() );
|
|
|
|
|
updateJournal = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_config->setFgColor( fg );
|
|
|
|
|
m_config->setBgColor( bg );
|
|
|
|
|
|
|
|
|
|
if (updateJournal)
|
|
|
|
|
{
|
|
|
|
|
// Only update the journal if new configuration was really used.
|
|
|
|
|
// This is necessary because setColor() is called also when loading a note from an .ics
|
|
|
|
|
// file and we do not want to inadvertantly update the last modified field each time.
|
|
|
|
|
m_journal->updated(); // because setCustomProperty() doesn't call it!!
|
|
|
|
|
emit sigDataChanged(noteId());
|
|
|
|
|
}
|
|
|
|
|
m_config->writeConfig();
|
|
|
|
|
|
|
|
|
|
TQPalette newpalette = palette();
|
|
|
|
|