diff options
Diffstat (limited to 'launcher/ui')
-rw-r--r-- | launcher/ui/dialogs/NewInstanceDialog.ui | 6 | ||||
-rw-r--r-- | launcher/ui/instanceview/InstanceDelegate.cpp | 2 | ||||
-rw-r--r-- | launcher/ui/pages/instance/ModFolderPage.cpp | 5 | ||||
-rw-r--r-- | launcher/ui/pages/instance/VersionPage.cpp | 2 |
4 files changed, 10 insertions, 5 deletions
diff --git a/launcher/ui/dialogs/NewInstanceDialog.ui b/launcher/ui/dialogs/NewInstanceDialog.ui index 7fb19ff5..8ca0b786 100644 --- a/launcher/ui/dialogs/NewInstanceDialog.ui +++ b/launcher/ui/dialogs/NewInstanceDialog.ui @@ -44,7 +44,11 @@ </widget> </item> <item row="0" column="2"> - <widget class="QLineEdit" name="instNameTextBox"/> + <widget class="QLineEdit" name="instNameTextBox"> + <property name="maxLength"> + <number>128</number> + </property> + </widget> </item> <item row="0" column="1"> <widget class="QLabel" name="nameLabel"> diff --git a/launcher/ui/instanceview/InstanceDelegate.cpp b/launcher/ui/instanceview/InstanceDelegate.cpp index 3c4ca63f..22ff78cd 100644 --- a/launcher/ui/instanceview/InstanceDelegate.cpp +++ b/launcher/ui/instanceview/InstanceDelegate.cpp @@ -405,6 +405,8 @@ void ListViewDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, QString text = realeditor->toPlainText(); text.replace(QChar('\n'), QChar(' ')); text = text.trimmed(); + // Prevent instance names longer than 128 chars + text.truncate(128); if(text.size() != 0) { model->setData(index, text); diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index ffb87bbe..c7a0376d 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -244,10 +244,7 @@ void ModFolderPage::on_RunningState_changed(bool running) return; } m_controlsEnabled = !running; - ui->actionAdd->setEnabled(m_controlsEnabled); - ui->actionDisable->setEnabled(m_controlsEnabled); - ui->actionEnable->setEnabled(m_controlsEnabled); - ui->actionRemove->setEnabled(m_controlsEnabled); + ui->actionsToolbar->setEnabled(m_controlsEnabled); } bool ModFolderPage::shouldDisplay() const diff --git a/launcher/ui/pages/instance/VersionPage.cpp b/launcher/ui/pages/instance/VersionPage.cpp index 0fa5f68d..43c449eb 100644 --- a/launcher/ui/pages/instance/VersionPage.cpp +++ b/launcher/ui/pages/instance/VersionPage.cpp @@ -212,6 +212,8 @@ void VersionPage::updateVersionControls() // FIXME: this is a dirty hack auto minecraftVersion = Version(m_profile->getComponentVersion("net.minecraft")); + ui->actionInstall_Forge->setEnabled(controlsEnabled); + bool supportsFabric = minecraftVersion >= Version("1.14"); ui->actionInstall_Fabric->setEnabled(controlsEnabled && supportsFabric); |