Changeset View
Changeset View
Standalone View
Standalone View
mainWindow/kpMainWindow_Text.cpp
Show First 20 Lines • Show All 144 Lines • ▼ Show 20 Line(s) | |||||
145 | // private slot | 145 | // private slot | ||
146 | void kpMainWindow::slotTextFontFamilyChanged () | 146 | void kpMainWindow::slotTextFontFamilyChanged () | ||
147 | { | 147 | { | ||
148 | qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextFontFamilyChanged() alive=" | 148 | qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextFontFamilyChanged() alive=" | ||
149 | << d->isFullyConstructed | 149 | << d->isFullyConstructed | ||
150 | << "fontFamily=" | 150 | << "fontFamily=" | ||
151 | << d->actionTextFontFamily->font () | 151 | << d->actionTextFontFamily->font () | ||
152 | << "action.currentItem=" | 152 | << "action.currentItem=" | ||
153 | << d->actionTextFontFamily->currentItem () | 153 | << d->actionTextFontFamily->currentItem (); | ||
154 | << endl; | | |||
155 | 154 | | |||
156 | if (!d->isFullyConstructed) | 155 | if (!d->isFullyConstructed) { | ||
157 | return; | 156 | return; | ||
157 | } | ||||
158 | 158 | | |||
159 | if (d->toolText && d->toolText->hasBegun ()) | 159 | if (d->toolText && d->toolText->hasBegun ()) | ||
160 | { | 160 | { | ||
161 | toolEndShape (); | 161 | toolEndShape (); | ||
162 | d->toolText->slotFontFamilyChanged (d->actionTextFontFamily->font (), | 162 | d->toolText->slotFontFamilyChanged (d->actionTextFontFamily->font (), | ||
163 | d->textOldFontFamily); | 163 | d->textOldFontFamily); | ||
164 | } | 164 | } | ||
165 | 165 | | |||
166 | // Since editable KSelectAction's steal focus from view, switch back to mainView | 166 | // Since editable KSelectAction's steal focus from view, switch back to mainView | ||
167 | // TODO: back to the last view | 167 | // TODO: back to the last view | ||
168 | if (d->mainView) | 168 | if (d->mainView) { | ||
169 | d->mainView->setFocus (); | 169 | d->mainView->setFocus (); | ||
170 | } | ||||
170 | 171 | | |||
171 | KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText); | 172 | KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText); | ||
172 | cfg.writeEntry (kpSettingFontFamily, d->actionTextFontFamily->font ()); | 173 | cfg.writeEntry (kpSettingFontFamily, d->actionTextFontFamily->font ()); | ||
173 | cfg.sync (); | 174 | cfg.sync (); | ||
174 | 175 | | |||
175 | d->textOldFontFamily = d->actionTextFontFamily->font (); | 176 | d->textOldFontFamily = d->actionTextFontFamily->font (); | ||
176 | } | 177 | } | ||
177 | 178 | | |||
178 | // private slot | 179 | // private slot | ||
179 | void kpMainWindow::slotTextFontSizeChanged () | 180 | void kpMainWindow::slotTextFontSizeChanged () | ||
180 | { | 181 | { | ||
181 | qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextFontSizeChanged() alive=" | 182 | qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextFontSizeChanged() alive=" | ||
182 | << d->isFullyConstructed | 183 | << d->isFullyConstructed | ||
183 | << " fontSize=" | 184 | << " fontSize=" | ||
184 | << d->actionTextFontSize->fontSize () | 185 | << d->actionTextFontSize->fontSize (); | ||
185 | << endl; | | |||
186 | 186 | | |||
187 | if (!d->isFullyConstructed) | 187 | if (!d->isFullyConstructed) { | ||
188 | return; | 188 | return; | ||
189 | } | ||||
189 | 190 | | |||
190 | if (d->toolText && d->toolText->hasBegun ()) | 191 | if (d->toolText && d->toolText->hasBegun ()) | ||
191 | { | 192 | { | ||
192 | toolEndShape (); | 193 | toolEndShape (); | ||
193 | d->toolText->slotFontSizeChanged (d->actionTextFontSize->fontSize (), | 194 | d->toolText->slotFontSizeChanged (d->actionTextFontSize->fontSize (), | ||
194 | d->textOldFontSize); | 195 | d->textOldFontSize); | ||
195 | } | 196 | } | ||
196 | 197 | | |||
197 | // Since editable KSelectAction's steal focus from view, switch back to mainView | 198 | // Since editable KSelectAction's steal focus from view, switch back to mainView | ||
198 | // TODO: back to the last view | 199 | // TODO: back to the last view | ||
199 | if (d->mainView) | 200 | if (d->mainView) { | ||
200 | d->mainView->setFocus (); | 201 | d->mainView->setFocus (); | ||
202 | } | ||||
201 | 203 | | |||
202 | KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText); | 204 | KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText); | ||
203 | cfg.writeEntry (kpSettingFontSize, d->actionTextFontSize->fontSize ()); | 205 | cfg.writeEntry (kpSettingFontSize, d->actionTextFontSize->fontSize ()); | ||
204 | cfg.sync (); | 206 | cfg.sync (); | ||
205 | 207 | | |||
206 | d->textOldFontSize = d->actionTextFontSize->fontSize (); | 208 | d->textOldFontSize = d->actionTextFontSize->fontSize (); | ||
207 | } | 209 | } | ||
208 | 210 | | |||
209 | // private slot | 211 | // private slot | ||
210 | void kpMainWindow::slotTextBoldChanged () | 212 | void kpMainWindow::slotTextBoldChanged () | ||
211 | { | 213 | { | ||
212 | qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextFontBoldChanged() alive=" | 214 | qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextFontBoldChanged() alive=" | ||
213 | << d->isFullyConstructed | 215 | << d->isFullyConstructed | ||
214 | << " bold=" | 216 | << " bold=" | ||
215 | << d->actionTextBold->isChecked () | 217 | << d->actionTextBold->isChecked (); | ||
216 | << endl; | | |||
217 | 218 | | |||
218 | if (!d->isFullyConstructed) | 219 | if (!d->isFullyConstructed) { | ||
219 | return; | 220 | return; | ||
221 | } | ||||
220 | 222 | | |||
221 | if (d->toolText && d->toolText->hasBegun ()) | 223 | if (d->toolText && d->toolText->hasBegun ()) | ||
222 | { | 224 | { | ||
223 | toolEndShape (); | 225 | toolEndShape (); | ||
224 | d->toolText->slotBoldChanged (d->actionTextBold->isChecked ()); | 226 | d->toolText->slotBoldChanged (d->actionTextBold->isChecked ()); | ||
225 | } | 227 | } | ||
226 | 228 | | |||
227 | KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText); | 229 | KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText); | ||
228 | cfg.writeEntry (kpSettingBold, d->actionTextBold->isChecked ()); | 230 | cfg.writeEntry (kpSettingBold, d->actionTextBold->isChecked ()); | ||
229 | cfg.sync (); | 231 | cfg.sync (); | ||
230 | } | 232 | } | ||
231 | 233 | | |||
232 | // private slot | 234 | // private slot | ||
233 | void kpMainWindow::slotTextItalicChanged () | 235 | void kpMainWindow::slotTextItalicChanged () | ||
234 | { | 236 | { | ||
235 | qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextFontItalicChanged() alive=" | 237 | qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextFontItalicChanged() alive=" | ||
236 | << d->isFullyConstructed | 238 | << d->isFullyConstructed | ||
237 | << " bold=" | 239 | << " bold=" | ||
238 | << d->actionTextItalic->isChecked () | 240 | << d->actionTextItalic->isChecked (); | ||
239 | << endl; | | |||
240 | 241 | | |||
241 | if (!d->isFullyConstructed) | 242 | if (!d->isFullyConstructed) { | ||
242 | return; | 243 | return; | ||
244 | } | ||||
243 | 245 | | |||
244 | if (d->toolText && d->toolText->hasBegun ()) | 246 | if (d->toolText && d->toolText->hasBegun ()) | ||
245 | { | 247 | { | ||
246 | toolEndShape (); | 248 | toolEndShape (); | ||
247 | d->toolText->slotItalicChanged (d->actionTextItalic->isChecked ()); | 249 | d->toolText->slotItalicChanged (d->actionTextItalic->isChecked ()); | ||
248 | } | 250 | } | ||
249 | 251 | | |||
250 | KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText); | 252 | KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText); | ||
251 | cfg.writeEntry (kpSettingItalic, d->actionTextItalic->isChecked ()); | 253 | cfg.writeEntry (kpSettingItalic, d->actionTextItalic->isChecked ()); | ||
252 | cfg.sync (); | 254 | cfg.sync (); | ||
253 | } | 255 | } | ||
254 | 256 | | |||
255 | // private slot | 257 | // private slot | ||
256 | void kpMainWindow::slotTextUnderlineChanged () | 258 | void kpMainWindow::slotTextUnderlineChanged () | ||
257 | { | 259 | { | ||
258 | qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextFontUnderlineChanged() alive=" | 260 | qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextFontUnderlineChanged() alive=" | ||
259 | << d->isFullyConstructed | 261 | << d->isFullyConstructed | ||
260 | << " underline=" | 262 | << " underline=" | ||
261 | << d->actionTextUnderline->isChecked () | 263 | << d->actionTextUnderline->isChecked (); | ||
262 | << endl; | | |||
263 | 264 | | |||
264 | if (!d->isFullyConstructed) | 265 | if (!d->isFullyConstructed) { | ||
265 | return; | 266 | return; | ||
267 | } | ||||
266 | 268 | | |||
267 | if (d->toolText && d->toolText->hasBegun ()) | 269 | if (d->toolText && d->toolText->hasBegun ()) | ||
268 | { | 270 | { | ||
269 | toolEndShape (); | 271 | toolEndShape (); | ||
270 | d->toolText->slotUnderlineChanged (d->actionTextUnderline->isChecked ()); | 272 | d->toolText->slotUnderlineChanged (d->actionTextUnderline->isChecked ()); | ||
271 | } | 273 | } | ||
272 | 274 | | |||
273 | KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText); | 275 | KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText); | ||
274 | cfg.writeEntry (kpSettingUnderline, d->actionTextUnderline->isChecked ()); | 276 | cfg.writeEntry (kpSettingUnderline, d->actionTextUnderline->isChecked ()); | ||
275 | cfg.sync (); | 277 | cfg.sync (); | ||
276 | } | 278 | } | ||
277 | 279 | | |||
278 | // private slot | 280 | // private slot | ||
279 | void kpMainWindow::slotTextStrikeThruChanged () | 281 | void kpMainWindow::slotTextStrikeThruChanged () | ||
280 | { | 282 | { | ||
281 | qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextStrikeThruChanged() alive=" | 283 | qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextStrikeThruChanged() alive=" | ||
282 | << d->isFullyConstructed | 284 | << d->isFullyConstructed | ||
283 | << " strikeThru=" | 285 | << " strikeThru=" | ||
284 | << d->actionTextStrikeThru->isChecked () | 286 | << d->actionTextStrikeThru->isChecked (); | ||
285 | << endl; | | |||
286 | 287 | | |||
287 | if (!d->isFullyConstructed) | 288 | if (!d->isFullyConstructed) { | ||
288 | return; | 289 | return; | ||
290 | } | ||||
289 | 291 | | |||
290 | if (d->toolText && d->toolText->hasBegun ()) | 292 | if (d->toolText && d->toolText->hasBegun ()) | ||
291 | { | 293 | { | ||
292 | toolEndShape (); | 294 | toolEndShape (); | ||
293 | d->toolText->slotStrikeThruChanged (d->actionTextStrikeThru->isChecked ()); | 295 | d->toolText->slotStrikeThruChanged (d->actionTextStrikeThru->isChecked ()); | ||
294 | } | 296 | } | ||
295 | 297 | | |||
296 | KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText); | 298 | KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText); | ||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |