diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index c3417144ee..a1c7ee3c08 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -91,7 +91,7 @@ Menu::Menu() : _jsConsole(NULL), _octreeStatsDialog(NULL), _lodToolsDialog(NULL), - _userLocationsWindow(NULL), + _userLocationsDialog(NULL), _maxVoxels(DEFAULT_MAX_VOXELS_PER_SYSTEM), _voxelSizeScale(DEFAULT_OCTREE_SIZE_SCALE), _oculusUIAngularSize(DEFAULT_OCULUS_UI_ANGULAR_SIZE), @@ -1186,13 +1186,13 @@ void Menu::namedLocationCreated(LocationManager::NamedLocationCreateResponse res } void Menu::toggleLocationList() { - if (!_userLocationsWindow) { - _userLocationsWindow = new UserLocationsWindow(Application::getInstance()->getWindow()); + if (!_userLocationsDialog) { + _userLocationsDialog = new UserLocationsDialog(Application::getInstance()->getWindow()); } - if (_userLocationsWindow->isVisible()) { - _userLocationsWindow->hide(); + if (_userLocationsDialog->isVisible()) { + _userLocationsDialog->hide(); } else { - _userLocationsWindow->show(); + _userLocationsDialog->show(); } } diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 9a5e2f9d43..3112607753 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -29,7 +29,7 @@ #include "ui/JSConsole.h" #include "ui/LoginDialog.h" #include "ui/ScriptEditorWindow.h" -#include "ui/UserLocationsWindow.h" +#include "ui/UserLocationsDialog.h" const float ADJUST_LOD_DOWN_FPS = 40.0; const float ADJUST_LOD_UP_FPS = 55.0; @@ -261,7 +261,7 @@ private: QDialog* _jsConsole; OctreeStatsDialog* _octreeStatsDialog; LodToolsDialog* _lodToolsDialog; - UserLocationsWindow* _userLocationsWindow; + UserLocationsDialog* _userLocationsDialog; int _maxVoxels; float _voxelSizeScale; float _oculusUIAngularSize; diff --git a/interface/src/ui/UserLocationsWindow.cpp b/interface/src/ui/UserLocationsDialog.cpp similarity index 82% rename from interface/src/ui/UserLocationsWindow.cpp rename to interface/src/ui/UserLocationsDialog.cpp index f7e684fc64..f72e66ce77 100644 --- a/interface/src/ui/UserLocationsWindow.cpp +++ b/interface/src/ui/UserLocationsDialog.cpp @@ -1,5 +1,5 @@ // -// UserLocationsWindow.cpp +// UserLocationsDialog.cpp // interface/src/ui // // Created by Ryan Huffman on 06/24/14. @@ -14,9 +14,9 @@ #include #include "Menu.h" -#include "UserLocationsWindow.h" +#include "UserLocationsDialog.h" -UserLocationsWindow::UserLocationsWindow(QWidget* parent) : +UserLocationsDialog::UserLocationsDialog(QWidget* parent) : QDialog(parent), _ui(), _proxyModel(this), @@ -32,30 +32,30 @@ UserLocationsWindow::UserLocationsWindow(QWidget* parent) : _ui.locationsTreeView->sortByColumn(UserLocationsModel::NameColumn, Qt::AscendingOrder); connect(_ui.locationsTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, - this, &UserLocationsWindow::updateEnabled); - connect(&_userLocationsModel, &UserLocationsModel::modelReset, this, &UserLocationsWindow::updateEnabled); + this, &UserLocationsDialog::updateEnabled); + connect(&_userLocationsModel, &UserLocationsModel::modelReset, this, &UserLocationsDialog::updateEnabled); connect(&_userLocationsModel, &UserLocationsModel::modelReset, &_proxyModel, &QSortFilterProxyModel::invalidate); - connect(_ui.locationsTreeView, &QTreeView::doubleClicked, this, &UserLocationsWindow::goToModelIndex); + connect(_ui.locationsTreeView, &QTreeView::doubleClicked, this, &UserLocationsDialog::goToModelIndex); - connect(_ui.deleteButton, &QPushButton::clicked, this, &UserLocationsWindow::deleteSelection); - connect(_ui.renameButton, &QPushButton::clicked, this, &UserLocationsWindow::renameSelection); + connect(_ui.deleteButton, &QPushButton::clicked, this, &UserLocationsDialog::deleteSelection); + connect(_ui.renameButton, &QPushButton::clicked, this, &UserLocationsDialog::renameSelection); connect(_ui.refreshButton, &QPushButton::clicked, &_userLocationsModel, &UserLocationsModel::refresh); this->setWindowTitle("My Locations"); } -void UserLocationsWindow::updateEnabled() { +void UserLocationsDialog::updateEnabled() { bool enabled = _ui.locationsTreeView->selectionModel()->hasSelection(); _ui.renameButton->setEnabled(enabled); _ui.deleteButton->setEnabled(enabled); } -void UserLocationsWindow::goToModelIndex(const QModelIndex& index) { +void UserLocationsDialog::goToModelIndex(const QModelIndex& index) { QVariant location = _proxyModel.data(index.sibling(index.row(), UserLocationsModel::LocationColumn)); Menu::getInstance()->goToURL(location.toString()); } -void UserLocationsWindow::deleteSelection() { +void UserLocationsDialog::deleteSelection() { QModelIndex selection = _ui.locationsTreeView->selectionModel()->currentIndex(); selection = _proxyModel.mapToSource(selection); if (selection.isValid()) { @@ -63,7 +63,7 @@ void UserLocationsWindow::deleteSelection() { } } -void UserLocationsWindow::renameSelection() { +void UserLocationsDialog::renameSelection() { QModelIndex selection = _ui.locationsTreeView->selectionModel()->currentIndex(); selection = _proxyModel.mapToSource(selection); if (selection.isValid()) { diff --git a/interface/src/ui/UserLocationsWindow.h b/interface/src/ui/UserLocationsDialog.h similarity index 65% rename from interface/src/ui/UserLocationsWindow.h rename to interface/src/ui/UserLocationsDialog.h index 215c1957f3..0e596ece87 100644 --- a/interface/src/ui/UserLocationsWindow.h +++ b/interface/src/ui/UserLocationsDialog.h @@ -1,5 +1,5 @@ // -// UserLocationsWindow.h +// UserLocationsDialog.h // interface/src/ui // // Created by Ryan Huffman on 06/24/14. @@ -9,16 +9,16 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef hifi_UserLocationsWindow_h -#define hifi_UserLocationsWindow_h +#ifndef hifi_UserLocationsDialog_h +#define hifi_UserLocationsDialog_h -#include "ui_userLocationsWindow.h" +#include "ui_userLocationsDialog.h" #include "UserLocationsModel.h" -class UserLocationsWindow : public QDialog { +class UserLocationsDialog : public QDialog { Q_OBJECT public: - UserLocationsWindow(QWidget* parent = NULL); + UserLocationsDialog(QWidget* parent = NULL); protected slots: void updateEnabled(); @@ -27,9 +27,9 @@ protected slots: void renameSelection(); private: - Ui::UserLocationsWindow _ui; + Ui::UserLocationsDialog _ui; QSortFilterProxyModel _proxyModel; UserLocationsModel _userLocationsModel; }; -#endif // hifi_UserLocationsWindow_h +#endif // hifi_UserLocationsDialog_h diff --git a/interface/ui/userLocationsWindow.ui b/interface/ui/userLocationsDialog.ui similarity index 97% rename from interface/ui/userLocationsWindow.ui rename to interface/ui/userLocationsDialog.ui index 61bb0149f8..609ce1c8ab 100644 --- a/interface/ui/userLocationsWindow.ui +++ b/interface/ui/userLocationsDialog.ui @@ -1,7 +1,7 @@ - UserLocationsWindow - + UserLocationsDialog + 0