40 QSettings settings(
"gecode.org",
"Gist");
41 hideFailed = settings.value(
"search/hideFailed",
true).toBool();
42 zoom = settings.value(
"search/zoom",
false).toBool();
43 copies = settings.value(
"search/copies",
false).toBool();
44 refresh = settings.value(
"search/refresh", 500).toInt();
45 refreshPause = settings.value(
"search/refreshPause", 0).toInt();
47 settings.value(
"smoothScrollAndZoom",
true).toBool();
54 new QCheckBox(tr(
"Hide failed subtrees automatically"));
57 new QCheckBox(tr(
"Automatic zoom enabled on start-up"));
60 new QCheckBox(tr(
"Smooth scrolling and zooming"));
63 QPushButton* defButton =
new QPushButton(tr(
"Defaults"));
64 QPushButton* cancelButton =
new QPushButton(tr(
"Cancel"));
65 QPushButton* okButton =
new QPushButton(tr(
"Ok"));
66 okButton->setDefault(
true);
67 QHBoxLayout* buttonLayout =
new QHBoxLayout();
68 buttonLayout->addWidget(defButton);
69 buttonLayout->addWidget(cancelButton);
70 buttonLayout->addWidget(okButton);
72 connect(cancelButton, SIGNAL(clicked()),
this, SLOT(reject()));
73 connect(defButton, SIGNAL(clicked()),
this, SLOT(
defaults()));
74 connect(okButton, SIGNAL(clicked()),
this, SLOT(
writeBack()));
76 QLabel* refreshLabel =
new QLabel(tr(
"Display refresh rate:"));
81 QHBoxLayout* refreshLayout =
new QHBoxLayout();
82 refreshLayout->addWidget(refreshLabel);
86 new QCheckBox(tr(
"Slow down search"));
91 connect(
slowBox, SIGNAL(stateChanged(
int)),
this,
95 new QCheckBox(tr(
"Move cursor during search"));
98 QVBoxLayout* layout =
new QVBoxLayout();
102 layout->addLayout(refreshLayout);
106 QTabWidget* tabs =
new QTabWidget;
107 QWidget* page1 =
new QWidget;
108 page1->setLayout(layout);
109 tabs->addTab(page1,
"Drawing");
111 QLabel* cdlabel =
new QLabel(tr(
"Commit distance:"));
112 cdBox =
new QSpinBox();
113 cdBox->setRange(0, 10000);
115 cdBox->setSingleStep(1);
116 QHBoxLayout* cdLayout =
new QHBoxLayout();
117 cdLayout->addWidget(cdlabel);
118 cdLayout->addWidget(
cdBox);
119 QLabel* adlabel =
new QLabel(tr(
"Adaptive distance:"));
120 adBox =
new QSpinBox();
121 adBox->setRange(0, 10000);
123 adBox->setSingleStep(1);
124 QHBoxLayout* adLayout =
new QHBoxLayout();
125 adLayout->addWidget(adlabel);
126 adLayout->addWidget(
adBox);
128 new QCheckBox(tr(
"Show clones in the tree"));
130 layout =
new QVBoxLayout();
131 layout->addLayout(cdLayout);
132 layout->addLayout(adLayout);
134 QWidget* page2 =
new QWidget;
135 page2->setLayout(layout);
136 tabs->addTab(page2,
"Search");
138 QVBoxLayout* mainLayout =
new QVBoxLayout();
139 mainLayout->addWidget(tabs);
140 mainLayout->addLayout(buttonLayout);
141 setLayout(mainLayout);
143 setWindowTitle(tr(
"Preferences"));