Changeset View
Changeset View
Standalone View
Standalone View
src/HistorySizeWidget.cpp
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | 103 | } else if (aMode == Enum::UnlimitedHistory) { | |||
---|---|---|---|---|---|
104 | _ui->unlimitedHistoryButton->setChecked(true); | 104 | _ui->unlimitedHistoryButton->setChecked(true); | ||
105 | } | 105 | } | ||
106 | _ui->fixedSizeWarningWidget->setVisible(Enum::FixedSizeHistory == aMode); | 106 | _ui->fixedSizeWarningWidget->setVisible(Enum::FixedSizeHistory == aMode); | ||
107 | _ui->unlimitedWarningWidget->setVisible(Enum::UnlimitedHistory == aMode); | 107 | _ui->unlimitedWarningWidget->setVisible(Enum::UnlimitedHistory == aMode); | ||
108 | } | 108 | } | ||
109 | 109 | | |||
110 | Enum::HistoryModeEnum HistorySizeWidget::mode() const | 110 | Enum::HistoryModeEnum HistorySizeWidget::mode() const | ||
111 | { | 111 | { | ||
112 | if (_ui->noHistoryButton->isChecked()) { | 112 | return _ui->unlimitedHistoryButton->isChecked() ? Enum::UnlimitedHistory | ||
113 | return Enum::NoHistory; | 113 | : _ui->fixedSizeHistoryButton->isChecked() ? Enum::FixedSizeHistory | ||
114 | } else if (_ui->fixedSizeHistoryButton->isChecked()) { | 114 | : Enum::NoHistory; | ||
115 | return Enum::FixedSizeHistory; | | |||
116 | } else if (_ui->unlimitedHistoryButton->isChecked()) { | | |||
117 | return Enum::UnlimitedHistory; | | |||
118 | } | | |||
119 | | ||||
120 | Q_ASSERT(false); | | |||
121 | return Enum::NoHistory; | | |||
122 | } | 115 | } | ||
123 | 116 | | |||
124 | void HistorySizeWidget::setLineCount(int lines) | 117 | void HistorySizeWidget::setLineCount(int lines) | ||
125 | { | 118 | { | ||
126 | _ui->historyLineSpinner->setValue(lines); | 119 | _ui->historyLineSpinner->setValue(lines); | ||
127 | _ui->historyLineSpinner->setSingleStep(lines / 10); | 120 | _ui->historyLineSpinner->setSingleStep(lines / 10); | ||
128 | } | 121 | } | ||
129 | 122 | | |||
130 | int HistorySizeWidget::lineCount() const | 123 | int HistorySizeWidget::lineCount() const | ||
131 | { | 124 | { | ||
132 | return _ui->historyLineSpinner->value(); | 125 | return _ui->historyLineSpinner->value(); | ||
133 | } | 126 | } |