51 setWindowIcon(myPic2);
54 setMinimumSize(300, 240);
55 setMaximumSize(300, 240);
56 QVBoxLayout* layout =
new QVBoxLayout();
57 QLabel* logo =
new QLabel();
58 logo->setPixmap(myPic);
59 layout->addWidget(logo, 0, Qt::AlignCenter);
61 new QLabel(tr(
"<h2>Gist</h2>"
62 "<p><b>The Gecode Interactive Search Tool</b</p> "
63 "<p>You can find more information about Gecode and Gist "
65 "<p><a href='http://www.gecode.org'>www.gecode.org</a>"
67 aboutLabel->setOpenExternalLinks(
true);
68 aboutLabel->setWordWrap(
true);
69 aboutLabel->setAlignment(Qt::AlignCenter);
70 layout->addWidget(aboutLabel);
72 setWindowTitle(tr(
"About Gist"));
73 setAttribute(Qt::WA_QuitOnClose,
false);
74 setAttribute(Qt::WA_DeleteOnClose,
false);
82 setWindowTitle(tr(
"Gist"));
90 setMinimumSize(400, 200);
94 QMenu* fileMenu =
menuBar->addMenu(tr(
"&File"));
95 fileMenu->addAction(
c->print);
96#if QT_VERSION >= 0x040400
97 fileMenu->addAction(
c->exportWholeTreePDF);
99 QAction* quitAction = fileMenu->addAction(tr(
"Quit"));
100 quitAction->setShortcut(QKeySequence(
"Ctrl+Q"));
101 connect(quitAction, SIGNAL(triggered()),
102 this, SLOT(close()));
103 prefAction = fileMenu->addAction(tr(
"Preferences"));
104 connect(prefAction, SIGNAL(triggered()),
this, SLOT(
preferences()));
106 QMenu* nodeMenu =
menuBar->addMenu(tr(
"&Node"));
108 inspectNodeMenu =
new QMenu(
"Inspect");
109 inspectNodeMenu->addAction(
c->inspect);
110 connect(inspectNodeMenu, SIGNAL(aboutToShow()),
113 inspectNodeBeforeFPMenu =
new QMenu(
"Inspect before fixpoint");
114 inspectNodeBeforeFPMenu->addAction(
c->inspectBeforeFP);
115 connect(inspectNodeBeforeFPMenu, SIGNAL(aboutToShow()),
119 nodeMenu->addMenu(inspectNodeMenu);
120 nodeMenu->addMenu(inspectNodeBeforeFPMenu);
121 nodeMenu->addAction(
c->compareNode);
122 nodeMenu->addAction(
c->compareNodeBeforeFP);
123 nodeMenu->addAction(
c->setPath);
124 nodeMenu->addAction(
c->inspectPath);
125 nodeMenu->addAction(
c->showNodeStats);
126 bookmarksMenu =
new QMenu(
"Bookmarks");
127 bookmarksMenu->addAction(
c->bookmarkNode);
128 connect(bookmarksMenu, SIGNAL(aboutToShow()),
130 nodeMenu->addMenu(bookmarksMenu);
131 nodeMenu->addSeparator();
132 nodeMenu->addAction(
c->navUp);
133 nodeMenu->addAction(
c->navDown);
134 nodeMenu->addAction(
c->navLeft);
135 nodeMenu->addAction(
c->navRight);
136 nodeMenu->addAction(
c->navRoot);
137 nodeMenu->addAction(
c->navNextSol);
138 nodeMenu->addAction(
c->navPrevSol);
139 nodeMenu->addSeparator();
140 nodeMenu->addAction(
c->toggleHidden);
141 nodeMenu->addAction(
c->hideFailed);
142 nodeMenu->addAction(
c->unhideAll);
143 nodeMenu->addAction(
c->labelBranches);
144 nodeMenu->addAction(
c->labelPath);
145 nodeMenu->addAction(
c->toggleStop);
146 nodeMenu->addAction(
c->unstopAll);
147 nodeMenu->addSeparator();
148 nodeMenu->addAction(
c->zoomToFit);
149 nodeMenu->addAction(
c->center);
150#if QT_VERSION >= 0x040400
151 nodeMenu->addAction(
c->exportPDF);
154 QMenu* searchMenu =
menuBar->addMenu(tr(
"&Search"));
155 searchMenu->addAction(
c->searchNext);
156 searchMenu->addAction(
c->searchAll);
157 searchMenu->addSeparator();
158 searchMenu->addAction(
c->stop);
159 searchMenu->addSeparator();
160 searchMenu->addAction(
c->reset);
162 QMenu* toolsMenu =
menuBar->addMenu(tr(
"&Tools"));
163 doubleClickInspectorsMenu =
new QMenu(
"Double click Inspectors");
164 connect(doubleClickInspectorsMenu, SIGNAL(aboutToShow()),
166 toolsMenu->addMenu(doubleClickInspectorsMenu);
167 solutionInspectorsMenu =
new QMenu(
"Solution inspectors");
168 connect(solutionInspectorsMenu, SIGNAL(aboutToShow()),
170 toolsMenu->addMenu(solutionInspectorsMenu);
171 moveInspectorsMenu =
new QMenu(
"Move inspectors");
172 connect(moveInspectorsMenu, SIGNAL(aboutToShow()),
174 toolsMenu->addMenu(moveInspectorsMenu);
175 comparatorsMenu =
new QMenu(
"Comparators");
176 connect(comparatorsMenu, SIGNAL(aboutToShow()),
178 toolsMenu->addMenu(comparatorsMenu);
180 QMenu* helpMenu =
menuBar->addMenu(tr(
"&Help"));
181 QAction* aboutAction = helpMenu->addAction(tr(
"About"));
182 connect(aboutAction, SIGNAL(triggered()),
183 this, SLOT(
about()));
191 QWidget* stw =
new QWidget();
192 QHBoxLayout* hbl =
new QHBoxLayout();
193 hbl->setContentsMargins(0,0,0,0);
194 hbl->addWidget(
new QLabel(
"Depth:"));
195 depthLabel =
new QLabel(
"0");
196 hbl->addWidget(depthLabel);
198 solvedLabel =
new QLabel(
"0");
199 hbl->addWidget(solvedLabel);
201 failedLabel =
new QLabel(
"0");
202 hbl->addWidget(failedLabel);
204 choicesLabel =
new QLabel(
"0");
205 hbl->addWidget(choicesLabel);
207 openLabel =
new QLabel(
" 0");
208 hbl->addWidget(openLabel);
210 statusBar()->addPermanentWidget(stw);
213 statusBar()->showMessage(
"Ready");
218 connect(
c,SIGNAL(searchFinished(
void)),
this,SLOT(close(
void)));
237 statusBar()->showMessage(
"Ready");
238 prefAction->setEnabled(
true);
239 }
else if (isSearching && finished) {
241 double ms = searchTimer.stop();
242 double s = std::floor(ms / 1000.0);
244 double m = std::floor(s / 60.0);
246 double h = std::floor(m / 60.0);
260 statusBar()->showMessage(
"Ready");
261 prefAction->setEnabled(
true);
262 }
else if (!isSearching && !finished) {
263 prefAction->setEnabled(
false);
264 statusBar()->showMessage(
"Searching");
270 failedLabel->setNum(stats.
failures);
271 choicesLabel->setNum(stats.
choices);
301 doubleClickInspectorsMenu->clear();
302 doubleClickInspectorsMenu->addActions(
303 c->doubleClickInspectorGroup->actions());
304 solutionInspectorsMenu->clear();
305 solutionInspectorsMenu->addActions(
c->solutionInspectorGroup->actions());
306 moveInspectorsMenu->clear();
307 moveInspectorsMenu->addActions(
c->moveInspectorGroup->actions());
308 comparatorsMenu->clear();
309 comparatorsMenu->addActions(
c->comparatorGroup->actions());
322 inspectNodeMenu->clear();
323 inspectNodeMenu->addAction(
c->inspect);
324 inspectNodeMenu->addSeparator();
325 inspectNodeMenu->addActions(
c->inspectGroup->actions());
326 inspectNodeBeforeFPMenu->clear();
327 inspectNodeBeforeFPMenu->addAction(
c->inspectBeforeFP);
328 inspectNodeBeforeFPMenu->addSeparator();
329 inspectNodeBeforeFPMenu->addActions(
c->inspectBeforeFPGroup->actions());
GistMainWindow(Space *root, bool bab, const Options &opt)
Constructor.
void populateBookmarks(void)
Populate the bookmarks menus from the actions found in Gist.
void populateInspectors(void)
Populate the inspector menus from the actions found in Gist.
void preferences(bool setup=false)
Open the preferences dialog.
void closeEvent(QCloseEvent *event)
Close Gist.
void populateInspectorSelection(void)
Populate the inspector menus from the actions found in Gist.
void statusChanged(const Statistics &stats, bool finished)
The status has changed (e.g., new solutions have been found)
Gist * c
The contained Gist object.