comparison src/settingsdialog.cpp @ 634:58ac1b197666

* Added setting to show history automatically when it changes (defaults to true)
author Sam Izzo <sam@humbug.net>
date Mon, 27 Aug 2012 01:45:26 +1000
parents db62a0cb3037
children 046ad99a4230
comparison
equal deleted inserted replaced
633:db62a0cb3037 634:58ac1b197666
85 lookLayout->addWidget(m_showIconLabels, row++, 0, 1, 2); 85 lookLayout->addWidget(m_showIconLabels, row++, 0, 1, 2);
86 86
87 m_showExtraText = new QCheckBox(tr("Show long descriptions for file status headings")); 87 m_showExtraText = new QCheckBox(tr("Show long descriptions for file status headings"));
88 lookLayout->addWidget(m_showExtraText, row++, 0, 1, 2); 88 lookLayout->addWidget(m_showExtraText, row++, 0, 1, 2);
89 89
90 m_showHistoryAutomatically = new QCheckBox(tr("Switch to history tab automatically when history changes"));
91 lookLayout->addWidget(m_showHistoryAutomatically, row++, 0, 1, 2);
92
90 #ifdef NOT_IMPLEMENTED_YET 93 #ifdef NOT_IMPLEMENTED_YET
91 lookLayout->addWidget(new QLabel(tr("Place the work and history views")), row, 0); 94 lookLayout->addWidget(new QLabel(tr("Place the work and history views")), row, 0);
92 m_workHistoryArrangement = new QComboBox(); 95 m_workHistoryArrangement = new QComboBox();
93 m_workHistoryArrangement->addItem(tr("In separate tabs")); 96 m_workHistoryArrangement->addItem(tr("In separate tabs"));
94 m_workHistoryArrangement->addItem(tr("Side-by-side in a single pane")); 97 m_workHistoryArrangement->addItem(tr("Side-by-side in a single pane"));
415 DEBUG << "SettingsDialog::clear" << endl; 418 DEBUG << "SettingsDialog::clear" << endl;
416 QSettings settings; 419 QSettings settings;
417 settings.beginGroup("Presentation"); 420 settings.beginGroup("Presentation");
418 settings.remove("showiconlabels"); 421 settings.remove("showiconlabels");
419 settings.remove("showhelpfultext"); 422 settings.remove("showhelpfultext");
423 settings.remove("showHistoryAutomatically");
420 settings.remove("dateformat"); 424 settings.remove("dateformat");
421 settings.endGroup(); 425 settings.endGroup();
422 settings.beginGroup("Locations"); 426 settings.beginGroup("Locations");
423 settings.remove("hgbinary"); 427 settings.remove("hgbinary");
424 settings.remove("extdiffbinary"); 428 settings.remove("extdiffbinary");
442 m_emailEdit->setText(settings.value("email").toString()); 446 m_emailEdit->setText(settings.value("email").toString());
443 settings.endGroup(); 447 settings.endGroup();
444 settings.beginGroup("Presentation"); 448 settings.beginGroup("Presentation");
445 m_showIconLabels->setChecked(settings.value("showiconlabels", true).toBool()); 449 m_showIconLabels->setChecked(settings.value("showiconlabels", true).toBool());
446 m_showExtraText->setChecked(settings.value("showhelpfultext", true).toBool()); 450 m_showExtraText->setChecked(settings.value("showhelpfultext", true).toBool());
451 m_showHistoryAutomatically->setChecked(settings.value("showHistoryAutomatically", true).toBool());
447 #ifdef NOT_IMPLEMENTED_YET 452 #ifdef NOT_IMPLEMENTED_YET
448 m_workHistoryArrangement->setCurrentIndex(settings.value("workhistoryarrangement", 0).toInt()); 453 m_workHistoryArrangement->setCurrentIndex(settings.value("workhistoryarrangement", 0).toInt());
449 #endif 454 #endif
450 m_dateFormat->setCurrentIndex(settings.value("dateformat", 0).toInt()); 455 m_dateFormat->setCurrentIndex(settings.value("dateformat", 0).toInt());
451 m_dateFrom->setDate(settings.value("datefrom", QDate(2000, 1, 1)).toDate()); 456 m_dateFrom->setDate(settings.value("datefrom", QDate(2000, 1, 1)).toDate());
483 b = m_showExtraText->isChecked(); 488 b = m_showExtraText->isChecked();
484 if (b != settings.value("showhelpfultext", true)) { 489 if (b != settings.value("showhelpfultext", true)) {
485 settings.setValue("showhelpfultext", b); 490 settings.setValue("showhelpfultext", b);
486 m_presentationChanged = true; 491 m_presentationChanged = true;
487 } 492 }
493 settings.setValue("showHistoryAutomatically", m_showHistoryAutomatically->isChecked());
488 int i; 494 int i;
489 #ifdef NOT_IMPLEMENTED_YET 495 #ifdef NOT_IMPLEMENTED_YET
490 i = m_workHistoryArrangement->currentIndex(); 496 i = m_workHistoryArrangement->currentIndex();
491 if (i != settings.value("workhistoryarrangement", 0)) { 497 if (i != settings.value("workhistoryarrangement", 0)) {
492 settings.setValue("workhistoryarrangement", i); 498 settings.setValue("workhistoryarrangement", i);