History

add a Go To User option to the menu

Stephen Birarda committed 13 years ago

Commit d66137e1 parent f7a0dd52 files · +32 −1Browse files

Showing the changes to interface/src/Menu.cpp (1 of 2 files). Show all

Unified · Split

interface/src/Menu.cpp+30−0
@@ -99,6 +99,11 @@ Menu::Menu() : · 98 unmodified lines
9999 Qt::CTRL | Qt::SHIFT | Qt::Key_L,
100100 this,
101101 SLOT(goToLocation()));
102+ addActionToQMenuAndActionHash(fileMenu,
103+ MenuOption::GoToUser,
104+ Qt::CTRL | Qt::SHIFT | Qt::Key_U,
105+ this,
106+ SLOT(goToUser()));
102107
103108
104109 addDisabledActionAndSeparator(fileMenu, "Settings");
@@ -966,6 +971,31 @@ void Menu::goToLocation() { · 861 unmodified lines
966971 }
967972 }
968973
974+void Menu::goToUser() {
975+ Application* applicationInstance = Application::getInstance();
976+ QDialog dialog(applicationInstance->getGLWidget());
977+ dialog.setWindowTitle("Go To User");
978+ QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom);
979+ dialog.setLayout(layout);
980+
981+ QFormLayout* form = new QFormLayout();
982+ layout->addLayout(form, 1);
983+
984+ QLineEdit* usernameLineEdit = new QLineEdit();
985+ usernameLineEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH);
986+ form->addRow("", usernameLineEdit);
987+
988+ QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
989+ dialog.connect(buttons, SIGNAL(accepted()), SLOT(accept()));
990+ dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject()));
991+ layout->addWidget(buttons);
992+
993+ int ret = dialog.exec();
994+ applicationInstance->getWindow()->activateWindow();
995+ if (ret != QDialog::Accepted) {
996+ return;
997+ }
998+}
969999
9701000 void Menu::bandwidthDetails() {
9711001