40 namespace Gecode {
namespace Gist {
44 QSettings settings(
"gecode.org",
"Gist");
45 hideFailed = settings.value(
"search/hideFailed",
true).toBool();
46 zoom = settings.value(
"search/zoom",
false).toBool();
47 copies = settings.value(
"search/copies",
false).toBool();
48 refresh = settings.value(
"search/refresh", 500).toInt();
49 refreshPause = settings.value(
"search/refreshPause", 0).toInt();
51 settings.value(
"smoothScrollAndZoom",
true).toBool();
58 new QCheckBox(tr(
"Hide failed subtrees automatically"));
61 new QCheckBox(tr(
"Automatic zoom enabled on start-up"));
64 new QCheckBox(tr(
"Smooth scrolling and zooming"));
67 QPushButton* defButton =
new QPushButton(tr(
"Defaults"));
68 QPushButton* cancelButton =
new QPushButton(tr(
"Cancel"));
69 QPushButton* okButton =
new QPushButton(tr(
"Ok"));
70 okButton->setDefault(
true);
71 QHBoxLayout* buttonLayout =
new QHBoxLayout();
72 buttonLayout->addWidget(defButton);
73 buttonLayout->addWidget(cancelButton);
74 buttonLayout->addWidget(okButton);
76 connect(cancelButton, SIGNAL(clicked()),
this, SLOT(reject()));
77 connect(defButton, SIGNAL(clicked()),
this, SLOT(
defaults()));
78 connect(okButton, SIGNAL(clicked()),
this, SLOT(
writeBack()));
80 QLabel* refreshLabel =
new QLabel(tr(
"Display refresh rate:"));
85 QHBoxLayout* refreshLayout =
new QHBoxLayout();
86 refreshLayout->addWidget(refreshLabel);
90 new QCheckBox(tr(
"Slow down search"));
95 connect(
slowBox, SIGNAL(stateChanged(
int)),
this,
99 new QCheckBox(tr(
"Move cursor during search"));
102 QVBoxLayout* layout =
new QVBoxLayout();
106 layout->addLayout(refreshLayout);
110 QTabWidget* tabs =
new QTabWidget;
111 QWidget* page1 =
new QWidget;
112 page1->setLayout(layout);
113 tabs->addTab(page1,
"Drawing");
115 QLabel* cdlabel =
new QLabel(tr(
"Commit distance:"));
116 cdBox =
new QSpinBox();
117 cdBox->setRange(0, 10000);
119 cdBox->setSingleStep(1);
120 QHBoxLayout* cdLayout =
new QHBoxLayout();
121 cdLayout->addWidget(cdlabel);
122 cdLayout->addWidget(
cdBox);
123 QLabel* adlabel =
new QLabel(tr(
"Adaptive distance:"));
124 adBox =
new QSpinBox();
125 adBox->setRange(0, 10000);
127 adBox->setSingleStep(1);
128 QHBoxLayout* adLayout =
new QHBoxLayout();
129 adLayout->addWidget(adlabel);
130 adLayout->addWidget(
adBox);
132 new QCheckBox(tr(
"Show clones in the tree"));
134 layout =
new QVBoxLayout();
135 layout->addLayout(cdLayout);
136 layout->addLayout(adLayout);
138 QWidget* page2 =
new QWidget;
139 page2->setLayout(layout);
140 tabs->addTab(page2,
"Search");
142 QVBoxLayout* mainLayout =
new QVBoxLayout();
143 mainLayout->addWidget(tabs);
144 mainLayout->addLayout(buttonLayout);
145 setLayout(mainLayout);
147 setWindowTitle(tr(
"Preferences"));
161 QSettings settings(
"gecode.org",
"Gist");
162 settings.setValue(
"search/hideFailed",
hideFailed);
163 settings.setValue(
"search/zoom",
zoom);
164 settings.setValue(
"search/copies",
copies);
165 settings.setValue(
"search/refresh",
refresh);