27 #include <QFileDialog>
28 #include <QInputDialog>
29 #include <QMessageBox>
33 #include "ImageList.h"
34 #include "MosaicSceneItem.h"
35 #include "MosaicSceneWidget.h"
49 QAction::setText(tr(
"View &Footprints..."));
50 QUndoCommand::setText(tr(
"View &Footprints..."));
86 foreach (
Image *image, *images) {
104 foreach (
Shape *shape, *shapes) {
120 int maxRecommendedFootprints = 50000;
121 if (success &&
imageList()->count() > maxRecommendedFootprints) {
122 QMessageBox::StandardButton selectedOpt = QMessageBox::warning(NULL,
123 tr(
"Potentially Slow Operation"),
124 tr(
"You are asking to open %L1 images in a 2D footprint view at once. This is possible, "
125 "but will take a significant amount of time and cause overall slowness. Working with "
126 "more than %L2 footprints is not recommended. Are you sure you want to view these "
127 "%L1 footprints?").arg(
imageList()->count()).arg(maxRecommendedFootprints),
128 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
130 if (selectedOpt == QMessageBox::No) {
141 if (existingViews.count()) {
142 for (
int i = 0; i < existingViews.count(); i++) {
143 viewOptions.append(existingViews[i]->windowTitle());
147 viewOptions.append(tr(
"New Footprint View"));
149 if (viewOptions.count() > 1) {
150 QString selected = QInputDialog::getItem(NULL, tr(
"View to see footprints in"),
151 tr(
"Which view would you like your\nimage's footprints to be put into?"),
152 viewOptions, viewOptions.count() - 1,
false, &success);
154 viewToUse = viewOptions.indexOf(selected);
157 viewToUse = viewOptions.count() - 1;
160 bool newView =
false;
161 if (viewToUse == viewOptions.count() - 1) {
163 QUndoCommand::setText(tr(
"View footprints in new 2D footprint view"));
165 else if (viewToUse != -1) {
166 QUndoCommand::setText(tr(
"View footprints in footprint view [%1]")
167 .arg(existingViews[viewToUse]->windowTitle()));
171 internalData.append(QString::number(viewToUse));
172 internalData.append(newView?
"new view" :
"existing view");
Internalizes a list of shapes and allows for operations on the entire list.
Internalizes a list of images and allows for operations on the entire list.
The main project for cnetsuite.
virtual void addItems(QList< ProjectItem * > items)
Adds several items to the view.
bool isFootprintable() const
Test to see if it's possible to create a footprint from this image.
Project * project() const
Returns the Project this WorkOrder is attached to.
QStringList internalData() const
Gets the internal data for this WorkOrder.
QList< Footprint2DView * > footprint2DViews()
Accessor for the list of Footprint2DViews currently available.
ProjectItemModel * model()
Gets the ProjectItemModel for this directory.
Parent class for anything that performs an action in Project.
This represents a cube in a project-based GUI interface.
Directory * directory() const
Returns the directory associated with this Project.
bool isFootprintable() const
Test to see if it's possible to create a footprint from this shape.
This represents a shape in a project-based GUI interface.
QList< ProjectItem * > selectedItems()
Returns a list of the selected items of the internal selection model.
Footprint2DView * addFootprint2DView()
Add the qmos view widget to the window.
Directory * directory() const
Returns the Directory object of the Project this WorkOrder is attached to.
virtual bool execute()
The (child) implementation of this method should prompt the user/gather state by any means necessary...
ImageList * imageList()
a pointer to the ImageList for this WorkOrder.
void setInternalData(QStringList data)
Sets the internal data for this WorkOrder.