9#include "CnetEditorView.h"
15#include <QMapIterator>
26#include "ControlNet.h"
27#include "CnetEditorWidget.h"
31#include "XmlStackedHandlerReader.h"
32#include "ProjectItemViewMenu.h"
46 setCentralWidget(centralWidget);
47 QGridLayout *resultLayout =
new QGridLayout;
48 centralWidget->setLayout(resultLayout);
53 resultLayout->addWidget(m_cnetEditorWidget, 0, 0, 1, 2);
55 QTabWidget *treeViews =
new QTabWidget;
56 treeViews->addTab( m_cnetEditorWidget->pointTreeView(), tr(
"Point View") );
57 treeViews->addTab( m_cnetEditorWidget->serialTreeView(), tr(
"Serial View") );
58 treeViews->addTab( m_cnetEditorWidget->connectionTreeView(), tr(
"Connection View") );
59 resultLayout->addWidget(treeViews, 1, 0, 1, 1);
61 QTabWidget *filterViews =
new QTabWidget;
62 filterViews->addTab( m_cnetEditorWidget->pointFilterWidget(), tr(
"Filter Points and Measures") );
63 filterViews->addTab( m_cnetEditorWidget->serialFilterWidget(), tr(
"Filter Images and Points") );
64 filterViews->addTab( m_cnetEditorWidget->connectionFilterWidget(), tr(
"Filter Connections") );
65 resultLayout->addWidget(filterViews, 1, 1, 1, 1);
83 delete m_cnetEditorWidget;
96 QMap< QAction *, QList< QString > > actionMap = m_cnetEditorWidget->menuActions();
97 QMapIterator< QAction *, QList< QString > > actionMapIter(actionMap);
103 while ( actionMapIter.hasNext() ) {
104 actionMapIter.next();
105 QAction *actionToAdd = actionMapIter.key();
108 if (actionToAdd->text() ==
"What's This?") {
126 QMap< QString, QList< QAction * > > actionMap;
127 actionMap = m_cnetEditorWidget->toolBarActions();
128 QMapIterator< QString, QList< QAction * > > actionIter(actionMap);
130 while (actionIter.hasNext()) {
132 QString objName = actionIter.key();
134 foreach (
QAction *action, actionList) {
162 return m_cnetEditorWidget;
182 xmlReader->pushContentHandler(
new XmlHandler(
this));
195 stream.writeStartElement(
"cnetEditorView");
196 stream.writeAttribute(
"objectName", objectName());
197 stream.writeAttribute(
"id", m_control->id());
198 stream.writeEndElement();
216 delete m_cnetEditorView;
217 m_cnetEditorView = NULL;
233 const QString &localName,
const QString &qName,
const QXmlAttributes &atts) {
235 bool result = XmlStackedHandler::startElement(namespaceURI, localName, qName, atts);
251 const QString &localName,
const QString &qName) {
253 bool result = XmlStackedHandler::endElement(namespaceURI, localName, qName);
AbstractProjectItemView is a base class for views of a ProjectItemModel in Qt's model-view framework.
virtual void disableActions()
Disables toolbars and toolpad actions.
XmlHandler(CnetEditorView *cnetEditorView)
Creates an XmlHandler for cnetEditor.
CnetEditorView * m_cnetEditorView
The view we are working with.
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Placeholder for later serialization of CnetEditorViews.
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
This method calls XmlStackedHandler's endElement() and dereferences pointers according to the value o...
Ipce view containing the CnetEditorWidget.
CnetEditorWidget * cnetEditorWidget()
Returns the cnetEditorWidget.
ProjectItemViewMenu * m_tablesMenu
View menu for storing actions.
void load(XmlStackedHandlerReader *xmlReader)
This method pushes a new XmlHandler into the parser stack.
CnetEditorView(Directory *directory, Control *control, FileName configFile, QWidget *parent=0)
Constructor.
QToolBar * m_permToolBar
The permanent tool bar.
~CnetEditorView()
Destructor.
void createMenus()
Uses the actions created by CnetEditorWidget, creates the tables menu, and puts the actions into the ...
void createToolBars()
Uses and adds the actions created by CnetEditorWidget to the view's toolbars Right now,...
void leaveEvent(QEvent *event)
Disables actions when cursor leaves the view.
void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const
This method saves the Controls object ids to the stream.
Control * control()
@description Returns the Control displayed in the CnetEditorWidget
This represents an ISIS control net in a project-based GUI interface.
File name manipulation and expansion.
The main project for ipce.
Manage a stack of content handlers for reading XML files.
This is free and unencumbered software released into the public domain.