Merge pull request #9928 from ctrlaltdavid/21234

Delete Developer > Network > RAM Caches Size menu item and dialog
This commit is contained in:
Chris Collins 2017-03-17 09:13:25 -07:00 committed by GitHub
commit 303a11a3e4
6 changed files with 0 additions and 146 deletions

View file

@ -560,8 +560,6 @@ Menu::Menu() {
false,
&UserActivityLogger::getInstance(),
SLOT(disable(bool)));
addActionToQMenuAndActionHash(networkMenu, MenuOption::CachesSize, 0,
dialogsManager.data(), SLOT(cachesSizeDialog()));
addActionToQMenuAndActionHash(networkMenu, MenuOption::DiskCacheEditor, 0,
dialogsManager.data(), SLOT(toggleDiskCacheEditor()));
addActionToQMenuAndActionHash(networkMenu, MenuOption::ShowDSConnectTable, 0,

View file

@ -52,7 +52,6 @@ namespace MenuOption {
const QString BinaryEyelidControl = "Binary Eyelid Control";
const QString BookmarkLocation = "Bookmark Location";
const QString Bookmarks = "Bookmarks";
const QString CachesSize = "RAM Caches Size";
const QString CalibrateCamera = "Calibrate Camera";
const QString CameraEntityMode = "Entity Mode";
const QString CenterPlayerInView = "Center Player In View";

View file

@ -1,84 +0,0 @@
//
// CachesSizeDialog.cpp
//
//
// Created by Clement on 1/12/15.
// Copyright 2015 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <QDoubleSpinBox>
#include <QFormLayout>
#include <QPushButton>
#include <AnimationCache.h>
#include <DependencyManager.h>
#include <GeometryCache.h>
#include <SoundCache.h>
#include <TextureCache.h>
#include "CachesSizeDialog.h"
QDoubleSpinBox* createDoubleSpinBox(QWidget* parent) {
QDoubleSpinBox* box = new QDoubleSpinBox(parent);
box->setDecimals(0);
box->setRange(MIN_UNUSED_MAX_SIZE / BYTES_PER_MEGABYTES, MAX_UNUSED_MAX_SIZE / BYTES_PER_MEGABYTES);
return box;
}
CachesSizeDialog::CachesSizeDialog(QWidget* parent) :
QDialog(parent, Qt::Window | Qt::WindowCloseButtonHint)
{
setWindowTitle("Caches Size");
// Create layouter
QFormLayout* form = new QFormLayout(this);
setLayout(form);
form->addRow("Animations cache size (MB):", _animations = createDoubleSpinBox(this));
form->addRow("Geometries cache size (MB):", _geometries = createDoubleSpinBox(this));
form->addRow("Sounds cache size (MB):", _sounds = createDoubleSpinBox(this));
form->addRow("Textures cache size (MB):", _textures = createDoubleSpinBox(this));
resetClicked(true);
// Add a button to reset
QPushButton* confirmButton = new QPushButton("Confirm", this);
QPushButton* resetButton = new QPushButton("Reset", this);
form->addRow(confirmButton, resetButton);
connect(confirmButton, SIGNAL(clicked(bool)), this, SLOT(confirmClicked(bool)));
connect(resetButton, SIGNAL(clicked(bool)), this, SLOT(resetClicked(bool)));
}
void CachesSizeDialog::confirmClicked(bool checked) {
DependencyManager::get<AnimationCache>()->setUnusedResourceCacheSize(_animations->value() * BYTES_PER_MEGABYTES);
DependencyManager::get<ModelCache>()->setUnusedResourceCacheSize(_geometries->value() * BYTES_PER_MEGABYTES);
DependencyManager::get<SoundCache>()->setUnusedResourceCacheSize(_sounds->value() * BYTES_PER_MEGABYTES);
// Disabling the texture cache because it's a liability in cases where we're overcommiting GPU memory
#if 0
DependencyManager::get<TextureCache>()->setUnusedResourceCacheSize(_textures->value() * BYTES_PER_MEGABYTES);
#endif
QDialog::close();
}
void CachesSizeDialog::resetClicked(bool checked) {
_animations->setValue(DependencyManager::get<AnimationCache>()->getUnusedResourceCacheSize() / BYTES_PER_MEGABYTES);
_geometries->setValue(DependencyManager::get<ModelCache>()->getUnusedResourceCacheSize() / BYTES_PER_MEGABYTES);
_sounds->setValue(DependencyManager::get<SoundCache>()->getUnusedResourceCacheSize() / BYTES_PER_MEGABYTES);
_textures->setValue(DependencyManager::get<TextureCache>()->getUnusedResourceCacheSize() / BYTES_PER_MEGABYTES);
}
void CachesSizeDialog::reject() {
// Just regularly close upon ESC
QDialog::close();
}
void CachesSizeDialog::closeEvent(QCloseEvent* event) {
QDialog::closeEvent(event);
emit closed();
}

View file

@ -1,45 +0,0 @@
//
// CachesSizeDialog.h
//
//
// Created by Clement on 1/12/15.
// Copyright 2015 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_CachesSizeDialog_h
#define hifi_CachesSizeDialog_h
#include <QDialog>
class QDoubleSpinBox;
class CachesSizeDialog : public QDialog {
Q_OBJECT
public:
// Sets up the UI
CachesSizeDialog(QWidget* parent);
signals:
void closed();
public slots:
void reject() override;
void confirmClicked(bool checked);
void resetClicked(bool checked);
protected:
// Emits a 'closed' signal when this dialog is closed.
void closeEvent(QCloseEvent* event) override;
private:
QDoubleSpinBox* _animations = nullptr;
QDoubleSpinBox* _geometries = nullptr;
QDoubleSpinBox* _scripts = nullptr;
QDoubleSpinBox* _sounds = nullptr;
QDoubleSpinBox* _textures = nullptr;
};
#endif // hifi_CachesSizeDialog_h

View file

@ -19,7 +19,6 @@
#include <PathUtils.h>
#include "AddressBarDialog.h"
#include "CachesSizeDialog.h"
#include "ConnectionFailureDialog.h"
#include "DiskCacheEditor.h"
#include "DomainConnectionDialog.h"
@ -97,16 +96,6 @@ void DialogsManager::octreeStatsDetails() {
_octreeStatsDialog->raise();
}
void DialogsManager::cachesSizeDialog() {
if (!_cachesSizeDialog) {
maybeCreateDialog(_cachesSizeDialog);
connect(_cachesSizeDialog, SIGNAL(closed()), _cachesSizeDialog, SLOT(deleteLater()));
_cachesSizeDialog->show();
}
_cachesSizeDialog->raise();
}
void DialogsManager::lodTools() {
if (!_lodToolsDialog) {
maybeCreateDialog(_lodToolsDialog);

View file

@ -21,7 +21,6 @@
class AnimationsDialog;
class AttachmentsDialog;
class CachesSizeDialog;
class DiskCacheEditor;
class LodToolsDialog;
class OctreeStatsDialog;
@ -50,7 +49,6 @@ public slots:
void toggleLoginDialog();
void showLoginDialog();
void octreeStatsDetails();
void cachesSizeDialog();
void lodTools();
void hmdTools(bool showTools);
void showScriptEditor();
@ -76,7 +74,6 @@ private:
QPointer<AnimationsDialog> _animationsDialog;
QPointer<AttachmentsDialog> _attachmentsDialog;
QPointer<CachesSizeDialog> _cachesSizeDialog;
QPointer<DiskCacheEditor> _diskCacheEditor;
QPointer<QMessageBox> _ircInfoBox;
QPointer<HMDToolsDialog> _hmdToolsDialog;