author | zautrix <zautrix> | 2005-08-17 17:09:57 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-17 17:09:57 (UTC) |
commit | b3de38d3c4c3935a3fa428eeb4ad97fa8c60c43a (patch) (unidiff) | |
tree | ed4d04abe2996cde745757632d8616b23a15670b /kaddressbook/views | |
parent | c21edc19916722f5dd4e939f1522d311a86411fd (diff) | |
download | kdepimpi-b3de38d3c4c3935a3fa428eeb4ad97fa8c60c43a.zip kdepimpi-b3de38d3c4c3935a3fa428eeb4ad97fa8c60c43a.tar.gz kdepimpi-b3de38d3c4c3935a3fa428eeb4ad97fa8c60c43a.tar.bz2 |
view select fix
-rw-r--r-- | kaddressbook/views/configuretableviewdialog.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kaddressbook/views/configuretableviewdialog.cpp b/kaddressbook/views/configuretableviewdialog.cpp index 0e36abd..c329cd9 100644 --- a/kaddressbook/views/configuretableviewdialog.cpp +++ b/kaddressbook/views/configuretableviewdialog.cpp | |||
@@ -46,129 +46,129 @@ | |||
46 | #endif //KAB_EMBEDDED | 46 | #endif //KAB_EMBEDDED |
47 | 47 | ||
48 | #include <kconfig.h> | 48 | #include <kconfig.h> |
49 | 49 | ||
50 | #include "colorlistbox.h" | 50 | #include "colorlistbox.h" |
51 | 51 | ||
52 | #include "configuretableviewdialog.h" | 52 | #include "configuretableviewdialog.h" |
53 | 53 | ||
54 | ConfigureTableViewWidget::ConfigureTableViewWidget( KABC::AddressBook *ab, | 54 | ConfigureTableViewWidget::ConfigureTableViewWidget( KABC::AddressBook *ab, |
55 | QWidget *parent, | 55 | QWidget *parent, |
56 | const char *name ) | 56 | const char *name ) |
57 | : ViewConfigureWidget( ab, parent, name ) | 57 | : ViewConfigureWidget( ab, parent, name ) |
58 | { | 58 | { |
59 | QWidget *page = addPage( i18n( "Look & Feel" ), QString::null, | 59 | QWidget *page = addPage( i18n( "Look & Feel" ), QString::null, |
60 | KGlobal::iconLoader()->loadIcon( "looknfeel", | 60 | KGlobal::iconLoader()->loadIcon( "looknfeel", |
61 | KIcon::Panel ) ); | 61 | KIcon::Panel ) ); |
62 | 62 | ||
63 | mPage = new LookAndFeelPage( page ); | 63 | mPage = new LookAndFeelPage( page ); |
64 | } | 64 | } |
65 | 65 | ||
66 | ConfigureTableViewWidget::~ConfigureTableViewWidget() | 66 | ConfigureTableViewWidget::~ConfigureTableViewWidget() |
67 | { | 67 | { |
68 | } | 68 | } |
69 | 69 | ||
70 | void ConfigureTableViewWidget::restoreSettings( KConfig *config ) | 70 | void ConfigureTableViewWidget::restoreSettings( KConfig *config ) |
71 | { | 71 | { |
72 | ViewConfigureWidget::restoreSettings( config ); | 72 | ViewConfigureWidget::restoreSettings( config ); |
73 | 73 | ||
74 | mPage->restoreSettings( config ); | 74 | mPage->restoreSettings( config ); |
75 | } | 75 | } |
76 | 76 | ||
77 | void ConfigureTableViewWidget::saveSettings( KConfig *config ) | 77 | void ConfigureTableViewWidget::saveSettings( KConfig *config ) |
78 | { | 78 | { |
79 | ViewConfigureWidget::saveSettings( config ); | 79 | ViewConfigureWidget::saveSettings( config ); |
80 | 80 | ||
81 | mPage->saveSettings( config ); | 81 | mPage->saveSettings( config ); |
82 | } | 82 | } |
83 | 83 | ||
84 | 84 | ||
85 | 85 | ||
86 | LookAndFeelPage::LookAndFeelPage(QWidget *parent, const char *name) | 86 | LookAndFeelPage::LookAndFeelPage(QWidget *parent, const char *name) |
87 | : QVBox(parent, name) | 87 | : QVBox(parent, name) |
88 | { | 88 | { |
89 | initGUI(); | 89 | initGUI(); |
90 | 90 | ||
91 | // Set initial state | 91 | // Set initial state |
92 | enableBackgroundToggled(mBackgroundBox->isChecked()); | 92 | enableBackgroundToggled(mBackgroundBox->isChecked()); |
93 | } | 93 | } |
94 | 94 | ||
95 | void LookAndFeelPage::restoreSettings( KConfig *config ) | 95 | void LookAndFeelPage::restoreSettings( KConfig *config ) |
96 | { | 96 | { |
97 | mAlternateButton->setChecked(config->readBoolEntry("ABackground", true)); | 97 | mAlternateButton->setChecked(config->readBoolEntry("ABackground", true)); |
98 | mLineButton->setChecked(config->readBoolEntry("SingleLine", false)); | 98 | mLineButton->setChecked(config->readBoolEntry("SingleLine", false)); |
99 | mToolTipBox->setChecked(config->readBoolEntry("ToolTips", true)); | 99 | mToolTipBox->setChecked(config->readBoolEntry("ToolTips", true)); |
100 | 100 | ||
101 | if (!mAlternateButton->isChecked() & !mLineButton->isChecked()) | 101 | if (!mAlternateButton->isChecked() & !mLineButton->isChecked()) |
102 | mNoneButton->setChecked(true); | 102 | mNoneButton->setChecked(true); |
103 | 103 | ||
104 | mBackgroundBox->setChecked(config->readBoolEntry("Background", false)); | 104 | mBackgroundBox->setChecked(config->readBoolEntry("Background", false)); |
105 | mBackgroundName->lineEdit()->setText(config->readEntry("BackgroundName")); | 105 | mBackgroundName->lineEdit()->setText(config->readEntry("BackgroundName")); |
106 | 106 | ||
107 | // colors | 107 | // colors |
108 | cbEnableCustomColors->setChecked( config->readBoolEntry( "EnableCustomColors", false ) ); | 108 | cbEnableCustomColors->setChecked( config->readBoolEntry( "EnableCustomColors", false ) ); |
109 | QColor c; | 109 | QColor c; |
110 | qDebug("LookAndFeelPage::restoreSettings make base color configurable"); | 110 | //qDebug("LookAndFeelPage::restoreSettings make base color configurable"); |
111 | 111 | ||
112 | #ifndef KAB_EMBEDDED | 112 | #ifndef KAB_EMBEDDED |
113 | c = KGlobalSettings::baseColor(); | 113 | c = KGlobalSettings::baseColor(); |
114 | #else //KAB_EMBEDDED | 114 | #else //KAB_EMBEDDED |
115 | c = QColor(0,0,0); | 115 | c = QColor(0,0,0); |
116 | #endif //KAB_EMBEDDED | 116 | #endif //KAB_EMBEDDED |
117 | 117 | ||
118 | c = colorGroup().background(); | 118 | c = colorGroup().background(); |
119 | lbColors->insertItem( new ColorListItem( i18n("Background Color"), | 119 | lbColors->insertItem( new ColorListItem( i18n("Background Color"), |
120 | config->readColorEntry( "BackgroundColor", &c ) ) ); | 120 | config->readColorEntry( "BackgroundColor", &c ) ) ); |
121 | c = colorGroup().foreground(); | 121 | c = colorGroup().foreground(); |
122 | lbColors->insertItem( new ColorListItem( i18n("Text Color"), | 122 | lbColors->insertItem( new ColorListItem( i18n("Text Color"), |
123 | config->readColorEntry( "TextColor", &c ) ) ); | 123 | config->readColorEntry( "TextColor", &c ) ) ); |
124 | c = colorGroup().button(); | 124 | c = colorGroup().button(); |
125 | lbColors->insertItem( new ColorListItem( i18n("Header Background Color"), | 125 | lbColors->insertItem( new ColorListItem( i18n("Header Background Color"), |
126 | config->readColorEntry( "HeaderBackgroundColor", &c ) ) ); | 126 | config->readColorEntry( "HeaderBackgroundColor", &c ) ) ); |
127 | c = colorGroup().buttonText(); | 127 | c = colorGroup().buttonText(); |
128 | lbColors->insertItem( new ColorListItem( i18n("Header Text Color"), | 128 | lbColors->insertItem( new ColorListItem( i18n("Header Text Color"), |
129 | config->readColorEntry( "HeaderTextColor", &c ) ) ); | 129 | config->readColorEntry( "HeaderTextColor", &c ) ) ); |
130 | c = colorGroup().highlight(); | 130 | c = colorGroup().highlight(); |
131 | lbColors->insertItem( new ColorListItem( i18n("Highlight Color"), | 131 | lbColors->insertItem( new ColorListItem( i18n("Highlight Color"), |
132 | config->readColorEntry( "HighlightColor", &c ) ) ); | 132 | config->readColorEntry( "HighlightColor", &c ) ) ); |
133 | c = colorGroup().highlightedText(); | 133 | c = colorGroup().highlightedText(); |
134 | lbColors->insertItem( new ColorListItem( i18n("Highlighted Text Color"), | 134 | lbColors->insertItem( new ColorListItem( i18n("Highlighted Text Color"), |
135 | config->readColorEntry( "HighlightedTextColor", &c ) ) ); | 135 | config->readColorEntry( "HighlightedTextColor", &c ) ) ); |
136 | c = colorGroup().background(); | 136 | c = colorGroup().background(); |
137 | lbColors->insertItem( new ColorListItem( i18n("Alternating Background Color"), | 137 | lbColors->insertItem( new ColorListItem( i18n("Alternating Background Color"), |
138 | config->readColorEntry( "AlternatingBackgroundColor", &c ) ) ); | 138 | config->readColorEntry( "AlternatingBackgroundColor", &c ) ) ); |
139 | 139 | ||
140 | enableColors(); | 140 | enableColors(); |
141 | 141 | ||
142 | // fonts | 142 | // fonts |
143 | QFont fnt = font(); | 143 | QFont fnt = font(); |
144 | updateFontLabel( config->readFontEntry( "TextFont", &fnt ), (QLabel*)lTextFont ); | 144 | updateFontLabel( config->readFontEntry( "TextFont", &fnt ), (QLabel*)lTextFont ); |
145 | fnt.setBold( true ); | 145 | fnt.setBold( true ); |
146 | updateFontLabel( config->readFontEntry( "HeaderFont", &fnt ), (QLabel*)lHeaderFont ); | 146 | updateFontLabel( config->readFontEntry( "HeaderFont", &fnt ), (QLabel*)lHeaderFont ); |
147 | cbEnableCustomFonts->setChecked( config->readBoolEntry( "EnableCustomFonts", false ) ); | 147 | cbEnableCustomFonts->setChecked( config->readBoolEntry( "EnableCustomFonts", false ) ); |
148 | enableFonts(); | 148 | enableFonts(); |
149 | 149 | ||
150 | } | 150 | } |
151 | 151 | ||
152 | void LookAndFeelPage::saveSettings( KConfig *config ) | 152 | void LookAndFeelPage::saveSettings( KConfig *config ) |
153 | { | 153 | { |
154 | config->writeEntry("ABackground", mAlternateButton->isChecked()); | 154 | config->writeEntry("ABackground", mAlternateButton->isChecked()); |
155 | config->writeEntry("SingleLine", mLineButton->isChecked()); | 155 | config->writeEntry("SingleLine", mLineButton->isChecked()); |
156 | config->writeEntry("ToolTips", mToolTipBox->isChecked()); | 156 | config->writeEntry("ToolTips", mToolTipBox->isChecked()); |
157 | config->writeEntry("Background", mBackgroundBox->isChecked()); | 157 | config->writeEntry("Background", mBackgroundBox->isChecked()); |
158 | config->writeEntry("BackgroundName", mBackgroundName->lineEdit()->text()); | 158 | config->writeEntry("BackgroundName", mBackgroundName->lineEdit()->text()); |
159 | 159 | ||
160 | // colors | 160 | // colors |
161 | config->writeEntry( "EnableCustomColors", cbEnableCustomColors->isChecked() ); | 161 | config->writeEntry( "EnableCustomColors", cbEnableCustomColors->isChecked() ); |
162 | if ( cbEnableCustomColors->isChecked() ) // ?? - Hmmm. | 162 | if ( cbEnableCustomColors->isChecked() ) // ?? - Hmmm. |
163 | { | 163 | { |
164 | config->writeEntry( "BackgroundColor", lbColors->color( 0 ) ); | 164 | config->writeEntry( "BackgroundColor", lbColors->color( 0 ) ); |
165 | config->writeEntry( "TextColor", lbColors->color( 1 ) ); | 165 | config->writeEntry( "TextColor", lbColors->color( 1 ) ); |
166 | config->writeEntry( "HeaderBackgroundColor", lbColors->color( 2 ) ); | 166 | config->writeEntry( "HeaderBackgroundColor", lbColors->color( 2 ) ); |
167 | config->writeEntry( "HeaderTextColor", lbColors->color( 3 ) ); | 167 | config->writeEntry( "HeaderTextColor", lbColors->color( 3 ) ); |
168 | config->writeEntry( "HighlightColor", lbColors->color( 4 ) ); | 168 | config->writeEntry( "HighlightColor", lbColors->color( 4 ) ); |
169 | config->writeEntry( "HighlightedTextColor", lbColors->color( 5 ) ); | 169 | config->writeEntry( "HighlightedTextColor", lbColors->color( 5 ) ); |
170 | config->writeEntry( "AlternatingBackgroundColor", lbColors->color( 6 ) ); | 170 | config->writeEntry( "AlternatingBackgroundColor", lbColors->color( 6 ) ); |
171 | } | 171 | } |
172 | // fonts | 172 | // fonts |
173 | config->writeEntry( "EnableCustomFonts", cbEnableCustomFonts->isChecked() ); | 173 | config->writeEntry( "EnableCustomFonts", cbEnableCustomFonts->isChecked() ); |
174 | if ( cbEnableCustomFonts->isChecked() ) | 174 | if ( cbEnableCustomFonts->isChecked() ) |