Diffstat (limited to 'kaddressbook/views/configurecardviewdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kaddressbook/views/configurecardviewdialog.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kaddressbook/views/configurecardviewdialog.cpp b/kaddressbook/views/configurecardviewdialog.cpp index d518cf7..366e54c 100644 --- a/kaddressbook/views/configurecardviewdialog.cpp +++ b/kaddressbook/views/configurecardviewdialog.cpp | |||
@@ -66,96 +66,97 @@ ConfigureCardViewWidget::ConfigureCardViewWidget( KABC::AddressBook *ab, QWidget | |||
66 | #endif //KAB_EMBEDDED | 66 | #endif //KAB_EMBEDDED |
67 | 67 | ||
68 | mAdvancedPage = new CardViewLookNFeelPage( page ); | 68 | mAdvancedPage = new CardViewLookNFeelPage( page ); |
69 | } | 69 | } |
70 | 70 | ||
71 | ConfigureCardViewWidget::~ConfigureCardViewWidget() | 71 | ConfigureCardViewWidget::~ConfigureCardViewWidget() |
72 | { | 72 | { |
73 | } | 73 | } |
74 | 74 | ||
75 | void ConfigureCardViewWidget::restoreSettings( KConfig *config ) | 75 | void ConfigureCardViewWidget::restoreSettings( KConfig *config ) |
76 | { | 76 | { |
77 | ViewConfigureWidget::restoreSettings( config ); | 77 | ViewConfigureWidget::restoreSettings( config ); |
78 | 78 | ||
79 | mAdvancedPage->restoreSettings( config ); | 79 | mAdvancedPage->restoreSettings( config ); |
80 | } | 80 | } |
81 | 81 | ||
82 | void ConfigureCardViewWidget::saveSettings( KConfig *config ) | 82 | void ConfigureCardViewWidget::saveSettings( KConfig *config ) |
83 | { | 83 | { |
84 | ViewConfigureWidget::saveSettings( config ); | 84 | ViewConfigureWidget::saveSettings( config ); |
85 | 85 | ||
86 | mAdvancedPage->saveSettings( config ); | 86 | mAdvancedPage->saveSettings( config ); |
87 | } | 87 | } |
88 | 88 | ||
89 | //////////////////////// | 89 | //////////////////////// |
90 | // CardViewLookNFeelPage | 90 | // CardViewLookNFeelPage |
91 | CardViewLookNFeelPage::CardViewLookNFeelPage( QWidget *parent, const char *name ) | 91 | CardViewLookNFeelPage::CardViewLookNFeelPage( QWidget *parent, const char *name ) |
92 | : QVBox( parent, name ) | 92 | : QVBox( parent, name ) |
93 | { | 93 | { |
94 | initGUI(); | 94 | initGUI(); |
95 | } | 95 | } |
96 | 96 | ||
97 | CardViewLookNFeelPage::~CardViewLookNFeelPage() | 97 | CardViewLookNFeelPage::~CardViewLookNFeelPage() |
98 | { | 98 | { |
99 | } | 99 | } |
100 | 100 | ||
101 | void CardViewLookNFeelPage::restoreSettings( KConfig *config ) | 101 | void CardViewLookNFeelPage::restoreSettings( KConfig *config ) |
102 | { | 102 | { |
103 | // colors | 103 | // colors |
104 | cbEnableCustomColors->setChecked( config->readBoolEntry( "EnableCustomColors", false ) ); | 104 | cbEnableCustomColors->setChecked( config->readBoolEntry( "EnableCustomColors", false ) ); |
105 | QColor c; | 105 | QColor c; |
106 | qDebug("CardViewLookNFeelPage::restoreSettings make base color configurable"); | 106 | qDebug("CardViewLookNFeelPage::restoreSettings make base color configurable"); |
107 | 107 | ||
108 | #ifndef KAB_EMBEDDED | 108 | #ifndef KAB_EMBEDDED |
109 | c = KGlobalSettings::baseColor(); | 109 | c = KGlobalSettings::baseColor(); |
110 | #else //KAB_EMBEDDED | 110 | #else //KAB_EMBEDDED |
111 | c = QColor(0,0,0); | 111 | c = QColor(0,0,0); |
112 | #endif //KAB_EMBEDDED | 112 | #endif //KAB_EMBEDDED |
113 | 113 | ||
114 | c = colorGroup().background(); | ||
114 | lbColors->insertItem( new ColorListItem( i18n("Background Color"), | 115 | lbColors->insertItem( new ColorListItem( i18n("Background Color"), |
115 | config->readColorEntry( "BackgroundColor", &c ) ) ); | 116 | config->readColorEntry( "BackgroundColor", &c ) ) ); |
116 | c = colorGroup().foreground(); | 117 | c = colorGroup().foreground(); |
117 | lbColors->insertItem( new ColorListItem( i18n("Text Color"), | 118 | lbColors->insertItem( new ColorListItem( i18n("Text Color"), |
118 | config->readColorEntry( "TextColor", &c ) ) ); | 119 | config->readColorEntry( "TextColor", &c ) ) ); |
119 | c = colorGroup().button(); | 120 | c = colorGroup().button(); |
120 | lbColors->insertItem( new ColorListItem( i18n("Header, Border and Separator Color"), | 121 | lbColors->insertItem( new ColorListItem( i18n("Header, Border and Separator Color"), |
121 | config->readColorEntry( "HeaderColor", &c ) ) ); | 122 | config->readColorEntry( "HeaderColor", &c ) ) ); |
122 | c = colorGroup().buttonText(); | 123 | c = colorGroup().buttonText(); |
123 | lbColors->insertItem( new ColorListItem( i18n("Header Text Color"), | 124 | lbColors->insertItem( new ColorListItem( i18n("Header Text Color"), |
124 | config->readColorEntry( "HeaderTextColor", &c ) ) ); | 125 | config->readColorEntry( "HeaderTextColor", &c ) ) ); |
125 | c = colorGroup().highlight(); | 126 | c = colorGroup().highlight(); |
126 | lbColors->insertItem( new ColorListItem( i18n("Highlight Color"), | 127 | lbColors->insertItem( new ColorListItem( i18n("Highlight Color"), |
127 | config->readColorEntry( "HighlightColor", &c ) ) ); | 128 | config->readColorEntry( "HighlightColor", &c ) ) ); |
128 | c = colorGroup().highlightedText(); | 129 | c = colorGroup().highlightedText(); |
129 | lbColors->insertItem( new ColorListItem( i18n("Highlighted Text Color"), | 130 | lbColors->insertItem( new ColorListItem( i18n("Highlighted Text Color"), |
130 | config->readColorEntry( "HighlightedTextColor", &c ) ) ); | 131 | config->readColorEntry( "HighlightedTextColor", &c ) ) ); |
131 | 132 | ||
132 | enableColors(); | 133 | enableColors(); |
133 | 134 | ||
134 | // fonts | 135 | // fonts |
135 | QFont fnt = font(); | 136 | QFont fnt = font(); |
136 | updateFontLabel( config->readFontEntry( "TextFont", &fnt ), (QLabel*)lTextFont ); | 137 | updateFontLabel( config->readFontEntry( "TextFont", &fnt ), (QLabel*)lTextFont ); |
137 | fnt.setBold( true ); | 138 | fnt.setBold( true ); |
138 | updateFontLabel( config->readFontEntry( "HeaderFont", &fnt ), (QLabel*)lHeaderFont ); | 139 | updateFontLabel( config->readFontEntry( "HeaderFont", &fnt ), (QLabel*)lHeaderFont ); |
139 | cbEnableCustomFonts->setChecked( config->readBoolEntry( "EnableCustomFonts", false ) ); | 140 | cbEnableCustomFonts->setChecked( config->readBoolEntry( "EnableCustomFonts", false ) ); |
140 | enableFonts(); | 141 | enableFonts(); |
141 | 142 | ||
142 | // layout | 143 | // layout |
143 | sbMargin->setValue( config->readNumEntry( "ItemMargin", 0 ) ); | 144 | sbMargin->setValue( config->readNumEntry( "ItemMargin", 0 ) ); |
144 | sbSpacing->setValue( config->readNumEntry( "ItemSpacing", 10 ) ); | 145 | sbSpacing->setValue( config->readNumEntry( "ItemSpacing", 10 ) ); |
145 | sbSepWidth->setValue( config->readNumEntry( "SeparatorWidth", 2 ) ); | 146 | sbSepWidth->setValue( config->readNumEntry( "SeparatorWidth", 2 ) ); |
146 | cbDrawSeps->setChecked( config->readBoolEntry( "DrawSeparators", true ) ); | 147 | cbDrawSeps->setChecked( config->readBoolEntry( "DrawSeparators", true ) ); |
147 | cbDrawBorders->setChecked( config->readBoolEntry( "DrawBorder", true ) ); | 148 | cbDrawBorders->setChecked( config->readBoolEntry( "DrawBorder", true ) ); |
148 | 149 | ||
149 | // behaviour | 150 | // behaviour |
150 | cbShowFieldLabels->setChecked( config->readBoolEntry( "DrawFieldLabels", false ) ); | 151 | cbShowFieldLabels->setChecked( config->readBoolEntry( "DrawFieldLabels", false ) ); |
151 | cbShowEmptyFields->setChecked( config->readBoolEntry( "ShowEmptyFields", false ) ); | 152 | cbShowEmptyFields->setChecked( config->readBoolEntry( "ShowEmptyFields", false ) ); |
152 | } | 153 | } |
153 | 154 | ||
154 | void CardViewLookNFeelPage::saveSettings( KConfig *config ) | 155 | void CardViewLookNFeelPage::saveSettings( KConfig *config ) |
155 | { | 156 | { |
156 | // colors | 157 | // colors |
157 | config->writeEntry( "EnableCustomColors", cbEnableCustomColors->isChecked() ); | 158 | config->writeEntry( "EnableCustomColors", cbEnableCustomColors->isChecked() ); |
158 | if ( cbEnableCustomColors->isChecked() ) // ?? - Hmmm. | 159 | if ( cbEnableCustomColors->isChecked() ) // ?? - Hmmm. |
159 | { | 160 | { |
160 | config->writeEntry( "BackgroundColor", lbColors->color( 0 ) ); | 161 | config->writeEntry( "BackgroundColor", lbColors->color( 0 ) ); |
161 | config->writeEntry( "TextColor", lbColors->color( 1 ) ); | 162 | config->writeEntry( "TextColor", lbColors->color( 1 ) ); |