80
UMLView *view = UMLApp::app()->currentView();
81
view->checkSelections();
82
if(!view->getSelectedWidgets(m_WidgetList)) {
81
UMLScene *scene = UMLApp::app()->currentView()->umlScene();
82
scene->checkSelections();
83
m_WidgetList = scene->selectedWidgetsExt();
85
84
//if there is no selected widget then there is no copy action
86
85
if (!m_WidgetList.count()) {
89
m_AssociationList = view->getSelectedAssocs();
90
view->copyAsImage(png);
88
m_AssociationList = scene->selectedAssocs();
89
scene->copyAsImage(png);
92
91
} else { //if the copy action is being performed from the ListView
93
92
UMLListViewItemList itemsSelected = listView->selectedItems();
108
107
//For each selected view select all the Actors, USe Cases and Concepts
109
108
//widgets in the ListView
110
109
foreach (UMLView* view, m_ViewList ) {
111
UMLObjectList objects = view->umlObjects();
110
UMLObjectList objects = view->umlScene()->umlObjects();
112
111
foreach (UMLObject* o, objects ) {
113
112
UMLListViewItem *item = listView->findUMLObject(o);
141
140
UMLView *view = UMLApp::app()->currentView();
142
141
data = new UMLDragData(m_ObjectList, m_WidgetList,
143
m_AssociationList, *png, view->type());
142
m_AssociationList, *png, view->umlScene()->type());
298
297
} else if ( Model_Utils::typeIsDiagram(type) ) {
299
298
withDiagrams = true;
300
299
onlyAttsOps = false;
301
view = doc->findView( item->getID() );
300
view = doc->findView( item->ID() );
302
301
m_ViewList.append( view );
303
302
} else if ( Model_Utils::typeIsFolder(type) ) {
304
303
onlyAttsOps = false;
354
353
UMLListView *listView = UMLApp::app()->listView();
355
354
for (int i = 0; i < parent->childCount(); i++) {
356
355
UMLListViewItem *childItem = static_cast<UMLListViewItem*>(parent->child(i));
357
Uml::IDType oldID = childItem->getID();
356
Uml::IDType oldID = childItem->ID();
358
357
Uml::IDType newID = chgLog->findNewID(oldID);
359
358
UMLListViewItem *shouldNotExist = listView->findItem(newID);
360
359
if (shouldNotExist) {
540
if( diagramType != UMLApp::app()->currentView()->type() ) {
539
UMLScene *currentScene = UMLApp::app()->currentView()->umlScene();
540
if( diagramType != currentScene->type() ) {
541
541
if( !checkPasteWidgets(widgets) ) {
542
542
while ( !assocs.isEmpty() ) {
543
543
delete assocs.takeFirst();
562
562
//now add any widget we are want to paste
563
563
bool objectAlreadyExists = false;
564
UMLView *currentView = UMLApp::app()->currentView();
565
currentView->beginPartialWidgetPaste();
564
currentScene->beginPartialWidgetPaste();
567
566
foreach ( UMLWidget* widget, widgets ) {
569
568
Uml::IDType oldId = widget->id();
570
569
Uml::IDType newId = idchanges->findNewID(oldId);
571
570
// how should findWidget find ::None id, which is returned for the first entry ?
572
if (currentView->findWidget(newId)) {
571
if (currentScene->findWidget(newId)) {
573
572
uError() << "widget (oldID=" << ID2STR(oldId) << ", newID="
574
573
<< ID2STR(newId) << ") already exists in target view.";
575
574
widgets.removeAll(widget);
577
576
objectAlreadyExists = true;
579
if (currentView->type() == Uml::DiagramType::Activity || currentView->type() == Uml::DiagramType::State)
578
if (currentScene->type() == Uml::DiagramType::Activity ||
579
currentScene->type() == Uml::DiagramType::State) {
580
580
widget->setID(doc->assignNewID(widget->id()));
581
if (! currentView->addWidget(widget, true)) {
582
currentView->endPartialWidgetPaste();
582
if (! currentScene->addWidget(widget, true)) {
583
currentScene->endPartialWidgetPaste();
588
589
//now paste the associations
589
590
foreach ( AssociationWidget* assoc, assocs ) {
590
if (!currentView->addAssociation(assoc, true)) {
591
currentView->endPartialWidgetPaste();
591
if (!currentScene->addAssociation(assoc, true)) {
592
currentScene->endPartialWidgetPaste();
596
currentView->clearSelected();
597
currentView->selectWidgets(widgets);
597
currentScene->clearSelected();
598
currentScene->selectWidgets(widgets);
598
599
foreach ( AssociationWidget* assoc, assocs ) {
599
currentView->selectWidgetsOfAssoc(assoc);
600
currentScene->selectWidgetsOfAssoc(assoc);
602
603
//Activate all the pasted associations and widgets
603
currentView->activate();
604
currentView->endPartialWidgetPaste();
604
currentScene->activate();
605
currentScene->endPartialWidgetPaste();
607
608
UMLListView *listView = UMLApp::app()->listView();