Showing the changes to interface/src/Menu.cpp (1 of 5 files). Show all
Unified · Split
| @@ -687,148 +687,8 @@ void Menu::loginForCurrentDomain() { · 686 unmodified lines | |||
| 687 | void Menu::editPreferences() { | 687 | void Menu::editPreferences() { |
| 688 | if (! _preferencesDialog) { | 688 | if (! _preferencesDialog) { |
| 689 | _preferencesDialog = new PreferencesDialog(Application::getInstance()->getGLWidget()); | 689 | _preferencesDialog = new PreferencesDialog(Application::getInstance()->getGLWidget()); |
| 690 | _preferencesDialog->show(); | ||
| 691 | } | 690 | } |
| 692 | _preferencesDialog->raise(); | 691 | _preferencesDialog->show(); |
| 693 | |||
| 694 | /* | ||
| 695 | |||
| 696 | Application* applicationInstance = Application::getInstance(); | ||
| 697 | |||
| 698 | QDialog dialog(applicationInstance->getWindow()); | ||
| 699 | dialog.setWindowTitle("Interface Preferences"); | ||
| 700 | |||
| 701 | QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom); | ||
| 702 | dialog.setLayout(layout); | ||
| 703 | |||
| 704 | QFormLayout* form = new QFormLayout(); | ||
| 705 | layout->addLayout(form, 1); | ||
| 706 | |||
| 707 | QString faceURLString = applicationInstance->getAvatar()->getHead()->getFaceModel().getURL().toString(); | ||
| 708 | QLineEdit* faceURLEdit = new QLineEdit(faceURLString); | ||
| 709 | faceURLEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); | ||
| 710 | faceURLEdit->setPlaceholderText(DEFAULT_HEAD_MODEL_URL.toString()); | ||
| 711 | form->addRow("Face URL:", faceURLEdit); | ||
| 712 | |||
| 713 | QString skeletonURLString = applicationInstance->getAvatar()->getSkeletonModel().getURL().toString(); | ||
| 714 | QLineEdit* skeletonURLEdit = new QLineEdit(skeletonURLString); | ||
| 715 | skeletonURLEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); | ||
| 716 | skeletonURLEdit->setPlaceholderText(DEFAULT_BODY_MODEL_URL.toString()); | ||
| 717 | form->addRow("Skeleton URL:", skeletonURLEdit); | ||
| 718 | |||
| 719 | QString displayNameString = applicationInstance->getAvatar()->getDisplayName(); | ||
| 720 | QLineEdit* displayNameEdit = new QLineEdit(displayNameString); | ||
| 721 | displayNameEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); | ||
| 722 | form->addRow("Display name:", displayNameEdit); | ||
| 723 | |||
| 724 | QSlider* pupilDilation = new QSlider(Qt::Horizontal); | ||
| 725 | pupilDilation->setValue(applicationInstance->getAvatar()->getHead()->getPupilDilation() * pupilDilation->maximum()); | ||
| 726 | form->addRow("Pupil Dilation:", pupilDilation); | ||
| 727 | |||
| 728 | QSlider* faceshiftEyeDeflection = new QSlider(Qt::Horizontal); | ||
| 729 | faceshiftEyeDeflection->setValue(_faceshiftEyeDeflection * faceshiftEyeDeflection->maximum()); | ||
| 730 | form->addRow("Faceshift Eye Deflection:", faceshiftEyeDeflection); | ||
| 731 | |||
| 732 | QSpinBox* fieldOfView = new QSpinBox(); | ||
| 733 | fieldOfView->setMaximum(180.f); | ||
| 734 | fieldOfView->setMinimum(1.f); | ||
| 735 | fieldOfView->setValue(_fieldOfView); | ||
| 736 | form->addRow("Vertical Field of View (Degrees):", fieldOfView); | ||
| 737 | |||
| 738 | QDoubleSpinBox* leanScale = new QDoubleSpinBox(); | ||
| 739 | leanScale->setValue(applicationInstance->getAvatar()->getLeanScale()); | ||
| 740 | form->addRow("Lean Scale:", leanScale); | ||
| 741 | |||
| 742 | QDoubleSpinBox* avatarScale = new QDoubleSpinBox(); | ||
| 743 | avatarScale->setValue(applicationInstance->getAvatar()->getScale()); | ||
| 744 | form->addRow("Avatar Scale:", avatarScale); | ||
| 745 | |||
| 746 | QSpinBox* audioJitterBufferSamples = new QSpinBox(); | ||
| 747 | audioJitterBufferSamples->setMaximum(10000); | ||
| 748 | audioJitterBufferSamples->setMinimum(-10000); | ||
| 749 | audioJitterBufferSamples->setValue(_audioJitterBufferSamples); | ||
| 750 | form->addRow("Audio Jitter Buffer Samples (0 for automatic):", audioJitterBufferSamples); | ||
| 751 | |||
| 752 | QSpinBox* maxVoxels = new QSpinBox(); | ||
| 753 | const int MAX_MAX_VOXELS = 5000000; | ||
| 754 | const int MIN_MAX_VOXELS = 0; | ||
| 755 | const int STEP_MAX_VOXELS = 50000; | ||
| 756 | maxVoxels->setMaximum(MAX_MAX_VOXELS); | ||
| 757 | maxVoxels->setMinimum(MIN_MAX_VOXELS); | ||
| 758 | maxVoxels->setSingleStep(STEP_MAX_VOXELS); | ||
| 759 | maxVoxels->setValue(_maxVoxels); | ||
| 760 | form->addRow("Maximum Voxels:", maxVoxels); | ||
| 761 | |||
| 762 | QSpinBox* maxVoxelsPPS = new QSpinBox(); | ||
| 763 | const int MAX_MAX_VOXELS_PPS = 6000; | ||
| 764 | const int MIN_MAX_VOXELS_PPS = 60; | ||
| 765 | const int STEP_MAX_VOXELS_PPS = 10; | ||
| 766 | maxVoxelsPPS->setMaximum(MAX_MAX_VOXELS_PPS); | ||
| 767 | maxVoxelsPPS->setMinimum(MIN_MAX_VOXELS_PPS); | ||
| 768 | maxVoxelsPPS->setSingleStep(STEP_MAX_VOXELS_PPS); | ||
| 769 | maxVoxelsPPS->setValue(_maxVoxelPacketsPerSecond); | ||
| 770 | form->addRow("Maximum Voxels Packets Per Second:", maxVoxelsPPS); | ||
| 771 | |||
| 772 | QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); | ||
| 773 | dialog.connect(buttons, SIGNAL(accepted()), SLOT(accept())); | ||
| 774 | dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject())); | ||
| 775 | layout->addWidget(buttons); | ||
| 776 | |||
| 777 | int ret = dialog.exec(); | ||
| 778 | if (ret == QDialog::Accepted) { | ||
| 779 | QUrl faceModelURL(faceURLEdit->text()); | ||
| 780 | |||
| 781 | bool shouldDispatchIdentityPacket = false; | ||
| 782 | |||
| 783 | if (faceModelURL.toString() != faceURLString) { | ||
| 784 | // change the faceModelURL in the profile, it will also update this user's BlendFace | ||
| 785 | applicationInstance->getAvatar()->setFaceModelURL(faceModelURL); | ||
| 786 | shouldDispatchIdentityPacket = true; | ||
| 787 | } | ||
| 788 | |||
| 789 | QUrl skeletonModelURL(skeletonURLEdit->text()); | ||
| 790 | |||
| 791 | if (skeletonModelURL.toString() != skeletonURLString) { | ||
| 792 | // change the skeletonModelURL in the profile, it will also update this user's Body | ||
| 793 | applicationInstance->getAvatar()->setSkeletonModelURL(skeletonModelURL); | ||
| 794 | shouldDispatchIdentityPacket = true; | ||
| 795 | } | ||
| 796 | |||
| 797 | QString displayNameStr(displayNameEdit->text()); | ||
| 798 | |||
| 799 | if (displayNameStr != displayNameString) { | ||
| 800 | applicationInstance->getAvatar()->setDisplayName(displayNameStr); | ||
| 801 | shouldDispatchIdentityPacket = true; | ||
| 802 | } | ||
| 803 | |||
| 804 | if (shouldDispatchIdentityPacket) { | ||
| 805 | applicationInstance->getAvatar()->sendIdentityPacket(); | ||
| 806 | } | ||
| 807 | |||
| 808 | applicationInstance->getAvatar()->getHead()->setPupilDilation(pupilDilation->value() / (float)pupilDilation->maximum()); | ||
| 809 | |||
| 810 | _maxVoxels = maxVoxels->value(); | ||
| 811 | applicationInstance->getVoxels()->setMaxVoxels(_maxVoxels); | ||
| 812 | |||
| 813 | _maxVoxelPacketsPerSecond = maxVoxelsPPS->value(); | ||
| 814 | |||
| 815 | applicationInstance->getAvatar()->setLeanScale(leanScale->value()); | ||
| 816 | applicationInstance->getAvatar()->setClampedTargetScale(avatarScale->value()); | ||
| 817 | |||
| 818 | _audioJitterBufferSamples = audioJitterBufferSamples->value(); | ||
| 819 | |||
| 820 | if (_audioJitterBufferSamples != 0) { | ||
| 821 | applicationInstance->getAudio()->setJitterBufferSamples(_audioJitterBufferSamples); | ||
| 822 | } | ||
| 823 | |||
| 824 | _fieldOfView = fieldOfView->value(); | ||
| 825 | applicationInstance->resizeGL(applicationInstance->getGLWidget()->width(), applicationInstance->getGLWidget()->height()); | ||
| 826 | |||
| 827 | _faceshiftEyeDeflection = faceshiftEyeDeflection->value() / (float)faceshiftEyeDeflection->maximum(); | ||
| 828 | } | ||
| 829 | QMetaObject::invokeMethod(applicationInstance->getAudio(), "reset", Qt::QueuedConnection); | ||
| 830 | */ | ||
| 831 | sendFakeEnterEvent(); | ||
| 832 | } | 692 | } |
| 833 | 693 | ||
| 834 | void Menu::goToDomain(const QString newDomain) { | 694 | void Menu::goToDomain(const QString newDomain) { |