36 namespace Gecode {
namespace Gist {
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"));
157 QSettings settings(
"gecode.org",
"Gist");
158 settings.setValue(
"search/hideFailed",
hideFailed);
159 settings.setValue(
"search/zoom",
zoom);
160 settings.setValue(
"search/copies",
copies);
161 settings.setValue(
"search/refresh",
refresh);
unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance) ...
bool zoom
Whether to automatically zoom during search.
unsigned int c_d
Create a clone after every c_d commits (commit distance)
bool hideFailed
Whether to automatically hide failed subtrees during search.
bool copies
Whether to show where copies are in the tree.
void toggleSlow(int state)
Toggle slow down setting.
int c_d
The copying distance.
void defaults(void)
Reset to defaults.
PreferencesDialog(const Options &opt, QWidget *parent=0)
Constructor.
bool smoothScrollAndZoom
Whether to use smooth scrolling and zooming.
void writeBack(void)
Write settings.
int refresh
How often to refresh the display during search.
int refreshPause
Milliseconds to wait after each refresh (to slow down search)
Gecode toplevel namespace
bool moveDuringSearch
Whether to move cursor during search.
QCheckBox * moveDuringSearchBox
int a_d
The adaptive recomputation distance.