diff options
author | Petr Mrázek <peterix@gmail.com> | 2018-11-22 01:50:32 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2018-11-22 01:50:32 +0100 |
commit | c214c13fb353ef68718e7bca6fd784037d262c91 (patch) | |
tree | 81dd20e7a685bb249762946b4df5c052555f7569 /application/MainWindow.cpp | |
parent | c4a472981f572bfcbd99a9ef74175ebfb3b7924b (diff) | |
download | MultiMC-c214c13fb353ef68718e7bca6fd784037d262c91.tar MultiMC-c214c13fb353ef68718e7bca6fd784037d262c91.tar.gz MultiMC-c214c13fb353ef68718e7bca6fd784037d262c91.tar.lz MultiMC-c214c13fb353ef68718e7bca6fd784037d262c91.tar.xz MultiMC-c214c13fb353ef68718e7bca6fd784037d262c91.zip |
GH-2101 POC for inline renaming
Diffstat (limited to 'application/MainWindow.cpp')
-rw-r--r-- | application/MainWindow.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp index 595e0615..66e1f141 100644 --- a/application/MainWindow.cpp +++ b/application/MainWindow.cpp @@ -1091,10 +1091,12 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *ev) QKeyEvent *keyEvent = static_cast<QKeyEvent *>(ev); switch (keyEvent->key()) { + /* case Qt::Key_Enter: case Qt::Key_Return: activateInstance(m_selectedInstance); return true; + */ case Qt::Key_Delete: on_actionDeleteInstance_triggered(); return true; @@ -1639,19 +1641,7 @@ void MainWindow::on_actionRenameInstance_triggered() { if (m_selectedInstance) { - bool ok = false; - QString name(m_selectedInstance->name()); - name = QInputDialog::getText(this, tr("Instance name"), tr("Enter a new instance name."), QLineEdit::Normal, name, &ok); - - name = name.trimmed(); - if (name.length() > 0) - { - if (ok && name.length()) - { - m_selectedInstance->setName(name); - ui->renameButton->setText(name); - } - } + view->edit(view->currentIndex()); } } |