comparison src/settingsdialog.cpp @ 617:2d5b831c1a0a

Added new functionality to limit the total number of items shown in the graph. For projects with a fairly high number of commits, makes every action is very slow. Was added to the settings dialog to select a QDateEdit day from which the log is to be displayed.
author Mikel <mikel.fernandez@bqreaders.com>
date Tue, 24 Jul 2012 15:33:02 +0200
parents 864cf6bc6eff
children 5dc24f89b791
comparison
equal deleted inserted replaced
616:32b8f32f14a6 617:2d5b831c1a0a
25 #include <QSettings> 25 #include <QSettings>
26 #include <QDir> 26 #include <QDir>
27 #include <QFileDialog> 27 #include <QFileDialog>
28 #include <QMessageBox> 28 #include <QMessageBox>
29 #include <QTabWidget> 29 #include <QTabWidget>
30 #include <QCalendarWidget>
30 31
31 QString 32 QString
32 SettingsDialog::m_installPath; 33 SettingsDialog::m_installPath;
33 34
34 SettingsDialog::SettingsDialog(QWidget *parent) : 35 SettingsDialog::SettingsDialog(QWidget *parent) :
93 m_workHistoryArrangement->addItem(tr("Side-by-side in a single pane")); 94 m_workHistoryArrangement->addItem(tr("Side-by-side in a single pane"));
94 lookLayout->addWidget(m_workHistoryArrangement, row++, 1, Qt::AlignLeft); 95 lookLayout->addWidget(m_workHistoryArrangement, row++, 1, Qt::AlignLeft);
95 lookLayout->setColumnStretch(1, 20); 96 lookLayout->setColumnStretch(1, 20);
96 #endif 97 #endif
97 98
99 lookLayout->addWidget(new QLabel(tr("History timeline from")), row, 0);
100 m_dateFrom = new QDateEdit();
101 m_dateFrom->setCalendarPopup(true);
102 lookLayout->addWidget(m_dateFrom, row++, 1, Qt::AlignLeft);
103
98 lookLayout->addWidget(new QLabel(tr("Label the history timeline with")), row, 0); 104 lookLayout->addWidget(new QLabel(tr("Label the history timeline with")), row, 0);
99 m_dateFormat = new QComboBox(); 105 m_dateFormat = new QComboBox();
100 m_dateFormat->addItem(tr("Ages, for example \"5 weeks ago\"")); 106 m_dateFormat->addItem(tr("Ages, for example \"5 weeks ago\""));
101 m_dateFormat->addItem(tr("Dates, for example \"2010-06-23\"")); 107 m_dateFormat->addItem(tr("Dates, for example \"2010-06-23\""));
102 lookLayout->addWidget(m_dateFormat, row++, 1, Qt::AlignLeft); 108 lookLayout->addWidget(m_dateFormat, row++, 1, Qt::AlignLeft);
103 lookLayout->setColumnStretch(1, 20); 109
104 110 lookLayout->setColumnStretch(1, 10);
105 lookLayout->setRowStretch(row, 20); 111 lookLayout->setRowStretch(row, 20);
106 112
107 113
108 QWidget *pathsBox = new QWidget; 114 QWidget *pathsBox = new QWidget;
109 m_tabs->addTab(pathsBox, tr("System application locations")); 115 m_tabs->addTab(pathsBox, tr("System application locations"));
429 m_showExtraText->setChecked(settings.value("showhelpfultext", true).toBool()); 435 m_showExtraText->setChecked(settings.value("showhelpfultext", true).toBool());
430 #ifdef NOT_IMPLEMENTED_YET 436 #ifdef NOT_IMPLEMENTED_YET
431 m_workHistoryArrangement->setCurrentIndex(settings.value("workhistoryarrangement", 0).toInt()); 437 m_workHistoryArrangement->setCurrentIndex(settings.value("workhistoryarrangement", 0).toInt());
432 #endif 438 #endif
433 m_dateFormat->setCurrentIndex(settings.value("dateformat", 0).toInt()); 439 m_dateFormat->setCurrentIndex(settings.value("dateformat", 0).toInt());
440 m_dateFrom->setDate(settings.value("datefrom", QDate(2000, 1, 1)).toDate());
434 settings.endGroup(); 441 settings.endGroup();
435 settings.beginGroup("Locations"); 442 settings.beginGroup("Locations");
436 m_hgPathLabel->setText(settings.value("hgbinary").toString()); 443 m_hgPathLabel->setText(settings.value("hgbinary").toString());
437 m_diffPathLabel->setText(settings.value("extdiffbinary").toString()); 444 m_diffPathLabel->setText(settings.value("extdiffbinary").toString());
438 m_mergePathLabel->setText(settings.value("mergebinary").toString()); 445 m_mergePathLabel->setText(settings.value("mergebinary").toString());
476 i = m_dateFormat->currentIndex(); 483 i = m_dateFormat->currentIndex();
477 if (i != settings.value("dateformat", 0)) { 484 if (i != settings.value("dateformat", 0)) {
478 settings.setValue("dateformat", i); 485 settings.setValue("dateformat", i);
479 m_presentationChanged = true; 486 m_presentationChanged = true;
480 } 487 }
488 if(settings.value("datefrom") != m_dateFrom->date()){
489 settings.setValue("datefrom", m_dateFrom->date());
490 m_presentationChanged = true;
491 }
492
481 settings.endGroup(); 493 settings.endGroup();
482 settings.beginGroup("Locations"); 494 settings.beginGroup("Locations");
483 settings.setValue("hgbinary", m_hgPathLabel->text()); 495 settings.setValue("hgbinary", m_hgPathLabel->text());
484 settings.setValue("extdiffbinary", m_diffPathLabel->text()); 496 settings.setValue("extdiffbinary", m_diffPathLabel->text());
485 settings.setValue("mergebinary", m_mergePathLabel->text()); 497 settings.setValue("mergebinary", m_mergePathLabel->text());