aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt7
-rw-r--r--launcher/ui/dialogs/OfflineLoginDialog.cpp9
-rw-r--r--launcher/ui/dialogs/OfflineLoginDialog.h1
-rw-r--r--launcher/ui/dialogs/OfflineLoginDialog.ui13
4 files changed, 27 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7cd0cf86..7537703c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -152,6 +152,10 @@ add_subdirectory(program_info)
# Install the build results according to platform
set(Launcher_PORTABLE 1 CACHE BOOL "The type of installation (Portable or System)")
+if (Launcher_PORTABLE)
+ # launcher/Application.cpp will use this value
+ set(Launcher_APP_BINARY_DEFS "-DLAUNCHER_PORTABLE")
+endif()
if(UNIX AND APPLE)
set(BINARY_DEST_DIR "${Launcher_Name}.app/Contents/MacOS")
@@ -191,9 +195,6 @@ elseif(UNIX)
set(BUNDLE_DEST_DIR ".")
set(JARS_DEST_DIR "bin/jars")
- # launcher/Application.cpp will use this value
- set(Launcher_APP_BINARY_DEFS "-DLAUNCHER_PORTABLE")
-
# Install basic runner script
configure_file(launcher/Launcher.in "${CMAKE_CURRENT_BINARY_DIR}/LauncherScript" @ONLY)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/LauncherScript" DESTINATION ${BUNDLE_DEST_DIR} RENAME ${Launcher_Name})
diff --git a/launcher/ui/dialogs/OfflineLoginDialog.cpp b/launcher/ui/dialogs/OfflineLoginDialog.cpp
index 345ed40a..4f3d8be4 100644
--- a/launcher/ui/dialogs/OfflineLoginDialog.cpp
+++ b/launcher/ui/dialogs/OfflineLoginDialog.cpp
@@ -42,6 +42,15 @@ void OfflineLoginDialog::setUserInputsEnabled(bool enable)
ui->buttonBox->setEnabled(enable);
}
+void OfflineLoginDialog::on_allowLongUsernames_stateChanged(int value)
+{
+ if (value == Qt::Checked) {
+ ui->userTextBox->setMaxLength(INT_MAX);
+ } else {
+ ui->userTextBox->setMaxLength(16);
+ }
+}
+
// Enable the OK button only when the textbox contains something.
void OfflineLoginDialog::on_userTextBox_textEdited(const QString &newText)
{
diff --git a/launcher/ui/dialogs/OfflineLoginDialog.h b/launcher/ui/dialogs/OfflineLoginDialog.h
index 5e608379..fdb3d91f 100644
--- a/launcher/ui/dialogs/OfflineLoginDialog.h
+++ b/launcher/ui/dialogs/OfflineLoginDialog.h
@@ -35,6 +35,7 @@ slots:
void onTaskProgress(qint64 current, qint64 total);
void on_userTextBox_textEdited(const QString &newText);
+ void on_allowLongUsernames_stateChanged(int value);
private:
Ui::OfflineLoginDialog *ui;
diff --git a/launcher/ui/dialogs/OfflineLoginDialog.ui b/launcher/ui/dialogs/OfflineLoginDialog.ui
index d8964a2e..4633cbe3 100644
--- a/launcher/ui/dialogs/OfflineLoginDialog.ui
+++ b/launcher/ui/dialogs/OfflineLoginDialog.ui
@@ -35,12 +35,25 @@
</item>
<item>
<widget class="QLineEdit" name="userTextBox">
+ <property name="maxLength">
+ <number>16</number>
+ </property>
<property name="placeholderText">
<string>Username</string>
</property>
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="allowLongUsernames">
+ <property name="toolTip">
+ <string>Usernames longer than 16 characters cannot be used for LAN games or offline-mode servers.</string>
+ </property>
+ <property name="text">
+ <string>Allow long usernames</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QProgressBar" name="progressBar">
<property name="value">
<number>69</number>