Engauge Digitizer  2
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
ChecklistGuide.cpp
1 #include "ChecklistGuide.h"
2 #include "ChecklistGuideBrowser.h"
3 #include "CmdMediator.h"
4 #include "EngaugeAssert.h"
5 #include "Logger.h"
6 #include <QTextBrowser>
7 
8 ChecklistGuide::ChecklistGuide (QWidget *parent) :
9  QDockWidget (parent),
10  m_browser (0)
11 {
12  setVisible (false);
13  setAllowedAreas (Qt::AllDockWidgetAreas);
14  setWindowTitle ("Checklist Guide"); // Appears in title bar when undocked
15  setStatusTip (tr ("Checklist Guide"));
16  setWhatsThis (tr ("Checklist Guide\n\n"
17  "This box contains a checklist of step suggested by the Checklist Guide Wizard. Following "
18  "these steps should produce a set of digitized points in an output file.\n\n"
19  "To run the Checklist Guide Wizard when an image file is imported, select the "
20  "Help / Checklist Wizard menu option."));
21 
22  m_browser = new ChecklistGuideBrowser;
23  setWidget (m_browser);
24 }
25 
27 {
28  return m_browser->toPlainText().isEmpty();
29 }
30 
31 void ChecklistGuide::closeEvent(QCloseEvent * /* event */)
32 {
33  LOG4CPP_INFO_S ((*mainCat)) << "ChecklistGuide::closeEvent";
34 
35  emit signalChecklistClosed();
36 }
37 
38 void ChecklistGuide::setTemplateHtml (const QString &html,
39  const QStringList &curveNames)
40 {
41  LOG4CPP_INFO_S ((*mainCat)) << "ChecklistGuide::setTemplateHtml";
42 
43  m_browser->setTemplateHtml (html,
44  curveNames);
45 }
46 
47 void ChecklistGuide::update (const CmdMediator &cmdMediator,
48  bool documentIsExported)
49 {
50  LOG4CPP_INFO_S ((*mainCat)) << "ChecklistGuide::update";
51 
52  ENGAUGE_CHECK_PTR (m_browser);
53 
54  m_browser->update (cmdMediator,
55  documentIsExported);
56 }
virtual void setTemplateHtml(const QString &html, const QStringList &curveNames)
Populate the browser with template html. The template html will be converted to real html...
void update(const CmdMediator &cmdMediator, bool documentIsExported)
Update using current CmdMediator/Document state.
bool browserIsEmpty() const
When browser is empty, it is pointless to show it.
void signalChecklistClosed()
Signal that this QDockWidget was just closed.
Class that adds rudimentary tree collapse/expand functionality to QTextBrowser.
virtual void closeEvent(QCloseEvent *event)
Catch close event so corresponding menu item in MainWindow can be updated accordingly.
Command queue stack.
Definition: CmdMediator.h:16
ChecklistGuide(QWidget *parent)
Single constructor. Parent is needed or else this widget cannot be redocked after being undocked...
void update(const CmdMediator &cmdMediator, bool documentIsExported)
Update using current CmdMediator/Document state.
void setTemplateHtml(const QString &html, const QStringList &curveNames)
Populate the browser with template html.