[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdepim/knotes
From:       Michael Brade <brade () kde ! org>
Date:       2004-08-31 21:09:38
Message-ID: 20040831210938.1BAED26C8 () office ! kde ! org
[Download RAW message or body]

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 );
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic