|
|
@ -515,13 +515,31 @@ TQColor KNote::bgColor() const
|
|
|
|
|
|
|
|
|
|
|
|
void KNote::setColor( const TQColor& fg, const TQColor& bg )
|
|
|
|
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() );
|
|
|
|
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() );
|
|
|
|
m_journal->setCustomProperty( "KNotes", "BgColor", bg.name() );
|
|
|
|
|
|
|
|
updateJournal = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_config->setFgColor( fg );
|
|
|
|
m_config->setFgColor( fg );
|
|
|
|
m_config->setBgColor( bg );
|
|
|
|
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!!
|
|
|
|
m_journal->updated(); // because setCustomProperty() doesn't call it!!
|
|
|
|
emit sigDataChanged(noteId());
|
|
|
|
emit sigDataChanged(noteId());
|
|
|
|
|
|
|
|
}
|
|
|
|
m_config->writeConfig();
|
|
|
|
m_config->writeConfig();
|
|
|
|
|
|
|
|
|
|
|
|
TQPalette newpalette = palette();
|
|
|
|
TQPalette newpalette = palette();
|
|
|
|