*******************************************************************************/
-//Created by Mateusz Półrola
+//! \file SettingsWidget.cpp
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
#include "SettingsWidget.h"
#include <QDebug>
setWindowTitle(tr("Settings"));
+ initalizeUI();
+}
+
+void SettingsWidget::initalizeUI() {
verticalLayout = new QVBoxLayout;
setLayout(verticalLayout);
historySizeSpinBox = new QSpinBox;
searchResultSizeSpinBox = new QSpinBox;
+
limitTip = "Limit maximal number of finded words, affect only when "
- "searching in file.";
+ "searching in file";
searchResultSizeSpinBox->setToolTip(limitTip);
- spinBoxesFormLayout = new QFormLayout;
+ spinBoxesFormLayout = new QFormLayout;
spinBoxesFormLayout->addRow(tr("Search result size"),
searchResultSizeSpinBox);
-
spinBoxesFormLayout->addRow(tr("History size"),
historySizeSpinBox);
searchResultSizeSpinBox->setMinimum(0);
+ searchResultSizeSpinBox->setSpecialValueText(tr("Unlimited"));
historySizeSpinBox->setMinimum(1);
+ searchResultSizeSpinBox->setMaximum(500);
+ historySizeSpinBox->setMaximum(50);
+
#ifdef Q_WS_MAEMO_5
verticalLayout->addSpacing(20);
#endif
#ifndef Q_WS_MAEMO_5
_save = false;
#endif
+
settings = guiInterface->settings();
historySizeSpinBox->setValue(
QDialog::hideEvent(e);
#ifndef Q_WS_MAEMO_5
- if(settings && _save) {
+ if(settings && _save) {
#else
- if(settings && _changed &&
- QMessageBox::question(this, tr("Save"), tr("Do you want to save changes?"),
+ if(settings && _changed &&
+ QMessageBox::question(this,
+ tr("Save"),
+ tr("Do you want to save changes?"),
QMessageBox::Save, QMessageBox::Cancel) == QMessageBox::Save) {
#endif