Update Group/Part Icons and copy/paste behaviour
This commit is contained in:
@@ -1296,16 +1296,33 @@ QMimeData * MainWindow::createMimeDataFromSelection () const
|
||||
sel.insert(sel.end(), it->second.begin(), it->second.end());
|
||||
all.insert(all.end(), dep.begin(), dep.end());
|
||||
}
|
||||
|
||||
|
||||
if (all.size() > sel.size()) {
|
||||
int ret = QMessageBox::question(getMainWindow(),
|
||||
tr("Object dependencies"),
|
||||
tr("The selected objects have a dependency to unselected objects.\n"
|
||||
"Do you want to copy them, too?"),
|
||||
QMessageBox::Yes,QMessageBox::No);
|
||||
if (ret == QMessageBox::Yes) {
|
||||
|
||||
//check if selection are only geofeaturegroup objects, for them it is intuitive and wanted to copy the
|
||||
//dependencies
|
||||
bool hasGroup = false, hasNormal = false;
|
||||
for(auto obj : sel) {
|
||||
if(obj->hasExtension(App::GroupExtension::getExtensionClassTypeId()))
|
||||
hasGroup = true;
|
||||
else
|
||||
hasNormal = true;
|
||||
}
|
||||
if(hasGroup && !hasNormal) {
|
||||
sel = all;
|
||||
}
|
||||
else {
|
||||
//if there are normal objects selected it may be possible that some dependencies are
|
||||
//from them, and not only from groups. so ask the user what to do.
|
||||
int ret = QMessageBox::question(getMainWindow(),
|
||||
tr("Object dependencies"),
|
||||
tr("The selected objects have a dependency to unselected objects.\n"
|
||||
"Do you want to copy them, too?"),
|
||||
QMessageBox::Yes,QMessageBox::No);
|
||||
if (ret == QMessageBox::Yes) {
|
||||
sel = all;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int memsize=1000; // ~ for the meta-information
|
||||
|
||||
Reference in New Issue
Block a user