| 570 | } |
| 571 | |
| 572 | bool ContainersView::saveChanges() { |
| 573 | if (this->currentContainer && containerNameControl->getText().length() == 0) { |
| 574 | this->errorMsg = getTranslation(Msg::CONTAINER_VIEW_ERROR_BLANK_NAME); |
| 575 | } else if (this->containerMountDriveControl->getSelection() != 0 && containerMountPathControl->getText().length()==0) { |
| 576 | this->errorMsg = getTranslation(Msg::CONTAINER_VIEW_ERROR_MISSING_MOUNT_LOCATION); |
| 577 | } else if (this->containerMountDriveControl->getSelection() == 0 && containerMountPathControl->getText().length() != 0) { |
| 578 | this->errorMsg = getTranslation(Msg::CONTAINER_VIEW_ERROR_MISSING_MOUNT_DRIVE); |
| 579 | } else if (this->currentApp && appNameControl->getText().length()==0) { |
| 580 | this->errorMsg = getTranslation(Msg::CONTAINER_VIEW_NAME_REQUIRED); |
| 581 | } |
| 582 | if (this->errorMsg.isEmpty()) { |
| 583 | if (this->currentContainer && this->currentContainerChanged) { |
| 584 | if (this->currentContainerMountChanged) { |
| 585 | this->currentContainer->clearMounts(); |
| 586 | if (this->containerMountDriveControl->getSelection() != 0) { |
| 587 | this->currentContainer->addNewMount(MountInfo(this->containerMountDriveControl->getSelectionStringValue(), containerMountPathControl->getText(), true)); |
| 588 | } |
| 589 | } |
| 590 | std::shared_ptr<FileSystemZip> fs = GlobalSettings::getInstalledFileSystemFromName(this->containerFileSystemControl->getSelectionStringValue()); |
| 591 | this->currentContainer->setFileSystem(fs); |
| 592 | this->currentContainer->setWindowsVersion(BoxedwineData::getWinVersions()[this->containerWindowsVersionControl->getSelection()]); |
| 593 | if (fs->wineVersion > 500) { |
| 594 | this->currentContainer->setGDI(containerRendererControl->getSelectionStringValue() == "gdi"); |
| 595 | this->currentContainer->setRenderer(containerRendererControl->getSelectionStringValue()); |
| 596 | } else { |
| 597 | this->currentContainer->setGDI(containerGdiControl->isChecked()); |
| 598 | this->currentContainer->setRenderer(B(containerGdiControl->isChecked()?"gdi":"gl")); |
| 599 | } |
| 600 | #ifdef _DEBUG |
| 601 | this->currentContainer->setVideoMemorySize(videoMemorySizeControl->getText()); |
| 602 | #endif |
| 603 | this->currentContainer->setMouseWarpOverride(containerMouseWarpControl->getSelectionStringValue()); |
| 604 | this->currentContainer->saveContainer(); |
| 605 | this->currentContainerChanged = false; |
| 606 | } |
| 607 | if (this->currentApp && this->currentAppChanged) { |
| 608 | BString ext = this->appGlExControl->getText(); |
| 609 | ext = ext.replace('\n', ' '); |
| 610 | ext = ext.replace(" ", " "); |
| 611 | ext = ext.replace(" ", " "); |
| 612 | this->currentApp->glExt = ext; |
| 613 | this->currentApp->name = appNameControl->getText(); |
| 614 | this->currentApp->args.clear(); |
| 615 | appArgumentsControl->getText().split('\n', this->currentApp->args); |
| 616 | |
| 617 | this->currentApp->resolution = appResolutionControl->getSelectionStringValue(); |
| 618 | this->currentApp->bpp = appBppControl->getSelectionIntValue(); |
| 619 | this->currentApp->scale = appScaleControl->getSelectionIntValue(); |
| 620 | this->currentApp->scaleQuality = this->appScaleQualityControl->getSelection(); |
| 621 | if (this->appOpenGlControl) { |
| 622 | this->currentApp->openGlType = this->appOpenGlControl->getSelectionIntValue(); |
| 623 | } |
| 624 | this->currentApp->fullScreen = this->appFullScreenControl->getSelection(); |
| 625 | this->currentApp->vsync = this->appVSyncControl->getSelectionIntValue(); |
| 626 | if (GlobalSettings::isDpiAware()) { |
| 627 | this->currentApp->dpiAware = this->appDpiAwareControl->isChecked(); |
| 628 | } |
| 629 | this->currentApp->ddrawOverride = this->appDdrawOverrideControl->isChecked(); |
no test coverage detected