From kde-commits Tue Aug 31 21:09:38 2004 From: Michael Brade Date: Tue, 31 Aug 2004 21:09:38 +0000 To: kde-commits Subject: kdepim/knotes Message-Id: <20040831210938.1BAED26C8 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=109398659129553 CVS commit by brade: Put the colors and the rich text switch into the journals. I'm not happy with my migration code yet, that will come in due time, when it's written elegantly. This way nothing will break but we can use the notes properly in Kontact now. M +23 -0 knote.cpp 1.135 --- kdepim/knotes/knote.cpp #1.134:1.135 @@ -266,4 +266,23 @@ KNote::KNote( QDomDocument buildDoc, Jou move( position ); // do before calling show() to avoid flicker + // config items in the journal have priority + QString property = m_journal->customProperty( "KNotes", "FgColor" ); + if ( property != QString::null ) + m_config->setFgColor( QColor( property ) ); + else + m_journal->setCustomProperty( "KNotes", "FgColor", m_config->fgColor().name() ); + + property = m_journal->customProperty( "KNotes", "BgColor" ); + if ( property != QString::null ) + m_config->setBgColor( QColor( property ) ); + else + m_journal->setCustomProperty( "KNotes", "BgColor", m_config->bgColor().name() ); + + property = m_journal->customProperty( "KNotes", "RichText" ); + if ( property != QString::null ) + m_config->setRichText( property == "true" ? true : false ); + else + m_journal->setCustomProperty( "KNotes", "RichText", m_config->richText() ? "true" : "false" ); + // read configuration settings... slotApplyConfig(); @@ -331,4 +350,7 @@ void KNote::saveData() m_journal->setSummary( m_label->text() ); m_journal->setDescription( m_editor->text() ); + m_journal->setCustomProperty( "KNotes", "FgColor", paletteForegroundColor().name() ); + m_journal->setCustomProperty( "KNotes", "BgColor", paletteBackgroundColor().name() ); + m_journal->setCustomProperty( "KNotes", "RichText", m_config->richText() ? "true" : "false" ); emit sigDataChanged(); @@ -891,4 +913,5 @@ void KNote::dropEvent( QDropEvent *e ) { setColor( paletteForegroundColor(), bg ); + m_journal->setCustomProperty( "KNotes", "BgColor", bg.name() ); m_config->setBgColor( bg ); }