75 bool ImageFileListViewWorkOrder::setupExecution() {
76 bool success = WorkOrder::setupExecution();
81 QList<ImageFileListWidget *> existingViews = project()->directory()->imageFileListViews();
84 if (existingViews.count()) {
85 for (
int i = 0; i < existingViews.count(); i++) {
86 viewOptions.append(existingViews[i]->windowTitle());
90 viewOptions.append(tr(
"New File List View"));
92 if (viewOptions.count() > 1) {
93 QString selected = QInputDialog::getItem(NULL, tr(
"View to see files in"),
94 tr(
"Which view would you like your\nimage's file names to be put into?"),
95 viewOptions, viewOptions.count() - 1,
false, &success);
97 viewToUse = viewOptions.indexOf(selected);
100 viewToUse = viewOptions.count() - 1;
103 if (viewToUse == viewOptions.count() - 1) {
104 if (!imageList()->name().isEmpty()) {
105 QUndoCommand::setText(tr(
"View image file names of list [%1] in new file list view")
106 .arg(imageList()->name()));
109 QUndoCommand::setText(tr(
"View [%1] Image File Names in new file list view")
110 .arg(imageList()->count()));
113 else if (viewToUse != -1) {
114 if (!imageList()->name().isEmpty()) {
115 QUndoCommand::setText(tr(
"View image file names of list [%1] in file list view [%2]")
116 .arg(imageList()->name()).arg(existingViews[viewToUse]->windowTitle()));
119 QUndoCommand::setText(tr(
"View [%1] Image File Names in file list view [%2]")
120 .arg(imageList()->count()).arg(existingViews[viewToUse]->windowTitle()));
125 internalData.append(QString::number(viewToUse));
126 setInternalData(internalData);
137 void ImageFileListViewWorkOrder::execute() {
139 int viewToUse = internalData().first().toInt();
142 if (viewToUse == project()->directory()->imageFileListViews().count()) {
143 fileListToUse = project()->directory()->addImageFileListView();
146 fileListToUse = project()->directory()->imageFileListViews()[viewToUse];
150 project()->setClean(
false);