diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-04-11 12:30:18 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-04-11 12:30:18 +0200 |
commit | 6775e3e72ba785f85c21eed97121051bbb5ab353 (patch) | |
tree | 9b6cc74ae6f97d463b5bc9fea5157a5eb85df1a0 /gui | |
parent | 8b4e22bbb88b289327c0614fa6df153533cdded3 (diff) | |
download | MultiMC-6775e3e72ba785f85c21eed97121051bbb5ab353.tar MultiMC-6775e3e72ba785f85c21eed97121051bbb5ab353.tar.gz MultiMC-6775e3e72ba785f85c21eed97121051bbb5ab353.tar.lz MultiMC-6775e3e72ba785f85c21eed97121051bbb5ab353.tar.xz MultiMC-6775e3e72ba785f85c21eed97121051bbb5ab353.zip |
NOISSUE Improve new instance dialog
Better layout, showing more of the modpack URL
Fixed logic for enabling OK button
Diffstat (limited to 'gui')
-rw-r--r-- | gui/dialogs/NewInstanceDialog.cpp | 9 | ||||
-rw-r--r-- | gui/dialogs/NewInstanceDialog.ui | 77 |
2 files changed, 49 insertions, 37 deletions
diff --git a/gui/dialogs/NewInstanceDialog.cpp b/gui/dialogs/NewInstanceDialog.cpp index 51060ad2..adb5c950 100644 --- a/gui/dialogs/NewInstanceDialog.cpp +++ b/gui/dialogs/NewInstanceDialog.cpp @@ -98,11 +98,10 @@ NewInstanceDialog::~NewInstanceDialog() void NewInstanceDialog::updateDialogState() { - ui->buttonBox->button(QDialogButtonBox::Ok) - ->setEnabled(!instName().isEmpty() - && m_selectedVersion - && (!ui->modpackBox->isChecked() - || ui->modpackEdit->hasAcceptableInput())); + bool allowOK = !instName().isEmpty() && + (ui->versionBox->isChecked() && m_selectedVersion || + (ui->modpackBox->isChecked() && ui->modpackEdit->hasAcceptableInput())); + ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(allowOK); } void NewInstanceDialog::setSelectedVersion(BaseVersionPtr version, bool initial) diff --git a/gui/dialogs/NewInstanceDialog.ui b/gui/dialogs/NewInstanceDialog.ui index adb7fa54..6cb0c97c 100644 --- a/gui/dialogs/NewInstanceDialog.ui +++ b/gui/dialogs/NewInstanceDialog.ui @@ -9,8 +9,8 @@ <rect> <x>0</x> <y>0</y> - <width>345</width> - <height>343</height> + <width>277</width> + <height>404</height> </rect> </property> <property name="windowTitle"> @@ -83,15 +83,8 @@ </widget> </item> <item> - <layout class="QGridLayout" name="gridLayout"> - <item row="1" column="2"> - <widget class="QToolButton" name="btnChangeVersion"> - <property name="text"> - <string>...</string> - </property> - </widget> - </item> - <item row="0" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> <widget class="QLabel" name="labelVersion_3"> <property name="text"> <string>&Group:</string> @@ -101,7 +94,7 @@ </property> </widget> </item> - <item row="0" column="1" colspan="2"> + <item> <widget class="QComboBox" name="groupBox"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> @@ -114,46 +107,57 @@ </property> </widget> </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="modpackEdit"> + </layout> + </item> + <item> + <layout class="QGridLayout" name="gridLayout"> + <item row="4" column="2"> + <widget class="QToolButton" name="modpackBtn"> <property name="enabled"> <bool>false</bool> </property> <property name="text"> - <string>http://</string> + <string>...</string> </property> </widget> </item> - <item row="2" column="2"> - <widget class="QToolButton" name="modpackBtn"> + <item row="4" column="0" colspan="2"> + <widget class="QLineEdit" name="modpackEdit"> <property name="enabled"> <bool>false</bool> </property> <property name="text"> - <string>...</string> + <string>http://</string> </property> </widget> </item> - <item row="1" column="0"> - <widget class="QRadioButton" name="versionBox"> - <property name="text"> - <string>&Version:</string> - </property> - <property name="checked"> + <item row="2" column="0" colspan="2"> + <widget class="QLineEdit" name="versionTextBox"> + <property name="readOnly"> <bool>true</bool> </property> </widget> </item> - <item row="2" column="0"> + <item row="2" column="2"> + <widget class="QToolButton" name="btnChangeVersion"> + <property name="text"> + <string>...</string> + </property> + </widget> + </item> + <item row="3" column="0" colspan="3"> <widget class="QRadioButton" name="modpackBox"> <property name="text"> - <string>Import &Modpack:</string> + <string>Impor&t Modpack (local file or link):</string> </property> </widget> </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="versionTextBox"> - <property name="readOnly"> + <item row="1" column="0" colspan="3"> + <widget class="QRadioButton" name="versionBox"> + <property name="text"> + <string>Vani&lla Minecraft (select version):</string> + </property> + <property name="checked"> <bool>true</bool> </property> </widget> @@ -192,9 +196,18 @@ </item> </layout> </widget> - <resources> - <include location="../../graphics.qrc"/> - </resources> + <tabstops> + <tabstop>instNameTextBox</tabstop> + <tabstop>groupBox</tabstop> + <tabstop>versionBox</tabstop> + <tabstop>versionTextBox</tabstop> + <tabstop>btnChangeVersion</tabstop> + <tabstop>modpackBox</tabstop> + <tabstop>modpackEdit</tabstop> + <tabstop>modpackBtn</tabstop> + <tabstop>iconButton</tabstop> + </tabstops> + <resources/> <connections> <connection> <sender>buttonBox</sender> |