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();
57 new QCheckBox(tr(
"Hide failed subtrees automatically"));
60 new QCheckBox(tr(
"Automatic zoom enabled on start-up"));
63 new QCheckBox(tr(
"Smooth scrolling and zooming"));
66 QPushButton* defButton =
new QPushButton(tr(
"Defaults"));
67 QPushButton* cancelButton =
new QPushButton(tr(
"Cancel"));
68 QPushButton* okButton =
new QPushButton(tr(
"Ok"));
69 okButton->setDefault(
true);
70 QHBoxLayout* buttonLayout =
new QHBoxLayout();
71 buttonLayout->addWidget(defButton);
72 buttonLayout->addWidget(cancelButton);
73 buttonLayout->addWidget(okButton);
75 connect(cancelButton, SIGNAL(clicked()),
this, SLOT(reject()));
76 connect(defButton, SIGNAL(clicked()),
this, SLOT(
defaults()));
77 connect(okButton, SIGNAL(clicked()),
this, SLOT(
writeBack()));
79 QLabel* refreshLabel =
new QLabel(tr(
"Display refresh rate:"));
84 QHBoxLayout* refreshLayout =
new QHBoxLayout();
85 refreshLayout->addWidget(refreshLabel);
89 new QCheckBox(tr(
"Slow down search"));
94 connect(
slowBox, SIGNAL(stateChanged(
int)),
this,
97 QVBoxLayout* layout =
new QVBoxLayout();
101 layout->addLayout(refreshLayout);
104 QTabWidget* tabs =
new QTabWidget;
105 QWidget* page1 =
new QWidget;
106 page1->setLayout(layout);
107 tabs->addTab(page1,
"Drawing");
109 QLabel* cdlabel =
new QLabel(tr(
"Commit distance:"));
110 cdBox =
new QSpinBox();
111 cdBox->setRange(0, 10000);
113 cdBox->setSingleStep(1);
114 QHBoxLayout* cdLayout =
new QHBoxLayout();
115 cdLayout->addWidget(cdlabel);
116 cdLayout->addWidget(
cdBox);
117 QLabel* adlabel =
new QLabel(tr(
"Adaptive distance:"));
118 adBox =
new QSpinBox();
119 adBox->setRange(0, 10000);
121 adBox->setSingleStep(1);
122 QHBoxLayout* adLayout =
new QHBoxLayout();
123 adLayout->addWidget(adlabel);
124 adLayout->addWidget(
adBox);
126 new QCheckBox(tr(
"Show clones in the tree"));
128 layout =
new QVBoxLayout();
129 layout->addLayout(cdLayout);
130 layout->addLayout(adLayout);
132 QWidget* page2 =
new QWidget;
133 page2->setLayout(layout);
134 tabs->addTab(page2,
"Search");
136 QVBoxLayout* mainLayout =
new QVBoxLayout();
137 mainLayout->addWidget(tabs);
138 mainLayout->addLayout(buttonLayout);
139 setLayout(mainLayout);
141 setWindowTitle(tr(
"Preferences"));
154 QSettings settings(
"gecode.org",
"Gist");
155 settings.setValue(
"search/hideFailed",
hideFailed);
156 settings.setValue(
"search/zoom",
zoom);
157 settings.setValue(
"search/copies",
copies);
158 settings.setValue(
"search/refresh",
refresh);