Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Checklist
ChecklistGuide.cpp
Go to the documentation of this file.
1
/******************************************************************************************************
2
* (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3
* under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4
* LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5
******************************************************************************************************/
6
7
#include "
ChecklistGuide.h
"
8
#include "
ChecklistGuideBrowser.h
"
9
#include "
CmdMediator.h
"
10
#include "
EngaugeAssert.h
"
11
#include "
Logger.h
"
12
#include <QTextBrowser>
13
14
ChecklistGuide::ChecklistGuide
(QWidget *parent) :
15
QDockWidget (parent),
16
m_browser (nullptr)
17
{
18
setVisible (
false
);
19
setAllowedAreas (Qt::AllDockWidgetAreas);
20
setWindowTitle (tr (
"Checklist Guide"
));
// Appears in title bar when undocked
21
setStatusTip (tr (
"Checklist Guide"
));
22
setWhatsThis (tr (
"Checklist Guide\n\n"
23
"This box contains a checklist of steps suggested by the Checklist Guide Wizard. Following "
24
"these steps should produce a set of digitized points in an output file.\n\n"
25
"To run the Checklist Guide Wizard when an image file is imported, select the "
26
"Help / Checklist Wizard menu option."
));
27
28
m_browser =
new
ChecklistGuideBrowser
;
29
setWidget (m_browser);
30
}
31
32
bool
ChecklistGuide::browserIsEmpty
()
const
33
{
34
return
m_browser->toPlainText().isEmpty();
35
}
36
37
void
ChecklistGuide::closeEvent
(QCloseEvent *
/* event */
)
38
{
39
qCInfo(ENGAUGE_LOG) <<
"ChecklistGuide::closeEvent"
;
40
41
emit
signalChecklistClosed
();
42
}
43
44
void
ChecklistGuide::setTemplateHtml
(
const
QString &html,
45
const
QStringList &curveNames)
46
{
47
qCInfo(ENGAUGE_LOG) <<
"ChecklistGuide::setTemplateHtml"
;
48
49
m_browser->setTemplateHtml (html,
50
curveNames);
51
}
52
53
void
ChecklistGuide::update
(
const
CmdMediator
&cmdMediator,
54
bool
documentIsExported)
55
{
56
qCInfo(ENGAUGE_LOG) <<
"ChecklistGuide::update"
;
57
58
ENGAUGE_CHECK_PTR
(m_browser);
59
60
m_browser->update (cmdMediator,
61
documentIsExported);
62
}
ChecklistGuideBrowser.h
ChecklistGuide.h
CmdMediator.h
EngaugeAssert.h
ENGAUGE_CHECK_PTR
#define ENGAUGE_CHECK_PTR(ptr)
Drop in replacement for Q_CHECK_PTR.
Definition
EngaugeAssert.h:20
Logger.h
ChecklistGuideBrowser
Class that adds rudimentary tree collapse/expand functionality to QTextBrowser.
Definition
ChecklistGuideBrowser.h:16
ChecklistGuide::browserIsEmpty
bool browserIsEmpty() const
When browser is empty, it is pointless to show it.
Definition
ChecklistGuide.cpp:32
ChecklistGuide::ChecklistGuide
ChecklistGuide(QWidget *parent)
Single constructor. Parent is needed or else this widget cannot be redocked after being undocked.
Definition
ChecklistGuide.cpp:14
ChecklistGuide::setTemplateHtml
void setTemplateHtml(const QString &html, const QStringList &curveNames)
Populate the browser with template html.
Definition
ChecklistGuide.cpp:44
ChecklistGuide::update
void update(const CmdMediator &cmdMediator, bool documentIsExported)
Update using current CmdMediator/Document state.
Definition
ChecklistGuide.cpp:53
ChecklistGuide::closeEvent
virtual void closeEvent(QCloseEvent *event)
Catch close event so corresponding menu item in MainWindow can be updated accordingly.
Definition
ChecklistGuide.cpp:37
ChecklistGuide::signalChecklistClosed
void signalChecklistClosed()
Signal that this QDockWidget was just closed.
CmdMediator
Command queue stack.
Definition
CmdMediator.h:24
Generated on
for Engauge Digitizer by
1.17.0