| 364 | } |
| 365 | |
| 366 | void Window::createTextFormatsGroupBox() |
| 367 | { |
| 368 | textFormatsGroupBox = new QGroupBox(tr("Text Formats")); |
| 369 | |
| 370 | weekdayColorCombo = createColorComboBox(); |
| 371 | weekdayColorCombo->setCurrentIndex(weekdayColorCombo->findText(tr("Black"))); |
| 372 | |
| 373 | weekdayColorLabel = new QLabel(tr("&Weekday color:")); |
| 374 | weekdayColorLabel->setBuddy(weekdayColorCombo); |
| 375 | |
| 376 | weekendColorCombo = createColorComboBox(); |
| 377 | weekendColorCombo->setCurrentIndex(weekendColorCombo->findText(tr("Red"))); |
| 378 | |
| 379 | weekendColorLabel = new QLabel(tr("Week&end color:")); |
| 380 | weekendColorLabel->setBuddy(weekendColorCombo); |
| 381 | |
| 382 | headerTextFormatCombo = new QComboBox; |
| 383 | headerTextFormatCombo->addItem(tr("Bold")); |
| 384 | headerTextFormatCombo->addItem(tr("Italic")); |
| 385 | headerTextFormatCombo->addItem(tr("Plain")); |
| 386 | |
| 387 | headerTextFormatLabel = new QLabel(tr("&Header text:")); |
| 388 | headerTextFormatLabel->setBuddy(headerTextFormatCombo); |
| 389 | |
| 390 | firstFridayCheckBox = new QCheckBox(tr("&First Friday in blue")); |
| 391 | |
| 392 | mayFirstCheckBox = new QCheckBox(tr("May &1 in red")); |
| 393 | |
| 394 | connect(weekdayColorCombo, SIGNAL(currentIndexChanged(int)), this, |
| 395 | SLOT(weekdayFormatChanged())); |
| 396 | connect(weekendColorCombo, SIGNAL(currentIndexChanged(int)), this, |
| 397 | SLOT(weekendFormatChanged())); |
| 398 | connect(headerTextFormatCombo, SIGNAL(currentIndexChanged(QString)), this, |
| 399 | SLOT(reformatHeaders())); |
| 400 | connect(firstFridayCheckBox, SIGNAL(toggled(bool)), this, |
| 401 | SLOT(reformatCalendarPage())); |
| 402 | connect(mayFirstCheckBox, SIGNAL(toggled(bool)), this, |
| 403 | SLOT(reformatCalendarPage())); |
| 404 | |
| 405 | QHBoxLayout* checkBoxLayout = new QHBoxLayout; |
| 406 | checkBoxLayout->addWidget(firstFridayCheckBox); |
| 407 | checkBoxLayout->addStretch(); |
| 408 | checkBoxLayout->addWidget(mayFirstCheckBox); |
| 409 | |
| 410 | QGridLayout* outerLayout = new QGridLayout; |
| 411 | outerLayout->addWidget(weekdayColorLabel, 0, 0); |
| 412 | outerLayout->addWidget(weekdayColorCombo, 0, 1); |
| 413 | outerLayout->addWidget(weekendColorLabel, 1, 0); |
| 414 | outerLayout->addWidget(weekendColorCombo, 1, 1); |
| 415 | outerLayout->addWidget(headerTextFormatLabel, 2, 0); |
| 416 | outerLayout->addWidget(headerTextFormatCombo, 2, 1); |
| 417 | outerLayout->addLayout(checkBoxLayout, 3, 0, 1, 2); |
| 418 | textFormatsGroupBox->setLayout(outerLayout); |
| 419 | |
| 420 | weekdayFormatChanged(); |
| 421 | weekendFormatChanged(); |
| 422 | reformatHeaders(); |
| 423 | reformatCalendarPage(); |