summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views
Unidiff
Diffstat (limited to 'kaddressbook/views') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/views/colorlistbox.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/kaddressbook/views/colorlistbox.cpp b/kaddressbook/views/colorlistbox.cpp
index 7386207..2bddca6 100644
--- a/kaddressbook/views/colorlistbox.cpp
+++ b/kaddressbook/views/colorlistbox.cpp
@@ -24,12 +24,15 @@
24 24
25#ifndef KAB_EMBEDDED 25#ifndef KAB_EMBEDDED
26#include <kcolordrag.h> 26#include <kcolordrag.h>
27#endif //KAB_EMBEDDED 27#endif //KAB_EMBEDDED
28 28
29#include "colorlistbox.h" 29#include "colorlistbox.h"
30#ifdef DESKTOP_VERSION
31#include <qcolordialog.h>
32#endif
30 33
31ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f ) 34ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f )
32 :KListBox( parent, name, f ), mCurrentOnDragEnter(-1) 35 :KListBox( parent, name, f ), mCurrentOnDragEnter(-1)
33{ 36{
34 connect( this, SIGNAL(selected(int)), this, SLOT(newColor(int)) ); 37 connect( this, SIGNAL(selected(int)), this, SLOT(newColor(int)) );
35 connect( this, SIGNAL(clicked(QListBoxItem *)), this, SLOT(slotNewColor(QListBoxItem *)) ); 38 connect( this, SIGNAL(clicked(QListBoxItem *)), this, SLOT(slotNewColor(QListBoxItem *)) );
@@ -94,19 +97,26 @@ void ColorListBox::newColor( int index )
94#ifndef KAB_EMBEDDED 97#ifndef KAB_EMBEDDED
95 if( KColorDialog::getColor( c, this ) != QDialog::Rejected ) 98 if( KColorDialog::getColor( c, this ) != QDialog::Rejected )
96 { 99 {
97 setColor( index, c ); 100 setColor( index, c );
98 } 101 }
99#else //KAB_EMBEDDED 102#else //KAB_EMBEDDED
103#ifdef DESKTOP_VERSION
104 QColor col = QColorDialog::getColor ( c );
105 if ( col.isValid () ) {
106 setColor( index, col );
107 }
108#else
100 KColorDialog* k = new KColorDialog( this ); 109 KColorDialog* k = new KColorDialog( this );
101 k->setColor( c ); 110 k->setColor( c );
102 int res = k->exec(); 111 int res = k->exec();
103 if ( res ) { 112 if ( res ) {
104 setColor( index, k->getColor() ); 113 setColor( index, k->getColor() );
105 } 114 }
106 delete k; 115 delete k;
116#endif
107#endif //KAB_EMBEDDED 117#endif //KAB_EMBEDDED
108 118
109 } 119 }
110} 120}
111 121
112 122